From 10e2a3f3f778e422c7b515c0d9f93c91a93f26fa Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 13 Mar 2020 00:20:48 +0200 Subject: [PATCH 001/140] New AST structure --- pkg/ast/ast.go | 200 ++++ pkg/ast/ast_test.go | 191 ++++ pkg/ast/node.go | 1814 ++++++++++++++++++++++++++++++++++ pkg/ast/traverser/dfs.go | 491 +++++++++ pkg/ast/visitor/dump.go | 1003 +++++++++++++++++++ pkg/ast/visitor/dump_test.go | 43 + pkg/ast/visitor/null.go | 683 +++++++++++++ 7 files changed, 4425 insertions(+) create mode 100644 pkg/ast/ast.go create mode 100644 pkg/ast/ast_test.go create mode 100644 pkg/ast/node.go create mode 100644 pkg/ast/traverser/dfs.go create mode 100644 pkg/ast/visitor/dump.go create mode 100644 pkg/ast/visitor/dump_test.go create mode 100644 pkg/ast/visitor/null.go diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go new file mode 100644 index 0000000..a7a1da6 --- /dev/null +++ b/pkg/ast/ast.go @@ -0,0 +1,200 @@ +package ast + +import ( + "github.com/z7zmey/php-parser/freefloating" + "github.com/z7zmey/php-parser/position" +) + +type Vertex interface { + Accept(v NodeVisitor) + + SetPosition(p *position.Position) + GetPosition() *position.Position + GetFreeFloating() *freefloating.Collection +} + +type Traverser interface { + Traverse(n Vertex) +} + +type Visitor interface { + Enter(key string, singleNode bool) + Leave(key string, singleNode bool) + + EnterNode(n Vertex) bool + LeaveNode(n Vertex) +} + +type NodeVisitor interface { + Root(n *Root) + Nullable(n *Nullable) + Parameter(n *Parameter) + Identifier(n *Identifier) + ArgumentList(n *ArgumentList) + Argument(n *Argument) + + StmtAltElse(n *StmtAltElse) + StmtAltElseIf(n *StmtAltElseIf) + StmtAltFor(n *StmtAltFor) + StmtAltForeach(n *StmtAltForeach) + StmtAltIf(n *StmtAltIf) + StmtAltSwitch(n *StmtAltSwitch) + StmtAltWhile(n *StmtAltWhile) + StmtBreak(n *StmtBreak) + StmtCase(n *StmtCase) + StmtCaseList(n *StmtCaseList) + StmtCatch(n *StmtCatch) + StmtClass(n *StmtClass) + StmtClassConstList(n *StmtClassConstList) + StmtClassExtends(n *StmtClassExtends) + StmtClassImplements(n *StmtClassImplements) + StmtClassMethod(n *StmtClassMethod) + StmtConstList(n *StmtConstList) + StmtConstant(n *StmtConstant) + StmtContinue(n *StmtContinue) + StmtDeclare(n *StmtDeclare) + StmtDefault(n *StmtDefault) + StmtDo(n *StmtDo) + StmtEcho(n *StmtEcho) + StmtElse(n *StmtElse) + StmtElseIf(n *StmtElseIf) + StmtExpression(n *StmtExpression) + StmtFinally(n *StmtFinally) + StmtFor(n *StmtFor) + StmtForeach(n *StmtForeach) + StmtFunction(n *StmtFunction) + StmtGlobal(n *StmtGlobal) + StmtGoto(n *StmtGoto) + StmtGroupUse(n *StmtGroupUse) + StmtHaltCompiler(n *StmtHaltCompiler) + StmtIf(n *StmtIf) + StmtInlineHtml(n *StmtInlineHtml) + StmtInterface(n *StmtInterface) + StmtInterfaceExtends(n *StmtInterfaceExtends) + StmtLabel(n *StmtLabel) + StmtNamespace(n *StmtNamespace) + StmtNop(n *StmtNop) + StmtProperty(n *StmtProperty) + StmtPropertyList(n *StmtPropertyList) + StmtReturn(n *StmtReturn) + StmtStatic(n *StmtStatic) + StmtStaticVar(n *StmtStaticVar) + StmtStmtList(n *StmtStmtList) + StmtSwitch(n *StmtSwitch) + StmtThrow(n *StmtThrow) + StmtTrait(n *StmtTrait) + StmtTraitAdaptationList(n *StmtTraitAdaptationList) + StmtTraitMethodRef(n *StmtTraitMethodRef) + StmtTraitUse(n *StmtTraitUse) + StmtTraitUseAlias(n *StmtTraitUseAlias) + StmtTraitUsePrecedence(n *StmtTraitUsePrecedence) + StmtTry(n *StmtTry) + StmtUnset(n *StmtUnset) + StmtUse(n *StmtUse) + StmtUseList(n *StmtUseList) + StmtWhile(n *StmtWhile) + + ExprArray(n *ExprArray) + ExprArrayDimFetch(n *ExprArrayDimFetch) + ExprArrayItem(n *ExprArrayItem) + ExprArrowFunction(n *ExprArrowFunction) + ExprBitwiseNot(n *ExprBitwiseNot) + ExprBooleanNot(n *ExprBooleanNot) + ExprClassConstFetch(n *ExprClassConstFetch) + ExprClone(n *ExprClone) + ExprClosure(n *ExprClosure) + ExprClosureUse(n *ExprClosureUse) + ExprConstFetch(n *ExprConstFetch) + ExprEmpty(n *ExprEmpty) + ExprErrorSuppress(n *ExprErrorSuppress) + ExprEval(n *ExprEval) + ExprExit(n *ExprExit) + ExprFunctionCall(n *ExprFunctionCall) + ExprInclude(n *ExprInclude) + ExprIncludeOnce(n *ExprIncludeOnce) + ExprInstanceOf(n *ExprInstanceOf) + ExprIsset(n *ExprIsset) + ExprList(n *ExprList) + ExprMethodCall(n *ExprMethodCall) + ExprNew(n *ExprNew) + ExprPostDec(n *ExprPostDec) + ExprPostInc(n *ExprPostInc) + ExprPreDec(n *ExprPreDec) + ExprPreInc(n *ExprPreInc) + ExprPrint(n *ExprPrint) + ExprPropertyFetch(n *ExprPropertyFetch) + ExprReference(n *ExprReference) + ExprRequire(n *ExprRequire) + ExprRequireOnce(n *ExprRequireOnce) + ExprShellExec(n *ExprShellExec) + ExprShortArray(n *ExprShortArray) + ExprShortList(n *ExprShortList) + ExprStaticCall(n *ExprStaticCall) + ExprStaticPropertyFetch(n *ExprStaticPropertyFetch) + ExprTernary(n *ExprTernary) + ExprUnaryMinus(n *ExprUnaryMinus) + ExprUnaryPlus(n *ExprUnaryPlus) + ExprVariable(n *ExprVariable) + ExprYield(n *ExprYield) + ExprYieldFrom(n *ExprYieldFrom) + + ExprAssign(n *ExprAssign) + ExprAssignReference(n *ExprAssignReference) + ExprAssignBitwiseAnd(n *ExprAssignBitwiseAnd) + ExprAssignBitwiseOr(n *ExprAssignBitwiseOr) + ExprAssignBitwiseXor(n *ExprAssignBitwiseXor) + ExprAssignCoalesce(n *ExprAssignCoalesce) + ExprAssignConcat(n *ExprAssignConcat) + ExprAssignDiv(n *ExprAssignDiv) + ExprAssignMinus(n *ExprAssignMinus) + ExprAssignMod(n *ExprAssignMod) + ExprAssignMul(n *ExprAssignMul) + ExprAssignPlus(n *ExprAssignPlus) + ExprAssignPow(n *ExprAssignPow) + ExprAssignShiftLeft(n *ExprAssignShiftLeft) + ExprAssignShiftRight(n *ExprAssignShiftRight) + + ExprBinaryBitwiseAnd(n *ExprBinaryBitwiseAnd) + ExprBinaryBitwiseOr(n *ExprBinaryBitwiseOr) + ExprBinaryBitwiseXor(n *ExprBinaryBitwiseXor) + ExprBinaryBooleanAnd(n *ExprBinaryBooleanAnd) + ExprBinaryBooleanOr(n *ExprBinaryBooleanOr) + ExprBinaryCoalesce(n *ExprBinaryCoalesce) + ExprBinaryConcat(n *ExprBinaryConcat) + ExprBinaryDiv(n *ExprBinaryDiv) + ExprBinaryEqual(n *ExprBinaryEqual) + ExprBinaryGreater(n *ExprBinaryGreater) + ExprBinaryGreaterOrEqual(n *ExprBinaryGreaterOrEqual) + ExprBinaryIdentical(n *ExprBinaryIdentical) + ExprBinaryLogicalAnd(n *ExprBinaryLogicalAnd) + ExprBinaryLogicalOr(n *ExprBinaryLogicalOr) + ExprBinaryLogicalXor(n *ExprBinaryLogicalXor) + ExprBinaryMinus(n *ExprBinaryMinus) + ExprBinaryMod(n *ExprBinaryMod) + ExprBinaryMul(n *ExprBinaryMul) + ExprBinaryNotEqual(n *ExprBinaryNotEqual) + ExprBinaryNotIdentical(n *ExprBinaryNotIdentical) + ExprBinaryPlus(n *ExprBinaryPlus) + ExprBinaryPow(n *ExprBinaryPow) + ExprBinaryShiftLeft(n *ExprBinaryShiftLeft) + ExprBinaryShiftRight(n *ExprBinaryShiftRight) + ExprBinarySmaller(n *ExprBinarySmaller) + ExprBinarySmallerOrEqual(n *ExprBinarySmallerOrEqual) + ExprBinarySpaceship(n *ExprBinarySpaceship) + + ExprCastArray(n *ExprCastArray) + ExprCastBool(n *ExprCastBool) + ExprCastDouble(n *ExprCastDouble) + ExprCastInt(n *ExprCastInt) + ExprCastObject(n *ExprCastObject) + ExprCastString(n *ExprCastString) + ExprCastUnset(n *ExprCastUnset) + + ScalarDnumber(n *ScalarDnumber) + ScalarEncapsed(n *ScalarEncapsed) + ScalarEncapsedStringPart(n *ScalarEncapsedStringPart) + ScalarHeredoc(n *ScalarHeredoc) + ScalarLnumber(n *ScalarLnumber) + ScalarMagicConstant(n *ScalarMagicConstant) + ScalarString(n *ScalarString) +} diff --git a/pkg/ast/ast_test.go b/pkg/ast/ast_test.go new file mode 100644 index 0000000..bb98e9f --- /dev/null +++ b/pkg/ast/ast_test.go @@ -0,0 +1,191 @@ +package ast_test + +import ( + "bytes" + "encoding/json" + "fmt" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/ast/traverser" + "github.com/z7zmey/php-parser/pkg/ast/visitor" + "os" + "strings" +) + +func ExampleJSON() { + stxTree := &ast.Root{ + Stmts: []ast.Vertex{ + &ast.Nullable{ + Expr: &ast.Parameter{ + Type: nil, + Var: nil, + DefaultValue: nil, + }, + }, + &ast.Identifier{}, + &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{}, + &ast.Argument{ + Expr: &ast.ScalarDnumber{}, + }, + }, + }, + }, + } + + jsonStxTree, err := json.Marshal(stxTree) + if err != nil { + panic(err) + } + + buf := bytes.NewBuffer(nil) + err = json.Indent(buf, jsonStxTree, "", " ") + if err != nil { + panic(err) + } + + fmt.Fprint(os.Stdout, buf.String()) + + // output: + // { + // "FreeFloating": null, + // "Position": null, + // "Stmts": [ + // { + // "FreeFloating": null, + // "Position": null, + // "Expr": { + // "FreeFloating": null, + // "Position": null, + // "ByRef": false, + // "Variadic": false, + // "Type": null, + // "Var": null, + // "DefaultValue": null + // } + // }, + // { + // "FreeFloating": null, + // "Position": null, + // "Value": "" + // }, + // { + // "FreeFloating": null, + // "Position": null, + // "Arguments": [ + // { + // "FreeFloating": null, + // "Position": null, + // "Variadic": false, + // "IsReference": false, + // "Expr": null + // }, + // { + // "FreeFloating": null, + // "Position": null, + // "Variadic": false, + // "IsReference": false, + // "Expr": { + // "FreeFloating": null, + // "Position": null, + // "Value": "" + // } + // } + // ] + // } + // ] + // } +} + +func ExampleStxTree() { + stxTree := &ast.Root{ + Stmts: []ast.Vertex{ + &ast.Nullable{ + Expr: &ast.Parameter{ + Type: nil, + Var: nil, + DefaultValue: nil, + }, + }, + &ast.Identifier{}, + &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{}, + &ast.Argument{ + Expr: &ast.ScalarDnumber{}, + }, + }, + }, + }, + } + + traverser.NewDFS(&testVisitor{}).Traverse(stxTree) + + //output: + //=> *ast.Root + //=> Stmts: + //=> *ast.Nullable + //=> Expr: + //=> *ast.Parameter + //=> *ast.Identifier + //=> *ast.ArgumentList + //=> Arguments: + //=> *ast.Argument + //=> *ast.Argument + //=> Expr: + //=> *ast.ScalarDnumber +} + +type testVisitor struct { + visitor.Null + depth int +} + + +func (v *testVisitor) Enter(key string, _ bool) { + v.depth++ + fmt.Fprint(os.Stdout, "=>", strings.Repeat(" ", v.depth), key, ":\n") +} + +func (v *testVisitor) Leave(key string, _ bool) { + v.depth-- +} + +func (v *testVisitor) EnterNode(n ast.Vertex) bool { + v.depth++ + n.Accept(v) + + return true +} + +func (v *testVisitor) LeaveNode(_ ast.Vertex) { + v.depth-- +} + +func (v *testVisitor) Root(_ *ast.Root) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Root") +} + +func (v *testVisitor) Nullable(_ *ast.Nullable) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Nullable") +} + +func (v *testVisitor) Parameter(_ *ast.Parameter) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Parameter") +} + +func (v *testVisitor) Identifier(_ *ast.Identifier) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Identifier") +} + +func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ArgumentList") +} + +func (v *testVisitor) Argument(_ *ast.Argument) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Argument") +} + +func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { + fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ScalarDnumber") +} diff --git a/pkg/ast/node.go b/pkg/ast/node.go new file mode 100644 index 0000000..65c2d98 --- /dev/null +++ b/pkg/ast/node.go @@ -0,0 +1,1814 @@ +package ast + +import ( + "github.com/z7zmey/php-parser/freefloating" + "github.com/z7zmey/php-parser/position" +) + +type Node struct { + FreeFloating freefloating.Collection + Position *position.Position +} + +// SetPosition sets node position +func (n *Node) SetPosition(p *position.Position) { + n.Position = p +} + +// GetPosition returns node positions +func (n *Node) GetPosition() *position.Position { + return n.Position +} + +func (n *Node) GetFreeFloating() *freefloating.Collection { + return &n.FreeFloating +} + +// Root node +type Root struct { + Node + Stmts []Vertex +} + +func (n *Root) Accept(v NodeVisitor) { + v.Root(n) +} + +// Nullable node +type Nullable struct { + Node + Expr Vertex +} + +func (n *Nullable) Accept(v NodeVisitor) { + v.Nullable(n) +} + +// Parameter node +type Parameter struct { + Node + ByRef bool + Variadic bool + Type Vertex + Var Vertex + DefaultValue Vertex +} + +func (n *Parameter) Accept(v NodeVisitor) { + v.Parameter(n) +} + +// Identifier node +type Identifier struct { + Node + Value string +} + +func (n *Identifier) Accept(v NodeVisitor) { + v.Identifier(n) +} + +// ArgumentList node +type ArgumentList struct { + Node + Arguments []Vertex +} + +func (n *ArgumentList) Accept(v NodeVisitor) { + v.ArgumentList(n) +} + +// Argument node +type Argument struct { + Node + Variadic bool + IsReference bool + Expr Vertex +} + +func (n *Argument) Accept(v NodeVisitor) { + v.Argument(n) +} + +// ScalarDnumber node +type ScalarDnumber struct { + Node + Value string +} + +func (n *ScalarDnumber) Accept(v NodeVisitor) { + v.ScalarDnumber(n) +} + +// ScalarEncapsed node +type ScalarEncapsed struct { + Node + Parts []Vertex +} + +func (n *ScalarEncapsed) Accept(v NodeVisitor) { + v.ScalarEncapsed(n) +} + +// ScalarEncapsedStringPart node +type ScalarEncapsedStringPart struct { + Node + Value string +} + +func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { + v.ScalarEncapsedStringPart(n) +} + +// ScalarHeredoc node +type ScalarHeredoc struct { + Node + Label string + Parts []Vertex +} + +func (n *ScalarHeredoc) Accept(v NodeVisitor) { + v.ScalarHeredoc(n) +} + +// ScalarLnumber node +type ScalarLnumber struct { + Node + Value string +} + +func (n *ScalarLnumber) Accept(v NodeVisitor) { + v.ScalarLnumber(n) +} + +// ScalarMagicConstant node +type ScalarMagicConstant struct { + Node + Value string +} + +func (n *ScalarMagicConstant) Accept(v NodeVisitor) { + v.ScalarMagicConstant(n) +} + +// ScalarString node +type ScalarString struct { + Node + Value string +} + +func (n *ScalarString) Accept(v NodeVisitor) { + v.ScalarString(n) +} + +// StmtAltElse node +type StmtAltElse struct { + Node + Stmt Vertex +} + +func (n *StmtAltElse) Accept(v NodeVisitor) { + v.StmtAltElse(n) +} + +// StmtAltElseIf node +type StmtAltElseIf struct { + Node + Cond Vertex + Stmt Vertex +} + +func (n *StmtAltElseIf) Accept(v NodeVisitor) { + v.StmtAltElseIf(n) +} + +// StmtAltFor node +type StmtAltFor struct { + Node + Init []Vertex + Cond []Vertex + Loop []Vertex + Stmt Vertex +} + +func (n *StmtAltFor) Accept(v NodeVisitor) { + v.StmtAltFor(n) +} + +// StmtAltForeach node +type StmtAltForeach struct { + Node + Expr Vertex + Key Vertex + Var Vertex + Stmt Vertex +} + +func (n *StmtAltForeach) Accept(v NodeVisitor) { + v.StmtAltForeach(n) +} + +// StmtAltIf node +type StmtAltIf struct { + Node + Cond Vertex + Stmt Vertex + ElseIf []Vertex + Else Vertex +} + +func (n *StmtAltIf) Accept(v NodeVisitor) { + v.StmtAltIf(n) +} + +// StmtAltSwitch node +type StmtAltSwitch struct { + Node + Cond Vertex + CaseList *StmtCaseList +} + +func (n *StmtAltSwitch) Accept(v NodeVisitor) { + v.StmtAltSwitch(n) +} + +// StmtAltWhile node +type StmtAltWhile struct { + Node + Cond Vertex + Stmt Vertex +} + +func (n *StmtAltWhile) Accept(v NodeVisitor) { + v.StmtAltWhile(n) +} + +// StmtBreak node +type StmtBreak struct { + Node + Expr Vertex +} + +func (n *StmtBreak) Accept(v NodeVisitor) { + v.StmtBreak(n) +} + +// StmtCase node +type StmtCase struct { + Node + Cond Vertex + Stmts []Vertex +} + +func (n *StmtCase) Accept(v NodeVisitor) { + v.StmtCase(n) +} + +// StmtCaseList node +type StmtCaseList struct { + Node + Cases []Vertex +} + +func (n *StmtCaseList) Accept(v NodeVisitor) { + v.StmtCaseList(n) +} + +// StmtCatch node +type StmtCatch struct { + Node + Types []Vertex + Var Vertex + Stmts []Vertex +} + +func (n *StmtCatch) Accept(v NodeVisitor) { + v.StmtCatch(n) +} + +// StmtClass node +type StmtClass struct { + Node + ClassName Vertex + Modifiers []Vertex + ArgumentList *ArgumentList + Extends *StmtClassExtends + Implements *StmtClassImplements + Stmts []Vertex +} + +func (n *StmtClass) Accept(v NodeVisitor) { + v.StmtClass(n) +} + +// StmtClassConstList node +type StmtClassConstList struct { + Node + Modifiers []Vertex + Consts []Vertex +} + +func (n *StmtClassConstList) Accept(v NodeVisitor) { + v.StmtClassConstList(n) +} + +// StmtClassExtends node +type StmtClassExtends struct { + Node + ClassName Vertex +} + +func (n *StmtClassExtends) Accept(v NodeVisitor) { + v.StmtClassExtends(n) +} + +// StmtClassImplements node +type StmtClassImplements struct { + Node + InterfaceNames []Vertex +} + +func (n *StmtClassImplements) Accept(v NodeVisitor) { + v.StmtClassImplements(n) +} + +// StmtClassMethod node +type StmtClassMethod struct { + Node + ReturnsRef bool + MethodName Vertex + Modifiers []Vertex + Params []Vertex + ReturnType Vertex + Stmt Vertex +} + +func (n *StmtClassMethod) Accept(v NodeVisitor) { + v.StmtClassMethod(n) +} + +// StmtConstList node +type StmtConstList struct { + Node + Consts []Vertex +} + +func (n *StmtConstList) Accept(v NodeVisitor) { + v.StmtConstList(n) +} + +// StmtConstant node +type StmtConstant struct { + Node + ConstantName Vertex + Expr Vertex +} + +func (n *StmtConstant) Accept(v NodeVisitor) { + v.StmtConstant(n) +} + +// StmtContinue node +type StmtContinue struct { + Node + Expr Vertex +} + +func (n *StmtContinue) Accept(v NodeVisitor) { + v.StmtContinue(n) +} + +// StmtDeclare node +type StmtDeclare struct { + Node + Alt bool + Consts []Vertex + Stmt Vertex +} + +func (n *StmtDeclare) Accept(v NodeVisitor) { + v.StmtDeclare(n) +} + +// StmtDefault node +type StmtDefault struct { + Node + Stmts []Vertex +} + +func (n *StmtDefault) Accept(v NodeVisitor) { + v.StmtDefault(n) +} + +// StmtDo node +type StmtDo struct { + Node + Stmt Vertex + Cond Vertex +} + +func (n *StmtDo) Accept(v NodeVisitor) { + v.StmtDo(n) +} + +// StmtEcho node +type StmtEcho struct { + Node + Exprs []Vertex +} + +func (n *StmtEcho) Accept(v NodeVisitor) { + v.StmtEcho(n) +} + +// StmtElse node +type StmtElse struct { + Node + Stmt Vertex +} + +func (n *StmtElse) Accept(v NodeVisitor) { + v.StmtElse(n) +} + +// StmtElseIf node +type StmtElseIf struct { + Node + Cond Vertex + Stmt Vertex +} + +func (n *StmtElseIf) Accept(v NodeVisitor) { + v.StmtElseIf(n) +} + +// StmtExpression node +type StmtExpression struct { + Node + Expr Vertex +} + +func (n *StmtExpression) Accept(v NodeVisitor) { + v.StmtExpression(n) +} + +// StmtFinally node +type StmtFinally struct { + Node + Stmts []Vertex +} + +func (n *StmtFinally) Accept(v NodeVisitor) { + v.StmtFinally(n) +} + +// StmtFor node +type StmtFor struct { + Node + Init []Vertex + Cond []Vertex + Loop []Vertex + Stmt Vertex +} + +func (n *StmtFor) Accept(v NodeVisitor) { + v.StmtFor(n) +} + +// StmtForeach node +type StmtForeach struct { + Node + Expr Vertex + Key Vertex + Var Vertex + Stmt Vertex +} + +func (n *StmtForeach) Accept(v NodeVisitor) { + v.StmtForeach(n) +} + +// StmtFunction node +type StmtFunction struct { + Node + ReturnsRef bool + FunctionName Vertex + Params []Vertex + ReturnType Vertex + Stmts []Vertex +} + +func (n *StmtFunction) Accept(v NodeVisitor) { + v.StmtFunction(n) +} + +// StmtGlobal node +type StmtGlobal struct { + Node + Vars []Vertex +} + +func (n *StmtGlobal) Accept(v NodeVisitor) { + v.StmtGlobal(n) +} + +// StmtGoto node +type StmtGoto struct { + Node + Label Vertex +} + +func (n *StmtGoto) Accept(v NodeVisitor) { + v.StmtGoto(n) +} + +// StmtGroupUse node +type StmtGroupUse struct { + Node + UseType Vertex + Prefix Vertex + UseList []Vertex +} + +func (n *StmtGroupUse) Accept(v NodeVisitor) { + v.StmtGroupUse(n) +} + +// StmtHaltCompiler node +type StmtHaltCompiler struct { + Node +} + +func (n *StmtHaltCompiler) Accept(v NodeVisitor) { + v.StmtHaltCompiler(n) +} + +// StmtIf node +type StmtIf struct { + Node + Cond Vertex + Stmt Vertex + ElseIf []Vertex + Else Vertex +} + +func (n *StmtIf) Accept(v NodeVisitor) { + v.StmtIf(n) +} + +// StmtInlineHtml node +type StmtInlineHtml struct { + Node + Value string +} + +func (n *StmtInlineHtml) Accept(v NodeVisitor) { + v.StmtInlineHtml(n) +} + +// StmtInterface node +type StmtInterface struct { + Node + InterfaceName Vertex + Extends *StmtInterfaceExtends + Stmts []Vertex +} + +func (n *StmtInterface) Accept(v NodeVisitor) { + v.StmtInterface(n) +} + +// StmtInterfaceExtends node +type StmtInterfaceExtends struct { + Node + InterfaceNames []Vertex +} + +func (n *StmtInterfaceExtends) Accept(v NodeVisitor) { + v.StmtInterfaceExtends(n) +} + +// StmtLabel node +type StmtLabel struct { + Node + LabelName Vertex +} + +func (n *StmtLabel) Accept(v NodeVisitor) { + v.StmtLabel(n) +} + +// StmtNamespace node +type StmtNamespace struct { + Node + NamespaceName Vertex + Stmts []Vertex +} + +func (n *StmtNamespace) Accept(v NodeVisitor) { + v.StmtNamespace(n) +} + +// StmtNop node +type StmtNop struct { + Node +} + +func (n *StmtNop) Accept(v NodeVisitor) { + v.StmtNop(n) +} + +// StmtProperty node +type StmtProperty struct { + Node + Var Vertex + Expr Vertex +} + +func (n *StmtProperty) Accept(v NodeVisitor) { + v.StmtProperty(n) +} + +// StmtPropertyList node +type StmtPropertyList struct { + Node + Modifiers []Vertex + Type Vertex + Properties []Vertex +} + +func (n *StmtPropertyList) Accept(v NodeVisitor) { + v.StmtPropertyList(n) +} + +// StmtReturn node +type StmtReturn struct { + Node + Expr Vertex +} + +func (n *StmtReturn) Accept(v NodeVisitor) { + v.StmtReturn(n) +} + +// StmtStatic node +type StmtStatic struct { + Node + Vars []Vertex +} + +func (n *StmtStatic) Accept(v NodeVisitor) { + v.StmtStatic(n) +} + +// StmtStaticVar node +type StmtStaticVar struct { + Node + Var Vertex + Expr Vertex +} + +func (n *StmtStaticVar) Accept(v NodeVisitor) { + v.StmtStaticVar(n) +} + +// StmtStmtList node +type StmtStmtList struct { + Node + Stmts []Vertex +} + +func (n *StmtStmtList) Accept(v NodeVisitor) { + v.StmtStmtList(n) +} + +// StmtSwitch node +type StmtSwitch struct { + Node + Cond Vertex + CaseList *StmtCaseList +} + +func (n *StmtSwitch) Accept(v NodeVisitor) { + v.StmtSwitch(n) +} + +// StmtThrow node +type StmtThrow struct { + Node + Expr Vertex +} + +func (n *StmtThrow) Accept(v NodeVisitor) { + v.StmtThrow(n) +} + +// StmtTrait node +type StmtTrait struct { + Node + TraitName Vertex + Stmts []Vertex +} + +func (n *StmtTrait) Accept(v NodeVisitor) { + v.StmtTrait(n) +} + +// StmtTraitAdaptationList node +type StmtTraitAdaptationList struct { + Node + Adaptations []Vertex +} + +func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { + v.StmtTraitAdaptationList(n) +} + +// StmtTraitMethodRef node +type StmtTraitMethodRef struct { + Node + Trait Vertex + Method Vertex +} + +func (n *StmtTraitMethodRef) Accept(v NodeVisitor) { + v.StmtTraitMethodRef(n) +} + +// StmtTraitUse node +type StmtTraitUse struct { + Node + Traits []Vertex + TraitAdaptationList Vertex +} + +func (n *StmtTraitUse) Accept(v NodeVisitor) { + v.StmtTraitUse(n) +} + +// StmtTraitUseAlias node +type StmtTraitUseAlias struct { + Node + Ref Vertex + Modifier Vertex + Alias Vertex +} + +func (n *StmtTraitUseAlias) Accept(v NodeVisitor) { + v.StmtTraitUseAlias(n) +} + +// StmtTraitUsePrecedence node +type StmtTraitUsePrecedence struct { + Node + Ref Vertex + Insteadof []Vertex +} + +func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { + v.StmtTraitUsePrecedence(n) +} + +// StmtTry node +type StmtTry struct { + Node + Stmts []Vertex + Catches []Vertex + Finally Vertex +} + +func (n *StmtTry) Accept(v NodeVisitor) { + v.StmtTry(n) +} + +// StmtUnset node +type StmtUnset struct { + Node + Vars []Vertex +} + +func (n *StmtUnset) Accept(v NodeVisitor) { + v.StmtUnset(n) +} + +// StmtUse node +type StmtUse struct { + Node + UseType Vertex + Use Vertex + Alias Vertex +} + +func (n *StmtUse) Accept(v NodeVisitor) { + v.StmtUse(n) +} + +// StmtUseList node +type StmtUseList struct { + Node + UseType Vertex + Uses []Vertex +} + +func (n *StmtUseList) Accept(v NodeVisitor) { + v.StmtUseList(n) +} + +// StmtWhile node +type StmtWhile struct { + Node + Cond Vertex + Stmt Vertex +} + +func (n *StmtWhile) Accept(v NodeVisitor) { + v.StmtWhile(n) +} + +// ExprArray node +type ExprArray struct { + Node + Items []Vertex +} + +func (n *ExprArray) Accept(v NodeVisitor) { + v.ExprArray(n) +} + +// ExprArrayDimFetch node +type ExprArrayDimFetch struct { + Node + Var Vertex + Dim Vertex +} + +func (n *ExprArrayDimFetch) Accept(v NodeVisitor) { + v.ExprArrayDimFetch(n) +} + +// ExprArrayItem node +type ExprArrayItem struct { + Node + Unpack bool + Key Vertex + Val Vertex +} + +func (n *ExprArrayItem) Accept(v NodeVisitor) { + v.ExprArrayItem(n) +} + +// ExprArrowFunction node +type ExprArrowFunction struct { + Node + ReturnsRef bool + Static bool + Params []Vertex + ReturnType Vertex + Expr Vertex +} + +func (n *ExprArrowFunction) Accept(v NodeVisitor) { + v.ExprArrowFunction(n) +} + +// ExprBitwiseNot node +type ExprBitwiseNot struct { + Node + Expr Vertex +} + +func (n *ExprBitwiseNot) Accept(v NodeVisitor) { + v.ExprBitwiseNot(n) +} + +// ExprBooleanNot node +type ExprBooleanNot struct { + Node + Expr Vertex +} + +func (n *ExprBooleanNot) Accept(v NodeVisitor) { + v.ExprBooleanNot(n) +} + +// ExprClassConstFetch node +type ExprClassConstFetch struct { + Node + Class Vertex + ConstantName Vertex +} + +func (n *ExprClassConstFetch) Accept(v NodeVisitor) { + v.ExprClassConstFetch(n) +} + +// ExprClone node +type ExprClone struct { + Node + Expr Vertex +} + +func (n *ExprClone) Accept(v NodeVisitor) { + v.ExprClone(n) +} + +// ExprClosure node +type ExprClosure struct { + Node + ReturnsRef bool + Static bool + Params []Vertex + ClosureUse *ExprClosureUse + ReturnType Vertex + Stmts []Vertex +} + +func (n *ExprClosure) Accept(v NodeVisitor) { + v.ExprClosure(n) +} + +// ExprClosureUse node +type ExprClosureUse struct { + Node + Uses []Vertex +} + +func (n *ExprClosureUse) Accept(v NodeVisitor) { + v.ExprClosureUse(n) +} + +// ExprConstFetch node +type ExprConstFetch struct { + Node + Const Vertex +} + +func (n *ExprConstFetch) Accept(v NodeVisitor) { + v.ExprConstFetch(n) +} + +// ExprEmpty node +type ExprEmpty struct { + Node + Expr Vertex +} + +func (n *ExprEmpty) Accept(v NodeVisitor) { + v.ExprEmpty(n) +} + +// ExprErrorSuppress node +type ExprErrorSuppress struct { + Node + Expr Vertex +} + +func (n *ExprErrorSuppress) Accept(v NodeVisitor) { + v.ExprErrorSuppress(n) +} + +// ExprEval node +type ExprEval struct { + Node + Expr Vertex +} + +func (n *ExprEval) Accept(v NodeVisitor) { + v.ExprEval(n) +} + +// ExprExit node +type ExprExit struct { + Node + Die bool + Expr Vertex +} + +func (n *ExprExit) Accept(v NodeVisitor) { + v.ExprExit(n) +} + +// ExprFunctionCall node +type ExprFunctionCall struct { + Node + Function Vertex + ArgumentList *ArgumentList +} + +func (n *ExprFunctionCall) Accept(v NodeVisitor) { + v.ExprFunctionCall(n) +} + +// ExprInclude node +type ExprInclude struct { + Node + Expr Vertex +} + +func (n *ExprInclude) Accept(v NodeVisitor) { + v.ExprInclude(n) +} + +// ExprIncludeOnce node +type ExprIncludeOnce struct { + Node + Expr Vertex +} + +func (n *ExprIncludeOnce) Accept(v NodeVisitor) { + v.ExprIncludeOnce(n) +} + +// ExprInstanceOf node +type ExprInstanceOf struct { + Node + Expr Vertex + Class Vertex +} + +func (n *ExprInstanceOf) Accept(v NodeVisitor) { + v.ExprInstanceOf(n) +} + +// ExprIsset node +type ExprIsset struct { + Node + Vars []Vertex +} + +func (n *ExprIsset) Accept(v NodeVisitor) { + v.ExprIsset(n) +} + +// ExprList node +type ExprList struct { + Node + Items []Vertex +} + +func (n *ExprList) Accept(v NodeVisitor) { + v.ExprList(n) +} + +// ExprMethodCall node +type ExprMethodCall struct { + Node + Var Vertex + Method Vertex + ArgumentList *ArgumentList +} + +func (n *ExprMethodCall) Accept(v NodeVisitor) { + v.ExprMethodCall(n) +} + +// ExprNew node +type ExprNew struct { + Node + Class Vertex + ArgumentList *ArgumentList +} + +func (n *ExprNew) Accept(v NodeVisitor) { + v.ExprNew(n) +} + +// ExprPostDec node +type ExprPostDec struct { + Node + Var Vertex +} + +func (n *ExprPostDec) Accept(v NodeVisitor) { + v.ExprPostDec(n) +} + +// ExprPostInc node +type ExprPostInc struct { + Node + Var Vertex +} + +func (n *ExprPostInc) Accept(v NodeVisitor) { + v.ExprPostInc(n) +} + +// ExprPreDec node +type ExprPreDec struct { + Node + Var Vertex +} + +func (n *ExprPreDec) Accept(v NodeVisitor) { + v.ExprPreDec(n) +} + +// ExprPreInc node +type ExprPreInc struct { + Node + Var Vertex +} + +func (n *ExprPreInc) Accept(v NodeVisitor) { + v.ExprPreInc(n) +} + +// ExprPrint node +type ExprPrint struct { + Node + Expr Vertex +} + +func (n *ExprPrint) Accept(v NodeVisitor) { + v.ExprPrint(n) +} + +// ExprPropertyFetch node +type ExprPropertyFetch struct { + Node + Var Vertex + Property Vertex +} + +func (n *ExprPropertyFetch) Accept(v NodeVisitor) { + v.ExprPropertyFetch(n) +} + +// ExprReference node +type ExprReference struct { + Node + Var Vertex +} + +func (n *ExprReference) Accept(v NodeVisitor) { + v.ExprReference(n) +} + +// ExprRequire node +type ExprRequire struct { + Node + Expr Vertex +} + +func (n *ExprRequire) Accept(v NodeVisitor) { + v.ExprRequire(n) +} + +// ExprRequireOnce node +type ExprRequireOnce struct { + Node + Expr Vertex +} + +func (n *ExprRequireOnce) Accept(v NodeVisitor) { + v.ExprRequireOnce(n) +} + +// ExprShellExec node +type ExprShellExec struct { + Node + Parts []Vertex +} + +func (n *ExprShellExec) Accept(v NodeVisitor) { + v.ExprShellExec(n) +} + +// ExprShortArray node +type ExprShortArray struct { + Node + Items []Vertex +} + +func (n *ExprShortArray) Accept(v NodeVisitor) { + v.ExprShortArray(n) +} + +// ExprShortList node +type ExprShortList struct { + Node + Items []Vertex +} + +func (n *ExprShortList) Accept(v NodeVisitor) { + v.ExprShortList(n) +} + +// ExprStaticCall node +type ExprStaticCall struct { + Node + Class Vertex + Call Vertex + ArgumentList *ArgumentList +} + +func (n *ExprStaticCall) Accept(v NodeVisitor) { + v.ExprStaticCall(n) +} + +// ExprStaticPropertyFetch node +type ExprStaticPropertyFetch struct { + Node + Class Vertex + Property Vertex +} + +func (n *ExprStaticPropertyFetch) Accept(v NodeVisitor) { + v.ExprStaticPropertyFetch(n) +} + +// ExprTernary node +type ExprTernary struct { + Node + Condition Vertex + IfTrue Vertex + IfFalse Vertex +} + +func (n *ExprTernary) Accept(v NodeVisitor) { + v.ExprTernary(n) +} + +// ExprUnaryMinus node +type ExprUnaryMinus struct { + Node + Expr Vertex +} + +func (n *ExprUnaryMinus) Accept(v NodeVisitor) { + v.ExprUnaryMinus(n) +} + +// ExprUnaryPlus node +type ExprUnaryPlus struct { + Node + Expr Vertex +} + +func (n *ExprUnaryPlus) Accept(v NodeVisitor) { + v.ExprUnaryPlus(n) +} + +// ExprVariable node +type ExprVariable struct { + Node + VarName Vertex +} + +func (n *ExprVariable) Accept(v NodeVisitor) { + v.ExprVariable(n) +} + +// ExprYield node +type ExprYield struct { + Node + Key Vertex + Value Vertex +} + +func (n *ExprYield) Accept(v NodeVisitor) { + v.ExprYield(n) +} + +// ExprYieldFrom node +type ExprYieldFrom struct { + Node + Expr Vertex +} + +func (n *ExprYieldFrom) Accept(v NodeVisitor) { + v.ExprYieldFrom(n) +} + +// ExprCastArray node +type ExprCastArray struct { + Node + Expr Vertex +} + +func (n *ExprCastArray) Accept(v NodeVisitor) { + v.ExprCastArray(n) +} + +// ExprCastBool node +type ExprCastBool struct { + Node + Expr Vertex +} + +func (n *ExprCastBool) Accept(v NodeVisitor) { + v.ExprCastBool(n) +} + +// ExprCastDouble node +type ExprCastDouble struct { + Node + Expr Vertex +} + +func (n *ExprCastDouble) Accept(v NodeVisitor) { + v.ExprCastDouble(n) +} + +// ExprCastInt node +type ExprCastInt struct { + Node + Expr Vertex +} + +func (n *ExprCastInt) Accept(v NodeVisitor) { + v.ExprCastInt(n) +} + +// ExprCastObject node +type ExprCastObject struct { + Node + Expr Vertex +} + +func (n *ExprCastObject) Accept(v NodeVisitor) { + v.ExprCastObject(n) +} + +// ExprCastString node +type ExprCastString struct { + Node + Expr Vertex +} + +func (n *ExprCastString) Accept(v NodeVisitor) { + v.ExprCastString(n) +} + +// ExprCastUnset node +type ExprCastUnset struct { + Node + Expr Vertex +} + +func (n *ExprCastUnset) Accept(v NodeVisitor) { + v.ExprCastUnset(n) +} + +// ExprAssign node +type ExprAssign struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssign) Accept(v NodeVisitor) { + v.ExprAssign(n) +} + +// ExprAssignReference node +type ExprAssignReference struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignReference) Accept(v NodeVisitor) { + v.ExprAssignReference(n) +} + +// ExprAssignBitwiseAnd node +type ExprAssignBitwiseAnd struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) { + v.ExprAssignBitwiseAnd(n) +} + +// ExprAssignBitwiseOr node +type ExprAssignBitwiseOr struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) { + v.ExprAssignBitwiseOr(n) +} + +// ExprAssignBitwiseXor node +type ExprAssignBitwiseXor struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) { + v.ExprAssignBitwiseXor(n) +} + +// ExprAssignCoalesce node +type ExprAssignCoalesce struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignCoalesce) Accept(v NodeVisitor) { + v.ExprAssignCoalesce(n) +} + +// ExprAssignConcat node +type ExprAssignConcat struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignConcat) Accept(v NodeVisitor) { + v.ExprAssignConcat(n) +} + +// ExprAssignDiv node +type ExprAssignDiv struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignDiv) Accept(v NodeVisitor) { + v.ExprAssignDiv(n) +} + +// ExprAssignMinus node +type ExprAssignMinus struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignMinus) Accept(v NodeVisitor) { + v.ExprAssignMinus(n) +} + +// ExprAssignMod node +type ExprAssignMod struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignMod) Accept(v NodeVisitor) { + v.ExprAssignMod(n) +} + +// ExprAssignMul node +type ExprAssignMul struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignMul) Accept(v NodeVisitor) { + v.ExprAssignMul(n) +} + +// ExprAssignPlus node +type ExprAssignPlus struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignPlus) Accept(v NodeVisitor) { + v.ExprAssignPlus(n) +} + +// ExprAssignPow node +type ExprAssignPow struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignPow) Accept(v NodeVisitor) { + v.ExprAssignPow(n) +} + +// ExprAssignShiftLeft node +type ExprAssignShiftLeft struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) { + v.ExprAssignShiftLeft(n) +} + +// ExprAssignShiftRight node +type ExprAssignShiftRight struct { + Node + Var Vertex + Expr Vertex +} + +func (n *ExprAssignShiftRight) Accept(v NodeVisitor) { + v.ExprAssignShiftRight(n) +} + +// ExprBinaryBitwiseAnd node +type ExprBinaryBitwiseAnd struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryBitwiseAnd) Accept(v NodeVisitor) { + v.ExprBinaryBitwiseAnd(n) +} + +// ExprBinaryBitwiseOr node +type ExprBinaryBitwiseOr struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryBitwiseOr) Accept(v NodeVisitor) { + v.ExprBinaryBitwiseOr(n) +} + +// ExprBinaryBitwiseXor node +type ExprBinaryBitwiseXor struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryBitwiseXor) Accept(v NodeVisitor) { + v.ExprBinaryBitwiseXor(n) +} + +// ExprBinaryBooleanAnd node +type ExprBinaryBooleanAnd struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryBooleanAnd) Accept(v NodeVisitor) { + v.ExprBinaryBooleanAnd(n) +} + +// ExprBinaryBooleanOr node +type ExprBinaryBooleanOr struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryBooleanOr) Accept(v NodeVisitor) { + v.ExprBinaryBooleanOr(n) +} + +// ExprBinaryCoalesce node +type ExprBinaryCoalesce struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryCoalesce) Accept(v NodeVisitor) { + v.ExprBinaryCoalesce(n) +} + +// ExprBinaryConcat node +type ExprBinaryConcat struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryConcat) Accept(v NodeVisitor) { + v.ExprBinaryConcat(n) +} + +// ExprBinaryDiv node +type ExprBinaryDiv struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryDiv) Accept(v NodeVisitor) { + v.ExprBinaryDiv(n) +} + +// ExprBinaryEqual node +type ExprBinaryEqual struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryEqual) Accept(v NodeVisitor) { + v.ExprBinaryEqual(n) +} + +// ExprBinaryGreater node +type ExprBinaryGreater struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryGreater) Accept(v NodeVisitor) { + v.ExprBinaryGreater(n) +} + +// ExprBinaryGreaterOrEqual node +type ExprBinaryGreaterOrEqual struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryGreaterOrEqual) Accept(v NodeVisitor) { + v.ExprBinaryGreaterOrEqual(n) +} + +// ExprBinaryIdentical node +type ExprBinaryIdentical struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryIdentical) Accept(v NodeVisitor) { + v.ExprBinaryIdentical(n) +} + +// ExprBinaryLogicalAnd node +type ExprBinaryLogicalAnd struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryLogicalAnd) Accept(v NodeVisitor) { + v.ExprBinaryLogicalAnd(n) +} + +// ExprBinaryLogicalOr node +type ExprBinaryLogicalOr struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryLogicalOr) Accept(v NodeVisitor) { + v.ExprBinaryLogicalOr(n) +} + +// ExprBinaryLogicalXor node +type ExprBinaryLogicalXor struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryLogicalXor) Accept(v NodeVisitor) { + v.ExprBinaryLogicalXor(n) +} + +// ExprBinaryMinus node +type ExprBinaryMinus struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryMinus) Accept(v NodeVisitor) { + v.ExprBinaryMinus(n) +} + +// ExprBinaryMod node +type ExprBinaryMod struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryMod) Accept(v NodeVisitor) { + v.ExprBinaryMod(n) +} + +// ExprBinaryMul node +type ExprBinaryMul struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryMul) Accept(v NodeVisitor) { + v.ExprBinaryMul(n) +} + +// ExprBinaryNotEqual node +type ExprBinaryNotEqual struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryNotEqual) Accept(v NodeVisitor) { + v.ExprBinaryNotEqual(n) +} + +// ExprBinaryNotIdentical node +type ExprBinaryNotIdentical struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryNotIdentical) Accept(v NodeVisitor) { + v.ExprBinaryNotIdentical(n) +} + +// ExprBinaryPlus node +type ExprBinaryPlus struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryPlus) Accept(v NodeVisitor) { + v.ExprBinaryPlus(n) +} + +// ExprBinaryPow node +type ExprBinaryPow struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryPow) Accept(v NodeVisitor) { + v.ExprBinaryPow(n) +} + +// ExprBinaryShiftLeft node +type ExprBinaryShiftLeft struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryShiftLeft) Accept(v NodeVisitor) { + v.ExprBinaryShiftLeft(n) +} + +// ExprBinaryShiftRight node +type ExprBinaryShiftRight struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinaryShiftRight) Accept(v NodeVisitor) { + v.ExprBinaryShiftRight(n) +} + +// ExprBinarySmaller node +type ExprBinarySmaller struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinarySmaller) Accept(v NodeVisitor) { + v.ExprBinarySmaller(n) +} + +// ExprBinarySmallerOrEqual node +type ExprBinarySmallerOrEqual struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinarySmallerOrEqual) Accept(v NodeVisitor) { + v.ExprBinarySmallerOrEqual(n) +} + +// ExprBinarySpaceship node +type ExprBinarySpaceship struct { + Node + Left Vertex + Right Vertex +} + +func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { + v.ExprBinarySpaceship(n) +} diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go new file mode 100644 index 0000000..f3d745e --- /dev/null +++ b/pkg/ast/traverser/dfs.go @@ -0,0 +1,491 @@ +package traverser + +import "github.com/z7zmey/php-parser/pkg/ast" + +type DFS struct { + visitor ast.Visitor +} + +func NewDFS(visitor ast.Visitor) *DFS { + return &DFS{ + visitor: visitor, + } +} + +func (t *DFS) Traverse(n ast.Vertex) { + if n == nil { + return + } + + if !t.visitor.EnterNode(n) { + return + } + + switch nn := n.(type) { + case *ast.Root: + t.traverseArray("Stmts", nn.Stmts) + case *ast.Nullable: + t.traverseSingle("Expr", nn.Expr) + case *ast.Parameter: + t.traverseSingle("Type", nn.Type) + t.traverseSingle("Var", nn.Var) + t.traverseSingle("DefaultValue", nn.DefaultValue) + case *ast.Identifier: + case *ast.ArgumentList: + t.traverseArray("Arguments", nn.Arguments) + case *ast.Argument: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtAltElse: + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtAltElseIf: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtAltFor: + t.traverseArray("Init", nn.Init) + t.traverseArray("Cond", nn.Cond) + t.traverseArray("Loop", nn.Loop) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtAltForeach: + t.traverseSingle("Expr", nn.Expr) + t.traverseSingle("Key", nn.Key) + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtAltIf: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + t.traverseArray("ElseIf", nn.ElseIf) + t.traverseSingle("Else", nn.Else) + case *ast.StmtAltSwitch: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("CaseList", nn.CaseList) + case *ast.StmtAltWhile: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtBreak: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtCase: + t.traverseSingle("Cond", nn.Cond) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtCaseList: + t.traverseArray("Cases", nn.Cases) + case *ast.StmtCatch: + t.traverseArray("Types", nn.Types) + t.traverseSingle("Var", nn.Var) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtClass: + t.traverseSingle("ClassName", nn.ClassName) + t.traverseArray("Modifiers", nn.Modifiers) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtClassConstList: + t.traverseArray("Modifiers", nn.Modifiers) + t.traverseArray("Consts", nn.Consts) + case *ast.StmtClassExtends: + t.traverseSingle("ClassName", nn.ClassName) + case *ast.StmtClassImplements: + t.traverseArray("InterfaceNames", nn.InterfaceNames) + case *ast.StmtClassMethod: + t.traverseSingle("MethodName", nn.MethodName) + t.traverseArray("Modifiers", nn.Modifiers) + t.traverseArray("Params", nn.Params) + t.traverseSingle("ReturnType", nn.ReturnType) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtConstList: + t.traverseArray("Consts", nn.Consts) + case *ast.StmtConstant: + t.traverseSingle("ConstantName", nn.ConstantName) + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtContinue: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtDeclare: + t.traverseArray("Consts", nn.Consts) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtDefault: + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtDo: + t.traverseSingle("Stmt", nn.Stmt) + t.traverseSingle("Cond", nn.Cond) + case *ast.StmtEcho: + t.traverseArray("Exprs", nn.Exprs) + case *ast.StmtElse: + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtElseIf: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtExpression: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtFinally: + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtFor: + t.traverseArray("Init", nn.Init) + t.traverseArray("Cond", nn.Cond) + t.traverseArray("Loop", nn.Loop) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtForeach: + t.traverseSingle("Expr", nn.Expr) + t.traverseSingle("Key", nn.Key) + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.StmtFunction: + t.traverseSingle("FunctionName", nn.FunctionName) + t.traverseArray("Params", nn.Params) + t.traverseSingle("ReturnType", nn.ReturnType) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtGlobal: + t.traverseArray("Vars", nn.Vars) + case *ast.StmtGoto: + t.traverseSingle("Label", nn.Label) + case *ast.StmtGroupUse: + t.traverseSingle("UseType", nn.UseType) + t.traverseSingle("Prefix", nn.Prefix) + t.traverseArray("UseList", nn.UseList) + case *ast.StmtHaltCompiler: + case *ast.StmtIf: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + t.traverseArray("ElseIf", nn.ElseIf) + t.traverseSingle("Else", nn.Else) + case *ast.StmtInlineHtml: + case *ast.StmtInterface: + t.traverseSingle("InterfaceName", nn.InterfaceName) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtInterfaceExtends: + t.traverseArray("InterfaceNames", nn.InterfaceNames) + case *ast.StmtLabel: + t.traverseSingle("LabelName", nn.LabelName) + case *ast.StmtNamespace: + t.traverseSingle("NamespaceName", nn.NamespaceName) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtNop: + case *ast.StmtProperty: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtPropertyList: + t.traverseArray("Modifiers", nn.Modifiers) + t.traverseSingle("Type", nn.Type) + t.traverseArray("Properties", nn.Properties) + case *ast.StmtReturn: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtStatic: + t.traverseArray("Vars", nn.Vars) + case *ast.StmtStaticVar: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtStmtList: + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtSwitch: + t.traverseSingle("Cond", nn.Cond) + case *ast.StmtThrow: + t.traverseSingle("Expr", nn.Expr) + case *ast.StmtTrait: + t.traverseSingle("TraitName", nn.TraitName) + t.traverseArray("Stmts", nn.Stmts) + case *ast.StmtTraitAdaptationList: + t.traverseArray("Adaptations", nn.Adaptations) + case *ast.StmtTraitMethodRef: + t.traverseSingle("Trait", nn.Trait) + t.traverseSingle("Method", nn.Method) + case *ast.StmtTraitUse: + t.traverseArray("Traits", nn.Traits) + t.traverseSingle("TraitAdaptationList", nn.TraitAdaptationList) + case *ast.StmtTraitUseAlias: + t.traverseSingle("Ref", nn.Ref) + t.traverseSingle("Modifier", nn.Modifier) + t.traverseSingle("Alias", nn.Alias) + case *ast.StmtTraitUsePrecedence: + t.traverseSingle("Ref", nn.Ref) + t.traverseArray("Insteadof", nn.Insteadof) + case *ast.StmtTry: + t.traverseArray("Stmts", nn.Stmts) + t.traverseArray("Catches", nn.Catches) + t.traverseSingle("Finally", nn.Finally) + case *ast.StmtUnset: + t.traverseArray("Vars", nn.Vars) + case *ast.StmtUse: + t.traverseSingle("UseType", nn.UseType) + t.traverseSingle("Use", nn.Use) + t.traverseSingle("Alias", nn.Alias) + case *ast.StmtUseList: + t.traverseSingle("UseType", nn.UseType) + t.traverseArray("Uses", nn.Uses) + case *ast.StmtWhile: + t.traverseSingle("Cond", nn.Cond) + t.traverseSingle("Stmt", nn.Stmt) + case *ast.ExprArray: + t.traverseArray("Items", nn.Items) + case *ast.ExprArrayDimFetch: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Dim", nn.Dim) + case *ast.ExprArrayItem: + t.traverseSingle("Key", nn.Key) + t.traverseSingle("Val", nn.Val) + case *ast.ExprArrowFunction: + t.traverseArray("Params", nn.Params) + t.traverseSingle("ReturnType", nn.ReturnType) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprBitwiseNot: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprBooleanNot: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprClassConstFetch: + t.traverseSingle("Class", nn.Class) + t.traverseSingle("ConstantName", nn.ConstantName) + case *ast.ExprClone: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprClosure: + t.traverseArray("Params", nn.Params) + t.traverseSingle("ClosureUse", nn.ClosureUse) + t.traverseSingle("ReturnType", nn.ReturnType) + t.traverseArray("Stmts", nn.Stmts) + case *ast.ExprClosureUse: + t.traverseArray("Uses", nn.Uses) + case *ast.ExprConstFetch: + t.traverseSingle("Const", nn.Const) + case *ast.ExprEmpty: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprErrorSuppress: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprEval: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprExit: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprFunctionCall: + t.traverseSingle("Function", nn.Function) + t.traverseSingle("ArgumentList", nn.ArgumentList) + case *ast.ExprInclude: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprIncludeOnce: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprInstanceOf: + t.traverseSingle("Expr", nn.Expr) + t.traverseSingle("Class", nn.Class) + case *ast.ExprIsset: + t.traverseArray("Vars", nn.Vars) + case *ast.ExprList: + t.traverseArray("Items", nn.Items) + case *ast.ExprMethodCall: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Method", nn.Method) + case *ast.ExprNew: + t.traverseSingle("Class", nn.Class) + case *ast.ExprPostDec: + t.traverseSingle("Var", nn.Var) + case *ast.ExprPostInc: + t.traverseSingle("Var", nn.Var) + case *ast.ExprPreDec: + t.traverseSingle("Var", nn.Var) + case *ast.ExprPreInc: + t.traverseSingle("Var", nn.Var) + case *ast.ExprPrint: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprPropertyFetch: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Property", nn.Property) + case *ast.ExprReference: + t.traverseSingle("Var", nn.Var) + case *ast.ExprRequire: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprRequireOnce: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprShellExec: + t.traverseArray("Parts", nn.Parts) + case *ast.ExprShortArray: + t.traverseArray("Items", nn.Items) + case *ast.ExprShortList: + t.traverseArray("Items", nn.Items) + case *ast.ExprStaticCall: + t.traverseSingle("Class", nn.Class) + t.traverseSingle("Call", nn.Call) + t.traverseSingle("ArgumentList", nn.ArgumentList) + case *ast.ExprStaticPropertyFetch: + t.traverseSingle("Class", nn.Class) + t.traverseSingle("Property", nn.Property) + case *ast.ExprTernary: + t.traverseSingle("Condition", nn.Condition) + t.traverseSingle("IfTrue", nn.IfTrue) + t.traverseSingle("IfFalse", nn.IfFalse) + case *ast.ExprUnaryMinus: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprUnaryPlus: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprVariable: + t.traverseSingle("VarName", nn.VarName) + case *ast.ExprYield: + t.traverseSingle("Key", nn.Key) + t.traverseSingle("Value", nn.Value) + case *ast.ExprYieldFrom: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssign: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignReference: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignBitwiseAnd: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignBitwiseOr: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignBitwiseXor: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignCoalesce: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignConcat: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignDiv: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignMinus: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignMod: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignMul: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignPlus: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignPow: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignShiftLeft: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprAssignShiftRight: + t.traverseSingle("Var", nn.Var) + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprBinaryBitwiseAnd: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryBitwiseOr: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryBitwiseXor: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryBooleanAnd: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryBooleanOr: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryCoalesce: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryConcat: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryDiv: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryEqual: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryGreater: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryGreaterOrEqual: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryIdentical: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryLogicalAnd: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryLogicalOr: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryLogicalXor: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryMinus: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryMod: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryMul: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryNotEqual: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryNotIdentical: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryPlus: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryPow: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryShiftLeft: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinaryShiftRight: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinarySmaller: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinarySmallerOrEqual: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprBinarySpaceship: + t.traverseSingle("Left", nn.Left) + t.traverseSingle("Right", nn.Right) + case *ast.ExprCastArray: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastBool: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastDouble: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastInt: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastObject: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastString: + t.traverseSingle("Expr", nn.Expr) + case *ast.ExprCastUnset: + t.traverseSingle("Expr", nn.Expr) + case *ast.ScalarDnumber: + case *ast.ScalarEncapsed: + t.traverseArray("Parts", nn.Parts) + case *ast.ScalarEncapsedStringPart: + case *ast.ScalarHeredoc: + t.traverseArray("Parts", nn.Parts) + case *ast.ScalarLnumber: + case *ast.ScalarMagicConstant: + case *ast.ScalarString: + } + + t.visitor.LeaveNode(n) +} + +func (t *DFS) traverseSingle(key string, n ast.Vertex) { + if n == nil { + return + } + + t.visitor.Enter(key, true) + t.Traverse(n) + t.visitor.Leave(key, true) +} + +func (t *DFS) traverseArray(key string, nn []ast.Vertex) { + if nn == nil { + return + } + + t.visitor.Enter(key, false) + for _, c := range nn { + t.Traverse(c) + } + t.visitor.Leave(key, false) +} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go new file mode 100644 index 0000000..b013607 --- /dev/null +++ b/pkg/ast/visitor/dump.go @@ -0,0 +1,1003 @@ +package visitor + +import ( + "fmt" + "github.com/z7zmey/php-parser/pkg/ast" + "io" + "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) { + v.print(strings.Repeat("\t", indentDepth)) +} + +func (v *Dump) printIndentIfNotSingle(indentDepth int) { + 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) + + 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) Root(_ *ast.Root) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.Root{\n") +} + +func (v *Dump) Nullable(_ *ast.Nullable) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.Nullable{\n") +} + +func (v *Dump) Parameter(n *ast.Parameter) { + v.printIndent(v.indent - 1) + v.print("&ast.Parameter{\n") + + if n.ByRef { + v.printIndent(v.indent) + v.print("ByRef: true,\n") + } + + if n.Variadic { + v.printIndent(v.indent) + v.print("Variadic: true,\n") + } +} + +func (v *Dump) Identifier(n *ast.Identifier) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.Identifier{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) ArgumentList(_ *ast.ArgumentList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ArgumentList{\n") +} + +func (v *Dump) Argument(n *ast.Argument) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.Argument{\n") + + 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) StmtAltElse(_ *ast.StmtAltElse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltElse{\n") +} + +func (v *Dump) StmtAltElseIf(_ *ast.StmtAltElseIf) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltElseIf{\n") +} + +func (v *Dump) StmtAltFor(_ *ast.StmtAltFor) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltFor{\n") +} + +func (v *Dump) StmtAltForeach(_ *ast.StmtAltForeach) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltForeach{\n") +} + +func (v *Dump) StmtAltIf(_ *ast.StmtAltIf) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltIf{\n") +} + +func (v *Dump) StmtAltSwitch(_ *ast.StmtAltSwitch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltSwitch{\n") +} + +func (v *Dump) StmtAltWhile(_ *ast.StmtAltWhile) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtAltWhile{\n") +} + +func (v *Dump) StmtBreak(_ *ast.StmtBreak) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtBreak{\n") +} + +func (v *Dump) StmtCase(_ *ast.StmtCase) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtCase{\n") +} + +func (v *Dump) StmtCaseList(_ *ast.StmtCaseList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtCaseList{\n") +} + +func (v *Dump) StmtCatch(_ *ast.StmtCatch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtCatch{\n") +} + +func (v *Dump) StmtClass(_ *ast.StmtClass) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtClass{\n") +} + +func (v *Dump) StmtClassConstList(_ *ast.StmtClassConstList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtClassConstList{\n") +} + +func (v *Dump) StmtClassExtends(_ *ast.StmtClassExtends) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtClassExtends{\n") +} + +func (v *Dump) StmtClassImplements(_ *ast.StmtClassImplements) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtClassImplements{\n") +} + +func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtClassMethod{\n") + + if n.ReturnsRef { + v.printIndent(v.indent) + v.print("ReturnsRef: true,\n") + } +} + +func (v *Dump) StmtConstList(_ *ast.StmtConstList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtConstList{\n") +} + +func (v *Dump) StmtConstant(_ *ast.StmtConstant) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtConstant{\n") +} + +func (v *Dump) StmtContinue(_ *ast.StmtContinue) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtContinue{\n") +} + +func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtDeclare{\n") + + if n.Alt { + v.printIndent(v.indent) + v.print("Alt: true,\n") + } +} + +func (v *Dump) StmtDefault(_ *ast.StmtDefault) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtDefault{\n") +} + +func (v *Dump) StmtDo(_ *ast.StmtDo) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtDo{\n") +} + +func (v *Dump) StmtEcho(_ *ast.StmtEcho) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtEcho{\n") +} + +func (v *Dump) StmtElse(_ *ast.StmtElse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtElse{\n") +} + +func (v *Dump) StmtElseIf(_ *ast.StmtElseIf) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtElseIf{\n") +} + +func (v *Dump) StmtExpression(_ *ast.StmtExpression) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtExpression{\n") +} + +func (v *Dump) StmtFinally(_ *ast.StmtFinally) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtFinally{\n") +} + +func (v *Dump) StmtFor(_ *ast.StmtFor) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtFor{\n") +} + +func (v *Dump) StmtForeach(_ *ast.StmtForeach) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtForeach{\n") +} + +func (v *Dump) StmtFunction(n *ast.StmtFunction) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtFunction{\n") + + if n.ReturnsRef { + v.printIndent(v.indent) + v.print("ReturnsRef: true,\n") + } +} + +func (v *Dump) StmtGlobal(_ *ast.StmtGlobal) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtGlobal{\n") +} + +func (v *Dump) StmtGoto(_ *ast.StmtGoto) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtGoto{\n") +} + +func (v *Dump) StmtGroupUse(_ *ast.StmtGroupUse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtGroupUse{\n") +} + +func (v *Dump) StmtHaltCompiler(_ *ast.StmtHaltCompiler) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtHaltCompiler{\n") +} + +func (v *Dump) StmtIf(_ *ast.StmtIf) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtIf{\n") +} + +func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtInlineHtml{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) StmtInterface(_ *ast.StmtInterface) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtInterface{\n") +} + +func (v *Dump) StmtInterfaceExtends(_ *ast.StmtInterfaceExtends) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtInterfaceExtends{\n") +} + +func (v *Dump) StmtLabel(_ *ast.StmtLabel) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtLabel{\n") +} + +func (v *Dump) StmtNamespace(_ *ast.StmtNamespace) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtNamespace{\n") +} + +func (v *Dump) StmtNop(_ *ast.StmtNop) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtNop{\n") +} + +func (v *Dump) StmtProperty(_ *ast.StmtProperty) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtProperty{\n") +} + +func (v *Dump) StmtPropertyList(_ *ast.StmtPropertyList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtPropertyList{\n") +} + +func (v *Dump) StmtReturn(_ *ast.StmtReturn) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtReturn{\n") +} + +func (v *Dump) StmtStatic(_ *ast.StmtStatic) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtStatic{\n") +} + +func (v *Dump) StmtStaticVar(_ *ast.StmtStaticVar) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtStaticVar{\n") +} + +func (v *Dump) StmtStmtList(_ *ast.StmtStmtList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtStmtList{\n") +} + +func (v *Dump) StmtSwitch(_ *ast.StmtSwitch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtSwitch{\n") +} + +func (v *Dump) StmtThrow(_ *ast.StmtThrow) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtThrow{\n") +} + +func (v *Dump) StmtTrait(_ *ast.StmtTrait) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTrait{\n") +} + +func (v *Dump) StmtTraitAdaptationList(_ *ast.StmtTraitAdaptationList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTraitAdaptationList{\n") +} + +func (v *Dump) StmtTraitMethodRef(_ *ast.StmtTraitMethodRef) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTraitMethodRef{\n") +} + +func (v *Dump) StmtTraitUse(_ *ast.StmtTraitUse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTraitUse{\n") +} + +func (v *Dump) StmtTraitUseAlias(_ *ast.StmtTraitUseAlias) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTraitUseAlias{\n") +} + +func (v *Dump) StmtTraitUsePrecedence(_ *ast.StmtTraitUsePrecedence) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTraitUsePrecedence{\n") +} + +func (v *Dump) StmtTry(_ *ast.StmtTry) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtTry{\n") +} + +func (v *Dump) StmtUnset(_ *ast.StmtUnset) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtUnset{\n") +} + +func (v *Dump) StmtUse(_ *ast.StmtUse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtUse{\n") +} + +func (v *Dump) StmtUseList(_ *ast.StmtUseList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtUseList{\n") +} + +func (v *Dump) StmtWhile(_ *ast.StmtWhile) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.StmtWhile{\n") +} + +func (v *Dump) ExprArray(_ *ast.ExprArray) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprArray{\n") +} + +func (v *Dump) ExprArrayDimFetch(_ *ast.ExprArrayDimFetch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprArrayDimFetch{\n") +} + +func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprArrayItem{\n") + + 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") + + 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(_ *ast.ExprBitwiseNot) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBitwiseNot{\n") +} + +func (v *Dump) ExprBooleanNot(_ *ast.ExprBooleanNot) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBooleanNot{\n") +} + +func (v *Dump) ExprClassConstFetch(_ *ast.ExprClassConstFetch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprClassConstFetch{\n") +} + +func (v *Dump) ExprClone(_ *ast.ExprClone) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprClone{\n") +} + +func (v *Dump) ExprClosure(n *ast.ExprClosure) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprClosure{\n") + + 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(_ *ast.ExprClosureUse) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprClosureUse{\n") +} + +func (v *Dump) ExprConstFetch(_ *ast.ExprConstFetch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprConstFetch{\n") +} + +func (v *Dump) ExprEmpty(_ *ast.ExprEmpty) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprEmpty{\n") +} + +func (v *Dump) ExprErrorSuppress(_ *ast.ExprErrorSuppress) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprErrorSuppress{\n") +} + +func (v *Dump) ExprEval(_ *ast.ExprEval) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprEval{\n") +} + +func (v *Dump) ExprExit(n *ast.ExprExit) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprExit{\n") + + if n.Die { + v.printIndent(v.indent) + v.print("Die: true,\n") + } +} + +func (v *Dump) ExprFunctionCall(_ *ast.ExprFunctionCall) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprFunctionCall{\n") +} + +func (v *Dump) ExprInclude(_ *ast.ExprInclude) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprInclude{\n") +} + +func (v *Dump) ExprIncludeOnce(_ *ast.ExprIncludeOnce) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprIncludeOnce{\n") +} + +func (v *Dump) ExprInstanceOf(_ *ast.ExprInstanceOf) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprInstanceOf{\n") +} + +func (v *Dump) ExprIsset(_ *ast.ExprIsset) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprIsset{\n") +} + +func (v *Dump) ExprList(_ *ast.ExprList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprList{\n") +} + +func (v *Dump) ExprMethodCall(_ *ast.ExprMethodCall) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprMethodCall{\n") +} + +func (v *Dump) ExprNew(_ *ast.ExprNew) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprNew{\n") +} + +func (v *Dump) ExprPostDec(_ *ast.ExprPostDec) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPostDec{\n") +} + +func (v *Dump) ExprPostInc(_ *ast.ExprPostInc) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPostInc{\n") +} + +func (v *Dump) ExprPreDec(_ *ast.ExprPreDec) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPreDec{\n") +} + +func (v *Dump) ExprPreInc(_ *ast.ExprPreInc) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPreInc{\n") +} + +func (v *Dump) ExprPrint(_ *ast.ExprPrint) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPrint{\n") +} + +func (v *Dump) ExprPropertyFetch(_ *ast.ExprPropertyFetch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprPropertyFetch{\n") +} + +func (v *Dump) ExprReference(_ *ast.ExprReference) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprReference{\n") +} + +func (v *Dump) ExprRequire(_ *ast.ExprRequire) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprRequire{\n") +} + +func (v *Dump) ExprRequireOnce(_ *ast.ExprRequireOnce) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprRequireOnce{\n") +} + +func (v *Dump) ExprShellExec(_ *ast.ExprShellExec) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprShellExec{\n") +} + +func (v *Dump) ExprShortArray(_ *ast.ExprShortArray) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprShortArray{\n") +} + +func (v *Dump) ExprShortList(_ *ast.ExprShortList) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprShortList{\n") +} + +func (v *Dump) ExprStaticCall(_ *ast.ExprStaticCall) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprStaticCall{\n") +} + +func (v *Dump) ExprStaticPropertyFetch(_ *ast.ExprStaticPropertyFetch) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprStaticPropertyFetch{\n") +} + +func (v *Dump) ExprTernary(_ *ast.ExprTernary) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprTernary{\n") +} + +func (v *Dump) ExprUnaryMinus(_ *ast.ExprUnaryMinus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprUnaryMinus{\n") +} + +func (v *Dump) ExprUnaryPlus(_ *ast.ExprUnaryPlus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprUnaryPlus{\n") +} + +func (v *Dump) ExprVariable(_ *ast.ExprVariable) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprVariable{\n") +} + +func (v *Dump) ExprYield(_ *ast.ExprYield) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprYield{\n") +} + +func (v *Dump) ExprYieldFrom(_ *ast.ExprYieldFrom) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprYieldFrom{\n") +} + +func (v *Dump) ExprAssign(_ *ast.ExprAssign) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssign{\n") +} + +func (v *Dump) ExprAssignReference(_ *ast.ExprAssignReference) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignReference{\n") +} + +func (v *Dump) ExprAssignBitwiseAnd(_ *ast.ExprAssignBitwiseAnd) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignBitwiseAnd{\n") +} + +func (v *Dump) ExprAssignBitwiseOr(_ *ast.ExprAssignBitwiseOr) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignBitwiseOr{\n") +} + +func (v *Dump) ExprAssignBitwiseXor(_ *ast.ExprAssignBitwiseXor) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignBitwiseXor{\n") +} + +func (v *Dump) ExprAssignCoalesce(_ *ast.ExprAssignCoalesce) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignCoalesce{\n") +} + +func (v *Dump) ExprAssignConcat(_ *ast.ExprAssignConcat) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignConcat{\n") +} + +func (v *Dump) ExprAssignDiv(_ *ast.ExprAssignDiv) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignDiv{\n") +} + +func (v *Dump) ExprAssignMinus(_ *ast.ExprAssignMinus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignMinus{\n") +} + +func (v *Dump) ExprAssignMod(_ *ast.ExprAssignMod) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignMod{\n") +} + +func (v *Dump) ExprAssignMul(_ *ast.ExprAssignMul) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignMul{\n") +} + +func (v *Dump) ExprAssignPlus(_ *ast.ExprAssignPlus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignPlus{\n") +} + +func (v *Dump) ExprAssignPow(_ *ast.ExprAssignPow) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignPow{\n") +} + +func (v *Dump) ExprAssignShiftLeft(_ *ast.ExprAssignShiftLeft) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignShiftLeft{\n") +} + +func (v *Dump) ExprAssignShiftRight(_ *ast.ExprAssignShiftRight) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprAssignShiftRight{\n") +} + +func (v *Dump) ExprBinaryBitwiseAnd(_ *ast.ExprBinaryBitwiseAnd) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryBitwiseAnd{\n") +} + +func (v *Dump) ExprBinaryBitwiseOr(_ *ast.ExprBinaryBitwiseOr) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryBitwiseOr{\n") +} + +func (v *Dump) ExprBinaryBitwiseXor(_ *ast.ExprBinaryBitwiseXor) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryBitwiseXor{\n") +} + +func (v *Dump) ExprBinaryBooleanAnd(_ *ast.ExprBinaryBooleanAnd) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryBooleanAnd{\n") +} + +func (v *Dump) ExprBinaryBooleanOr(_ *ast.ExprBinaryBooleanOr) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryBooleanOr{\n") +} + +func (v *Dump) ExprBinaryCoalesce(_ *ast.ExprBinaryCoalesce) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryCoalesce{\n") +} + +func (v *Dump) ExprBinaryConcat(_ *ast.ExprBinaryConcat) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryConcat{\n") +} + +func (v *Dump) ExprBinaryDiv(_ *ast.ExprBinaryDiv) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryDiv{\n") +} + +func (v *Dump) ExprBinaryEqual(_ *ast.ExprBinaryEqual) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryEqual{\n") +} + +func (v *Dump) ExprBinaryGreater(_ *ast.ExprBinaryGreater) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryGreater{\n") +} + +func (v *Dump) ExprBinaryGreaterOrEqual(_ *ast.ExprBinaryGreaterOrEqual) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryGreaterOrEqual{\n") +} + +func (v *Dump) ExprBinaryIdentical(_ *ast.ExprBinaryIdentical) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryIdentical{\n") +} + +func (v *Dump) ExprBinaryLogicalAnd(_ *ast.ExprBinaryLogicalAnd) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryLogicalAnd{\n") +} + +func (v *Dump) ExprBinaryLogicalOr(_ *ast.ExprBinaryLogicalOr) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryLogicalOr{\n") +} + +func (v *Dump) ExprBinaryLogicalXor(_ *ast.ExprBinaryLogicalXor) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryLogicalXor{\n") +} + +func (v *Dump) ExprBinaryMinus(_ *ast.ExprBinaryMinus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryMinus{\n") +} + +func (v *Dump) ExprBinaryMod(_ *ast.ExprBinaryMod) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryMod{\n") +} + +func (v *Dump) ExprBinaryMul(_ *ast.ExprBinaryMul) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryMul{\n") +} + +func (v *Dump) ExprBinaryNotEqual(_ *ast.ExprBinaryNotEqual) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryNotEqual{\n") +} + +func (v *Dump) ExprBinaryNotIdentical(_ *ast.ExprBinaryNotIdentical) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryNotIdentical{\n") +} + +func (v *Dump) ExprBinaryPlus(_ *ast.ExprBinaryPlus) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryPlus{\n") +} + +func (v *Dump) ExprBinaryPow(_ *ast.ExprBinaryPow) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryPow{\n") +} + +func (v *Dump) ExprBinaryShiftLeft(_ *ast.ExprBinaryShiftLeft) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryShiftLeft{\n") +} + +func (v *Dump) ExprBinaryShiftRight(_ *ast.ExprBinaryShiftRight) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinaryShiftRight{\n") +} + +func (v *Dump) ExprBinarySmaller(_ *ast.ExprBinarySmaller) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinarySmaller{\n") +} + +func (v *Dump) ExprBinarySmallerOrEqual(_ *ast.ExprBinarySmallerOrEqual) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinarySmallerOrEqual{\n") +} + +func (v *Dump) ExprBinarySpaceship(_ *ast.ExprBinarySpaceship) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprBinarySpaceship{\n") +} + +func (v *Dump) ExprCastArray(_ *ast.ExprCastArray) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastArray{\n") +} + +func (v *Dump) ExprCastBool(_ *ast.ExprCastBool) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastBool{\n") +} + +func (v *Dump) ExprCastDouble(_ *ast.ExprCastDouble) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastDouble{\n") +} + +func (v *Dump) ExprCastInt(_ *ast.ExprCastInt) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastInt{\n") +} + +func (v *Dump) ExprCastObject(_ *ast.ExprCastObject) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastObject{\n") +} + +func (v *Dump) ExprCastString(_ *ast.ExprCastString) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastString{\n") +} + +func (v *Dump) ExprCastUnset(_ *ast.ExprCastUnset) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ExprCastUnset{\n") +} + +func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarDnumber{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) ScalarEncapsed(_ *ast.ScalarEncapsed) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarEncapsed{\n") +} + +func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarEncapsedStringPart{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarHeredoc{\n") + + v.printIndentIfNotSingle(v.indent) + 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") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarMagicConstant{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) ScalarString(n *ast.ScalarString) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.ScalarString{\n") + + v.printIndentIfNotSingle(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go new file mode 100644 index 0000000..5d2277d --- /dev/null +++ b/pkg/ast/visitor/dump_test.go @@ -0,0 +1,43 @@ +package visitor_test + +import ( + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/ast/traverser" + "github.com/z7zmey/php-parser/pkg/ast/visitor" + "os" +) + +func ExampleDump() { + stxTree := &ast.Root{ + Stmts: []ast.Vertex{ + &ast.Identifier{}, + &ast.Parameter{ + Variadic: true, + Var: &ast.ExprVariable{ + }, + }, + &ast.StmtInlineHtml{ + Value: "foo", + }, + }, + } + + traverser.NewDFS(visitor.NewDump(os.Stdout)).Traverse(stxTree) + + //output: + //&ast.Root{ + // Stmts: []ast.Vertex{ + // &ast.Identifier{ + // Value: "", + // }, + // &ast.Parameter{ + // Variadic: true, + // Var: &ast.ExprVariable{ + // }, + // }, + // &ast.StmtInlineHtml{ + // Value: "foo", + // }, + // }, + //} +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go new file mode 100644 index 0000000..41ab67b --- /dev/null +++ b/pkg/ast/visitor/null.go @@ -0,0 +1,683 @@ +package visitor + +import ( + "github.com/z7zmey/php-parser/pkg/ast" +) + +type Null struct { +} + +func (v *Null) Enter(_ string, _ bool) { + // do nothing +} +func (v *Null) Leave(_ string, _ bool) { + // do nothing +} + +func (v *Null) EnterNode(_ ast.Vertex) bool { + return true +} + +func (v *Null) LeaveNode(_ ast.Vertex) { + // do nothing +} + +func (v *Null) Root(_ *ast.Root) { + // do nothing +} + +func (v *Null) Nullable(_ *ast.Nullable) { + // do nothing +} + +func (v *Null) Parameter(_ *ast.Parameter) { + // do nothing +} + +func (v *Null) Identifier(_ *ast.Identifier) { + // do nothing +} + +func (v *Null) ArgumentList(_ *ast.ArgumentList) { + // do nothing +} + +func (v *Null) Argument(_ *ast.Argument) { + // do nothing +} + +func (v *Null) StmtAltElse(_ *ast.StmtAltElse) { + // do nothing +} + +func (v *Null) StmtAltElseIf(_ *ast.StmtAltElseIf) { + // do nothing +} + +func (v *Null) StmtAltFor(_ *ast.StmtAltFor) { + // do nothing +} + +func (v *Null) StmtAltForeach(_ *ast.StmtAltForeach) { + // do nothing +} + +func (v *Null) StmtAltIf(_ *ast.StmtAltIf) { + // do nothing +} + +func (v *Null) StmtAltSwitch(_ *ast.StmtAltSwitch) { + // do nothing +} + +func (v *Null) StmtAltWhile(_ *ast.StmtAltWhile) { + // do nothing +} + +func (v *Null) StmtBreak(_ *ast.StmtBreak) { + // do nothing +} + +func (v *Null) StmtCase(_ *ast.StmtCase) { + // do nothing +} + +func (v *Null) StmtCaseList(_ *ast.StmtCaseList) { + // do nothing +} + +func (v *Null) StmtCatch(_ *ast.StmtCatch) { + // do nothing +} + +func (v *Null) StmtClass(_ *ast.StmtClass) { + // do nothing +} + +func (v *Null) StmtClassConstList(_ *ast.StmtClassConstList) { + // do nothing +} + +func (v *Null) StmtClassExtends(_ *ast.StmtClassExtends) { + // do nothing +} + +func (v *Null) StmtClassImplements(_ *ast.StmtClassImplements) { + // do nothing +} + +func (v *Null) StmtClassMethod(_ *ast.StmtClassMethod) { + // do nothing +} + +func (v *Null) StmtConstList(_ *ast.StmtConstList) { + // do nothing +} + +func (v *Null) StmtConstant(_ *ast.StmtConstant) { + // do nothing +} + +func (v *Null) StmtContinue(_ *ast.StmtContinue) { + // do nothing +} + +func (v *Null) StmtDeclare(_ *ast.StmtDeclare) { + // do nothing +} + +func (v *Null) StmtDefault(_ *ast.StmtDefault) { + // do nothing +} + +func (v *Null) StmtDo(_ *ast.StmtDo) { + // do nothing +} + +func (v *Null) StmtEcho(_ *ast.StmtEcho) { + // do nothing +} + +func (v *Null) StmtElse(_ *ast.StmtElse) { + // do nothing +} + +func (v *Null) StmtElseIf(_ *ast.StmtElseIf) { + // do nothing +} + +func (v *Null) StmtExpression(_ *ast.StmtExpression) { + // do nothing +} + +func (v *Null) StmtFinally(_ *ast.StmtFinally) { + // do nothing +} + +func (v *Null) StmtFor(_ *ast.StmtFor) { + // do nothing +} + +func (v *Null) StmtForeach(_ *ast.StmtForeach) { + // do nothing +} + +func (v *Null) StmtFunction(_ *ast.StmtFunction) { + // do nothing +} + +func (v *Null) StmtGlobal(_ *ast.StmtGlobal) { + // do nothing +} + +func (v *Null) StmtGoto(_ *ast.StmtGoto) { + // do nothing +} + +func (v *Null) StmtGroupUse(_ *ast.StmtGroupUse) { + // do nothing +} + +func (v *Null) StmtHaltCompiler(_ *ast.StmtHaltCompiler) { + // do nothing +} + +func (v *Null) StmtIf(_ *ast.StmtIf) { + // do nothing +} + +func (v *Null) StmtInlineHtml(_ *ast.StmtInlineHtml) { + // do nothing +} + +func (v *Null) StmtInterface(_ *ast.StmtInterface) { + // do nothing +} + +func (v *Null) StmtInterfaceExtends(_ *ast.StmtInterfaceExtends) { + // do nothing +} + +func (v *Null) StmtLabel(_ *ast.StmtLabel) { + // do nothing +} + +func (v *Null) StmtNamespace(_ *ast.StmtNamespace) { + // do nothing +} + +func (v *Null) StmtNop(_ *ast.StmtNop) { + // do nothing +} + +func (v *Null) StmtProperty(_ *ast.StmtProperty) { + // do nothing +} + +func (v *Null) StmtPropertyList(_ *ast.StmtPropertyList) { + // do nothing +} + +func (v *Null) StmtReturn(_ *ast.StmtReturn) { + // do nothing +} + +func (v *Null) StmtStatic(_ *ast.StmtStatic) { + // do nothing +} + +func (v *Null) StmtStaticVar(_ *ast.StmtStaticVar) { + // do nothing +} + +func (v *Null) StmtStmtList(_ *ast.StmtStmtList) { + // do nothing +} + +func (v *Null) StmtSwitch(_ *ast.StmtSwitch) { + // do nothing +} + +func (v *Null) StmtThrow(_ *ast.StmtThrow) { + // do nothing +} + +func (v *Null) StmtTrait(_ *ast.StmtTrait) { + // do nothing +} + +func (v *Null) StmtTraitAdaptationList(_ *ast.StmtTraitAdaptationList) { + // do nothing +} + +func (v *Null) StmtTraitMethodRef(_ *ast.StmtTraitMethodRef) { + // do nothing +} + +func (v *Null) StmtTraitUse(_ *ast.StmtTraitUse) { + // do nothing +} + +func (v *Null) StmtTraitUseAlias(_ *ast.StmtTraitUseAlias) { + // do nothing +} + +func (v *Null) StmtTraitUsePrecedence(_ *ast.StmtTraitUsePrecedence) { + // do nothing +} + +func (v *Null) StmtTry(_ *ast.StmtTry) { + // do nothing +} + +func (v *Null) StmtUnset(_ *ast.StmtUnset) { + // do nothing +} + +func (v *Null) StmtUse(_ *ast.StmtUse) { + // do nothing +} + +func (v *Null) StmtUseList(_ *ast.StmtUseList) { + // do nothing +} + +func (v *Null) StmtWhile(_ *ast.StmtWhile) { + // do nothing +} + +func (v *Null) ExprArray(_ *ast.ExprArray) { + // do nothing +} + +func (v *Null) ExprArrayDimFetch(_ *ast.ExprArrayDimFetch) { + // do nothing +} + +func (v *Null) ExprArrayItem(_ *ast.ExprArrayItem) { + // do nothing +} + +func (v *Null) ExprArrowFunction(_ *ast.ExprArrowFunction) { + // do nothing +} + +func (v *Null) ExprBitwiseNot(_ *ast.ExprBitwiseNot) { + // do nothing +} + +func (v *Null) ExprBooleanNot(_ *ast.ExprBooleanNot) { + // do nothing +} + +func (v *Null) ExprClassConstFetch(_ *ast.ExprClassConstFetch) { + // do nothing +} + +func (v *Null) ExprClone(_ *ast.ExprClone) { + // do nothing +} + +func (v *Null) ExprClosure(_ *ast.ExprClosure) { + // do nothing +} + +func (v *Null) ExprClosureUse(_ *ast.ExprClosureUse) { + // do nothing +} + +func (v *Null) ExprConstFetch(_ *ast.ExprConstFetch) { + // do nothing +} + +func (v *Null) ExprEmpty(_ *ast.ExprEmpty) { + // do nothing +} + +func (v *Null) ExprErrorSuppress(_ *ast.ExprErrorSuppress) { + // do nothing +} + +func (v *Null) ExprEval(_ *ast.ExprEval) { + // do nothing +} + +func (v *Null) ExprExit(_ *ast.ExprExit) { + // do nothing +} + +func (v *Null) ExprFunctionCall(_ *ast.ExprFunctionCall) { + // do nothing +} + +func (v *Null) ExprInclude(_ *ast.ExprInclude) { + // do nothing +} + +func (v *Null) ExprIncludeOnce(_ *ast.ExprIncludeOnce) { + // do nothing +} + +func (v *Null) ExprInstanceOf(_ *ast.ExprInstanceOf) { + // do nothing +} + +func (v *Null) ExprIsset(_ *ast.ExprIsset) { + // do nothing +} + +func (v *Null) ExprList(_ *ast.ExprList) { + // do nothing +} + +func (v *Null) ExprMethodCall(_ *ast.ExprMethodCall) { + // do nothing +} + +func (v *Null) ExprNew(_ *ast.ExprNew) { + // do nothing +} + +func (v *Null) ExprPostDec(_ *ast.ExprPostDec) { + // do nothing +} + +func (v *Null) ExprPostInc(_ *ast.ExprPostInc) { + // do nothing +} + +func (v *Null) ExprPreDec(_ *ast.ExprPreDec) { + // do nothing +} + +func (v *Null) ExprPreInc(_ *ast.ExprPreInc) { + // do nothing +} + +func (v *Null) ExprPrint(_ *ast.ExprPrint) { + // do nothing +} + +func (v *Null) ExprPropertyFetch(_ *ast.ExprPropertyFetch) { + // do nothing +} + +func (v *Null) ExprReference(_ *ast.ExprReference) { + // do nothing +} + +func (v *Null) ExprRequire(_ *ast.ExprRequire) { + // do nothing +} + +func (v *Null) ExprRequireOnce(_ *ast.ExprRequireOnce) { + // do nothing +} + +func (v *Null) ExprShellExec(_ *ast.ExprShellExec) { + // do nothing +} + +func (v *Null) ExprShortArray(_ *ast.ExprShortArray) { + // do nothing +} + +func (v *Null) ExprShortList(_ *ast.ExprShortList) { + // do nothing +} + +func (v *Null) ExprStaticCall(_ *ast.ExprStaticCall) { + // do nothing +} + +func (v *Null) ExprStaticPropertyFetch(_ *ast.ExprStaticPropertyFetch) { + // do nothing +} + +func (v *Null) ExprTernary(_ *ast.ExprTernary) { + // do nothing +} + +func (v *Null) ExprUnaryMinus(_ *ast.ExprUnaryMinus) { + // do nothing +} + +func (v *Null) ExprUnaryPlus(_ *ast.ExprUnaryPlus) { + // do nothing +} + +func (v *Null) ExprVariable(_ *ast.ExprVariable) { + // do nothing +} + +func (v *Null) ExprYield(_ *ast.ExprYield) { + // do nothing +} + +func (v *Null) ExprYieldFrom(_ *ast.ExprYieldFrom) { + // do nothing +} + +func (v *Null) ExprAssign(_ *ast.ExprAssign) { + // do nothing +} + +func (v *Null) ExprAssignReference(_ *ast.ExprAssignReference) { + // do nothing +} + +func (v *Null) ExprAssignBitwiseAnd(_ *ast.ExprAssignBitwiseAnd) { + // do nothing +} + +func (v *Null) ExprAssignBitwiseOr(_ *ast.ExprAssignBitwiseOr) { + // do nothing +} + +func (v *Null) ExprAssignBitwiseXor(_ *ast.ExprAssignBitwiseXor) { + // do nothing +} + +func (v *Null) ExprAssignCoalesce(_ *ast.ExprAssignCoalesce) { + // do nothing +} + +func (v *Null) ExprAssignConcat(_ *ast.ExprAssignConcat) { + // do nothing +} + +func (v *Null) ExprAssignDiv(_ *ast.ExprAssignDiv) { + // do nothing +} + +func (v *Null) ExprAssignMinus(_ *ast.ExprAssignMinus) { + // do nothing +} + +func (v *Null) ExprAssignMod(_ *ast.ExprAssignMod) { + // do nothing +} + +func (v *Null) ExprAssignMul(_ *ast.ExprAssignMul) { + // do nothing +} + +func (v *Null) ExprAssignPlus(_ *ast.ExprAssignPlus) { + // do nothing +} + +func (v *Null) ExprAssignPow(_ *ast.ExprAssignPow) { + // do nothing +} + +func (v *Null) ExprAssignShiftLeft(_ *ast.ExprAssignShiftLeft) { + // do nothing +} + +func (v *Null) ExprAssignShiftRight(_ *ast.ExprAssignShiftRight) { + // do nothing +} + +func (v *Null) ExprBinaryBitwiseAnd(_ *ast.ExprBinaryBitwiseAnd) { + // do nothing +} + +func (v *Null) ExprBinaryBitwiseOr(_ *ast.ExprBinaryBitwiseOr) { + // do nothing +} + +func (v *Null) ExprBinaryBitwiseXor(_ *ast.ExprBinaryBitwiseXor) { + // do nothing +} + +func (v *Null) ExprBinaryBooleanAnd(_ *ast.ExprBinaryBooleanAnd) { + // do nothing +} + +func (v *Null) ExprBinaryBooleanOr(_ *ast.ExprBinaryBooleanOr) { + // do nothing +} + +func (v *Null) ExprBinaryCoalesce(_ *ast.ExprBinaryCoalesce) { + // do nothing +} + +func (v *Null) ExprBinaryConcat(_ *ast.ExprBinaryConcat) { + // do nothing +} + +func (v *Null) ExprBinaryDiv(_ *ast.ExprBinaryDiv) { + // do nothing +} + +func (v *Null) ExprBinaryEqual(_ *ast.ExprBinaryEqual) { + // do nothing +} + +func (v *Null) ExprBinaryGreater(_ *ast.ExprBinaryGreater) { + // do nothing +} + +func (v *Null) ExprBinaryGreaterOrEqual(_ *ast.ExprBinaryGreaterOrEqual) { + // do nothing +} + +func (v *Null) ExprBinaryIdentical(_ *ast.ExprBinaryIdentical) { + // do nothing +} + +func (v *Null) ExprBinaryLogicalAnd(_ *ast.ExprBinaryLogicalAnd) { + // do nothing +} + +func (v *Null) ExprBinaryLogicalOr(_ *ast.ExprBinaryLogicalOr) { + // do nothing +} + +func (v *Null) ExprBinaryLogicalXor(_ *ast.ExprBinaryLogicalXor) { + // do nothing +} + +func (v *Null) ExprBinaryMinus(_ *ast.ExprBinaryMinus) { + // do nothing +} + +func (v *Null) ExprBinaryMod(_ *ast.ExprBinaryMod) { + // do nothing +} + +func (v *Null) ExprBinaryMul(_ *ast.ExprBinaryMul) { + // do nothing +} + +func (v *Null) ExprBinaryNotEqual(_ *ast.ExprBinaryNotEqual) { + // do nothing +} + +func (v *Null) ExprBinaryNotIdentical(_ *ast.ExprBinaryNotIdentical) { + // do nothing +} + +func (v *Null) ExprBinaryPlus(_ *ast.ExprBinaryPlus) { + // do nothing +} + +func (v *Null) ExprBinaryPow(_ *ast.ExprBinaryPow) { + // do nothing +} + +func (v *Null) ExprBinaryShiftLeft(_ *ast.ExprBinaryShiftLeft) { + // do nothing +} + +func (v *Null) ExprBinaryShiftRight(_ *ast.ExprBinaryShiftRight) { + // do nothing +} + +func (v *Null) ExprBinarySmaller(_ *ast.ExprBinarySmaller) { + // do nothing +} + +func (v *Null) ExprBinarySmallerOrEqual(_ *ast.ExprBinarySmallerOrEqual) { + // do nothing +} + +func (v *Null) ExprBinarySpaceship(_ *ast.ExprBinarySpaceship) { + // do nothing +} + +func (v *Null) ExprCastArray(_ *ast.ExprCastArray) { + // do nothing +} + +func (v *Null) ExprCastBool(_ *ast.ExprCastBool) { + // do nothing +} + +func (v *Null) ExprCastDouble(_ *ast.ExprCastDouble) { + // do nothing +} + +func (v *Null) ExprCastInt(_ *ast.ExprCastInt) { + // do nothing +} + +func (v *Null) ExprCastObject(_ *ast.ExprCastObject) { + // do nothing +} + +func (v *Null) ExprCastString(_ *ast.ExprCastString) { + // do nothing +} + +func (v *Null) ExprCastUnset(_ *ast.ExprCastUnset) { + // do nothing +} + +func (v *Null) ScalarDnumber(_ *ast.ScalarDnumber) { + // do nothing +} + +func (v *Null) ScalarEncapsed(_ *ast.ScalarEncapsed) { + // do nothing +} + +func (v *Null) ScalarEncapsedStringPart(_ *ast.ScalarEncapsedStringPart) { + // do nothing +} + +func (v *Null) ScalarHeredoc(_ *ast.ScalarHeredoc) { + // do nothing +} + +func (v *Null) ScalarLnumber(_ *ast.ScalarLnumber) { + // do nothing +} + +func (v *Null) ScalarMagicConstant(_ *ast.ScalarMagicConstant) { + // do nothing +} + +func (v *Null) ScalarString(_ *ast.ScalarString) { + // do nothing +} From 60f171bfa175cf0cee5f8958af061a16a646eb22 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 10 May 2020 08:47:13 +0300 Subject: [PATCH 002/140] refactor token structure --- pkg/ast/ast.go | 10 +-- pkg/ast/ast_test.go | 88 -------------------------- pkg/ast/node.go | 19 ++---- pkg/token/token.go | 149 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 155 insertions(+), 111 deletions(-) create mode 100644 pkg/token/token.go diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index a7a1da6..dfd53c3 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -1,16 +1,8 @@ package ast -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/position" -) - type Vertex interface { Accept(v NodeVisitor) - - SetPosition(p *position.Position) - GetPosition() *position.Position - GetFreeFloating() *freefloating.Collection + GetNode() *Node } type Traverser interface { diff --git a/pkg/ast/ast_test.go b/pkg/ast/ast_test.go index bb98e9f..7930e5f 100644 --- a/pkg/ast/ast_test.go +++ b/pkg/ast/ast_test.go @@ -1,8 +1,6 @@ package ast_test import ( - "bytes" - "encoding/json" "fmt" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/ast/traverser" @@ -11,92 +9,6 @@ import ( "strings" ) -func ExampleJSON() { - stxTree := &ast.Root{ - Stmts: []ast.Vertex{ - &ast.Nullable{ - Expr: &ast.Parameter{ - Type: nil, - Var: nil, - DefaultValue: nil, - }, - }, - &ast.Identifier{}, - &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{}, - &ast.Argument{ - Expr: &ast.ScalarDnumber{}, - }, - }, - }, - }, - } - - jsonStxTree, err := json.Marshal(stxTree) - if err != nil { - panic(err) - } - - buf := bytes.NewBuffer(nil) - err = json.Indent(buf, jsonStxTree, "", " ") - if err != nil { - panic(err) - } - - fmt.Fprint(os.Stdout, buf.String()) - - // output: - // { - // "FreeFloating": null, - // "Position": null, - // "Stmts": [ - // { - // "FreeFloating": null, - // "Position": null, - // "Expr": { - // "FreeFloating": null, - // "Position": null, - // "ByRef": false, - // "Variadic": false, - // "Type": null, - // "Var": null, - // "DefaultValue": null - // } - // }, - // { - // "FreeFloating": null, - // "Position": null, - // "Value": "" - // }, - // { - // "FreeFloating": null, - // "Position": null, - // "Arguments": [ - // { - // "FreeFloating": null, - // "Position": null, - // "Variadic": false, - // "IsReference": false, - // "Expr": null - // }, - // { - // "FreeFloating": null, - // "Position": null, - // "Variadic": false, - // "IsReference": false, - // "Expr": { - // "FreeFloating": null, - // "Position": null, - // "Value": "" - // } - // } - // ] - // } - // ] - // } -} - func ExampleStxTree() { stxTree := &ast.Root{ Stmts: []ast.Vertex{ diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 65c2d98..13b285c 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1,27 +1,18 @@ package ast import ( - "github.com/z7zmey/php-parser/freefloating" + "github.com/z7zmey/php-parser/pkg/token" "github.com/z7zmey/php-parser/position" ) type Node struct { - FreeFloating freefloating.Collection + StartTokens []token.Token + EndTokens []token.Token Position *position.Position } -// SetPosition sets node position -func (n *Node) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Node) GetPosition() *position.Position { - return n.Position -} - -func (n *Node) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating +func (n *Node) GetNode() *Node { + return n } // Root node diff --git a/pkg/token/token.go b/pkg/token/token.go new file mode 100644 index 0000000..a79915d --- /dev/null +++ b/pkg/token/token.go @@ -0,0 +1,149 @@ +package token + +type TokenID int + +const ( + T_INCLUDE TokenID = iota + 57346 + T_INCLUDE_ONCE + T_EXIT + T_IF + T_LNUMBER + T_DNUMBER + T_STRING + T_STRING_VARNAME + T_VARIABLE + T_NUM_STRING + T_INLINE_HTML + T_CHARACTER + T_BAD_CHARACTER + T_ENCAPSED_AND_WHITESPACE + T_CONSTANT_ENCAPSED_STRING + T_ECHO + T_DO + T_WHILE + T_ENDWHILE + T_FOR + T_ENDFOR + T_FOREACH + T_ENDFOREACH + T_DECLARE + T_ENDDECLARE + T_AS + T_SWITCH + T_ENDSWITCH + T_CASE + T_DEFAULT + T_BREAK + T_CONTINUE + T_GOTO + T_FUNCTION + T_FN + T_CONST + T_RETURN + T_TRY + T_CATCH + T_FINALLY + T_THROW + T_USE + T_INSTEADOF + T_GLOBAL + T_VAR + T_UNSET + T_ISSET + T_EMPTY + T_HALT_COMPILER + T_CLASS + T_TRAIT + T_INTERFACE + T_EXTENDS + T_IMPLEMENTS + T_OBJECT_OPERATOR + T_DOUBLE_ARROW + T_LIST + T_ARRAY + T_CALLABLE + T_CLASS_C + T_TRAIT_C + T_METHOD_C + T_FUNC_C + T_LINE + T_FILE + T_COMMENT + T_DOC_COMMENT + T_OPEN_TAG + T_OPEN_TAG_WITH_ECHO + T_CLOSE_TAG + T_WHITESPACE + T_START_HEREDOC + T_END_HEREDOC + T_DOLLAR_OPEN_CURLY_BRACES + T_CURLY_OPEN + T_PAAMAYIM_NEKUDOTAYIM + T_NAMESPACE + T_NS_C + T_DIR + T_NS_SEPARATOR + T_ELLIPSIS + T_EVAL + T_REQUIRE + T_REQUIRE_ONCE + T_LOGICAL_OR + T_LOGICAL_XOR + T_LOGICAL_AND + T_INSTANCEOF + T_NEW + T_CLONE + T_ELSEIF + T_ELSE + T_ENDIF + T_PRINT + T_YIELD + T_STATIC + T_ABSTRACT + T_FINAL + T_PRIVATE + T_PROTECTED + T_PUBLIC + T_INC + T_DEC + T_YIELD_FROM + T_INT_CAST + T_DOUBLE_CAST + T_STRING_CAST + T_ARRAY_CAST + T_OBJECT_CAST + T_BOOL_CAST + T_UNSET_CAST + T_COALESCE + T_SPACESHIP + T_NOELSE + T_PLUS_EQUAL + T_MINUS_EQUAL + T_MUL_EQUAL + T_POW_EQUAL + T_DIV_EQUAL + T_CONCAT_EQUAL + T_MOD_EQUAL + T_AND_EQUAL + T_OR_EQUAL + T_XOR_EQUAL + T_SL_EQUAL + T_SR_EQUAL + T_COALESCE_EQUAL + T_BOOLEAN_OR + T_BOOLEAN_AND + T_POW + T_SL + T_SR + T_IS_IDENTICAL + T_IS_NOT_IDENTICAL + T_IS_EQUAL + T_IS_NOT_EQUAL + T_IS_SMALLER_OR_EQUAL + T_IS_GREATER_OR_EQUAL +) + +type Token struct { + ID TokenID + Value []byte +} From 3b9ef2b56d8fe154aa99440c8928ecc19f89ff72 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 10 May 2020 08:53:00 +0300 Subject: [PATCH 003/140] refactor position package --- pkg/position/position.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pkg/position/position.go diff --git a/pkg/position/position.go b/pkg/position/position.go new file mode 100644 index 0000000..d4099cd --- /dev/null +++ b/pkg/position/position.go @@ -0,0 +1,27 @@ +package position + +import ( + "fmt" +) + +// Position represents node position +type Position struct { + StartLine int + EndLine int + StartPos int + EndPos int +} + +// NewPosition Position constructor +func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position { + return &Position{ + StartLine: StartLine, + EndLine: EndLine, + StartPos: StartPos, + EndPos: EndPos, + } +} + +func (p Position) String() string { + return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) +} From aab9da03f0605df8ec89d2effbbdfa76183af2de Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 10 May 2020 08:53:17 +0300 Subject: [PATCH 004/140] refactor position package --- pkg/ast/node.go | 8 ++++---- pkg/position/position.go | 8 -------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 13b285c..b8b486e 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1,14 +1,14 @@ package ast import ( + "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" - "github.com/z7zmey/php-parser/position" ) type Node struct { - StartTokens []token.Token - EndTokens []token.Token - Position *position.Position + StartTokens []token.Token + EndTokens []token.Token + Position *position.Position } func (n *Node) GetNode() *Node { diff --git a/pkg/position/position.go b/pkg/position/position.go index d4099cd..ffe4746 100644 --- a/pkg/position/position.go +++ b/pkg/position/position.go @@ -1,9 +1,5 @@ package position -import ( - "fmt" -) - // Position represents node position type Position struct { StartLine int @@ -21,7 +17,3 @@ func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position EndPos: EndPos, } } - -func (p Position) String() string { - return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) -} From 6a84d58ee694402b6e9fd95aa82b33b03de25d8e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Wed, 13 May 2020 00:16:36 +0300 Subject: [PATCH 005/140] refactor php7 --- Makefile | 18 +- {php5 => internal/php5}/parser.go | 17 +- {php5 => internal/php5}/php5.go | Bin {php5 => internal/php5}/php5.y | 0 {php5 => internal/php5}/php5_bench_test.go | 0 {php5 => internal/php5}/php5_test.go | 0 internal/php7/parser.go | 190 + {php7 => internal/php7}/php7.go | Bin 285184 -> 287586 bytes internal/php7/php7.y | 5655 +++++ {php7 => internal/php7}/php7_bench_test.go | 2 +- internal/php7/php7_test.go | 20023 ++++++++++++++++ .../positionbuilder}/position_builder.go | 38 +- .../positionbuilder/position_builder_test.go | 485 + {scanner => internal/scanner}/lexer.go | 50 +- {scanner => internal/scanner}/lexer_tokens.go | 0 {scanner => internal/scanner}/newline.go | 0 {scanner => internal/scanner}/scanner.go | Bin 381562 -> 384834 bytes {scanner => internal/scanner}/scanner.rl | 36 +- {scanner => internal/scanner}/scanner_test.go | 401 +- internal/scanner/token.go | 15 + {scanner => internal/scanner}/token_pool.go | 0 .../scanner}/token_pool_test.go | 4 +- .../scanner}/tokenid_string.go | 0 {version => internal/version}/version.go | 0 php7/parser.go | 225 - php7/php7.y | 5666 ----- php7/php7_test.go | 16450 ------------- pkg/ast/ast.go | 5 + pkg/ast/ast_test.go | 7 +- pkg/ast/node.go | 53 +- pkg/ast/visitor/dump.go | 2 +- pkg/ast/visitor/dump_test.go | 3 +- {errors => pkg/errors}/error.go | 2 +- {errors => pkg/errors}/error_test.go | 0 {parser => pkg/parser}/parser.go | 14 +- .../string.go => pkg/token/position.go | 31 +- .../token}/position_string.go | 2 +- pkg/token/token.go | 6 +- position/position.go | 27 - position/position_test.go | 19 - positionbuilder/position_builder_test.go | 463 - scanner/token.go | 35 - scanner/token_test.go | 37 - visitor/dumper.go | 83 - visitor/dumper_test.go | 151 - visitor/go_dumper.go | 172 - visitor/go_dumper_test.go | 528 - visitor/json_dumper.go | 142 - visitor/json_dumper_test.go | 41 - visitor/namespace_resolver.go | 392 - visitor/namespace_resolver_test.go | 976 - visitor/pretty_json_dumper.go | 187 - visitor/pretty_json_dumper_test.go | 509 - walker/walker.go | 21 - 54 files changed, 26702 insertions(+), 26481 deletions(-) rename {php5 => internal/php5}/parser.go (94%) rename {php5 => internal/php5}/php5.go (100%) rename {php5 => internal/php5}/php5.y (100%) rename {php5 => internal/php5}/php5_bench_test.go (100%) rename {php5 => internal/php5}/php5_test.go (100%) create mode 100644 internal/php7/parser.go rename {php7 => internal/php7}/php7.go (50%) create mode 100644 internal/php7/php7.y rename {php7 => internal/php7}/php7_bench_test.go (99%) create mode 100644 internal/php7/php7_test.go rename {positionbuilder => internal/positionbuilder}/position_builder.go (74%) create mode 100644 internal/positionbuilder/position_builder_test.go rename {scanner => internal/scanner}/lexer.go (83%) rename {scanner => internal/scanner}/lexer_tokens.go (100%) rename {scanner => internal/scanner}/newline.go (100%) rename {scanner => internal/scanner}/scanner.go (94%) rename {scanner => internal/scanner}/scanner.rl (95%) rename {scanner => internal/scanner}/scanner_test.go (76%) create mode 100644 internal/scanner/token.go rename {scanner => internal/scanner}/token_pool.go (100%) rename {scanner => internal/scanner}/token_pool_test.go (87%) rename {scanner => internal/scanner}/tokenid_string.go (100%) rename {version => internal/version}/version.go (100%) delete mode 100644 php7/parser.go delete mode 100644 php7/php7.y delete mode 100644 php7/php7_test.go rename {errors => pkg/errors}/error.go (90%) rename {errors => pkg/errors}/error_test.go (100%) rename {parser => pkg/parser}/parser.go (59%) rename freefloating/string.go => pkg/token/position.go (66%) rename {freefloating => pkg/token}/position_string.go (99%) delete mode 100644 position/position.go delete mode 100644 position/position_test.go delete mode 100644 positionbuilder/position_builder_test.go delete mode 100644 scanner/token.go delete mode 100644 scanner/token_test.go delete mode 100644 visitor/dumper.go delete mode 100644 visitor/dumper_test.go delete mode 100644 visitor/go_dumper.go delete mode 100644 visitor/go_dumper_test.go delete mode 100644 visitor/json_dumper.go delete mode 100644 visitor/json_dumper_test.go delete mode 100644 visitor/namespace_resolver.go delete mode 100644 visitor/namespace_resolver_test.go delete mode 100644 visitor/pretty_json_dumper.go delete mode 100644 visitor/pretty_json_dumper_test.go delete mode 100644 walker/walker.go diff --git a/Makefile b/Makefile index 9540674..a5b8399 100644 --- a/Makefile +++ b/Makefile @@ -22,21 +22,21 @@ bench: go test -benchmem -bench=. ./php5 go test -benchmem -bench=. ./php7 -compile: ./php5/php5.go ./php7/php7.go ./scanner/scanner.go fmt - sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php7/php7.go - sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./php5/php5.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./php5/php5.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./php7/php7.go - sed -i '' -e 's/\/\/line/\/\/ line/g' ./scanner/scanner.go +compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scanner.go fmt + sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go + sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php5/php5.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/php5/php5.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/php7/php7.go + sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/scanner/scanner.go rm -f y.output -./scanner/scanner.go: ./scanner/scanner.rl +./internal/scanner/scanner.go: ./internal/scanner/scanner.rl ragel -Z -G2 -o $@ $< -./php5/php5.go: ./php5/php5.y +./internal/php5/php5.go: ./internal/php5/php5.y goyacc -o $@ $< -./php7/php7.go: ./php7/php7.y +./internal/php7/php7.go: ./internal/php7/php7.y goyacc -o $@ $< cpu_pprof: diff --git a/php5/parser.go b/internal/php5/parser.go similarity index 94% rename from php5/parser.go rename to internal/php5/parser.go index 027f444..311e544 100644 --- a/php5/parser.go +++ b/internal/php5/parser.go @@ -1,13 +1,14 @@ package php5 import ( - "strings" - - "github.com/z7zmey/php-parser/errors" "github.com/z7zmey/php-parser/freefloating" "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/positionbuilder" + "strings" + + "github.com/z7zmey/php-parser/internal/positionbuilder" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/scanner" ) @@ -20,7 +21,7 @@ type Parser struct { Lexer scanner.Scanner currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder - rootNode node.Node + rootNode ast.Vertex } // NewParser creates and returns new Parser @@ -54,7 +55,7 @@ func (l *Parser) Error(msg string) { l.Lexer.AddError(errors.NewError(msg, pos)) } -func (l *Parser) WithFreeFloating() { +func (l *Parser) WithTokens() { l.Lexer.SetWithFreeFloating(true) } @@ -71,7 +72,7 @@ func (l *Parser) Parse() int { } // GetRootNode returns root node -func (l *Parser) GetRootNode() node.Node { +func (l *Parser) GetRootNode() ast.Vertex { return l.rootNode } diff --git a/php5/php5.go b/internal/php5/php5.go similarity index 100% rename from php5/php5.go rename to internal/php5/php5.go diff --git a/php5/php5.y b/internal/php5/php5.y similarity index 100% rename from php5/php5.y rename to internal/php5/php5.y diff --git a/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go similarity index 100% rename from php5/php5_bench_test.go rename to internal/php5/php5_bench_test.go diff --git a/php5/php5_test.go b/internal/php5/php5_test.go similarity index 100% rename from php5/php5_test.go rename to internal/php5/php5_test.go diff --git a/internal/php7/parser.go b/internal/php7/parser.go new file mode 100644 index 0000000..cb42f54 --- /dev/null +++ b/internal/php7/parser.go @@ -0,0 +1,190 @@ +package php7 + +import ( + "bytes" + + "github.com/z7zmey/php-parser/internal/positionbuilder" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" +) + +func (lval *yySymType) Token(t *scanner.Token) { + lval.token = t +} + +// Parser structure +type Parser struct { + Lexer scanner.Scanner + currentToken *scanner.Token + positionBuilder *positionbuilder.PositionBuilder + rootNode ast.Vertex +} + +// NewParser creates and returns new Parser +func NewParser(src []byte, v string) *Parser { + lexer := scanner.NewLexer(src) + lexer.PHPVersion = v + + return &Parser{ + lexer, + nil, + nil, + nil, + } +} + +func (l *Parser) Lex(lval *yySymType) int { + t := l.Lexer.Lex(lval) + l.currentToken = lval.token + return t +} + +func (l *Parser) Error(msg string) { + pos := &position.Position{ + StartLine: l.currentToken.StartLine, + EndLine: l.currentToken.EndLine, + StartPos: l.currentToken.StartPos, + EndPos: l.currentToken.EndPos, + } + + l.Lexer.AddError(errors.NewError(msg, pos)) +} + +func (l *Parser) WithTokens() { + l.Lexer.SetWithTokens(true) +} + +// Parse the php7 Parser entrypoint +func (l *Parser) Parse() int { + // init + l.Lexer.SetErrors(nil) + l.rootNode = nil + l.positionBuilder = &positionbuilder.PositionBuilder{} + + // parse + + return yyParse(l) +} + +// GetRootNode returns root node +func (l *Parser) GetRootNode() ast.Vertex { + return l.rootNode +} + +// GetErrors returns errors list +func (l *Parser) GetErrors() []*errors.Error { + return l.Lexer.GetErrors() +} + +// helpers + +func lastNode(nn []ast.Vertex) ast.Vertex { + if len(nn) == 0 { + return nil + } + return nn[len(nn)-1] +} + +func firstNode(nn []ast.Vertex) ast.Vertex { + return nn[0] +} + +func isDollar(r rune) bool { + return r == '$' +} + +func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + if src.GetNode().Tokens == nil { + return + } + + l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + delete(src.GetNode().Tokens, token.Start) +} + +func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + if len(strings) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + (*dstCollection)[p] = strings +} + +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { + if l.Lexer.GetWithFreeFloating() == false { + return []token.Token{} + } + + tokens := make([]token.Token, len(t.Tokens)) + copy(tokens, t.Tokens) + + return tokens +} + +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + semiColon := prevNode.GetNode().Tokens[token.SemiColon] + delete(prevNode.GetNode().Tokens, token.SemiColon) + if len(semiColon) == 0 { + return + } + + if semiColon[0].Value[0] == ';' { + l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + { + ID: token.ID(';'), + Value: semiColon[0].Value[0:1], + }, + }) + } + + vlen := len(semiColon[0].Value) + tlen := 2 + if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { + tlen = 3 + } + + phpCloseTag := []token.Token{} + if vlen-tlen > 1 { + phpCloseTag = append(phpCloseTag, token.Token{ + ID: token.T_WHITESPACE, + Value: semiColon[0].Value[1 : vlen-tlen], + }) + } + + phpCloseTag = append(phpCloseTag, token.Token{ + ID: T_CLOSE_TAG, + Value: semiColon[0].Value[vlen-tlen:], + }) + + l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) +} + +func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { + for i := 1; i < len(yyDollar); i++ { + if yyDollar[i].token != nil { + p.Lexer.ReturnTokenToPool(yyDollar[i].token) + } + yyDollar[i].token = nil + } + yyVAL.token = nil +} diff --git a/php7/php7.go b/internal/php7/php7.go similarity index 50% rename from php7/php7.go rename to internal/php7/php7.go index 5e35ac086cb0342eb58ebf6374c982fa851f132e..0a41dffeff2caf8787ba8bf265c4846f14ee0741 100644 GIT binary patch literal 287586 zcmeFa>vkJQnl1QSdJ42xS0AY?(gYG$SG#9qi7xZBOzDVpRrhjxbZ82a*rrG>60*&% zuJcy&8uLuE_m21?A`=-v0!UJ_EiDm9WX9#Y-y$;ev(Gw@&Rh0{si_Rzb`ef-K*6-fkJD>b; zJ)2&Af`hBs+STKC~RFEU0zKuKMS~B9Uq+m zdv;#f;o`^FpB-HRt_JO9=RZ!*KDm2;2@c)C-P!fUv~zuZaQ*g>M*#ob@vQT=yLYay zuR0yl@9v#5vZ#Z(xBoJ|oK1hZdq?AU{^&v9KIC+F@0^}o%{ra$zE4|XKn#P=le5>L z$)nSwtE=5#X4A8m9KO@}BO4#g-pDdfT%kAQoyLa{|B(IK+r#5V8 zTD`(y&#&HHPQSeZKKiG&yT4pq#w&OKe)ld|2viPV?Cn2#^6lf@&KI4*sOS%?=U+VC ze`FU&;o|PU?H&3a<8X5CD}QPdPCeQG_M0zvpS$yeopAnf>3lbwKRA58xBq9~yjMB> z;x7-M??3#;Lo+DCWt`u8_~jG3&<__d%Zt*GgK%kY|HN>P`r-43 zj}8Oe5$`V_K7LWX8VRtw|LEbfgWbn39_~MW@z<~S4tEcpJv8bKB2^we-9I>dxPSN} zbVz|5Ml$U_`ueGZZ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jGP#i31E7duLuE%6{y4H5`>8(6gt5YE{W8^Lfr!6aRlGlk-G?o;ZOCSoLT2l( zUbBO%vQJJ0Anlp`30Wmzn2upr^LI0Hp4xCDfO`eud-z7ysxydLZTiz`rc=-^IVJ^A1#=papS$lXo6G J`pdV!{6DTgD`fxx diff --git a/internal/php7/php7.y b/internal/php7/php7.y new file mode 100644 index 0000000..9f08fa4 --- /dev/null +++ b/internal/php7/php7.y @@ -0,0 +1,5655 @@ +%{ +package php7 + +import ( + "bytes" + "strconv" + + "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" +) + +%} + +%union{ + node ast.Vertex + token *scanner.Token + list []ast.Vertex + str string + + ClassExtends *ast.StmtClassExtends + ClassImplements *ast.StmtClassImplements + InterfaceExtends *ast.StmtInterfaceExtends + ClosureUse *ast.ExprClosureUse +} + +%type $unk +%token T_INCLUDE +%token T_INCLUDE_ONCE +%token T_EXIT +%token T_IF +%token T_LNUMBER +%token T_DNUMBER +%token T_STRING +%token T_STRING_VARNAME +%token T_VARIABLE +%token T_NUM_STRING +%token T_INLINE_HTML +%token T_CHARACTER +%token T_BAD_CHARACTER +%token T_ENCAPSED_AND_WHITESPACE +%token T_CONSTANT_ENCAPSED_STRING +%token T_ECHO +%token T_DO +%token T_WHILE +%token T_ENDWHILE +%token T_FOR +%token T_ENDFOR +%token T_FOREACH +%token T_ENDFOREACH +%token T_DECLARE +%token T_ENDDECLARE +%token T_AS +%token T_SWITCH +%token T_ENDSWITCH +%token T_CASE +%token T_DEFAULT +%token T_BREAK +%token T_CONTINUE +%token T_GOTO +%token T_FUNCTION +%token T_FN +%token T_CONST +%token T_RETURN +%token T_TRY +%token T_CATCH +%token T_FINALLY +%token T_THROW +%token T_USE +%token T_INSTEADOF +%token T_GLOBAL +%token T_VAR +%token T_UNSET +%token T_ISSET +%token T_EMPTY +%token T_HALT_COMPILER +%token T_CLASS +%token T_TRAIT +%token T_INTERFACE +%token T_EXTENDS +%token T_IMPLEMENTS +%token T_OBJECT_OPERATOR +%token T_DOUBLE_ARROW +%token T_LIST +%token T_ARRAY +%token T_CALLABLE +%token T_CLASS_C +%token T_TRAIT_C +%token T_METHOD_C +%token T_FUNC_C +%token T_LINE +%token T_FILE +%token T_COMMENT +%token T_DOC_COMMENT +%token T_OPEN_TAG +%token T_OPEN_TAG_WITH_ECHO +%token T_CLOSE_TAG +%token T_WHITESPACE +%token T_START_HEREDOC +%token T_END_HEREDOC +%token T_DOLLAR_OPEN_CURLY_BRACES +%token T_CURLY_OPEN +%token T_PAAMAYIM_NEKUDOTAYIM +%token T_NAMESPACE +%token T_NS_C +%token T_DIR +%token T_NS_SEPARATOR +%token T_ELLIPSIS +%token T_EVAL +%token T_REQUIRE +%token T_REQUIRE_ONCE +%token T_LOGICAL_OR +%token T_LOGICAL_XOR +%token T_LOGICAL_AND +%token T_INSTANCEOF +%token T_NEW +%token T_CLONE +%token T_ELSEIF +%token T_ELSE +%token T_ENDIF +%token T_PRINT +%token T_YIELD +%token T_STATIC +%token T_ABSTRACT +%token T_FINAL +%token T_PRIVATE +%token T_PROTECTED +%token T_PUBLIC +%token T_INC +%token T_DEC +%token T_YIELD_FROM +%token T_INT_CAST +%token T_DOUBLE_CAST +%token T_STRING_CAST +%token T_ARRAY_CAST +%token T_OBJECT_CAST +%token T_BOOL_CAST +%token T_UNSET_CAST +%token T_COALESCE +%token T_SPACESHIP +%token T_NOELSE +%token T_PLUS_EQUAL +%token T_MINUS_EQUAL +%token T_MUL_EQUAL +%token T_POW_EQUAL +%token T_DIV_EQUAL +%token T_CONCAT_EQUAL +%token T_MOD_EQUAL +%token T_AND_EQUAL +%token T_OR_EQUAL +%token T_XOR_EQUAL +%token T_SL_EQUAL +%token T_SR_EQUAL +%token T_COALESCE_EQUAL +%token T_BOOLEAN_OR +%token T_BOOLEAN_AND +%token T_POW +%token T_SL +%token T_SR +%token T_IS_IDENTICAL +%token T_IS_NOT_IDENTICAL +%token T_IS_EQUAL +%token T_IS_NOT_EQUAL +%token T_IS_SMALLER_OR_EQUAL +%token T_IS_GREATER_OR_EQUAL +%token '"' +%token '`' +%token '{' +%token '}' +%token ';' +%token ':' +%token '(' +%token ')' +%token '[' +%token ']' +%token '?' +%token '&' +%token '-' +%token '+' +%token '!' +%token '~' +%token '@' +%token '$' +%token ',' +%token '|' +%token '=' +%token '^' +%token '*' +%token '/' +%token '%' +%token '<' +%token '>' +%token '.' + +%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE +%left ',' +%left T_LOGICAL_OR +%left T_LOGICAL_XOR +%left T_LOGICAL_AND +%right T_PRINT +%right T_YIELD +%right T_DOUBLE_ARROW +%right T_YIELD_FROM +%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL +%left '?' ':' +%right T_COALESCE +%left T_BOOLEAN_OR +%left T_BOOLEAN_AND +%left '|' +%left '^' +%left '&' +%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP +%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL +%left T_SL T_SR +%left '+' '-' '.' +%left '*' '/' '%' +%right '!' +%nonassoc T_INSTANCEOF +%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' +%right T_POW +%right '[' +%nonassoc T_NEW T_CLONE +%left T_NOELSE +%left T_ELSEIF +%left T_ELSE +%left T_ENDIF +%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC + +%type is_reference is_variadic returns_ref + +%type reserved_non_modifiers +%type semi_reserved +%type identifier +%type possible_comma +%type case_separator + +%type top_statement name statement function_declaration_statement +%type class_declaration_statement trait_declaration_statement +%type interface_declaration_statement +%type group_use_declaration inline_use_declaration +%type mixed_group_use_declaration use_declaration unprefixed_use_declaration +%type const_decl inner_statement +%type expr optional_expr +%type declare_statement finally_statement unset_variable variable +%type parameter optional_type argument expr_without_variable global_var +%type static_var class_statement trait_adaptation trait_precedence trait_alias +%type absolute_trait_method_reference trait_method_reference property echo_expr +%type new_expr anonymous_class class_name class_name_reference simple_variable +%type internal_functions_in_yacc +%type exit_expr scalar lexical_var function_call member_name property_name +%type variable_class_name dereferencable_scalar constant dereferencable +%type callable_expr callable_variable static_member new_variable +%type encaps_var encaps_var_offset +%type if_stmt +%type alt_if_stmt +%type if_stmt_without_else +%type class_const_decl +%type alt_if_stmt_without_else +%type array_pair possible_array_pair +%type isset_variable type return_type type_expr +%type class_modifier +%type argument_list ctor_arguments +%type trait_adaptations +%type switch_case_list +%type method_body +%type foreach_statement for_statement while_statement +%type inline_function +%type extends_from +%type implements_list +%type interface_extends_list +%type lexical_vars + +%type member_modifier +%type use_type +%type foreach_variable + + +%type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list +%type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list +%type unprefixed_use_declarations inline_use_declarations property_list static_var_list +%type case_list trait_adaptation_list unset_variables +%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list +%type array_pair_list non_empty_argument_list top_statement_list +%type inner_statement_list parameter_list non_empty_parameter_list class_statement_list +%type method_modifiers variable_modifiers +%type non_empty_member_modifiers name_list class_modifiers + +%type backup_doc_comment + +%% + +///////////////////////////////////////////////////////////////////////// + +start: + top_statement_list + { + yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} + + // save position + yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +reserved_non_modifiers: + T_INCLUDE {$$=$1} | T_INCLUDE_ONCE {$$=$1} | T_EVAL {$$=$1} | T_REQUIRE {$$=$1} | T_REQUIRE_ONCE {$$=$1} | T_LOGICAL_OR {$$=$1} | T_LOGICAL_XOR {$$=$1} | T_LOGICAL_AND {$$=$1} + | T_INSTANCEOF {$$=$1} | T_NEW {$$=$1} | T_CLONE {$$=$1} | T_EXIT {$$=$1} | T_IF {$$=$1} | T_ELSEIF {$$=$1} | T_ELSE {$$=$1} | T_ENDIF {$$=$1} | T_ECHO {$$=$1} | T_DO {$$=$1} | T_WHILE {$$=$1} | T_ENDWHILE {$$=$1} + | T_FOR {$$=$1} | T_ENDFOR {$$=$1} | T_FOREACH {$$=$1} | T_ENDFOREACH {$$=$1} | T_DECLARE {$$=$1} | T_ENDDECLARE {$$=$1} | T_AS {$$=$1} | T_TRY {$$=$1} | T_CATCH {$$=$1} | T_FINALLY {$$=$1} + | T_THROW {$$=$1} | T_USE {$$=$1} | T_INSTEADOF {$$=$1} | T_GLOBAL {$$=$1} | T_VAR {$$=$1} | T_UNSET {$$=$1} | T_ISSET {$$=$1} | T_EMPTY {$$=$1} | T_CONTINUE {$$=$1} | T_GOTO {$$=$1} + | T_FUNCTION {$$=$1} | T_CONST {$$=$1} | T_RETURN {$$=$1} | T_PRINT {$$=$1} | T_YIELD {$$=$1} | T_LIST {$$=$1} | T_SWITCH {$$=$1} | T_ENDSWITCH {$$=$1} | T_CASE {$$=$1} | T_DEFAULT {$$=$1} | T_BREAK {$$=$1} + | T_ARRAY {$$=$1} | T_CALLABLE {$$=$1} | T_EXTENDS {$$=$1} | T_IMPLEMENTS {$$=$1} | T_NAMESPACE {$$=$1} | T_TRAIT {$$=$1} | T_INTERFACE {$$=$1} | T_CLASS {$$=$1} + | T_CLASS_C {$$=$1} | T_TRAIT_C {$$=$1} | T_FUNC_C {$$=$1} | T_METHOD_C {$$=$1} | T_LINE {$$=$1} | T_FILE {$$=$1} | T_DIR {$$=$1} | T_NS_C {$$=$1} | T_FN {$$=$1} +; + +semi_reserved: + reserved_non_modifiers + { + $$ = $1 + } + | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} +; + +identifier: + T_STRING + { + $$ = $1 + } + | semi_reserved + { + $$ = $1 + } +; + +top_statement_list: + top_statement_list top_statement + { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) + } + + if $2 != nil { + $$ = append($1, $2) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +namespace_name: + T_STRING + { + namePart := &ast.NameNamePart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{namePart} + + // save position + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | namespace_name T_NS_SEPARATOR T_STRING + { + namePart := &ast.NameNamePart{ast.Node{}, $3.Value} + $$ = append($1, namePart) + + // save position + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +name: + namespace_name + { + $$ = &ast.NameName{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NAMESPACE T_NS_SEPARATOR namespace_name + { + $$ = &ast.NameRelative{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name + { + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +top_statement: + error + { + // error + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | interface_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_HALT_COMPILER '(' ')' ';' + { + $$ = &ast.StmtHaltCompiler{ast.Node{}} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NAMESPACE namespace_name ';' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, nil} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NAMESPACE namespace_name '{' top_statement_list '}' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NAMESPACE '{' top_statement_list '}' + { + $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE mixed_group_use_declaration ';' + { + $$ = $2 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE use_type group_use_declaration ';' + { + $3.(*ast.StmtGroupUse).UseType = $2 + $$ = $3 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE use_declarations ';' + { + $$ = &ast.StmtUseList{ast.Node{}, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE use_type use_declarations ';' + { + $$ = &ast.StmtUseList{ast.Node{}, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONST const_list ';' + { + $$ = &ast.StmtConstList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_type: + T_FUNCTION + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONST + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +group_use_declaration: + namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + if $5 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Tokens) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +mixed_group_use_declaration: + namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + if $5 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' + { + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Use, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +possible_comma: + /* empty */ + { + $$ = nil + } + | ',' + { + $$ = $1 + } +; + +inline_use_declarations: + inline_use_declarations ',' inline_use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | inline_use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unprefixed_use_declarations: + unprefixed_use_declarations ',' unprefixed_use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | unprefixed_use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_declarations: + use_declarations ',' use_declaration + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | use_declaration + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inline_use_declaration: + unprefixed_use_declaration + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | use_type unprefixed_use_declaration + { + $2.(*ast.StmtUse).UseType = $1 + $$ = $2 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unprefixed_use_declaration: + namespace_name + { + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | namespace_name T_AS T_STRING + { + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], name) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +use_declaration: + unprefixed_use_declaration + { + $$ = $1 + + // save coments + yylex.(*Parser).MoveFreeFloating($1.(*ast.StmtUse).Use, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_SEPARATOR unprefixed_use_declaration + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +const_list: + const_list ',' const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | const_decl + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inner_statement_list: + inner_statement_list inner_statement + { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { + prevNode := lastNode($1) + yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) + } + + if $2 != nil { + $$ = append($1, $2) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inner_statement: + error + { + // error + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | interface_declaration_statement + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_HALT_COMPILER '(' ')' ';' + { + $$ = &ast.StmtHaltCompiler{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + +statement: + '{' inner_statement_list '}' + { + $$ = &ast.StmtStmtList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_WHILE '(' expr ')' while_statement + { + switch n := $5.(type) { + case *ast.StmtWhile : + n.Cond = $3 + case *ast.StmtAltWhile : + n.Cond = $3 + } + + $$ = $5 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.While, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DO statement T_WHILE '(' expr ')' ';' + { + $$ = &ast.StmtDo{ast.Node{}, $2, $5} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.While, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement + { + switch n := $9.(type) { + case *ast.StmtFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + case *ast.StmtAltFor : + n.Init = $3 + n.Cond = $5 + n.Loop = $7 + } + + $$ = $9 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_SWITCH '(' expr ')' switch_case_list + { + switch n := $5.(type) { + case *ast.StmtSwitch: + n.Cond = $3 + case *ast.StmtAltSwitch: + n.Cond = $3 + default: + panic("unexpected node type") + } + + $$ = $5 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Switch, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_BREAK optional_expr ';' + { + $$ = &ast.StmtBreak{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONTINUE optional_expr ';' + { + $$ = &ast.StmtContinue{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_RETURN optional_expr ';' + { + $$ = &ast.StmtReturn{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_GLOBAL global_var_list ';' + { + $$ = &ast.StmtGlobal{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STATIC static_var_list ';' + { + $$ = &ast.StmtStatic{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ECHO echo_expr_list ';' + { + $$ = &ast.StmtEcho{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INLINE_HTML + { + $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr ';' + { + $$ = &ast.StmtExpression{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_UNSET '(' unset_variables possible_comma ')' ';' + { + $$ = &ast.StmtUnset{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + if $4 != nil { + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement + { + switch n := $7.(type) { + case *ast.StmtForeach : + n.Expr = $3 + n.Var = $5 + case *ast.StmtAltForeach : + n.Expr = $3 + n.Var = $5 + } + + $$ = $7 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $6.Tokens) + + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement + { + switch n := $9.(type) { + case *ast.StmtForeach : + n.Expr = $3 + n.Key = $5 + n.Var = $7 + case *ast.StmtAltForeach : + n.Expr = $3 + n.Key = $5 + n.Var = $7 + } + + $$ = $9 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DECLARE '(' const_list ')' declare_statement + { + $$ = $5 + $$.(*ast.StmtDeclare).Consts = $3 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ';' + { + $$ = &ast.StmtNop{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_TRY '{' inner_statement_list '}' catch_list finally_statement + { + if $6 == nil { + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) + } else { + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + } + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_THROW expr ';' + { + $$ = &ast.StmtThrow{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_GOTO T_STRING ';' + { + label := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtGoto{ast.Node{}, label} + + // save position + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STRING ':' + { + label := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtLabel{ast.Node{}, label} + + // save position + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + +catch_list: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($5.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + catch := &ast.StmtCatch{ast.Node{}, $4, variable, $8} + $$ = append($1, catch) + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) + catch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9) + + // save comments + yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; +catch_name_list: + name + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | catch_name_list '|' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +finally_statement: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINALLY '{' inner_statement_list '}' + { + $$ = &ast.StmtFinally{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unset_variables: + unset_variable + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | unset_variables ',' unset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +unset_variable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +function_declaration_statement: + T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $6, $8, $10} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + } else { + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Tokens) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) + } + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +is_reference: + /* empty */ + { + $$ = nil + } + | '&' + { + $$ = $1 + } +; + +is_variadic: + /* empty */ + { + $$ = nil + } + | T_ELLIPSIS + { + $$ = $1 + } +; + +class_declaration_statement: + class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtClass{ast.Node{}, name, $1, nil, $4, $5, $8} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtClass{ast.Node{}, name, nil, nil, $3, $4, $7} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_modifiers: + class_modifier + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_modifiers class_modifier + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_modifier: + T_ABSTRACT + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINAL + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_declaration_statement: + T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtTrait{ast.Node{}, name, $5} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +interface_declaration_statement: + T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtInterface{ast.Node{}, name, $3, $6} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +extends_from: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EXTENDS name + { + $$ = &ast.StmtClassExtends{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +interface_extends_list: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EXTENDS name_list + { + $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +implements_list: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_IMPLEMENTS name_list + { + $$ = &ast.StmtClassImplements{ast.Node{}, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +foreach_variable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' variable + { + $$ = &ast.ExprReference{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LIST '(' array_pair_list ')' + { + $$ = &ast.ExprList{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '[' array_pair_list ']' + { + $$ = &ast.ExprShortList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save commentsc + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +for_statement: + statement + { + $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDFOR ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +foreach_statement: + statement + { + $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDFOREACH ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +declare_statement: + statement + { + $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDDECLARE ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +switch_case_list: + '{' case_list '}' + { + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' ';' case_list '}' + { + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' case_list T_ENDSWITCH ';' + { + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' ';' case_list T_ENDSWITCH ';' + { + + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} + + // save position + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +case_list: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | case_list T_CASE expr case_separator inner_statement_list + { + _case := &ast.StmtCase{ast.Node{}, $3, $5} + $$ = append($1, _case) + + // save position + _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) + + // save comments + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, append($4.Tokens)) + yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | case_list T_DEFAULT case_separator inner_statement_list + { + _default := &ast.StmtDefault{ast.Node{}, $4} + $$ = append($1, _default) + + // save position + _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + + // save comments + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +case_separator: + ':' + { + $$ = $1 + } + | ';' + { + $$ = $1 + } +; + +while_statement: + statement + { + $$ = &ast.StmtWhile{ast.Node{}, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' inner_statement_list T_ENDWHILE ';' + { + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} + + // save position + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +if_stmt_without_else: + T_IF '(' expr ')' statement + { + $$ = &ast.StmtIf{ast.Node{}, $3, $5, nil, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt_without_else T_ELSEIF '(' expr ')' statement + { + _elseIf := &ast.StmtElseIf{ast.Node{}, $4, $6} + $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, _elseIf) + + $$ = $1 + + // save position + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +if_stmt: + if_stmt_without_else %prec T_NOELSE + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | if_stmt_without_else T_ELSE statement + { + _else := &ast.StmtElse{ast.Node{}, $3} + $1.(*ast.StmtIf).Else = _else + + $$ = $1 + + // save position + _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +alt_if_stmt_without_else: + T_IF '(' expr ')' ':' inner_statement_list + { + stmts := &ast.StmtStmtList{ast.Node{}, $6} + $$ = &ast.StmtAltIf{ast.Node{}, $3, stmts, nil, nil} + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list + { + stmts := &ast.StmtStmtList{ast.Node{}, $7} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, $4, stmts} + $1.(*ast.StmtAltIf).ElseIf = append($1.(*ast.StmtAltIf).ElseIf, _elseIf) + + $$ = $1 + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($7) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7) + + // save comments + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $6.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +alt_if_stmt: + alt_if_stmt_without_else T_ENDIF ';' + { + $$ = $1 + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' + { + stmts := &ast.StmtStmtList{ast.Node{}, $4} + _else := &ast.StmtAltElse{ast.Node{}, stmts} + $1.(*ast.StmtAltIf).Else = _else + + $$ = $1 + + // save position + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) + _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_else, token.Else, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +parameter_list: + non_empty_parameter_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_parameter_list: + parameter + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_parameter_list ',' parameter + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +parameter: + optional_type is_reference is_variadic T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + } else if $2 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) + } else if $3 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + } + + // save comments + if $1 != nil { + yylex.(*Parser).MoveFreeFloating($1, $$) + } + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + } + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | optional_type is_reference is_variadic T_VARIABLE '=' expr + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + } else if $2 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + } else if $3 != nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) + } + + // save comments + if $1 != nil { + yylex.(*Parser).MoveFreeFloating($1, $$) + } + if $2 != nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + } + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + + // normalize + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + } + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + } + if $1 == nil { + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +optional_type: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | type_expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +type_expr: + type + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '?' type + { + $$ = &ast.Nullable{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +type: + T_ARRAY + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CALLABLE + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +return_type: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | ':' type_expr + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Colon, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +argument_list: + '(' ')' + { + $$ = &ast.ArgumentList{ast.Node{}, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' non_empty_argument_list possible_comma ')' + { + $$ = &ast.ArgumentList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $3 != nil { + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, append($3.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.Tokens...)...)) + } else { + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $4.Tokens) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_argument_list: + argument + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_argument_list ',' argument + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +argument: + expr + { + $$ = &ast.Argument{ast.Node{}, false, false, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ELLIPSIS expr + { + $$ = &ast.Argument{ast.Node{}, true, false, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +global_var_list: + global_var_list ',' global_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | global_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +global_var: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_var_list: + static_var_list ',' static_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | static_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_var: + T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '=' expr + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_statement_list: + class_statement_list class_statement + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_statement: + variable_modifiers optional_type property_list ';' + { + $$ = &ast.StmtPropertyList{ast.Node{}, $1, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | method_modifiers T_CONST class_const_list ';' + { + $$ = &ast.StmtClassConstList{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4) + + // save comments + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE name_list trait_adaptations + { + $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body + { + name := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $7, $9, $10} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + if $1 == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10) + } + + // save comments + if len($1) > 0 { + yylex.(*Parser).MoveFreeFloating($1[0], $$) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + } + if $3 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) + if $9 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +name_list: + name + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name_list ',' name + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptations: + ';' + { + $$ = &ast.StmtNop{ast.Node{}, } + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' '}' + { + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, nil} + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' trait_adaptation_list '}' + { + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} + + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptation_list: + trait_adaptation + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_adaptation_list trait_adaptation + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_adaptation: + trait_precedence ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_alias ';' + { + $$ = $1; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_precedence: + absolute_trait_method_reference T_INSTEADOF name_list + { + $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_alias: + trait_method_reference T_AS T_STRING + { + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} + + // save position + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS reserved_non_modifiers + { + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} + + // save position + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS member_modifier identifier + { + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} + + // save position + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | trait_method_reference T_AS member_modifier + { + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +trait_method_reference: + identifier + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | absolute_trait_method_reference + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +absolute_trait_method_reference: + name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} + + // save position + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +method_body: + ';' /* abstract method */ + { + $$ = &ast.StmtNop{ast.Node{}, } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' inner_statement_list '}' + { + $$ = &ast.StmtStmtList{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable_modifiers: + non_empty_member_modifiers + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VAR + { + modifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = []ast.Vertex{modifier} + + // save position + modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +method_modifiers: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_member_modifiers + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_member_modifiers: + member_modifier + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_member_modifiers member_modifier + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +member_modifier: + T_PUBLIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PROTECTED + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PRIVATE + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STATIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ABSTRACT + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FINAL + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property_list: + property_list ',' property + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | property + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property: + T_VARIABLE backup_doc_comment + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtProperty{ast.Node{}, variable, nil} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '=' expr backup_doc_comment + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtProperty{ast.Node{}, variable, $3} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_const_list: + class_const_list ',' class_const_decl + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_const_decl + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_const_decl: + identifier '=' expr backup_doc_comment + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtConstant{ast.Node{}, name, $3} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +const_decl: + T_STRING '=' expr backup_doc_comment + { + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtConstant{ast.Node{}, name, $3} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +echo_expr_list: + echo_expr_list ',' echo_expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | echo_expr + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +echo_expr: + expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +for_exprs: + /* empty */ + { + $$ = nil; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | non_empty_for_exprs + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_for_exprs: + non_empty_for_exprs ',' expr + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +anonymous_class: + T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' + { + if $2 != nil { + $$ = &ast.StmtClass{ast.Node{}, nil, nil, $2.(*ast.ArgumentList), $3, $4, $7} + } else { + $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, $3, $4, $7} + } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +new_expr: + T_NEW class_name_reference ctor_arguments + { + if $3 != nil { + $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + } else { + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + } + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NEW anonymous_class + { + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +expr_without_variable: + T_LIST '(' array_pair_list ')' '=' expr + { + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '[' array_pair_list ']' '=' expr + { + shortList := &ast.ExprShortList{ast.Node{}, $2} + $$ = &ast.ExprAssign{ast.Node{}, shortList, $5} + + // save position + shortList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable '=' expr + { + $$ = &ast.ExprAssign{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable '=' '&' expr + { + $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLONE expr + { + $$ = &ast.ExprClone{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_PLUS_EQUAL expr + { + $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MINUS_EQUAL expr + { + $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MUL_EQUAL expr + { + $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_POW_EQUAL expr + { + $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_DIV_EQUAL expr + { + $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_CONCAT_EQUAL expr + { + $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_MOD_EQUAL expr + { + $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_AND_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_OR_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_XOR_EQUAL expr + { + $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_SL_EQUAL expr + { + $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_SR_EQUAL expr + { + $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_COALESCE_EQUAL expr + { + $$ = &ast.ExprAssignCoalesce{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_INC + { + $$ = &ast.ExprPostInc{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INC variable + { + $$ = &ast.ExprPreInc{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable T_DEC + { + $$ = &ast.ExprPostDec{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DEC variable + { + $$ = &ast.ExprPreDec{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_BOOLEAN_OR expr + { + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_BOOLEAN_AND expr + { + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_OR expr + { + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_AND expr + { + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_LOGICAL_XOR expr + { + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '|' expr + { + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '&' expr + { + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '^' expr + { + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '.' expr + { + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '+' expr + { + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '-' expr + { + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '*' expr + { + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_POW expr + { + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '/' expr + { + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '%' expr + { + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SL expr + { + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SR expr + { + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '+' expr %prec T_INC + { + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '-' expr %prec T_INC + { + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '!' expr + { + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '~' expr + { + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_IDENTICAL expr + { + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_NOT_IDENTICAL expr + { + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_EQUAL expr + { + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_NOT_EQUAL expr + { + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '<' expr + { + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_SMALLER_OR_EQUAL expr + { + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '>' expr + { + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_IS_GREATER_OR_EQUAL expr + { + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_SPACESHIP expr + { + $$ = &ast.ExprBinarySpaceship{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_INSTANCEOF class_name_reference + { + $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '?' expr ':' expr + { + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr '?' ':' expr + { + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_COALESCE expr + { + $$ = &ast.ExprBinaryCoalesce{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | internal_functions_in_yacc + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INT_CAST expr + { + $$ = &ast.ExprCastInt{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DOUBLE_CAST expr + { + $$ = &ast.ExprCastDouble{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STRING_CAST expr + { + $$ = &ast.ExprCastString{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ARRAY_CAST expr + { + $$ = &ast.ExprCastArray{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_OBJECT_CAST expr + { + $$ = &ast.ExprCastObject{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_BOOL_CAST expr + { + $$ = &ast.ExprCastBool{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_UNSET_CAST expr + { + $$ = &ast.ExprCastUnset{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EXIT exit_expr + { + var e *ast.ExprExit; + if $2 != nil { + e = $2.(*ast.ExprExit) + } else { + e = &ast.ExprExit{ast.Node{}, false, nil} + } + + $$ = e + + if (bytes.EqualFold($1.Value, []byte("die"))) { + e.Die = true + } + + // save position + if $2 == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + } else { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + } + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '@' expr + { + $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '`' backticks_expr '`' + { + $$ = &ast.ExprShellExec{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_PRINT expr + { + $$ = &ast.ExprPrint{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD + { + $$ = &ast.ExprYield{ast.Node{}, nil, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD expr + { + $$ = &ast.ExprYield{ast.Node{}, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD expr T_DOUBLE_ARROW expr + { + $$ = &ast.ExprYield{ast.Node{}, $2, $4} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_YIELD_FROM expr + { + $$ = &ast.ExprYieldFrom{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | inline_function + { + $$ = $1; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_STATIC inline_function + { + $$ = $2; + + switch n := $$.(type) { + case *ast.ExprClosure : + n.Static = true; + case *ast.ExprArrowFunction : + n.Static = true; + }; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens); + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +inline_function: + T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' + { + $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $5, $7, $8, $10} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + } + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + if $8 != nil { + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) + } + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + + // normalize + if $8 == nil { + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + } + if $7 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr + { + $$ = &ast.ExprArrowFunction{ast.Node{}, $2 != nil, false, $4, $6, $9} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if $2 == nil { + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + }; + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) + }; + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) + + // normalize + if $6 == nil { + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + }; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +backup_doc_comment: + /* empty */ + { + $$ = yylex.(*Parser).Lexer.GetPhpDocComment() + yylex.(*Parser).Lexer.SetPhpDocComment("") + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +returns_ref: + /* empty */ + { + $$ = nil + } + | '&' + { + $$ = $1 + } +; + +lexical_vars: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_USE '(' lexical_var_list ')' + { + $$ = &ast.ExprClosureUse{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +lexical_var_list: + lexical_var_list ',' lexical_var + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | lexical_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +lexical_var: + T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprReference{ast.Node{}, variable} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +function_call: + name argument_list + { + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list + { + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list + { + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | callable_expr argument_list + { + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_name: + T_STATIC + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +class_name_reference: + class_name + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +exit_expr: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' optional_expr ')' + { + $$ = &ast.ExprExit{ast.Node{}, false, $2}; + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +backticks_expr: + /* empty */ + { + $$ = []ast.Vertex{} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ENCAPSED_AND_WHITESPACE + { + part := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{part} + + // save position + part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +ctor_arguments: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | argument_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +dereferencable_scalar: + T_ARRAY '(' array_pair_list ')' + { + $$ = &ast.ExprArray{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '[' array_pair_list ']' + { + $$ = &ast.ExprShortArray{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CONSTANT_ENCAPSED_STRING + { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +scalar: + T_LNUMBER + { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DNUMBER + { + $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LINE + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FILE + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DIR + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_TRAIT_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_METHOD_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_FUNC_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NS_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CLASS_C + { + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC T_END_HEREDOC + { + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '"' encaps_list '"' + { + $$ = &ast.ScalarEncapsed{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_START_HEREDOC encaps_list T_END_HEREDOC + { + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable_scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | constant + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +constant: + name + { + $$ = &ast.ExprConstFetch{ast.Node{}, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + + // save position + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier + { + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + + // save position + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +expr: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr_without_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +optional_expr: + /* empty */ + { + $$ = nil + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable_class_name: + dereferencable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +dereferencable: + variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable_scalar + { + $$ = $1; + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +callable_expr: + callable_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '(' expr ')' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable_scalar + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +callable_variable: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | constant '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable '{' expr '}' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable T_OBJECT_OPERATOR property_name argument_list + { + $$ = &ast.ExprMethodCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | function_call + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +variable: + callable_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | static_member + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | dereferencable T_OBJECT_OPERATOR property_name + { + $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +simple_variable: + T_VARIABLE + { + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '$' '{' expr '}' + { + $$ = &ast.ExprVariable{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '$' simple_variable + { + $$ = &ast.ExprVariable{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +static_member: + class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +new_variable: + simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable '[' optional_expr ']' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable '{' expr '}' + { + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable T_OBJECT_OPERATOR property_name + { + $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable + { + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +member_name: + identifier + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +property_name: + T_STRING + { + $$ = &ast.Identifier{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '{' expr '}' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | simple_variable + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +array_pair_list: + non_empty_array_pair_list + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +possible_array_pair: + /* empty */ + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | array_pair + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +non_empty_array_pair_list: + non_empty_array_pair_list ',' possible_array_pair + { + if len($1) == 0 { + $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} + } + + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | possible_array_pair + { + if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { + $$ = []ast.Vertex{} + } else { + $$ = []ast.Vertex{$1} + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +array_pair: + expr T_DOUBLE_ARROW expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_DOUBLE_ARROW '&' variable + { + reference := &ast.ExprReference{ast.Node{}, $4} + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, reference} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '&' variable + { + reference := &ast.ExprReference{ast.Node{}, $2} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ELLIPSIS expr + { + $$ = &ast.ExprArrayItem{ast.Node{}, true, nil, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' + { + // TODO: Cannot use list() as standalone expression + listNode := &ast.ExprList{ast.Node{}, $5} + $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, listNode} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + + // save comments + yylex.(*Parser).MoveFreeFloating($1, $$) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_LIST '(' array_pair_list ')' + { + // TODO: Cannot use list() as standalone expression + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} + + // save position + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +encaps_list: + encaps_list encaps_var + { + $$ = append($1, $2) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_list T_ENCAPSED_AND_WHITESPACE + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = append($1, encapsed) + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + + // save comments + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | encaps_var + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_ENCAPSED_AND_WHITESPACE encaps_var + { + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{encapsed, $2} + + // save position + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +encaps_var: + T_VARIABLE + { + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE '[' encaps_var_offset ']' + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE T_OBJECT_OPERATOR T_STRING + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + fetch := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DOLLAR_OPEN_CURLY_BRACES expr '}' + { + variable := &ast.ExprVariable{ast.Node{}, $2} + + $$ = variable + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' + { + name := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, name} + + $$ = variable + + // save position + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' + { + identifier := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Tokens, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($6.Tokens, yylex.(*Parser).GetFreeFloatingToken($6)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_CURLY_OPEN variable '}' + { + $$ = $2; + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +encaps_var_offset: + T_STRING + { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_NUM_STRING + { + // TODO: add option to handle 64 bit integer + if _, err := strconv.Atoi(string($1.Value)); err == nil { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + } else { + $$ = &ast.ScalarString{ast.Node{}, $1.Value} + } + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | '-' T_NUM_STRING + { + var lnumber *ast.ScalarLnumber + // TODO: add option to handle 64 bit integer + _, err := strconv.Atoi(string($2.Value)); + isInt := err == nil + + if isInt { + lnumber = &ast.ScalarLnumber{ast.Node{}, $2.Value} + $$ = &ast.ExprUnaryMinus{ast.Node{}, lnumber} + } else { + $2.Value = append([]byte("-"), $2.Value...) + $$ = &ast.ScalarString{ast.Node{}, $2.Value} + } + + // save position + if isInt { + lnumber.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + } + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_VARIABLE + { + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} + + // save position + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +internal_functions_in_yacc: + T_ISSET '(' isset_variables possible_comma ')' + { + $$ = &ast.ExprIsset{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + if $4 == nil { + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + } else { + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + } + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EMPTY '(' expr ')' + { + $$ = &ast.ExprEmpty{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INCLUDE expr + { + $$ = &ast.ExprInclude{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_INCLUDE_ONCE expr + { + $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_EVAL '(' expr ')' + { + $$ = &ast.ExprEval{ast.Node{}, $3} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_REQUIRE expr + { + $$ = &ast.ExprRequire{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | T_REQUIRE_ONCE expr + { + $$ = &ast.ExprRequireOnce{ast.Node{}, $2} + + // save position + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + + // save comments + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +isset_variables: + isset_variable + { + $$ = []ast.Vertex{$1} + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } + | isset_variables ',' isset_variable + { + $$ = append($1, $3) + + // save comments + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +isset_variable: + expr + { + $$ = $1 + + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + } +; + +///////////////////////////////////////////////////////////////////////// + +%% diff --git a/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go similarity index 99% rename from php7/php7_bench_test.go rename to internal/php7/php7_bench_test.go index c7acc29..a5a9aee 100644 --- a/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -3,7 +3,7 @@ package php7_test import ( "testing" - "github.com/z7zmey/php-parser/php7" + "github.com/z7zmey/php-parser/internal/php7" ) func BenchmarkPhp7(b *testing.B) { diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go new file mode 100644 index 0000000..5e0268a --- /dev/null +++ b/internal/php7/php7_test.go @@ -0,0 +1,20023 @@ +package php7_test + +import ( + "testing" + + "gotest.tools/assert" + + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" +) + +func TestPhp7(t *testing.T) { + src := `bar($a, ...$b); + foo::bar($a, ...$b); + $foo::bar($a, ...$b); + new foo($a, ...$b); + /** anonymous class */ + new class ($a, ...$b) {}; + new class {}; + new $foo; + new $foo[1]; + new $foo{$bar}; + new $foo->bar; + new $foo::$bar; + new static::$bar; + + function foo(?bar $bar=null, baz &...$baz) {} + class foo {public function foo(?bar $bar=null, baz &...$baz) {}} + function(?bar $bar=null, baz &...$baz) {}; + static function(?bar $bar=null, baz &...$baz) {}; + + 1234567890123456789; + 12345678901234567890; + 0.; + 0b0111111111111111111111111111111111111111111111111111111111111111; + 0b1111111111111111111111111111111111111111111111111111111111111111; + 0x007111111111111111; + 0x8111111111111111; + __CLASS__; + __DIR__; + __FILE__; + __FUNCTION__; + __LINE__; + __NAMESPACE__; + __METHOD__; + __TRAIT__; + + "test $var"; + "test $var[1]"; + "test $var[-1]"; + "test $var[1234567890123456789012345678901234567890]"; + "test $var[-1234567890123456789012345678901234567890]"; + "test $var[bar]"; + "test $var[$bar]"; + "$foo $bar"; + "test $foo->bar()"; + "test ${foo}"; + "test ${foo[0]}"; + "test ${$foo}"; + "test {$foo->bar()}"; + + if ($a) : + endif; + if ($a) : + elseif ($b): + endif; + if ($a) : + else: + endif; + if ($a) : + elseif ($b): + elseif ($c): + else: + endif; + + while (1) { break; } + while (1) { break 2; } + while (1) : break(3); endwhile; + class foo{ public const FOO = 1, BAR = 2; } + class foo{ const FOO = 1, BAR = 2; } + class foo{ function bar() {} } + class foo{ public static function &bar() {} } + class foo{ public static function &bar(): void {} } + abstract class foo{ } + final class foo extends bar { } + final class foo implements bar { } + final class foo implements bar, baz { } + new class() extends foo implements bar, baz { }; + + const FOO = 1, BAR = 2; + while (1) { continue; } + while (1) { continue 2; } + while (1) { continue(3); } + declare(ticks=1); + declare(ticks=1) {} + declare(ticks=1): enddeclare; + do {} while(1); + echo $a, 1; + echo($a); + for($i = 0; $i < 10; $i++, $i++) {} + for(; $i < 10; $i++, $i++) : endfor; + foreach ($a as $v) {} + foreach ($a as $v) : endforeach; + foreach ($a as $k => $v) {} + foreach ($a as $k => &$v) {} + foreach ($a as $k => list($v)) {} + foreach ($a as $k => [$v]) {} + function foo() {} + function foo() {return;} + function &foo() {return 1;} + function &foo(): void {} + global $a, $b; + a: + goto a; + if ($a) {} + if ($a) {} elseif ($b) {} + if ($a) {} else {} + if ($a) {} elseif ($b) {} elseif ($c) {} else {} + if ($a) {} elseif ($b) {} else if ($c) {} else {} + ?>
1, &$b,); + ~$a; + !$a; + + Foo::Bar; + $foo::Bar; + clone($a); + clone $a; + function(){}; + function($a, $b) use ($c, &$d) {}; + function(): void {}; + foo; + namespace\foo; + \foo; + + empty($a); + @$a; + eval($a); + exit; + exit($a); + die; + die($a); + foo(); + namespace\foo(); + \foo(); + $foo(); + + $a--; + $a++; + --$a; + ++$a; + + include $a; + include_once $a; + require $a; + require_once $a; + + $a instanceof Foo; + $a instanceof namespace\Foo; + $a instanceof \Foo; + + isset($a, $b); + list($a) = $b; + list($a[]) = $b; + list(list($a)) = $b; + + $a->foo(); + new Foo(); + new namespace\Foo(); + new \Foo(); + new class ($a, ...$b) {}; + print($a); + $a->foo; + ` + "`cmd $a`;" + ` + ` + "`cmd`;" + ` + ` + "``;" + ` + []; + [1]; + [1=>1, &$b,]; + + [$a] = $b; + [$a[]] = $b; + [list($a)] = $b; + Foo::bar(); + namespace\Foo::bar(); + \Foo::bar(); + Foo::$bar; + $foo::$bar; + namespace\Foo::$bar; + \Foo::$bar; + $a ? $b : $c; + $a ? : $c; + $a ? $b ? $c : $d : $e; + $a ? $b : $c ? $d : $e; + -$a; + +$a; + $$a; + yield; + yield $a; + yield $a => $b; + yield from $a; + + (array)$a; + (boolean)$a; + (bool)$a; + (double)$a; + (float)$a; + (integer)$a; + (int)$a; + (object)$a; + (string)$a; + (unset)$a; + + $a & $b; + $a | $b; + $a ^ $b; + $a && $b; + $a || $b; + $a ?? $b; + $a . $b; + $a / $b; + $a == $b; + $a >= $b; + $a > $b; + $a === $b; + $a and $b; + $a or $b; + $a xor $b; + $a - $b; + $a % $b; + $a * $b; + $a != $b; + $a !== $b; + $a + $b; + $a ** $b; + $a << $b; + $a >> $b; + $a <= $b; + $a < $b; + $a <=> $b; + + $a =& $b; + $a = $b; + $a &= $b; + $a |= $b; + $a ^= $b; + $a .= $b; + $a /= $b; + $a -= $b; + $a %= $b; + $a *= $b; + $a += $b; + $a **= $b; + $a <<= $b; + $a >>= $b; + + class foo {public function class() {} } + \foo\bar(); + + function foo(&$a, ...$b) { + + function bar() {} + class Baz {} + trait Quux{} + interface Quuux {} + } + + function foo(&$a = 1, ...$b = 1, $c = 1) {} + function foo(array $a, callable $b) {} + abstract final class foo { abstract protected static function bar(); final private function baz() {} } + + (new Foo)->bar; + (new Foo)(); + [$foo][0](); + foo[1](); + "foo"(); + [1]{$foo}(); + ${foo()}; + + Foo::$bar(); + Foo::{$bar[0]}(); + + $foo->$bar; + $foo->{$bar[0]}; + + [1=>&$a, 2=>list($b)]; + + __halt_compiler(); + + parsing process must be terminated + ` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 348, + StartPos: 5, + EndPos: 6319, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 20, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 19, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 8, + EndPos: 19, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 13, + EndPos: 18, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 39, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 38, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 27, + }, + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 27, + EndPos: 38, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 32, + EndPos: 37, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 63, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 62, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 46, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 42, + EndPos: 46, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 48, + EndPos: 51, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 51, + EndPos: 62, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 61, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 86, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 85, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + }, + Value: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 85, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 84, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 110, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 109, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 93, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 93, + }, + }, + Value: []byte("foo"), + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 95, + EndPos: 98, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 98, + EndPos: 109, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 108, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 132, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 131, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 131, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 130, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 185, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 184, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 184, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 170, + EndPos: 181, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 175, + EndPos: 180, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 188, + EndPos: 201, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 188, + EndPos: 200, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 192, + EndPos: 200, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 204, + EndPos: 213, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 204, + EndPos: 212, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 208, + EndPos: 212, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 208, + EndPos: 212, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 216, + EndPos: 228, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 216, + EndPos: 227, + }, + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 227, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 224, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 220, + EndPos: 224, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 225, + EndPos: 226, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 231, + EndPos: 246, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 231, + EndPos: 245, + }, + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 245, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 239, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 235, + EndPos: 239, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 240, + EndPos: 244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 13, + EndLine: 13, + StartPos: 240, + EndPos: 244, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 249, + EndPos: 263, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 249, + EndPos: 262, + }, + }, + Class: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 262, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 257, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 253, + EndPos: 257, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 259, + EndPos: 262, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 266, + EndPos: 281, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 266, + EndPos: 280, + }, + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 280, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 274, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 270, + EndPos: 274, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 276, + EndPos: 280, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 276, + EndPos: 280, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 284, + EndPos: 301, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 284, + EndPos: 300, + }, + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 288, + EndPos: 300, + }, + }, + Class: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 288, + EndPos: 294, + }, + }, + Value: []byte("static"), + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 296, + EndPos: 300, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 296, + EndPos: 300, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 305, + EndPos: 350, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 314, + EndPos: 317, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 318, + EndPos: 332, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 318, + EndPos: 322, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 322, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 319, + EndPos: 322, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 323, + EndPos: 327, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 323, + EndPos: 327, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 328, + EndPos: 332, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 346, + }, + }, + Variadic: true, + ByRef: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 337, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 334, + EndPos: 337, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 342, + EndPos: 346, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 342, + EndPos: 346, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 353, + EndPos: 417, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 359, + EndPos: 362, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 364, + EndPos: 416, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 380, + EndPos: 383, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 364, + EndPos: 370, + }, + }, + Value: []byte("public"), + }, + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 384, + EndPos: 398, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 384, + EndPos: 388, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 388, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 385, + EndPos: 388, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 389, + EndPos: 393, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 389, + EndPos: 393, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 394, + EndPos: 398, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 412, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 403, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 400, + EndPos: 403, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 408, + EndPos: 412, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 408, + EndPos: 412, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 414, + EndPos: 416, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 420, + EndPos: 462, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 420, + EndPos: 461, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 429, + EndPos: 443, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 429, + EndPos: 433, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 433, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 430, + EndPos: 433, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 434, + EndPos: 438, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 434, + EndPos: 438, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 439, + EndPos: 443, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 457, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 448, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 445, + EndPos: 448, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 453, + EndPos: 457, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 453, + EndPos: 457, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 465, + EndPos: 514, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 465, + EndPos: 513, + }, + }, + ReturnsRef: false, + Static: true, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 481, + EndPos: 495, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Nullable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 481, + EndPos: 485, + }, + }, + Expr: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 485, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 482, + EndPos: 485, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 486, + EndPos: 490, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 486, + EndPos: 490, + }, + }, + Value: []byte("bar"), + }, + }, + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 491, + EndPos: 495, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 509, + }, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 500, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 497, + EndPos: 500, + }, + }, + Value: []byte("baz"), + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 505, + EndPos: 509, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 505, + EndPos: 509, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 518, + EndPos: 538, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 518, + EndPos: 537, + }, + }, + Value: []byte("1234567890123456789"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 541, + EndPos: 562, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 541, + EndPos: 561, + }, + }, + Value: []byte("12345678901234567890"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 565, + EndPos: 568, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 565, + EndPos: 567, + }, + }, + Value: []byte("0."), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 571, + EndPos: 638, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 571, + EndPos: 637, + }, + }, + Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 641, + EndPos: 708, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 641, + EndPos: 707, + }, + }, + Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 711, + EndPos: 732, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 711, + EndPos: 731, + }, + }, + Value: []byte("0x007111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 735, + EndPos: 754, + }, + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 29, + EndLine: 29, + StartPos: 735, + EndPos: 753, + }, + }, + Value: []byte("0x8111111111111111"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 757, + EndPos: 767, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 757, + EndPos: 766, + }, + }, + Value: []byte("__CLASS__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 770, + EndPos: 778, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 770, + EndPos: 777, + }, + }, + Value: []byte("__DIR__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 781, + EndPos: 790, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 781, + EndPos: 789, + }, + }, + Value: []byte("__FILE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 793, + EndPos: 806, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 793, + EndPos: 805, + }, + }, + Value: []byte("__FUNCTION__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 818, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 817, + }, + }, + Value: []byte("__LINE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 821, + EndPos: 835, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 821, + EndPos: 834, + }, + }, + Value: []byte("__NAMESPACE__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 838, + EndPos: 849, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 838, + EndPos: 848, + }, + }, + Value: []byte("__METHOD__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 852, + EndPos: 862, + }, + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 852, + EndPos: 861, + }, + }, + Value: []byte("__TRAIT__"), + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 866, + EndPos: 878, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 866, + EndPos: 877, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 867, + EndPos: 872, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 872, + EndPos: 876, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 872, + EndPos: 876, + }, + }, + Value: []byte("var"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 881, + EndPos: 896, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 881, + EndPos: 895, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 882, + EndPos: 887, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 894, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 891, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 887, + EndPos: 891, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 40, + EndLine: 40, + StartPos: 892, + EndPos: 893, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 899, + EndPos: 915, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 899, + EndPos: 914, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 900, + EndPos: 905, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 913, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 909, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 905, + EndPos: 909, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 910, + EndPos: 912, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 910, + EndPos: 912, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 918, + EndPos: 972, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 918, + EndPos: 971, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 919, + EndPos: 924, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 970, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 928, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 924, + EndPos: 928, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 42, + EndLine: 42, + StartPos: 929, + EndPos: 969, + }, + }, + Value: []byte("1234567890123456789012345678901234567890"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 975, + EndPos: 1030, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 975, + EndPos: 1029, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 976, + EndPos: 981, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 1028, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 985, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 981, + EndPos: 985, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 986, + EndPos: 1027, + }, + }, + Value: []byte("-1234567890123456789012345678901234567890"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1033, + EndPos: 1050, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1033, + EndPos: 1049, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1034, + EndPos: 1039, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1048, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1043, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1039, + EndPos: 1043, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 1044, + EndPos: 1047, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1053, + EndPos: 1071, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1053, + EndPos: 1070, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1054, + EndPos: 1059, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1069, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1063, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1059, + EndPos: 1063, + }, + }, + Value: []byte("var"), + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1064, + EndPos: 1068, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 45, + EndLine: 45, + StartPos: 1064, + EndPos: 1068, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1074, + EndPos: 1086, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1074, + EndPos: 1085, + }, + }, + Parts: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1079, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1075, + EndPos: 1079, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1079, + EndPos: 1080, + }, + }, + Value: []byte(" "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1080, + EndPos: 1084, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 1080, + EndPos: 1084, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1089, + EndPos: 1108, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1089, + EndPos: 1107, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1090, + EndPos: 1095, + }, + }, + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1104, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1099, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1095, + EndPos: 1099, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1101, + EndPos: 1104, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: 47, + StartPos: 1104, + EndPos: 1106, + }, + }, + Value: []byte("()"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1111, + EndPos: 1125, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1111, + EndPos: 1124, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1112, + EndPos: 1117, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1117, + EndPos: 1123, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 48, + EndLine: 48, + StartPos: 1119, + EndPos: 1122, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1128, + EndPos: 1145, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1128, + EndPos: 1144, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1129, + EndPos: 1134, + }, + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1134, + EndPos: 1143, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1136, + EndPos: 1139, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1136, + EndPos: 1139, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1140, + EndPos: 1141, + }, + }, + Value: []byte("0"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1148, + EndPos: 1163, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1148, + EndPos: 1162, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1149, + EndPos: 1154, + }, + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1154, + EndPos: 1161, + }, + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1156, + EndPos: 1160, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1156, + EndPos: 1160, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1166, + EndPos: 1187, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1166, + EndPos: 1186, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1167, + EndPos: 1172, + }, + }, + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1184, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1177, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1173, + EndPos: 1177, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1179, + EndPos: 1182, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1182, + EndPos: 1184, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 54, + StartPos: 1191, + EndPos: 1209, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1195, + EndPos: 1197, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 53, + EndLine: 53, + StartPos: 1195, + EndPos: 1197, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 57, + StartPos: 1212, + EndPos: 1245, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1216, + EndPos: 1218, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1216, + EndPos: 1218, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: -1, + StartPos: 1224, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1232, + EndPos: 1234, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1232, + EndPos: 1234, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 60, + StartPos: 1248, + EndPos: 1274, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1252, + EndPos: 1254, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1252, + EndPos: 1254, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 59, + EndLine: -1, + StartPos: 1260, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtAltIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 65, + StartPos: 1277, + EndPos: 1333, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1281, + EndPos: 1283, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1281, + EndPos: 1283, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: -1, + StartPos: 1289, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1297, + EndPos: 1299, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1297, + EndPos: 1299, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: -1, + StartPos: 1304, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1312, + EndPos: 1314, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1312, + EndPos: 1314, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: -1, + StartPos: 1319, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1337, + EndPos: 1357, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1344, + EndPos: 1345, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1347, + EndPos: 1357, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1349, + EndPos: 1355, + }, + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1360, + EndPos: 1382, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1367, + EndPos: 1368, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1370, + EndPos: 1382, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1372, + EndPos: 1380, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1378, + EndPos: 1379, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + &ast.StmtAltWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1385, + EndPos: 1416, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1392, + EndPos: 1393, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1397, + EndPos: 1406, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1397, + EndPos: 1406, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1403, + EndPos: 1404, + }, + }, + Value: []byte("3"), + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1419, + EndPos: 1462, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1425, + EndPos: 1428, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1430, + EndPos: 1460, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1430, + EndPos: 1436, + }, + }, + Value: []byte("public"), + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1443, + EndPos: 1450, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1443, + EndPos: 1446, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1449, + EndPos: 1450, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1452, + EndPos: 1459, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1452, + EndPos: 1455, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1458, + EndPos: 1459, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1465, + EndPos: 1501, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1471, + EndPos: 1474, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1476, + EndPos: 1499, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1482, + EndPos: 1489, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1482, + EndPos: 1485, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1488, + EndPos: 1489, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1491, + EndPos: 1498, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1491, + EndPos: 1494, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1497, + EndPos: 1498, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1504, + EndPos: 1534, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1510, + EndPos: 1513, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1515, + EndPos: 1532, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1524, + EndPos: 1527, + }, + }, + Value: []byte("bar"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1530, + EndPos: 1532, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1537, + EndPos: 1582, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1543, + EndPos: 1546, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1548, + EndPos: 1580, + }, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1572, + EndPos: 1575, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1548, + EndPos: 1554, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1555, + EndPos: 1561, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1578, + EndPos: 1580, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1585, + EndPos: 1636, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1591, + EndPos: 1594, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1596, + EndPos: 1634, + }, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1620, + EndPos: 1623, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1596, + EndPos: 1602, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1603, + EndPos: 1609, + }, + }, + Value: []byte("static"), + }, + }, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1627, + EndPos: 1631, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1627, + EndPos: 1631, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1632, + EndPos: 1634, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1639, + EndPos: 1660, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1654, + EndPos: 1657, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1639, + EndPos: 1647, + }, + }, + Value: []byte("abstract"), + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1663, + EndPos: 1694, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1675, + EndPos: 1678, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1663, + EndPos: 1668, + }, + }, + Value: []byte("final"), + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1679, + EndPos: 1690, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1687, + EndPos: 1690, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1687, + EndPos: 1690, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1697, + EndPos: 1731, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1709, + EndPos: 1712, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1697, + EndPos: 1702, + }, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1713, + EndPos: 1727, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1724, + EndPos: 1727, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1724, + EndPos: 1727, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1734, + EndPos: 1773, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1746, + EndPos: 1749, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1734, + EndPos: 1739, + }, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1750, + EndPos: 1769, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1761, + EndPos: 1764, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1761, + EndPos: 1764, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1766, + EndPos: 1769, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1766, + EndPos: 1769, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1776, + EndPos: 1824, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1776, + EndPos: 1823, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1780, + EndPos: 1823, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1785, + EndPos: 1787, + }, + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1788, + EndPos: 1799, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1796, + EndPos: 1799, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1796, + EndPos: 1799, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1800, + EndPos: 1819, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1811, + EndPos: 1814, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1811, + EndPos: 1814, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1816, + EndPos: 1819, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1816, + EndPos: 1819, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1828, + EndPos: 1851, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1834, + EndPos: 1841, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1834, + EndPos: 1837, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1840, + EndPos: 1841, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1843, + EndPos: 1850, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1843, + EndPos: 1846, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1849, + EndPos: 1850, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1854, + EndPos: 1877, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1861, + EndPos: 1862, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1864, + EndPos: 1877, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1866, + EndPos: 1875, + }, + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1880, + EndPos: 1905, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1887, + EndPos: 1888, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1890, + EndPos: 1905, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1892, + EndPos: 1903, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1901, + EndPos: 1902, + }, + }, + Value: []byte("2"), + }, + }, + }, + }, + }, + &ast.StmtWhile{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1908, + EndPos: 1934, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1915, + EndPos: 1916, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1918, + EndPos: 1934, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1920, + EndPos: 1932, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1929, + EndPos: 1930, + }, + }, + Value: []byte("3"), + }, + }, + }, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1937, + EndPos: 1954, + }, + }, + Alt: false, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1945, + EndPos: 1952, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1945, + EndPos: 1950, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1951, + EndPos: 1952, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 1953, + EndPos: 1954, + }, + }, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1957, + EndPos: 1976, + }, + }, + Alt: false, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1965, + EndPos: 1972, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1965, + EndPos: 1970, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1971, + EndPos: 1972, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 1974, + EndPos: 1976, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1979, + EndPos: 2008, + }, + }, + Alt: true, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1987, + EndPos: 1994, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1987, + EndPos: 1992, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 87, + EndLine: 87, + StartPos: 1993, + EndPos: 1994, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDo{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2011, + EndPos: 2026, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2014, + EndPos: 2016, + }, + }, + Stmts: []ast.Vertex{}, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 88, + EndLine: 88, + StartPos: 2023, + EndPos: 2024, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2029, + EndPos: 2040, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2034, + EndPos: 2036, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2034, + EndPos: 2036, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2038, + EndPos: 2039, + }, + }, + Value: []byte("1"), + }, + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2043, + EndPos: 2052, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2048, + EndPos: 2050, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2048, + EndPos: 2050, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2055, + EndPos: 2090, + }, + }, + Init: []ast.Vertex{ + &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2065, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2061, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2059, + EndPos: 2061, + }, + }, + Value: []byte("i"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2064, + EndPos: 2065, + }, + }, + Value: []byte("0"), + }, + }, + }, + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2074, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2069, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2067, + EndPos: 2069, + }, + }, + Value: []byte("i"), + }, + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2072, + EndPos: 2074, + }, + }, + Value: []byte("10"), + }, + }, + }, + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2080, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2078, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2076, + EndPos: 2078, + }, + }, + Value: []byte("i"), + }, + }, + }, + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2086, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2084, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2082, + EndPos: 2084, + }, + }, + Value: []byte("i"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2088, + EndPos: 2090, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2093, + EndPos: 2129, + }, + }, + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2106, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2101, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2099, + EndPos: 2101, + }, + }, + Value: []byte("i"), + }, + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2104, + EndPos: 2106, + }, + }, + Value: []byte("10"), + }, + }, + }, + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2112, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2110, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2108, + EndPos: 2110, + }, + }, + Value: []byte("i"), + }, + }, + }, + &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2118, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2116, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 92, + EndLine: 92, + StartPos: 2114, + EndPos: 2116, + }, + }, + Value: []byte("i"), + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2132, + EndPos: 2153, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2141, + EndPos: 2143, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2141, + EndPos: 2143, + }, + }, + Value: []byte("a"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2147, + EndPos: 2149, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2147, + EndPos: 2149, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 93, + EndLine: 93, + StartPos: 2151, + EndPos: 2153, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2156, + EndPos: 2188, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2165, + EndPos: 2167, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2165, + EndPos: 2167, + }, + }, + Value: []byte("a"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2171, + EndPos: 2173, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2171, + EndPos: 2173, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2191, + EndPos: 2218, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2200, + EndPos: 2202, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2200, + EndPos: 2202, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2206, + EndPos: 2208, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2206, + EndPos: 2208, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2212, + EndPos: 2214, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2212, + EndPos: 2214, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2216, + EndPos: 2218, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2221, + EndPos: 2249, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2230, + EndPos: 2232, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2230, + EndPos: 2232, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2236, + EndPos: 2238, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2236, + EndPos: 2238, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2242, + EndPos: 2245, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2243, + EndPos: 2245, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 96, + EndLine: 96, + StartPos: 2247, + EndPos: 2249, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2252, + EndPos: 2285, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2261, + EndPos: 2263, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2261, + EndPos: 2263, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2267, + EndPos: 2269, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2267, + EndPos: 2269, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2273, + EndPos: 2281, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2278, + EndPos: 2280, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2283, + EndPos: 2285, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2288, + EndPos: 2317, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2297, + EndPos: 2299, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2297, + EndPos: 2299, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2303, + EndPos: 2305, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2303, + EndPos: 2305, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2309, + EndPos: 2313, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2310, + EndPos: 2312, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2315, + EndPos: 2317, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2320, + EndPos: 2337, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2329, + EndPos: 2332, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2340, + EndPos: 2364, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2349, + EndPos: 2352, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2356, + EndPos: 2363, + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2367, + EndPos: 2394, + }, + }, + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2377, + EndPos: 2380, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2384, + EndPos: 2393, + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2391, + EndPos: 2392, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2397, + EndPos: 2421, + }, + }, + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2407, + EndPos: 2410, + }, + }, + Value: []byte("foo"), + }, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2414, + EndPos: 2418, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2414, + EndPos: 2418, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtGlobal{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2424, + EndPos: 2438, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2431, + EndPos: 2433, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2431, + EndPos: 2433, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2435, + EndPos: 2437, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2435, + EndPos: 2437, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtLabel{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2441, + EndPos: 2443, + }, + }, + LabelName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2441, + EndPos: 2442, + }, + }, + Value: []byte("a"), + }, + }, + &ast.StmtGoto{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2447, + EndPos: 2454, + }, + }, + Label: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2452, + EndPos: 2453, + }, + }, + Value: []byte("a"), + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2457, + EndPos: 2467, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2463, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2461, + EndPos: 2463, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2465, + EndPos: 2467, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2470, + EndPos: 2495, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2474, + EndPos: 2476, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2474, + EndPos: 2476, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2478, + EndPos: 2480, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2481, + EndPos: 2495, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2489, + EndPos: 2491, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2489, + EndPos: 2491, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2493, + EndPos: 2495, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2498, + EndPos: 2516, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2502, + EndPos: 2504, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2502, + EndPos: 2504, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2506, + EndPos: 2508, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2509, + EndPos: 2516, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2514, + EndPos: 2516, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2519, + EndPos: 2567, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2523, + EndPos: 2525, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2523, + EndPos: 2525, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2527, + EndPos: 2529, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2530, + EndPos: 2544, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2538, + EndPos: 2540, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2538, + EndPos: 2540, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2542, + EndPos: 2544, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2545, + EndPos: 2559, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2553, + EndPos: 2555, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2553, + EndPos: 2555, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2557, + EndPos: 2559, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2560, + EndPos: 2567, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2565, + EndPos: 2567, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2570, + EndPos: 2619, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2574, + EndPos: 2576, + }, + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2578, + EndPos: 2580, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2581, + EndPos: 2595, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2589, + EndPos: 2591, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2589, + EndPos: 2591, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2593, + EndPos: 2595, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2596, + EndPos: 2619, + }, + }, + Stmt: &ast.StmtIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2601, + EndPos: 2619, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2605, + EndPos: 2607, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2605, + EndPos: 2607, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2609, + EndPos: 2611, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2612, + EndPos: 2619, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2617, + EndPos: 2619, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + }, + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2622, + EndPos: 2624, + }, + }, + }, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2624, + EndPos: 2637, + }, + }, + Value: []byte("
"), + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2642, + EndPos: 2658, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2652, + EndPos: 2655, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2661, + EndPos: 2689, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2671, + EndPos: 2674, + }, + }, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2675, + EndPos: 2686, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2683, + EndPos: 2686, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2683, + EndPos: 2686, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2692, + EndPos: 2725, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2702, + EndPos: 2705, + }, + }, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2706, + EndPos: 2722, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2714, + EndPos: 2717, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2714, + EndPos: 2717, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2719, + EndPos: 2722, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2719, + EndPos: 2722, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2728, + EndPos: 2742, + }, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2738, + EndPos: 2741, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2738, + EndPos: 2741, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2745, + EndPos: 2761, + }, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2755, + EndPos: 2758, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2755, + EndPos: 2758, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 117, + EndLine: 117, + StartPos: 2764, + EndPos: 2776, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2779, + EndPos: 2798, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2785, + EndPos: 2788, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2790, + EndPos: 2797, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2790, + EndPos: 2793, + }, + }, + Value: []byte("var"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2794, + EndPos: 2796, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2801, + EndPos: 2838, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2807, + EndPos: 2810, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2837, + }, + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2812, + EndPos: 2818, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2819, + EndPos: 2825, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2826, + EndPos: 2828, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.StmtProperty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2836, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2832, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2830, + EndPos: 2832, + }, + }, + Value: []byte("b"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2835, + EndPos: 2836, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + }, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2841, + EndPos: 2859, + }, + }, + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2848, + EndPos: 2850, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2858, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2854, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2852, + EndPos: 2854, + }, + }, + Value: []byte("b"), + }, + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: 120, + StartPos: 2857, + EndPos: 2858, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + &ast.StmtAltSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 122, + EndLine: 126, + StartPos: 2863, + EndPos: 2922, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 122, + EndLine: 122, + StartPos: 2871, + EndPos: 2872, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: -1, + StartPos: 2879, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: -1, + StartPos: 2879, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 123, + EndLine: 123, + StartPos: 2884, + EndPos: 2885, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtDefault{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 124, + EndLine: -1, + StartPos: 2890, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: -1, + StartPos: 2902, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: 125, + StartPos: 2907, + EndPos: 2908, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtAltSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 128, + EndLine: 131, + StartPos: 2926, + EndPos: 2974, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 128, + EndLine: 128, + StartPos: 2934, + EndPos: 2935, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: -1, + StartPos: 2943, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: -1, + StartPos: 2943, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 129, + StartPos: 2948, + EndPos: 2949, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: -1, + StartPos: 2954, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: 130, + StartPos: 2959, + EndPos: 2960, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 136, + StartPos: 2980, + EndPos: 3032, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 133, + StartPos: 2988, + EndPos: 2989, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 133, + EndLine: 136, + StartPos: 2991, + EndPos: 3032, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 2996, + EndPos: 3010, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 3001, + EndPos: 3002, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 3004, + EndPos: 3010, + }, + }, + }, + }, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3014, + EndPos: 3028, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3019, + EndPos: 3020, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 3022, + EndPos: 3028, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtSwitch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 141, + StartPos: 3038, + EndPos: 3091, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 3046, + EndPos: 3047, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 141, + StartPos: 3049, + EndPos: 3091, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3055, + EndPos: 3069, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3060, + EndPos: 3061, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3063, + EndPos: 3069, + }, + }, + }, + }, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3073, + EndPos: 3087, + }, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3078, + EndPos: 3079, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3081, + EndPos: 3087, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtThrow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3095, + EndPos: 3104, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3101, + EndPos: 3103, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3101, + EndPos: 3103, + }, + }, + Value: []byte("e"), + }, + }, + }, + &ast.StmtTrait{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3108, + EndPos: 3120, + }, + }, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 145, + EndLine: 145, + StartPos: 3114, + EndPos: 3117, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3123, + EndPos: 3145, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3129, + EndPos: 3132, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3135, + EndPos: 3143, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3139, + EndPos: 3142, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3139, + EndPos: 3142, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: 146, + StartPos: 3142, + EndPos: 3143, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3148, + EndPos: 3177, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3154, + EndPos: 3157, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3160, + EndPos: 3175, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3164, + EndPos: 3167, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3164, + EndPos: 3167, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3169, + EndPos: 3172, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3169, + EndPos: 3172, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3173, + EndPos: 3175, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3180, + EndPos: 3226, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3186, + EndPos: 3189, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3192, + EndPos: 3224, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3196, + EndPos: 3199, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3196, + EndPos: 3199, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3201, + EndPos: 3204, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3201, + EndPos: 3204, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3205, + EndPos: 3224, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3221, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3210, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3207, + EndPos: 3210, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3214, + EndPos: 3221, + }, + }, + Value: []byte("include"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3229, + EndPos: 3274, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3235, + EndPos: 3238, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3241, + EndPos: 3272, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3245, + EndPos: 3248, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3245, + EndPos: 3248, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3250, + EndPos: 3253, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3250, + EndPos: 3253, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3254, + EndPos: 3272, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3269, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3259, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3256, + EndPos: 3259, + }, + }, + Value: []byte("one"), + }, + }, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3263, + EndPos: 3269, + }, + }, + Value: []byte("public"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3277, + EndPos: 3326, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3283, + EndPos: 3286, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3289, + EndPos: 3324, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3293, + EndPos: 3296, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3293, + EndPos: 3296, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3298, + EndPos: 3301, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3298, + EndPos: 3301, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3302, + EndPos: 3324, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3321, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3307, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3304, + EndPos: 3307, + }, + }, + Value: []byte("one"), + }, + }, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3311, + EndPos: 3317, + }, + }, + Value: []byte("public"), + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3318, + EndPos: 3321, + }, + }, + Value: []byte("two"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3329, + EndPos: 3406, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3335, + EndPos: 3338, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3341, + EndPos: 3404, + }, + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3345, + EndPos: 3348, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3345, + EndPos: 3348, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3350, + EndPos: 3353, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3350, + EndPos: 3353, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3354, + EndPos: 3404, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3384, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3364, + }, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3359, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3356, + EndPos: 3359, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3361, + EndPos: 3364, + }, + }, + Value: []byte("one"), + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3375, + EndPos: 3378, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3375, + EndPos: 3378, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3380, + EndPos: 3384, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3380, + EndPos: 3384, + }, + }, + Value: []byte("Quux"), + }, + }, + }, + }, + }, + &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3401, + }, + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3394, + }, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3389, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3386, + EndPos: 3389, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3391, + EndPos: 3394, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 151, + EndLine: 151, + StartPos: 3398, + EndPos: 3401, + }, + }, + Value: []byte("two"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 153, + EndLine: -1, + StartPos: 3410, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{}, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3419, + EndPos: 3449, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3426, + EndPos: 3449, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3433, + EndPos: 3442, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3433, + EndPos: 3442, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3443, + EndPos: 3445, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3443, + EndPos: 3445, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3452, + EndPos: 3499, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3459, + EndPos: 3499, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3466, + EndPos: 3475, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3466, + EndPos: 3475, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3476, + EndPos: 3492, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3476, + EndPos: 3492, + }, + }, + Value: []byte("RuntimeException"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3493, + EndPos: 3495, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3493, + EndPos: 3495, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3502, + EndPos: 3563, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3509, + EndPos: 3532, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3516, + EndPos: 3525, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3516, + EndPos: 3525, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3526, + EndPos: 3528, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3526, + EndPos: 3528, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3533, + EndPos: 3563, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3540, + EndPos: 3556, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3540, + EndPos: 3556, + }, + }, + Value: []byte("RuntimeException"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3557, + EndPos: 3559, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3557, + EndPos: 3559, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3566, + EndPos: 3607, + }, + }, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3573, + EndPos: 3596, + }, + }, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3580, + EndPos: 3589, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3580, + EndPos: 3589, + }, + }, + Value: []byte("Exception"), + }, + }, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3590, + EndPos: 3592, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3590, + EndPos: 3592, + }, + }, + Value: []byte("e"), + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + Finally: &ast.StmtFinally{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3597, + EndPos: 3607, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3611, + EndPos: 3626, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3617, + EndPos: 3619, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3617, + EndPos: 3619, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3621, + EndPos: 3623, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3621, + EndPos: 3623, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3630, + EndPos: 3638, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3634, + EndPos: 3637, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3641, + EndPos: 3650, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3646, + EndPos: 3649, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3653, + EndPos: 3669, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3668, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3661, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3658, + EndPos: 3661, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3665, + EndPos: 3668, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3672, + EndPos: 3685, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3676, + EndPos: 3679, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3681, + EndPos: 3684, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3688, + EndPos: 3708, + }, + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3692, + EndPos: 3695, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3707, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3700, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3697, + EndPos: 3700, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3704, + EndPos: 3707, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3711, + EndPos: 3734, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3715, + EndPos: 3723, + }, + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3724, + EndPos: 3727, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3730, + EndPos: 3733, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3737, + EndPos: 3774, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3741, + EndPos: 3749, + }, + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3760, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3753, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3750, + EndPos: 3753, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3757, + EndPos: 3760, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3773, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3766, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3763, + EndPos: 3766, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3770, + EndPos: 3773, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3777, + EndPos: 3797, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3781, + EndPos: 3786, + }, + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3787, + EndPos: 3790, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3796, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + }, + }, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3800, + EndPos: 3834, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3804, + EndPos: 3809, + }, + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3820, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3813, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3810, + EndPos: 3813, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3817, + EndPos: 3820, + }, + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3833, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3826, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3823, + EndPos: 3826, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3830, + EndPos: 3833, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3838, + EndPos: 3858, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3843, + EndPos: 3846, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3843, + EndPos: 3846, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3848, + EndPos: 3851, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3853, + EndPos: 3856, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3861, + EndPos: 3888, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3868, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3865, + EndPos: 3868, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3870, + EndPos: 3873, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3886, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3878, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3875, + EndPos: 3878, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3882, + EndPos: 3886, + }, + }, + Value: []byte("quux"), + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3891, + EndPos: 3919, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3895, + EndPos: 3903, + }, + }, + Value: []byte("function"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3904, + EndPos: 3907, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3909, + EndPos: 3912, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3914, + EndPos: 3917, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3922, + EndPos: 3948, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3926, + EndPos: 3931, + }, + }, + Value: []byte("const"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3933, + EndPos: 3936, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3933, + EndPos: 3936, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3938, + EndPos: 3941, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3943, + EndPos: 3946, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtGroupUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3951, + EndPos: 3985, + }, + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3958, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3955, + EndPos: 3958, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3960, + EndPos: 3965, + }, + }, + Value: []byte("const"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3966, + EndPos: 3969, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + &ast.StmtUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + UseType: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3971, + EndPos: 3979, + }, + }, + Value: []byte("function"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3980, + EndPos: 3983, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3995, + }, + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3994, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3991, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3989, + EndPos: 3991, + }, + }, + Value: []byte("a"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3992, + EndPos: 3993, + }, + }, + Value: []byte("1"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4007, + }, + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4006, + }, + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4003, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4000, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3998, + EndPos: 4000, + }, + }, + Value: []byte("a"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4001, + EndPos: 4002, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 4004, + EndPos: 4005, + }, + }, + Value: []byte("2"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4010, + EndPos: 4018, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 4010, + EndPos: 4017, + }, + }, + Items: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4021, + EndPos: 4030, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4021, + EndPos: 4029, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4027, + EndPos: 4028, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 4027, + EndPos: 4028, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4033, + EndPos: 4051, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4033, + EndPos: 4050, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4039, + EndPos: 4043, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4039, + EndPos: 4040, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4042, + EndPos: 4043, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4045, + EndPos: 4048, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4045, + EndPos: 4048, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4046, + EndPos: 4048, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4046, + EndPos: 4048, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4054, + EndPos: 4058, + }, + }, + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4054, + EndPos: 4057, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4057, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4055, + EndPos: 4057, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4061, + EndPos: 4065, + }, + }, + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4061, + EndPos: 4064, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4062, + EndPos: 4064, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4062, + EndPos: 4064, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4078, + }, + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4077, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4072, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4069, + EndPos: 4072, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4074, + EndPos: 4077, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4091, + }, + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4090, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4085, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4081, + EndPos: 4085, + }, + }, + Value: []byte("foo"), + }, + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4087, + EndPos: 4090, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4094, + EndPos: 4104, + }, + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4094, + EndPos: 4102, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4100, + EndPos: 4102, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4100, + EndPos: 4102, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4107, + EndPos: 4116, + }, + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4107, + EndPos: 4115, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4113, + EndPos: 4115, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4113, + EndPos: 4115, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4119, + EndPos: 4132, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4119, + EndPos: 4131, + }, + }, + ReturnsRef: false, + Static: false, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4135, + EndPos: 4169, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4135, + EndPos: 4168, + }, + }, + Static: false, + ReturnsRef: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4144, + EndPos: 4146, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4148, + EndPos: 4150, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4152, + EndPos: 4165, + }, + }, + Uses: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4157, + EndPos: 4159, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4157, + EndPos: 4159, + }, + }, + Value: []byte("c"), + }, + }, + &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4161, + EndPos: 4164, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4162, + EndPos: 4164, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4162, + EndPos: 4164, + }, + }, + Value: []byte("d"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4172, + EndPos: 4192, + }, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4172, + EndPos: 4191, + }, + }, + ReturnsRef: false, + Static: false, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4188, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4184, + EndPos: 4188, + }, + }, + Value: []byte("void"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4199, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4195, + EndPos: 4198, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4216, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4215, + }, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4202, + EndPos: 4215, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4212, + EndPos: 4215, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4224, + }, + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4223, + }, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4219, + EndPos: 4223, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4220, + EndPos: 4223, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4228, + EndPos: 4238, + }, + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4228, + EndPos: 4237, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4234, + EndPos: 4236, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4234, + EndPos: 4236, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4241, + EndPos: 4245, + }, + }, + Expr: &ast.ExprErrorSuppress{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4241, + EndPos: 4244, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4242, + EndPos: 4244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 197, + EndLine: 197, + StartPos: 4242, + EndPos: 4244, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4248, + EndPos: 4257, + }, + }, + Expr: &ast.ExprEval{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4248, + EndPos: 4256, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4253, + EndPos: 4255, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4253, + EndPos: 4255, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4260, + EndPos: 4265, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4260, + EndPos: 4264, + }, + }, + Die: false, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4268, + EndPos: 4277, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4268, + EndPos: 4276, + }, + }, + Die: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4273, + EndPos: 4275, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4273, + EndPos: 4275, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4280, + EndPos: 4284, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4280, + EndPos: 4283, + }, + }, + Die: true, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4287, + EndPos: 4295, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4287, + EndPos: 4294, + }, + }, + Die: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4291, + EndPos: 4293, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 202, + EndLine: 202, + StartPos: 4291, + EndPos: 4293, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4304, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4303, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4301, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4298, + EndPos: 4301, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4301, + EndPos: 4303, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4323, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4322, + }, + }, + Function: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4307, + EndPos: 4320, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4317, + EndPos: 4320, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4320, + EndPos: 4322, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4333, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4332, + }, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4326, + EndPos: 4330, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4327, + EndPos: 4330, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4330, + EndPos: 4332, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4343, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4342, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4340, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4336, + EndPos: 4340, + }, + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4340, + EndPos: 4342, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4352, + }, + }, + Expr: &ast.ExprPostDec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4351, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4349, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4347, + EndPos: 4349, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4360, + }, + }, + Expr: &ast.ExprPostInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4359, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4357, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4355, + EndPos: 4357, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4363, + EndPos: 4368, + }, + }, + Expr: &ast.ExprPreDec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4363, + EndPos: 4367, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4365, + EndPos: 4367, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4365, + EndPos: 4367, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4371, + EndPos: 4376, + }, + }, + Expr: &ast.ExprPreInc{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4371, + EndPos: 4375, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4373, + EndPos: 4375, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 211, + EndLine: 211, + StartPos: 4373, + EndPos: 4375, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4380, + EndPos: 4391, + }, + }, + Expr: &ast.ExprInclude{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4380, + EndPos: 4390, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4388, + EndPos: 4390, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4388, + EndPos: 4390, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4394, + EndPos: 4410, + }, + }, + Expr: &ast.ExprIncludeOnce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4394, + EndPos: 4409, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4407, + EndPos: 4409, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4407, + EndPos: 4409, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4413, + EndPos: 4424, + }, + }, + Expr: &ast.ExprRequire{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4413, + EndPos: 4423, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4427, + EndPos: 4443, + }, + }, + Expr: &ast.ExprRequireOnce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4427, + EndPos: 4442, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4440, + EndPos: 4442, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4440, + EndPos: 4442, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4465, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4464, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4449, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4447, + EndPos: 4449, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4461, + EndPos: 4464, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 218, + EndLine: 218, + StartPos: 4461, + EndPos: 4464, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4496, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4495, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4470, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4468, + EndPos: 4470, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4482, + EndPos: 4495, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4492, + EndPos: 4495, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4518, + }, + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4517, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4501, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4499, + EndPos: 4501, + }, + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4513, + EndPos: 4517, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4514, + EndPos: 4517, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4522, + EndPos: 4536, + }, + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4522, + EndPos: 4535, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4530, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4530, + }, + }, + Value: []byte("a"), + }, + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4532, + EndPos: 4534, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4532, + EndPos: 4534, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4553, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4552, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4539, + EndPos: 4547, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4544, + EndPos: 4546, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4552, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4550, + EndPos: 4552, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4572, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4571, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4556, + EndPos: 4566, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4565, + }, + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4565, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4563, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4561, + EndPos: 4563, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4569, + EndPos: 4571, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4569, + EndPos: 4571, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4595, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4594, + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4575, + EndPos: 4589, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4580, + EndPos: 4588, + }, + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4580, + EndPos: 4588, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4585, + EndPos: 4587, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4592, + EndPos: 4594, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4592, + EndPos: 4594, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4609, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4608, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4601, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4599, + EndPos: 4601, + }, + }, + Value: []byte("a"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4603, + EndPos: 4606, + }, + }, + Value: []byte("foo"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4606, + EndPos: 4608, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4612, + EndPos: 4622, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4612, + EndPos: 4621, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4616, + EndPos: 4619, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4616, + EndPos: 4619, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4619, + EndPos: 4621, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4625, + EndPos: 4645, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4625, + EndPos: 4644, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4629, + EndPos: 4642, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4639, + EndPos: 4642, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4642, + EndPos: 4644, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4648, + EndPos: 4659, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4648, + EndPos: 4658, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4652, + EndPos: 4656, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4653, + EndPos: 4656, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4656, + EndPos: 4658, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4662, + EndPos: 4687, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4662, + EndPos: 4686, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4666, + EndPos: 4686, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4672, + EndPos: 4683, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4673, + EndPos: 4675, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4677, + EndPos: 4682, + }, + }, + IsReference: false, + Variadic: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4680, + EndPos: 4682, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4680, + EndPos: 4682, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4690, + EndPos: 4700, + }, + }, + Expr: &ast.ExprPrint{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4690, + EndPos: 4698, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4696, + EndPos: 4698, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4696, + EndPos: 4698, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4711, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4710, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4705, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4703, + EndPos: 4705, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4707, + EndPos: 4710, + }, + }, + Value: []byte("foo"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4714, + EndPos: 4723, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4714, + EndPos: 4722, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4715, + EndPos: 4719, + }, + }, + Value: []byte("cmd "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4719, + EndPos: 4721, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 234, + EndLine: 234, + StartPos: 4719, + EndPos: 4721, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4726, + EndPos: 4732, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4726, + EndPos: 4731, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4727, + EndPos: 4730, + }, + }, + Value: []byte("cmd"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4735, + EndPos: 4738, + }, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4735, + EndPos: 4737, + }, + }, + Parts: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4741, + EndPos: 4744, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4741, + EndPos: 4743, + }, + }, + Items: []ast.Vertex{}, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4747, + EndPos: 4751, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4747, + EndPos: 4750, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4748, + EndPos: 4749, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4748, + EndPos: 4749, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4754, + EndPos: 4767, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4754, + EndPos: 4766, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4755, + EndPos: 4759, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4755, + EndPos: 4756, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4758, + EndPos: 4759, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4764, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4764, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4762, + EndPos: 4764, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4762, + EndPos: 4764, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4781, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4780, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4771, + EndPos: 4775, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4772, + EndPos: 4774, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4778, + EndPos: 4780, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4778, + EndPos: 4780, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4796, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4795, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4784, + EndPos: 4790, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4789, + }, + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4789, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4787, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4785, + EndPos: 4787, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4795, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4793, + EndPos: 4795, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4815, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4814, + }, + }, + Var: &ast.ExprShortList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4799, + EndPos: 4809, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4800, + EndPos: 4808, + }, + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4800, + EndPos: 4808, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4805, + EndPos: 4807, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4812, + EndPos: 4814, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4812, + EndPos: 4814, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4829, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4828, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4821, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4818, + EndPos: 4821, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4823, + EndPos: 4826, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4826, + EndPos: 4828, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4853, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4852, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4832, + EndPos: 4845, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4842, + EndPos: 4845, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4847, + EndPos: 4850, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4850, + EndPos: 4852, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4868, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4867, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4856, + EndPos: 4860, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4857, + EndPos: 4860, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4862, + EndPos: 4865, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4865, + EndPos: 4867, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4881, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4880, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4874, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4871, + EndPos: 4874, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4876, + EndPos: 4880, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4876, + EndPos: 4880, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4895, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4894, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4888, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4884, + EndPos: 4888, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4890, + EndPos: 4894, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4890, + EndPos: 4894, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4918, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4917, + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4898, + EndPos: 4911, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4908, + EndPos: 4911, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4917, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4917, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4932, + }, + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4931, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4925, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4922, + EndPos: 4925, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4927, + EndPos: 4931, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4927, + EndPos: 4931, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4948, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4947, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4937, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4935, + EndPos: 4937, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4940, + EndPos: 4942, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4940, + EndPos: 4942, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4945, + EndPos: 4947, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4945, + EndPos: 4947, + }, + }, + Value: []byte("c"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4961, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4960, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4953, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4951, + EndPos: 4953, + }, + }, + Value: []byte("a"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4958, + EndPos: 4960, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4958, + EndPos: 4960, + }, + }, + Value: []byte("c"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4987, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4986, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4966, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4964, + EndPos: 4966, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4981, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4971, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4969, + EndPos: 4971, + }, + }, + Value: []byte("b"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4974, + EndPos: 4976, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4974, + EndPos: 4976, + }, + }, + Value: []byte("c"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4979, + EndPos: 4981, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4979, + EndPos: 4981, + }, + }, + Value: []byte("d"), + }, + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4984, + EndPos: 4986, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4984, + EndPos: 4986, + }, + }, + Value: []byte("e"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5013, + }, + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5012, + }, + }, + Condition: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 5002, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 4992, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4990, + EndPos: 4992, + }, + }, + Value: []byte("a"), + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4995, + EndPos: 4997, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4995, + EndPos: 4997, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5000, + EndPos: 5002, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5000, + EndPos: 5002, + }, + }, + Value: []byte("c"), + }, + }, + }, + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5005, + EndPos: 5007, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5005, + EndPos: 5007, + }, + }, + Value: []byte("d"), + }, + }, + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5010, + EndPos: 5012, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 5010, + EndPos: 5012, + }, + }, + Value: []byte("e"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5016, + EndPos: 5020, + }, + }, + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5016, + EndPos: 5019, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5019, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5017, + EndPos: 5019, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5023, + EndPos: 5027, + }, + }, + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5023, + EndPos: 5026, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5024, + EndPos: 5026, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 256, + EndLine: 256, + StartPos: 5024, + EndPos: 5026, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5034, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5030, + EndPos: 5033, + }, + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5031, + EndPos: 5033, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5031, + EndPos: 5033, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5043, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5042, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5046, + EndPos: 5055, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5046, + EndPos: 5054, + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5052, + EndPos: 5054, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5052, + EndPos: 5054, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5058, + EndPos: 5073, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5058, + EndPos: 5072, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5064, + EndPos: 5066, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5064, + EndPos: 5066, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5070, + EndPos: 5072, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5070, + EndPos: 5072, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5090, + }, + }, + Expr: &ast.ExprYieldFrom{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5089, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5089, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5087, + EndPos: 5089, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5096, + EndPos: 5106, + }, + }, + Expr: &ast.ExprCastArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5096, + EndPos: 5105, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5103, + EndPos: 5105, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5103, + EndPos: 5105, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5109, + EndPos: 5121, + }, + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5109, + EndPos: 5120, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5120, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5118, + EndPos: 5120, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5124, + EndPos: 5133, + }, + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5124, + EndPos: 5132, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5136, + EndPos: 5147, + }, + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5136, + EndPos: 5146, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5144, + EndPos: 5146, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5144, + EndPos: 5146, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5150, + EndPos: 5160, + }, + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5150, + EndPos: 5159, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5157, + EndPos: 5159, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 267, + EndLine: 267, + StartPos: 5157, + EndPos: 5159, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5163, + EndPos: 5175, + }, + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5163, + EndPos: 5174, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5174, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5172, + EndPos: 5174, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5178, + EndPos: 5186, + }, + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5178, + EndPos: 5185, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5183, + EndPos: 5185, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5183, + EndPos: 5185, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5189, + EndPos: 5200, + }, + }, + Expr: &ast.ExprCastObject{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5189, + EndPos: 5199, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5197, + EndPos: 5199, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5197, + EndPos: 5199, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5203, + EndPos: 5214, + }, + }, + Expr: &ast.ExprCastString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5203, + EndPos: 5213, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5213, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5211, + EndPos: 5213, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5217, + EndPos: 5227, + }, + }, + Expr: &ast.ExprCastUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5217, + EndPos: 5226, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5224, + EndPos: 5226, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5224, + EndPos: 5226, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5239, + }, + }, + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5238, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5233, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5231, + EndPos: 5233, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5236, + EndPos: 5238, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5236, + EndPos: 5238, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5250, + }, + }, + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5249, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5244, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5242, + EndPos: 5244, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5247, + EndPos: 5249, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5247, + EndPos: 5249, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5261, + }, + }, + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5260, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5255, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5253, + EndPos: 5255, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5258, + EndPos: 5260, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5258, + EndPos: 5260, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5273, + }, + }, + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5272, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5266, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5264, + EndPos: 5266, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5270, + EndPos: 5272, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5270, + EndPos: 5272, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5285, + }, + }, + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5284, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5278, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5276, + EndPos: 5278, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5282, + EndPos: 5284, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5282, + EndPos: 5284, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5297, + }, + }, + Expr: &ast.ExprBinaryCoalesce{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5296, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5290, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5288, + EndPos: 5290, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5294, + EndPos: 5296, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5294, + EndPos: 5296, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5308, + }, + }, + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5307, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5302, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5300, + EndPos: 5302, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5305, + EndPos: 5307, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5305, + EndPos: 5307, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5319, + }, + }, + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5318, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5313, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5311, + EndPos: 5313, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5316, + EndPos: 5318, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5316, + EndPos: 5318, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5331, + }, + }, + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5330, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5324, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5322, + EndPos: 5324, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5328, + EndPos: 5330, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5328, + EndPos: 5330, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5343, + }, + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5342, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5336, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5334, + EndPos: 5336, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5340, + EndPos: 5342, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5340, + EndPos: 5342, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5354, + }, + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5353, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5348, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5346, + EndPos: 5348, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5351, + EndPos: 5353, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5351, + EndPos: 5353, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5367, + }, + }, + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5366, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5359, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5357, + EndPos: 5359, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5364, + EndPos: 5366, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5364, + EndPos: 5366, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5380, + }, + }, + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5379, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5372, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5370, + EndPos: 5372, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5377, + EndPos: 5379, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5377, + EndPos: 5379, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5392, + }, + }, + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5391, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5385, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5383, + EndPos: 5385, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5389, + EndPos: 5391, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5389, + EndPos: 5391, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5405, + }, + }, + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5404, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5397, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5395, + EndPos: 5397, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5402, + EndPos: 5404, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5402, + EndPos: 5404, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5416, + }, + }, + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5415, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5410, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5408, + EndPos: 5410, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5413, + EndPos: 5415, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5413, + EndPos: 5415, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5427, + }, + }, + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5426, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5421, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5419, + EndPos: 5421, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5424, + EndPos: 5426, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5424, + EndPos: 5426, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5438, + }, + }, + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5437, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5432, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5430, + EndPos: 5432, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5435, + EndPos: 5437, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5435, + EndPos: 5437, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5450, + }, + }, + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5449, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5443, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5441, + EndPos: 5443, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5447, + EndPos: 5449, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5447, + EndPos: 5449, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5463, + }, + }, + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5462, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5455, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5453, + EndPos: 5455, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5460, + EndPos: 5462, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 293, + EndLine: 293, + StartPos: 5460, + EndPos: 5462, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5474, + }, + }, + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5473, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5468, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5466, + EndPos: 5468, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5471, + EndPos: 5473, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5471, + EndPos: 5473, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5486, + }, + }, + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5485, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5479, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5477, + EndPos: 5479, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5483, + EndPos: 5485, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5483, + EndPos: 5485, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5498, + }, + }, + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5497, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5491, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5489, + EndPos: 5491, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5495, + EndPos: 5497, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5495, + EndPos: 5497, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5510, + }, + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5509, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5503, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5501, + EndPos: 5503, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5507, + EndPos: 5509, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5507, + EndPos: 5509, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5522, + }, + }, + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5521, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5515, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5513, + EndPos: 5515, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5519, + EndPos: 5521, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5519, + EndPos: 5521, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5533, + }, + }, + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5532, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5527, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5525, + EndPos: 5527, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5530, + EndPos: 5532, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5530, + EndPos: 5532, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5546, + }, + }, + Expr: &ast.ExprBinarySpaceship{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5545, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5538, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5536, + EndPos: 5538, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5543, + EndPos: 5545, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5543, + EndPos: 5545, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5559, + }, + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5558, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5552, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5550, + EndPos: 5552, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5556, + EndPos: 5558, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5556, + EndPos: 5558, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5570, + }, + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5569, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5564, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5562, + EndPos: 5564, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5567, + EndPos: 5569, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5567, + EndPos: 5569, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5582, + }, + }, + Expr: &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5581, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5575, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5573, + EndPos: 5575, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5579, + EndPos: 5581, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5579, + EndPos: 5581, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5594, + }, + }, + Expr: &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5593, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5587, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5585, + EndPos: 5587, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5591, + EndPos: 5593, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5591, + EndPos: 5593, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5606, + }, + }, + Expr: &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5605, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5599, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5597, + EndPos: 5599, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5603, + EndPos: 5605, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5603, + EndPos: 5605, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5618, + }, + }, + Expr: &ast.ExprAssignConcat{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5617, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5611, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5609, + EndPos: 5611, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5615, + EndPos: 5617, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5615, + EndPos: 5617, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5630, + }, + }, + Expr: &ast.ExprAssignDiv{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5629, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5623, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5621, + EndPos: 5623, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5627, + EndPos: 5629, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5627, + EndPos: 5629, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5642, + }, + }, + Expr: &ast.ExprAssignMinus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5641, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5635, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5633, + EndPos: 5635, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5654, + }, + }, + Expr: &ast.ExprAssignMod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5653, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5647, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5645, + EndPos: 5647, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5651, + EndPos: 5653, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 310, + EndLine: 310, + StartPos: 5651, + EndPos: 5653, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5666, + }, + }, + Expr: &ast.ExprAssignMul{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5665, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5659, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5657, + EndPos: 5659, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5663, + EndPos: 5665, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 311, + EndLine: 311, + StartPos: 5663, + EndPos: 5665, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5678, + }, + }, + Expr: &ast.ExprAssignPlus{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5677, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5671, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5669, + EndPos: 5671, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5675, + EndPos: 5677, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5675, + EndPos: 5677, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5691, + }, + }, + Expr: &ast.ExprAssignPow{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5690, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5683, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5681, + EndPos: 5683, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5688, + EndPos: 5690, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5688, + EndPos: 5690, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5704, + }, + }, + Expr: &ast.ExprAssignShiftLeft{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5703, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5696, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5694, + EndPos: 5696, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5701, + EndPos: 5703, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5701, + EndPos: 5703, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5717, + }, + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5716, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5709, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5707, + EndPos: 5709, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5714, + EndPos: 5716, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5714, + EndPos: 5716, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5721, + EndPos: 5760, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5727, + EndPos: 5730, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5732, + EndPos: 5758, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5748, + EndPos: 5753, + }, + }, + Value: []byte("class"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5732, + EndPos: 5738, + }, + }, + Value: []byte("public"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5756, + EndPos: 5758, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5774, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5773, + }, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5763, + EndPos: 5771, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5764, + EndPos: 5767, + }, + }, + Value: []byte("foo"), + }, + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5768, + EndPos: 5771, + }, + }, + Value: []byte("bar"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5771, + EndPos: 5773, + }, + }, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 326, + StartPos: 5778, + EndPos: 5905, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5787, + EndPos: 5790, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5791, + EndPos: 5794, + }, + }, + ByRef: true, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5792, + EndPos: 5794, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5792, + EndPos: 5794, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5796, + EndPos: 5801, + }, + }, + ByRef: false, + Variadic: true, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5799, + EndPos: 5801, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5799, + EndPos: 5801, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5830, + EndPos: 5847, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5839, + EndPos: 5842, + }, + }, + Value: []byte("bar"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5851, + EndPos: 5863, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5857, + EndPos: 5860, + }, + }, + Value: []byte("Baz"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtTrait{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5867, + EndPos: 5879, + }, + }, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5873, + EndPos: 5877, + }, + }, + Value: []byte("Quux"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtInterface{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5883, + EndPos: 5901, + }, + }, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5893, + EndPos: 5898, + }, + }, + Value: []byte("Quuux"), + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5911, + EndPos: 5954, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5920, + EndPos: 5923, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5924, + EndPos: 5931, + }, + }, + ByRef: true, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5925, + EndPos: 5927, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5925, + EndPos: 5927, + }, + }, + Value: []byte("a"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5930, + EndPos: 5931, + }, + }, + Value: []byte("1"), + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5933, + EndPos: 5942, + }, + }, + ByRef: false, + Variadic: true, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5936, + EndPos: 5938, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5936, + EndPos: 5938, + }, + }, + Value: []byte("b"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5941, + EndPos: 5942, + }, + }, + Value: []byte("1"), + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5950, + }, + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5946, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5944, + EndPos: 5946, + }, + }, + Value: []byte("c"), + }, + }, + DefaultValue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5949, + EndPos: 5950, + }, + }, + Value: []byte("1"), + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5957, + EndPos: 5995, + }, + }, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5966, + EndPos: 5969, + }, + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5970, + EndPos: 5978, + }, + }, + ByRef: false, + Variadic: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5970, + EndPos: 5975, + }, + }, + Value: []byte("array"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5976, + EndPos: 5978, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5976, + EndPos: 5978, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Parameter{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5980, + EndPos: 5991, + }, + }, + Variadic: false, + ByRef: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5980, + EndPos: 5988, + }, + }, + Value: []byte("callable"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5989, + EndPos: 5991, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5989, + EndPos: 5991, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 6100, + }, + }, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6019, + EndPos: 6022, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5998, + EndPos: 6006, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6007, + EndPos: 6012, + }, + }, + Value: []byte("final"), + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6025, + EndPos: 6066, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6060, + EndPos: 6063, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6025, + EndPos: 6033, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6034, + EndPos: 6043, + }, + }, + Value: []byte("protected"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6044, + EndPos: 6050, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6065, + EndPos: 6066, + }, + }, + }, + }, + &ast.StmtClassMethod{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6067, + EndPos: 6098, + }, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6090, + EndPos: 6093, + }, + }, + Value: []byte("baz"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6067, + EndPos: 6072, + }, + }, + Value: []byte("final"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6073, + EndPos: 6080, + }, + }, + Value: []byte("private"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 6096, + EndPos: 6098, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6119, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6118, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6105, + EndPos: 6112, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6109, + EndPos: 6112, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6109, + EndPos: 6112, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6115, + EndPos: 6118, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6134, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6133, + }, + }, + Function: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6123, + EndPos: 6130, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6130, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6127, + EndPos: 6130, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6131, + EndPos: 6133, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6149, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6148, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6146, + }, + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6137, + EndPos: 6143, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6138, + EndPos: 6142, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6144, + EndPos: 6145, + }, + }, + Value: []byte("0"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6146, + EndPos: 6148, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6161, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6160, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6158, + }, + }, + Var: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6152, + EndPos: 6155, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6156, + EndPos: 6157, + }, + }, + Value: []byte("1"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6158, + EndPos: 6160, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6172, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6171, + }, + }, + Function: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6164, + EndPos: 6169, + }, + }, + Value: []byte("\"foo\""), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6169, + EndPos: 6171, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6187, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6186, + }, + }, + Function: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6184, + }, + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6175, + EndPos: 6178, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6176, + EndPos: 6177, + }, + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6176, + EndPos: 6177, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + Dim: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6179, + EndPos: 6183, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6179, + EndPos: 6183, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6184, + EndPos: 6186, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6190, + EndPos: 6199, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6190, + EndPos: 6198, + }, + }, + VarName: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6197, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6195, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6192, + EndPos: 6195, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6195, + EndPos: 6197, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6215, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6214, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6206, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6203, + EndPos: 6206, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6208, + EndPos: 6212, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6208, + EndPos: 6212, + }, + }, + Value: []byte("bar"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6212, + EndPos: 6214, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6235, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6234, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6221, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6218, + EndPos: 6221, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Call: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6231, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6228, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6224, + EndPos: 6228, + }, + }, + Value: []byte("bar"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6229, + EndPos: 6230, + }, + }, + Value: []byte("0"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6232, + EndPos: 6234, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6252, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6251, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6245, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6241, + EndPos: 6245, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6247, + EndPos: 6251, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6247, + EndPos: 6251, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6271, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6269, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6259, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6255, + EndPos: 6259, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6269, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6266, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6262, + EndPos: 6266, + }, + }, + Value: []byte("bar"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6267, + EndPos: 6268, + }, + }, + Value: []byte("0"), + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6275, + EndPos: 6297, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6275, + EndPos: 6296, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6276, + EndPos: 6282, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6276, + EndPos: 6277, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6279, + EndPos: 6282, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6280, + EndPos: 6282, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6280, + EndPos: 6282, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6284, + EndPos: 6295, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6284, + EndPos: 6285, + }, + }, + Value: []byte("2"), + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6287, + EndPos: 6295, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6292, + EndPos: 6294, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + }, + }, + &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6301, + EndPos: 6319, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestPhp5Strings(t *testing.T) { + src := `YTI`-#KZEQWmBqr-rbM^Tu4SSYu$TR?-;cCQ&1aDBAXo!OhNqM6q{V zDr^{p%_1h2PN&)+R&>KiV%SyMuf^B}^HS0>S+FuZwDEs^6MR!sUhUiXM=Q5QV!ZFT z+TW{!s;CZ@!rMbB3d$|EpD#If|x{n>-82(}~3OCAiX z=*b61$^+y^Fk7?yIokk`RAMBNkUf|N*iexsLqs&xSZLq&n&SaurwtrAeE6UdV}W#6 zd|1wkU5H+kV{{3R4ujk|q$``f@-zKVOtdysGBLX^L1SW;sBjUANAk>>)_F!I4H_|R zY@%6AWMq$D?{9Cxs}Wk^2P=IPH|De2r-R;%C9jTQTeB#8_?Nai%gDSNy`g_cMPVb} zc-J=OJO>0@tYi09>2l3|$v9>NUqU)Lk6`_qiMF{!W=S+;2PuB6!}Xpl=&dx{U^9+H zHM#CI=KtDcm?%d?Y$O}CCewym#gikHKxSB*Y#ZTxlOZ&W(?_tAYyE8lb|%4Z>rKL9 zA$z||B>VbpR3bZ@vFr3U5m92Ak}m6k*yhn3h>intf&8(gHfN~|8p=3tBB7#1OsGX( zunZnMXiQS#z(I}OxS`Uu5I&R@{3xo`%E!px4ysrp< zLMkjQ_9XU)?>5lwAaP?4D*ChgC$SdK7ptzLEc5ex`x!_C?^Rzm;?!%b)#*`P-Nc@R zQu_SJfp~=*{oJyAQ&KZid|zwj#{bi?(OzJL_oI}S?BVC`p3(7~EA6W+8ccNaQ2ZapO73hY0BR=|+V*O9{FSu-xlY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Tdpo*dWzsu*yOFqp(?(4iw+W>pT^jN}N_TXro=e%AG|S!&Ncn|Lcz@vs$`^dz z*!Q)JBckEJ`xp*SC=;>5ZK18qTWHj#dA|2%|sLmZ5Vs=6UKv zjo^q!>AVX0(4X)xjt}Ht8kaYIF2;#a%gM+{2N#!k$p7|&i06Dw?JU|Zif+e&U)6$DW$azQd?P>zCq(U+JRx6cf}WQFlmONxh-#o3sryCDKR^ctY}RQGI=iCY2Pf4@y8R)%B7p-Xiy$KC`M{0+%4gtc5dmf`5Z*PrIu{&2gDTBJB=qi&6v8R76oSqd)RCc475l!Y?T&I($sm4aUm zv{Eu^^-`>LS}Cyh7=FD9Iu!@bt8x9D_tADxnom8{Eqmxyy$72Y2=3I=y)q#jZG!~| zcww%JNliG|Tv)&{TpshMxIBXTj8Fedb!ej%kMXrpr{nZh>1@Yw`F2z!c%Tkn z(8IDY^{20CJaz}yCSReR@-hU)*XSA<`I+zNemM%cPX8`PSFh_R>P-CmV=x@OMn{0< zd)h&oqCWT+jgoDo;b5hq4yXm06wXso;eXhbA?>v(luwe$`v)*{b8# z8_so89O1IJ(nZGd^3kJ~`zYE@M6U`Y`zozF$%Sk4Lwx@MXL!W;DqhWbYMhMnlbo1T zlfN?B_OK3s9o>~QNm6tV1`RhI2v66&dhi&sI|# z7mUmsi_1}G4wq;?QhQa-~ z7H!$3pFV9(KRjf9*MC6B5i^87sp$VG;LjGGV%3vM`0tr7zI{UHr<8-DmXZNVA)mf# zfHKBrXKN~7DEO0-A`Id7pOleyd+POpdh#9Ol`_C7*66TUC;i`EwwKQT_1`g8_lX}o IdO->N53F%s-T(jq diff --git a/scanner/scanner.rl b/internal/scanner/scanner.rl similarity index 95% rename from scanner/scanner.rl rename to internal/scanner/scanner.rl index c15fbdf..5eec481 100644 --- a/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -4,8 +4,6 @@ import ( "fmt" "strconv" "strings" - - "github.com/z7zmey/php-parser/freefloating" ) %%{ @@ -30,13 +28,13 @@ func NewLexer(data []byte) *Lexer { } func (lex *Lexer) Lex(lval Lval) int { - lex.FreeFloating = nil + lex.Tokens = nil eof := lex.pe var tok TokenID token := lex.TokenPool.Get() - token.FreeFloating = lex.FreeFloating - token.Value = string(lex.data[0:0]) + token.Tokens = lex.Tokens + token.Value = lex.data[0:0] lblStart := 0 lblEnd := 0 @@ -136,7 +134,7 @@ func (lex *Lexer) Lex(lval Lval) int { main := |* "#!" any* :>> newline => { - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) + lex.addToken(T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -152,12 +150,12 @@ func (lex *Lexer) Lex(lval Lval) int { fbreak; }; ' { - lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.te) + lex.addToken(T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.ts+5) + lex.addToken(T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { @@ -169,7 +167,7 @@ func (lex *Lexer) Lex(lval Lval) int { *|; php := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; @@ -329,17 +327,19 @@ func (lex *Lexer) Lex(lval Lval) int { ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) + lex.addToken(T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; if lex.te - lex.ts > 4 && string(lex.data[lex.ts:lex.ts+3]) == "/**" { isDocComment = true; } - lex.addFreeFloating(freefloating.CommentType, lex.ts, lex.te) if isDocComment { lex.PhpDocComment = string(lex.data[lex.ts:lex.te]) + lex.addToken(T_DOC_COMMENT, lex.ts, lex.te) + } else { + lex.addToken(T_COMMENT, lex.ts, lex.te) } }; @@ -388,7 +388,7 @@ func (lex *Lexer) Lex(lval Lval) int { *|; property := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; "->" => {lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; varname => {lex.setTokenPosition(token); tok = T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; @@ -484,32 +484,32 @@ func (lex *Lexer) Lex(lval Lval) int { *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; "(" => {lex.setTokenPosition(token); tok = TokenID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; ")" => {lex.setTokenPosition(token); tok = TokenID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addFreeFloating(freefloating.WhiteSpaceType, lex.ts, lex.te)}; + whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; ";" => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addFreeFloating(freefloating.TokenType, lex.ts, lex.te); }; + any_line* => { lex.addToken(T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - token.FreeFloating = lex.FreeFloating - token.Value = string(lex.data[lex.ts:lex.te]) + token.Tokens = lex.Tokens + token.Value = lex.data[lex.ts:lex.te] lval.Token(token) diff --git a/scanner/scanner_test.go b/internal/scanner/scanner_test.go similarity index 76% rename from scanner/scanner_test.go rename to internal/scanner/scanner_test.go index eb496a2..71822c4 100644 --- a/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -3,8 +3,7 @@ package scanner import ( "testing" - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/pkg/token" "gotest.tools/assert" ) @@ -361,7 +360,7 @@ func TestTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -390,15 +389,15 @@ func TestShebang(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} token := lexer.Lex(lv) assert.Equal(t, token, int(T_DNUMBER)) - for _, tt := range lv.Tkn.FreeFloating { - actual = append(actual, tt.Value) + for _, tt := range lv.Tkn.Tokens { + actual = append(actual, string(tt.Value)) } assert.DeepEqual(t, expected, actual) @@ -411,12 +410,12 @@ func TestShebangHtml(t *testing.T) { ` lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} token := lexer.Lex(lv) assert.Equal(t, token, int(T_INLINE_HTML)) - assert.Equal(t, lv.Tkn.FreeFloating[0].Value, "#!/usr/bin/env php\n") + assert.Equal(t, string(lv.Tkn.Tokens[0].Value), "#!/usr/bin/env php\n") token = lexer.Lex(lv) assert.Equal(t, token, int(T_DNUMBER)) @@ -462,7 +461,7 @@ func TestNumberTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -520,7 +519,7 @@ func TestConstantStrings(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -656,7 +655,7 @@ func TestTeplateStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -742,7 +741,7 @@ func TestBackquoteStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -837,7 +836,7 @@ CAT; } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -911,7 +910,7 @@ CAT } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -951,7 +950,7 @@ CAT; } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -983,7 +982,7 @@ func TestHereDocTokens73(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1015,7 +1014,7 @@ CAT;` lexer := NewLexer([]byte(src)) lexer.PHPVersion = "7.2" - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1048,7 +1047,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} actual := []string{} @@ -1094,7 +1093,7 @@ func TestStringTokensAfterVariable(t *testing.T) { break } - actualTokens = append(actualTokens, lv.Tkn.Value) + actualTokens = append(actualTokens, string(lv.Tkn.Value)) actual = append(actual, TokenID(token).String()) } @@ -1128,7 +1127,7 @@ func TestSlashAfterVariable(t *testing.T) { break } - actualTokens = append(actualTokens, lv.Tkn.Value) + actualTokens = append(actualTokens, string(lv.Tkn.Value)) actual = append(actual, TokenID(token).String()) } @@ -1139,31 +1138,29 @@ func TestSlashAfterVariable(t *testing.T) { func TestCommentEnd(t *testing.T) { src := ` test` - expected := []freefloating.String{ + expected := []token.Token{ { - Value: " bar ( '' ) ;` lexer := NewLexer([]byte(src)) - lexer.WithFreeFloating = true + lexer.WithTokens = true lv := &lval{} - expected := []freefloating.String{ + expected := []token.Token{ { - Value: "\n") { - tlen = 3 - } - - phpCloseTag := []freefloating.String{} - if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[1 : vlen-tlen], - Position: &position.Position{ - StartLine: p.StartLine, - EndLine: p.EndLine, - StartPos: p.StartPos + 1, - EndPos: p.EndPos - tlen, - }, - }) - } - - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[vlen-tlen:], - Position: &position.Position{ - StartLine: p.EndLine, - EndLine: p.EndLine, - StartPos: p.EndPos - tlen, - EndPos: p.EndPos, - }, - }) - - l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) -} - -func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { - for i := 1; i < len(yyDollar); i++ { - if yyDollar[i].token != nil { - p.Lexer.ReturnTokenToPool(yyDollar[i].token) - } - yyDollar[i].token = nil - } - yyVAL.token = nil -} diff --git a/php7/php7.y b/php7/php7.y deleted file mode 100644 index e6634ff..0000000 --- a/php7/php7.y +++ /dev/null @@ -1,5666 +0,0 @@ -%{ -package php7 - -import ( - "strings" - "strconv" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/scanner" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" -) - -%} - -%union{ - node node.Node - token *scanner.Token - list []node.Node - str string - - ClassExtends *stmt.ClassExtends - ClassImplements *stmt.ClassImplements - InterfaceExtends *stmt.InterfaceExtends - ClosureUse *expr.ClosureUse -} - -%type $unk -%token T_INCLUDE -%token T_INCLUDE_ONCE -%token T_EXIT -%token T_IF -%token T_LNUMBER -%token T_DNUMBER -%token T_STRING -%token T_STRING_VARNAME -%token T_VARIABLE -%token T_NUM_STRING -%token T_INLINE_HTML -%token T_CHARACTER -%token T_BAD_CHARACTER -%token T_ENCAPSED_AND_WHITESPACE -%token T_CONSTANT_ENCAPSED_STRING -%token T_ECHO -%token T_DO -%token T_WHILE -%token T_ENDWHILE -%token T_FOR -%token T_ENDFOR -%token T_FOREACH -%token T_ENDFOREACH -%token T_DECLARE -%token T_ENDDECLARE -%token T_AS -%token T_SWITCH -%token T_ENDSWITCH -%token T_CASE -%token T_DEFAULT -%token T_BREAK -%token T_CONTINUE -%token T_GOTO -%token T_FUNCTION -%token T_FN -%token T_CONST -%token T_RETURN -%token T_TRY -%token T_CATCH -%token T_FINALLY -%token T_THROW -%token T_USE -%token T_INSTEADOF -%token T_GLOBAL -%token T_VAR -%token T_UNSET -%token T_ISSET -%token T_EMPTY -%token T_HALT_COMPILER -%token T_CLASS -%token T_TRAIT -%token T_INTERFACE -%token T_EXTENDS -%token T_IMPLEMENTS -%token T_OBJECT_OPERATOR -%token T_DOUBLE_ARROW -%token T_LIST -%token T_ARRAY -%token T_CALLABLE -%token T_CLASS_C -%token T_TRAIT_C -%token T_METHOD_C -%token T_FUNC_C -%token T_LINE -%token T_FILE -%token T_COMMENT -%token T_DOC_COMMENT -%token T_OPEN_TAG -%token T_OPEN_TAG_WITH_ECHO -%token T_CLOSE_TAG -%token T_WHITESPACE -%token T_START_HEREDOC -%token T_END_HEREDOC -%token T_DOLLAR_OPEN_CURLY_BRACES -%token T_CURLY_OPEN -%token T_PAAMAYIM_NEKUDOTAYIM -%token T_NAMESPACE -%token T_NS_C -%token T_DIR -%token T_NS_SEPARATOR -%token T_ELLIPSIS -%token T_EVAL -%token T_REQUIRE -%token T_REQUIRE_ONCE -%token T_LOGICAL_OR -%token T_LOGICAL_XOR -%token T_LOGICAL_AND -%token T_INSTANCEOF -%token T_NEW -%token T_CLONE -%token T_ELSEIF -%token T_ELSE -%token T_ENDIF -%token T_PRINT -%token T_YIELD -%token T_STATIC -%token T_ABSTRACT -%token T_FINAL -%token T_PRIVATE -%token T_PROTECTED -%token T_PUBLIC -%token T_INC -%token T_DEC -%token T_YIELD_FROM -%token T_INT_CAST -%token T_DOUBLE_CAST -%token T_STRING_CAST -%token T_ARRAY_CAST -%token T_OBJECT_CAST -%token T_BOOL_CAST -%token T_UNSET_CAST -%token T_COALESCE -%token T_SPACESHIP -%token T_NOELSE -%token T_PLUS_EQUAL -%token T_MINUS_EQUAL -%token T_MUL_EQUAL -%token T_POW_EQUAL -%token T_DIV_EQUAL -%token T_CONCAT_EQUAL -%token T_MOD_EQUAL -%token T_AND_EQUAL -%token T_OR_EQUAL -%token T_XOR_EQUAL -%token T_SL_EQUAL -%token T_SR_EQUAL -%token T_COALESCE_EQUAL -%token T_BOOLEAN_OR -%token T_BOOLEAN_AND -%token T_POW -%token T_SL -%token T_SR -%token T_IS_IDENTICAL -%token T_IS_NOT_IDENTICAL -%token T_IS_EQUAL -%token T_IS_NOT_EQUAL -%token T_IS_SMALLER_OR_EQUAL -%token T_IS_GREATER_OR_EQUAL -%token '"' -%token '`' -%token '{' -%token '}' -%token ';' -%token ':' -%token '(' -%token ')' -%token '[' -%token ']' -%token '?' -%token '&' -%token '-' -%token '+' -%token '!' -%token '~' -%token '@' -%token '$' -%token ',' -%token '|' -%token '=' -%token '^' -%token '*' -%token '/' -%token '%' -%token '<' -%token '>' -%token '.' - -%left T_INCLUDE T_INCLUDE_ONCE T_EVAL T_REQUIRE T_REQUIRE_ONCE -%left ',' -%left T_LOGICAL_OR -%left T_LOGICAL_XOR -%left T_LOGICAL_AND -%right T_PRINT -%right T_YIELD -%right T_DOUBLE_ARROW -%right T_YIELD_FROM -%left '=' T_PLUS_EQUAL T_MINUS_EQUAL T_MUL_EQUAL T_DIV_EQUAL T_CONCAT_EQUAL T_MOD_EQUAL T_AND_EQUAL T_OR_EQUAL T_XOR_EQUAL T_SL_EQUAL T_SR_EQUAL T_POW_EQUAL T_COALESCE_EQUAL -%left '?' ':' -%right T_COALESCE -%left T_BOOLEAN_OR -%left T_BOOLEAN_AND -%left '|' -%left '^' -%left '&' -%nonassoc T_IS_EQUAL T_IS_NOT_EQUAL T_IS_IDENTICAL T_IS_NOT_IDENTICAL T_SPACESHIP -%nonassoc '<' T_IS_SMALLER_OR_EQUAL '>' T_IS_GREATER_OR_EQUAL -%left T_SL T_SR -%left '+' '-' '.' -%left '*' '/' '%' -%right '!' -%nonassoc T_INSTANCEOF -%right '~' T_INC T_DEC T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@' -%right T_POW -%right '[' -%nonassoc T_NEW T_CLONE -%left T_NOELSE -%left T_ELSEIF -%left T_ELSE -%left T_ENDIF -%right T_STATIC T_ABSTRACT T_FINAL T_PRIVATE T_PROTECTED T_PUBLIC - -%type is_reference is_variadic returns_ref - -%type reserved_non_modifiers -%type semi_reserved -%type identifier -%type possible_comma -%type case_separator - -%type top_statement name statement function_declaration_statement -%type class_declaration_statement trait_declaration_statement -%type interface_declaration_statement -%type group_use_declaration inline_use_declaration -%type mixed_group_use_declaration use_declaration unprefixed_use_declaration -%type const_decl inner_statement -%type expr optional_expr -%type declare_statement finally_statement unset_variable variable -%type parameter optional_type argument expr_without_variable global_var -%type static_var class_statement trait_adaptation trait_precedence trait_alias -%type absolute_trait_method_reference trait_method_reference property echo_expr -%type new_expr anonymous_class class_name class_name_reference simple_variable -%type internal_functions_in_yacc -%type exit_expr scalar lexical_var function_call member_name property_name -%type variable_class_name dereferencable_scalar constant dereferencable -%type callable_expr callable_variable static_member new_variable -%type encaps_var encaps_var_offset -%type if_stmt -%type alt_if_stmt -%type if_stmt_without_else -%type class_const_decl -%type alt_if_stmt_without_else -%type array_pair possible_array_pair -%type isset_variable type return_type type_expr -%type class_modifier -%type argument_list ctor_arguments -%type trait_adaptations -%type switch_case_list -%type method_body -%type foreach_statement for_statement while_statement -%type inline_function -%type extends_from -%type implements_list -%type interface_extends_list -%type lexical_vars - -%type member_modifier -%type use_type -%type foreach_variable - - -%type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list -%type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list -%type unprefixed_use_declarations inline_use_declarations property_list static_var_list -%type case_list trait_adaptation_list unset_variables -%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list -%type array_pair_list non_empty_argument_list top_statement_list -%type inner_statement_list parameter_list non_empty_parameter_list class_statement_list -%type method_modifiers variable_modifiers -%type non_empty_member_modifiers name_list class_modifiers - -%type backup_doc_comment - -%% - -///////////////////////////////////////////////////////////////////////// - -start: - top_statement_list - { - yylex.(*Parser).rootNode = node.NewRoot($1) - - // save position - yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -reserved_non_modifiers: - T_INCLUDE {$$=$1} | T_INCLUDE_ONCE {$$=$1} | T_EVAL {$$=$1} | T_REQUIRE {$$=$1} | T_REQUIRE_ONCE {$$=$1} | T_LOGICAL_OR {$$=$1} | T_LOGICAL_XOR {$$=$1} | T_LOGICAL_AND {$$=$1} - | T_INSTANCEOF {$$=$1} | T_NEW {$$=$1} | T_CLONE {$$=$1} | T_EXIT {$$=$1} | T_IF {$$=$1} | T_ELSEIF {$$=$1} | T_ELSE {$$=$1} | T_ENDIF {$$=$1} | T_ECHO {$$=$1} | T_DO {$$=$1} | T_WHILE {$$=$1} | T_ENDWHILE {$$=$1} - | T_FOR {$$=$1} | T_ENDFOR {$$=$1} | T_FOREACH {$$=$1} | T_ENDFOREACH {$$=$1} | T_DECLARE {$$=$1} | T_ENDDECLARE {$$=$1} | T_AS {$$=$1} | T_TRY {$$=$1} | T_CATCH {$$=$1} | T_FINALLY {$$=$1} - | T_THROW {$$=$1} | T_USE {$$=$1} | T_INSTEADOF {$$=$1} | T_GLOBAL {$$=$1} | T_VAR {$$=$1} | T_UNSET {$$=$1} | T_ISSET {$$=$1} | T_EMPTY {$$=$1} | T_CONTINUE {$$=$1} | T_GOTO {$$=$1} - | T_FUNCTION {$$=$1} | T_CONST {$$=$1} | T_RETURN {$$=$1} | T_PRINT {$$=$1} | T_YIELD {$$=$1} | T_LIST {$$=$1} | T_SWITCH {$$=$1} | T_ENDSWITCH {$$=$1} | T_CASE {$$=$1} | T_DEFAULT {$$=$1} | T_BREAK {$$=$1} - | T_ARRAY {$$=$1} | T_CALLABLE {$$=$1} | T_EXTENDS {$$=$1} | T_IMPLEMENTS {$$=$1} | T_NAMESPACE {$$=$1} | T_TRAIT {$$=$1} | T_INTERFACE {$$=$1} | T_CLASS {$$=$1} - | T_CLASS_C {$$=$1} | T_TRAIT_C {$$=$1} | T_FUNC_C {$$=$1} | T_METHOD_C {$$=$1} | T_LINE {$$=$1} | T_FILE {$$=$1} | T_DIR {$$=$1} | T_NS_C {$$=$1} | T_FN {$$=$1} -; - -semi_reserved: - reserved_non_modifiers - { - $$ = $1 - } - | T_STATIC {$$=$1} | T_ABSTRACT {$$=$1} | T_FINAL {$$=$1} | T_PRIVATE {$$=$1} | T_PROTECTED {$$=$1} | T_PUBLIC {$$=$1} -; - -identifier: - T_STRING - { - $$ = $1 - } - | semi_reserved - { - $$ = $1 - } -; - -top_statement_list: - top_statement_list top_statement - { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - - if $2 != nil { - $$ = append($1, $2) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -namespace_name: - T_STRING - { - namePart := name.NewNamePart($1.Value) - $$ = []node.Node{namePart} - - // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | namespace_name T_NS_SEPARATOR T_STRING - { - namePart := name.NewNamePart($3.Value) - $$ = append($1, namePart) - - // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -name: - namespace_name - { - $$ = name.NewName($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE T_NS_SEPARATOR namespace_name - { - $$ = name.NewRelative($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name - { - $$ = name.NewFullyQualified($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -top_statement: - error - { - // error - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | interface_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_HALT_COMPILER '(' ')' ';' - { - $$ = stmt.NewHaltCompiler() - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE namespace_name ';' - { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, nil) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE namespace_name '{' top_statement_list '}' - { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NAMESPACE '{' top_statement_list '}' - { - $$ = stmt.NewNamespace(nil, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE mixed_group_use_declaration ';' - { - $$ = $2 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_type group_use_declaration ';' - { - $$ = $3.(*stmt.GroupUse).SetUseType($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_declarations ';' - { - $$ = stmt.NewUseList(nil, $2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE use_type use_declarations ';' - { - $$ = stmt.NewUseList($2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONST const_list ';' - { - $$ = stmt.NewConstList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_type: - T_FUNCTION - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONST - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -group_use_declaration: - namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' - { - name := name.NewName($1) - $$ = stmt.NewGroupUse(nil, name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) - if $5 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' - { - name := name.NewName($2) - $$ = stmt.NewGroupUse(nil, name, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.UseType, $1.FreeFloating) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -mixed_group_use_declaration: - namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' - { - name := name.NewName($1) - $$ = stmt.NewGroupUse(nil, name, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $3.FreeFloating) - if $5 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($5.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' - { - name := name.NewName($2) - $$ = stmt.NewGroupUse(nil, name, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Use, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, $4.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, append($6.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -possible_comma: - /* empty */ - { - $$ = nil - } - | ',' - { - $$ = $1 - } -; - -inline_use_declarations: - inline_use_declarations ',' inline_use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | inline_use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unprefixed_use_declarations: - unprefixed_use_declarations ',' unprefixed_use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | unprefixed_use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_declarations: - use_declarations ',' use_declaration - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | use_declaration - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inline_use_declaration: - unprefixed_use_declaration - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | use_type unprefixed_use_declaration - { - $$ = $2.(*stmt.Use).SetUseType($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unprefixed_use_declaration: - namespace_name - { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | namespace_name T_AS T_STRING - { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -use_declaration: - unprefixed_use_declaration - { - $$ = $1 - - // save coments - yylex.(*Parser).MoveFreeFloating($1.(*stmt.Use).Use, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_SEPARATOR unprefixed_use_declaration - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -const_list: - const_list ',' const_decl - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | const_decl - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inner_statement_list: - inner_statement_list inner_statement - { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - - if $2 != nil { - $$ = append($1, $2) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inner_statement: - error - { - // error - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | interface_declaration_statement - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_HALT_COMPILER '(' ')' ';' - { - $$ = stmt.NewHaltCompiler() - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - -statement: - '{' inner_statement_list '}' - { - $$ = stmt.NewStmtList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_WHILE '(' expr ')' while_statement - { - switch n := $5.(type) { - case *stmt.While : - n.Cond = $3 - case *stmt.AltWhile : - n.Cond = $3 - } - - $$ = $5 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.While, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DO statement T_WHILE '(' expr ')' ';' - { - $$ = stmt.NewDo($2, $5) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.While, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement - { - switch n := $9.(type) { - case *stmt.For : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - case *stmt.AltFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - } - - $$ = $9 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.For, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.InitExpr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CondExpr, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.IncExpr, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_SWITCH '(' expr ')' switch_case_list - { - switch n := $5.(type) { - case *stmt.Switch: - n.Cond = $3 - case *stmt.AltSwitch: - n.Cond = $3 - default: - panic("unexpected node type") - } - - $$ = $5 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Switch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_BREAK optional_expr ';' - { - $$ = stmt.NewBreak($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONTINUE optional_expr ';' - { - $$ = stmt.NewContinue($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_RETURN optional_expr ';' - { - $$ = stmt.NewReturn($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_GLOBAL global_var_list ';' - { - $$ = stmt.NewGlobal($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC static_var_list ';' - { - $$ = stmt.NewStatic($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ECHO echo_expr_list ';' - { - $$ = stmt.NewEcho($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INLINE_HTML - { - $$ = stmt.NewInlineHtml($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr ';' - { - $$ = stmt.NewExpression($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_UNSET '(' unset_variables possible_comma ')' ';' - { - $$ = stmt.NewUnset($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) - if $4 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement - { - switch n := $7.(type) { - case *stmt.Foreach : - n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : - n.Expr = $3 - n.Variable = $5 - } - - $$ = $7 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $6.FreeFloating) - - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement - { - switch n := $9.(type) { - case *stmt.Foreach : - n.Expr = $3 - n.Key = $5 - n.Variable = $7 - case *stmt.AltForeach : - n.Expr = $3 - n.Key = $5 - n.Variable = $7 - } - - $$ = $9 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Key, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DECLARE '(' const_list ')' declare_statement - { - $$ = $5 - $$.(*stmt.Declare).Consts = $3 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Declare, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ';' - { - $$ = stmt.NewNop() - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_TRY '{' inner_statement_list '}' catch_list finally_statement - { - if $6 == nil { - $$ = stmt.NewTry($3, $5, $6) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) - } else { - $$ = stmt.NewTry($3, $5, $6) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) - } - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Try, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_THROW expr ';' - { - $$ = stmt.NewThrow($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_GOTO T_STRING ';' - { - label := node.NewIdentifier($2.Value) - $$ = stmt.NewGoto(label) - - // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(label, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STRING ':' - { - label := node.NewIdentifier($1.Value) - $$ = stmt.NewLabel(label) - - // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - -catch_list: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($5.Value, isDollar)) - variable := expr.NewVariable(identifier) - catch := stmt.NewCatch($4, variable, $8) - $$ = append($1, catch) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($5)) - catch.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9)) - - // save comments - yylex.(*Parser).setFreeFloating(catch, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Catch, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $5.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catch, freefloating.Var, $6.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Cond, $7.FreeFloating) - yylex.(*Parser).setFreeFloating(catch, freefloating.Stmts, $9.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; -catch_name_list: - name - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | catch_name_list '|' name - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -finally_statement: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINALLY '{' inner_statement_list '}' - { - $$ = stmt.NewFinally($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Finally, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unset_variables: - unset_variable - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | unset_variables ',' unset_variable - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -unset_variable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -function_declaration_statement: - T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' - { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewFunction(name, $2 != nil, $6, $8, $10, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) - - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $7.FreeFloating) - if $8 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) - - // normalize - if $8 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -is_reference: - /* empty */ - { - $$ = nil - } - | '&' - { - $$ = $1 - } -; - -is_variadic: - /* empty */ - { - $$ = nil - } - | T_ELLIPSIS - { - $$ = $1 - } -; - -class_declaration_statement: - class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewClass(name, $1, nil, $4, $5, $8, $6) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewClass(name, nil, nil, $3, $4, $7, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_modifiers: - class_modifier - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_modifiers class_modifier - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_modifier: - T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_declaration_statement: - T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewTrait(name, $5, $3) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -interface_declaration_statement: - T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' - { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewInterface(name, $3, $6, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -extends_from: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXTENDS name - { - $$ = stmt.NewClassExtends($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -interface_extends_list: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXTENDS name_list - { - $$ = stmt.NewInterfaceExtends($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -implements_list: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_IMPLEMENTS name_list - { - $$ = stmt.NewClassImplements($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -foreach_variable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' variable - { - $$ = expr.NewReference($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LIST '(' array_pair_list ')' - { - $$ = expr.NewList($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' - { - $$ = expr.NewShortList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save commentsc - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -for_statement: - statement - { - $$ = stmt.NewFor(nil, nil, nil, $1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDFOR ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltFor(nil, nil, nil, stmtList) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -foreach_statement: - statement - { - $$ = stmt.NewForeach(nil, nil, nil, $1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDFOREACH ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -declare_statement: - statement - { - $$ = stmt.NewDeclare(nil, $1, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDDECLARE ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewDeclare(nil, stmtList, true) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -switch_case_list: - '{' case_list '}' - { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' ';' case_list '}' - { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' case_list T_ENDSWITCH ';' - { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewAltSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' ';' case_list T_ENDSWITCH ';' - { - - caseList := stmt.NewCaseList($3) - $$ = stmt.NewAltSwitch(nil, caseList) - - // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -case_list: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | case_list T_CASE expr case_separator inner_statement_list - { - _case := stmt.NewCase($3, $5) - $$ = append($1, _case) - - // save position - _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) - - // save comments - yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, append($4.FreeFloating)) - yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | case_list T_DEFAULT case_separator inner_statement_list - { - _default := stmt.NewDefault($4) - $$ = append($1, _default) - - // save position - _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - - // save comments - yylex.(*Parser).setFreeFloating(_default, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.Default, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -case_separator: - ':' - { - $$ = $1 - } - | ';' - { - $$ = $1 - } -; - -while_statement: - statement - { - $$ = stmt.NewWhile(nil, $1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' inner_statement_list T_ENDWHILE ';' - { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltWhile(nil, stmtList) - - // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -if_stmt_without_else: - T_IF '(' expr ')' statement - { - $$ = stmt.NewIf($3, $5, nil, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt_without_else T_ELSEIF '(' expr ')' statement - { - _elseIf := stmt.NewElseIf($4, $6) - $$ = $1.(*stmt.If).AddElseIf(_elseIf) - - // save position - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -if_stmt: - if_stmt_without_else %prec T_NOELSE - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | if_stmt_without_else T_ELSE statement - { - _else := stmt.NewElse($3) - $$ = $1.(*stmt.If).SetElse(_else) - - // save position - _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -alt_if_stmt_without_else: - T_IF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($6) - $$ = stmt.NewAltIf($3, stmts, nil, nil) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.If, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list - { - stmts := stmt.NewStmtList($7) - _elseIf := stmt.NewAltElseIf($4, stmts) - $$ = $1.(*stmt.AltIf).AddElseIf(_elseIf) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($7)) - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7)) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, $5.FreeFloating) - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $6.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -alt_if_stmt: - alt_if_stmt_without_else T_ENDIF ';' - { - $$ = $1 - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' - { - stmts := stmt.NewStmtList($4) - _else := stmt.NewAltElse(stmts) - $$ = $1.(*stmt.AltIf).SetElse(_else) - - // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - _else.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating(_else, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_else, freefloating.Else, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -parameter_list: - non_empty_parameter_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_parameter_list: - parameter - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_parameter_list ',' parameter - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -parameter: - optional_type is_reference is_variadic T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) - } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - } - - // save comments - if $1 != nil { - yylex.(*Parser).MoveFreeFloating($1, $$) - } - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) - } - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - // normalize - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) - } - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) - } - if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | optional_type is_reference is_variadic T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) - } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) - } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) - } - - // save comments - if $1 != nil { - yylex.(*Parser).MoveFreeFloating($1, $$) - } - if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) - } - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) - - // normalize - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) - } - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) - } - if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -optional_type: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | type_expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -type_expr: - type - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '?' type - { - $$ = node.NewNullable($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -type: - T_ARRAY - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CALLABLE - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -return_type: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | ':' type_expr - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Colon, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -argument_list: - '(' ')' - { - $$ = node.NewArgumentList(nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' non_empty_argument_list possible_comma ')' - { - $$ = node.NewArgumentList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, append($3.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.FreeFloating...)...)) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $4.FreeFloating) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_argument_list: - argument - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_argument_list ',' argument - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -argument: - expr - { - $$ = node.NewArgument($1, false, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ELLIPSIS expr - { - $$ = node.NewArgument($2, true, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -global_var_list: - global_var_list ',' global_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | global_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -global_var: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_var_list: - static_var_list ',' static_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | static_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_var: - T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewStaticVar(variable, nil) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE '=' expr - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewStaticVar(variable, $3) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_statement_list: - class_statement_list class_statement - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_statement: - variable_modifiers optional_type property_list ';' - { - $$ = stmt.NewPropertyList($1, $2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | method_modifiers T_CONST class_const_list ';' - { - $$ = stmt.NewClassConstList($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4)) - - // save comments - if len($1) > 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE name_list trait_adaptations - { - $$ = stmt.NewTraitUse($2, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body - { - name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3 != nil, $7, $9, $10, $5) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - if $1 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10)) - } - - // save comments - if len($1) > 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) - } - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $8.FreeFloating) - if $9 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$9.GetFreeFloating())[freefloating.Colon]); delete((*$9.GetFreeFloating()), freefloating.Colon) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -name_list: - name - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name_list ',' name - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptations: - ';' - { - $$ = stmt.NewNop() - - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) - - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' '}' - { - $$ = stmt.NewTraitAdaptationList(nil) - - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' trait_adaptation_list '}' - { - $$ = stmt.NewTraitAdaptationList($2) - - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptation_list: - trait_adaptation - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_adaptation_list trait_adaptation - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_adaptation: - trait_precedence ';' - { - $$ = $1; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_alias ';' - { - $$ = $1; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_precedence: - absolute_trait_method_reference T_INSTEADOF name_list - { - $$ = stmt.NewTraitUsePrecedence($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_alias: - trait_method_reference T_AS T_STRING - { - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS reserved_non_modifiers - { - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitUseAlias($1, nil, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS member_modifier identifier - { - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewTraitUseAlias($1, $3, alias) - - // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | trait_method_reference T_AS member_modifier - { - $$ = stmt.NewTraitUseAlias($1, $3, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -trait_method_reference: - identifier - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewTraitMethodRef(nil, name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | absolute_trait_method_reference - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -absolute_trait_method_reference: - name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitMethodRef($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -method_body: - ';' /* abstract method */ - { - $$ = stmt.NewNop() - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' inner_statement_list '}' - { - $$ = stmt.NewStmtList($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable_modifiers: - non_empty_member_modifiers - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VAR - { - modifier := node.NewIdentifier($1.Value) - $$ = []node.Node{modifier} - - // save position - modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -method_modifiers: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_member_modifiers - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_member_modifiers: - member_modifier - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_member_modifiers member_modifier - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -member_modifier: - T_PUBLIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PROTECTED - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PRIVATE - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ABSTRACT - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FINAL - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property_list: - property_list ',' property - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | property - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property: - T_VARIABLE backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewProperty(variable, nil, $2) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE '=' expr backup_doc_comment - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewProperty(variable, $3, $4) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_const_list: - class_const_list ',' class_const_decl - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_const_decl - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_const_decl: - identifier '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewConstant(name, $3, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -const_decl: - T_STRING '=' expr backup_doc_comment - { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewConstant(name, $3, $4) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -echo_expr_list: - echo_expr_list ',' echo_expr - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | echo_expr - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -echo_expr: - expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -for_exprs: - /* empty */ - { - $$ = nil; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | non_empty_for_exprs - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_for_exprs: - non_empty_for_exprs ',' expr - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -anonymous_class: - T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' - { - if $2 != nil { - $$ = stmt.NewClass(nil, nil, $2.(*node.ArgumentList), $3, $4, $7, $5) - } else { - $$ = stmt.NewClass(nil, nil, nil, $3, $4, $7, $5) - } - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -new_expr: - T_NEW class_name_reference ctor_arguments - { - if $3 != nil { - $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - } else { - $$ = expr.NewNew($2, nil) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - } - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NEW anonymous_class - { - $$ = expr.NewNew($2, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -expr_without_variable: - T_LIST '(' array_pair_list ')' '=' expr - { - listNode := expr.NewList($3) - $$ = assign.NewAssign(listNode, $6) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' '=' expr - { - shortList := expr.NewShortList($2) - $$ = assign.NewAssign(shortList, $5) - - // save position - shortList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(shortList, freefloating.ArrayPairList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable '=' expr - { - $$ = assign.NewAssign($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable '=' '&' expr - { - $$ = assign.NewReference($1, $4) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLONE expr - { - $$ = expr.NewClone($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_PLUS_EQUAL expr - { - $$ = assign.NewPlus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MINUS_EQUAL expr - { - $$ = assign.NewMinus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MUL_EQUAL expr - { - $$ = assign.NewMul($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_POW_EQUAL expr - { - $$ = assign.NewPow($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_DIV_EQUAL expr - { - $$ = assign.NewDiv($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_CONCAT_EQUAL expr - { - $$ = assign.NewConcat($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_MOD_EQUAL expr - { - $$ = assign.NewMod($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_AND_EQUAL expr - { - $$ = assign.NewBitwiseAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_OR_EQUAL expr - { - $$ = assign.NewBitwiseOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_XOR_EQUAL expr - { - $$ = assign.NewBitwiseXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_SL_EQUAL expr - { - $$ = assign.NewShiftLeft($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_SR_EQUAL expr - { - $$ = assign.NewShiftRight($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_COALESCE_EQUAL expr - { - $$ = assign.NewCoalesce($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_INC - { - $$ = expr.NewPostInc($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INC variable - { - $$ = expr.NewPreInc($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable T_DEC - { - $$ = expr.NewPostDec($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DEC variable - { - $$ = expr.NewPreDec($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_BOOLEAN_OR expr - { - $$ = binary.NewBooleanOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_BOOLEAN_AND expr - { - $$ = binary.NewBooleanAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_OR expr - { - $$ = binary.NewLogicalOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_AND expr - { - $$ = binary.NewLogicalAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_LOGICAL_XOR expr - { - $$ = binary.NewLogicalXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '|' expr - { - $$ = binary.NewBitwiseOr($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '&' expr - { - $$ = binary.NewBitwiseAnd($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '^' expr - { - $$ = binary.NewBitwiseXor($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '.' expr - { - $$ = binary.NewConcat($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '+' expr - { - $$ = binary.NewPlus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '-' expr - { - $$ = binary.NewMinus($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '*' expr - { - $$ = binary.NewMul($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_POW expr - { - $$ = binary.NewPow($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '/' expr - { - $$ = binary.NewDiv($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '%' expr - { - $$ = binary.NewMod($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SL expr - { - $$ = binary.NewShiftLeft($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SR expr - { - $$ = binary.NewShiftRight($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '+' expr %prec T_INC - { - $$ = expr.NewUnaryPlus($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '-' expr %prec T_INC - { - $$ = expr.NewUnaryMinus($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '!' expr - { - $$ = expr.NewBooleanNot($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '~' expr - { - $$ = expr.NewBitwiseNot($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_IDENTICAL expr - { - $$ = binary.NewIdentical($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_NOT_IDENTICAL expr - { - $$ = binary.NewNotIdentical($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_EQUAL expr - { - $$ = binary.NewEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_NOT_EQUAL expr - { - $$ = binary.NewNotEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '<' expr - { - $$ = binary.NewSmaller($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_SMALLER_OR_EQUAL expr - { - $$ = binary.NewSmallerOrEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '>' expr - { - $$ = binary.NewGreater($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_IS_GREATER_OR_EQUAL expr - { - $$ = binary.NewGreaterOrEqual($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_SPACESHIP expr - { - $$ = binary.NewSpaceship($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_INSTANCEOF class_name_reference - { - $$ = expr.NewInstanceOf($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '?' expr ':' expr - { - $$ = expr.NewTernary($1, $3, $5) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr '?' ':' expr - { - $$ = expr.NewTernary($1, nil, $4) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_COALESCE expr - { - $$ = binary.NewCoalesce($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | internal_functions_in_yacc - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INT_CAST expr - { - $$ = cast.NewInt($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOUBLE_CAST expr - { - $$ = cast.NewDouble($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STRING_CAST expr - { - $$ = cast.NewString($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ARRAY_CAST expr - { - $$ = cast.NewArray($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_OBJECT_CAST expr - { - $$ = cast.NewObject($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_BOOL_CAST expr - { - $$ = cast.NewBool($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_UNSET_CAST expr - { - $$ = cast.NewUnset($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EXIT exit_expr - { - var e *expr.Exit; - if $2 != nil { - e = $2.(*expr.Exit) - } else { - e = expr.NewExit(nil) - } - - $$ = e - - if (strings.EqualFold($1.Value, "die")) { - e.Die = true - } - - // save position - if $2 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - } - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '@' expr - { - $$ = expr.NewErrorSuppress($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '`' backticks_expr '`' - { - $$ = expr.NewShellExec($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_PRINT expr - { - $$ = expr.NewPrint($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD - { - $$ = expr.NewYield(nil, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD expr - { - $$ = expr.NewYield(nil, $2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD expr T_DOUBLE_ARROW expr - { - $$ = expr.NewYield($2, $4) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_YIELD_FROM expr - { - $$ = expr.NewYieldFrom($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | inline_function - { - $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_STATIC inline_function - { - $$ = $2; - - switch n := $$.(type) { - case *expr.Closure : - n.Static = true; - case *expr.ArrowFunction : - n.Static = true; - }; - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Static, (*$$.GetFreeFloating())[freefloating.Start]); delete((*$$.GetFreeFloating()), freefloating.Start) - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating); - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -inline_function: - T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' - { - $$ = expr.NewClosure($5, $7, $8, $10, false, $2 != nil, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) - if $8 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$8.GetFreeFloating())[freefloating.Colon]); delete((*$8.GetFreeFloating()), freefloating.Colon) - } - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $9.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $11.FreeFloating) - - // normalize - if $8 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - } - if $7 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVarList]); delete((*$$.GetFreeFloating()), freefloating.LexicalVarList) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr - { - $$ = expr.NewArrowFunction($4, $6, $9, false, $2 != nil, $7) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) - }; - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $5.FreeFloating) - if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$6.GetFreeFloating())[freefloating.Colon]); delete((*$6.GetFreeFloating()), freefloating.Colon) - }; - yylex.(*Parser).setFreeFloating($$, freefloating.ReturnType, $8.FreeFloating) - - // normalize - if $6 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.ReturnType]); delete((*$$.GetFreeFloating()), freefloating.ReturnType) - }; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -backup_doc_comment: - /* empty */ - { - $$ = yylex.(*Parser).Lexer.GetPhpDocComment() - yylex.(*Parser).Lexer.SetPhpDocComment("") - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -returns_ref: - /* empty */ - { - $$ = nil - } - | '&' - { - $$ = $1 - } -; - -lexical_vars: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_USE '(' lexical_var_list ')' - { - $$ = expr.NewClosureUse($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Use, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVarList, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -lexical_var_list: - lexical_var_list ',' lexical_var - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | lexical_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -lexical_var: - T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($2.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = expr.NewReference(variable) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -function_call: - name argument_list - { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list - { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | callable_expr argument_list - { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_name: - T_STATIC - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -class_name_reference: - class_name - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -exit_expr: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' optional_expr ')' - { - $$ = expr.NewExit($2); - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -backticks_expr: - /* empty */ - { - $$ = []node.Node{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ENCAPSED_AND_WHITESPACE - { - part := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{part} - - // save position - part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -ctor_arguments: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | argument_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -dereferencable_scalar: - T_ARRAY '(' array_pair_list ')' - { - $$ = expr.NewArray($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '[' array_pair_list ']' - { - $$ = expr.NewShortArray($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CONSTANT_ENCAPSED_STRING - { - $$ = scalar.NewString($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -scalar: - T_LNUMBER - { - $$ = scalar.NewLnumber($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DNUMBER - { - $$ = scalar.NewDnumber($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LINE - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FILE - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DIR - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_TRAIT_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_METHOD_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_FUNC_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NS_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CLASS_C - { - $$ = scalar.NewMagicConstant($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC - { - encapsed := scalar.NewEncapsedStringPart($2.Value) - $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_START_HEREDOC T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, nil) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '"' encaps_list '"' - { - $$ = scalar.NewEncapsed($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_START_HEREDOC encaps_list T_END_HEREDOC - { - $$ = scalar.NewHeredoc($1.Value, $2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | constant - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -constant: - name - { - $$ = expr.NewConstFetch($1) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier - { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - - // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -expr: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr_without_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -optional_expr: - /* empty */ - { - $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable_class_name: - dereferencable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -dereferencable: - variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -callable_expr: - callable_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '(' expr ')' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable_scalar - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -callable_variable: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | constant '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable T_OBJECT_OPERATOR property_name argument_list - { - $$ = expr.NewMethodCall($1, $3, $4.(*node.ArgumentList)) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | function_call - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -variable: - callable_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | static_member - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | dereferencable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -simple_variable: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '$' '{' expr '}' - { - $$ = expr.NewVariable($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '$' simple_variable - { - $$ = expr.NewVariable($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -static_member: - class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -new_variable: - simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable '[' optional_expr ']' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable '{' expr '}' - { - $$ = expr.NewArrayDimFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable T_OBJECT_OPERATOR property_name - { - $$ = expr.NewPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable - { - $$ = expr.NewStaticPropertyFetch($1, $3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -member_name: - identifier - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' expr '}' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -property_name: - T_STRING - { - $$ = node.NewIdentifier($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '{' expr '}' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | simple_variable - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -array_pair_list: - non_empty_array_pair_list - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -possible_array_pair: - /* empty */ - { - $$ = expr.NewArrayItem(nil, nil, false) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | array_pair - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -non_empty_array_pair_list: - non_empty_array_pair_list ',' possible_array_pair - { - if len($1) == 0 { - $1 = []node.Node{expr.NewArrayItem(nil, nil, false)} - } - - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | possible_array_pair - { - if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { - $$ = []node.Node{} - } else { - $$ = []node.Node{$1} - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -array_pair: - expr T_DOUBLE_ARROW expr - { - $$ = expr.NewArrayItem($1, $3, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr - { - $$ = expr.NewArrayItem(nil, $1, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_DOUBLE_ARROW '&' variable - { - reference := expr.NewReference($4) - $$ = expr.NewArrayItem($1, reference, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '&' variable - { - reference := expr.NewReference($2) - $$ = expr.NewArrayItem(nil, reference, false) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ELLIPSIS expr - { - $$ = expr.NewArrayItem(nil, $2, true) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' - { - // TODO: Cannot use list() as standalone expression - listNode := expr.NewList($5) - $$ = expr.NewArrayItem($1, listNode, false) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6)) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $6.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_LIST '(' array_pair_list ')' - { - // TODO: Cannot use list() as standalone expression - listNode := expr.NewList($3) - $$ = expr.NewArrayItem(nil, listNode, false) - - // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_list: - encaps_list encaps_var - { - $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_list T_ENCAPSED_AND_WHITESPACE - { - encapsed := scalar.NewEncapsedStringPart($2.Value) - $$ = append($1, encapsed) - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | encaps_var - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_ENCAPSED_AND_WHITESPACE encaps_var - { - encapsed := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{encapsed, $2} - - // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_var: - T_VARIABLE - { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE '[' encaps_var_offset ']' - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $3) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE T_OBJECT_OPERATOR T_STRING - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - fetch := node.NewIdentifier($3.Value) - $$ = expr.NewPropertyFetch(variable, fetch) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOLLAR_OPEN_CURLY_BRACES expr '}' - { - variable := expr.NewVariable($2) - - $$ = variable - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' - { - name := node.NewIdentifier($2.Value) - variable := expr.NewVariable(name) - - $$ = variable - - // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - { - identifier := node.NewIdentifier($2.Value) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $4) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($5.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($6.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($6)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_CURLY_OPEN variable '}' - { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -encaps_var_offset: - T_STRING - { - $$ = scalar.NewString($1.Value) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_NUM_STRING - { - // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi($1.Value); err == nil { - $$ = scalar.NewLnumber($1.Value) - } else { - $$ = scalar.NewString($1.Value) - } - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | '-' T_NUM_STRING - { - var lnumber *scalar.Lnumber - // TODO: add option to handle 64 bit integer - _, err := strconv.Atoi($2.Value); - isInt := err == nil - - if isInt { - lnumber = scalar.NewLnumber($2.Value) - $$ = expr.NewUnaryMinus(lnumber) - } else { - $2.Value = "-"+$2.Value - $$ = scalar.NewString($2.Value) - } - - // save position - if isInt { - lnumber.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_VARIABLE - { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) - - // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -internal_functions_in_yacc: - T_ISSET '(' isset_variables possible_comma ')' - { - $$ = expr.NewIsset($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) - if $4 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $5.FreeFloating) - } else { - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, append($4.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.FreeFloating...)...)) - } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EMPTY '(' expr ')' - { - $$ = expr.NewEmpty($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INCLUDE expr - { - $$ = expr.NewInclude($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_INCLUDE_ONCE expr - { - $$ = expr.NewIncludeOnce($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_EVAL '(' expr ')' - { - $$ = expr.NewEval($3) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Eval, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_REQUIRE expr - { - $$ = expr.NewRequire($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | T_REQUIRE_ONCE expr - { - $$ = expr.NewRequireOnce($2) - - // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - - // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -isset_variables: - isset_variable - { - $$ = []node.Node{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } - | isset_variables ',' isset_variable - { - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -isset_variable: - expr - { - $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } -; - -///////////////////////////////////////////////////////////////////////// - -%% diff --git a/php7/php7_test.go b/php7/php7_test.go deleted file mode 100644 index 32b79c7..0000000 --- a/php7/php7_test.go +++ /dev/null @@ -1,16450 +0,0 @@ -package php7_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/position" -) - -func TestPhp7(t *testing.T) { - src := `bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - /** anonymous class */ - new class ($a, ...$b) {}; - new class {}; - new $foo; - new $foo[1]; - new $foo{$bar}; - new $foo->bar; - new $foo::$bar; - new static::$bar; - - function foo(?bar $bar=null, baz &...$baz) {} - class foo {public function foo(?bar $bar=null, baz &...$baz) {}} - function(?bar $bar=null, baz &...$baz) {}; - static function(?bar $bar=null, baz &...$baz) {}; - - 1234567890123456789; - 12345678901234567890; - 0.; - 0b0111111111111111111111111111111111111111111111111111111111111111; - 0b1111111111111111111111111111111111111111111111111111111111111111; - 0x007111111111111111; - 0x8111111111111111; - __CLASS__; - __DIR__; - __FILE__; - __FUNCTION__; - __LINE__; - __NAMESPACE__; - __METHOD__; - __TRAIT__; - - "test $var"; - "test $var[1]"; - "test $var[-1]"; - "test $var[1234567890123456789012345678901234567890]"; - "test $var[-1234567890123456789012345678901234567890]"; - "test $var[bar]"; - "test $var[$bar]"; - "$foo $bar"; - "test $foo->bar()"; - "test ${foo}"; - "test ${foo[0]}"; - "test ${$foo}"; - "test {$foo->bar()}"; - - if ($a) : - endif; - if ($a) : - elseif ($b): - endif; - if ($a) : - else: - endif; - if ($a) : - elseif ($b): - elseif ($c): - else: - endif; - - while (1) { break; } - while (1) { break 2; } - while (1) : break(3); endwhile; - class foo{ public const FOO = 1, BAR = 2; } - class foo{ const FOO = 1, BAR = 2; } - class foo{ function bar() {} } - class foo{ public static function &bar() {} } - class foo{ public static function &bar(): void {} } - abstract class foo{ } - final class foo extends bar { } - final class foo implements bar { } - final class foo implements bar, baz { } - new class() extends foo implements bar, baz { }; - - const FOO = 1, BAR = 2; - while (1) { continue; } - while (1) { continue 2; } - while (1) { continue(3); } - declare(ticks=1); - declare(ticks=1) {} - declare(ticks=1): enddeclare; - do {} while(1); - echo $a, 1; - echo($a); - for($i = 0; $i < 10; $i++, $i++) {} - for(; $i < 10; $i++, $i++) : endfor; - foreach ($a as $v) {} - foreach ($a as $v) : endforeach; - foreach ($a as $k => $v) {} - foreach ($a as $k => &$v) {} - foreach ($a as $k => list($v)) {} - foreach ($a as $k => [$v]) {} - function foo() {} - function foo() {return;} - function &foo() {return 1;} - function &foo(): void {} - global $a, $b; - a: - goto a; - if ($a) {} - if ($a) {} elseif ($b) {} - if ($a) {} else {} - if ($a) {} elseif ($b) {} elseif ($c) {} else {} - if ($a) {} elseif ($b) {} else if ($c) {} else {} - ?>
1, &$b,); - ~$a; - !$a; - - Foo::Bar; - $foo::Bar; - clone($a); - clone $a; - function(){}; - function($a, $b) use ($c, &$d) {}; - function(): void {}; - foo; - namespace\foo; - \foo; - - empty($a); - @$a; - eval($a); - exit; - exit($a); - die; - die($a); - foo(); - namespace\foo(); - \foo(); - $foo(); - - $a--; - $a++; - --$a; - ++$a; - - include $a; - include_once $a; - require $a; - require_once $a; - - $a instanceof Foo; - $a instanceof namespace\Foo; - $a instanceof \Foo; - - isset($a, $b); - list($a) = $b; - list($a[]) = $b; - list(list($a)) = $b; - - $a->foo(); - new Foo(); - new namespace\Foo(); - new \Foo(); - new class ($a, ...$b) {}; - print($a); - $a->foo; - ` + "`cmd $a`;" + ` - ` + "`cmd`;" + ` - ` + "``;" + ` - []; - [1]; - [1=>1, &$b,]; - - [$a] = $b; - [$a[]] = $b; - [list($a)] = $b; - Foo::bar(); - namespace\Foo::bar(); - \Foo::bar(); - Foo::$bar; - $foo::$bar; - namespace\Foo::$bar; - \Foo::$bar; - $a ? $b : $c; - $a ? : $c; - $a ? $b ? $c : $d : $e; - $a ? $b : $c ? $d : $e; - -$a; - +$a; - $$a; - yield; - yield $a; - yield $a => $b; - yield from $a; - - (array)$a; - (boolean)$a; - (bool)$a; - (double)$a; - (float)$a; - (integer)$a; - (int)$a; - (object)$a; - (string)$a; - (unset)$a; - - $a & $b; - $a | $b; - $a ^ $b; - $a && $b; - $a || $b; - $a ?? $b; - $a . $b; - $a / $b; - $a == $b; - $a >= $b; - $a > $b; - $a === $b; - $a and $b; - $a or $b; - $a xor $b; - $a - $b; - $a % $b; - $a * $b; - $a != $b; - $a !== $b; - $a + $b; - $a ** $b; - $a << $b; - $a >> $b; - $a <= $b; - $a < $b; - $a <=> $b; - - $a =& $b; - $a = $b; - $a &= $b; - $a |= $b; - $a ^= $b; - $a .= $b; - $a /= $b; - $a -= $b; - $a %= $b; - $a *= $b; - $a += $b; - $a **= $b; - $a <<= $b; - $a >>= $b; - - class foo {public function class() {} } - \foo\bar(); - - function foo(&$a, ...$b) { - - function bar() {} - class Baz {} - trait Quux{} - interface Quuux {} - } - - function foo(&$a = 1, ...$b = 1, $c = 1) {} - function foo(array $a, callable $b) {} - abstract final class foo { abstract protected static function bar(); final private function baz() {} } - - (new Foo)->bar; - (new Foo)(); - [$foo][0](); - foo[1](); - "foo"(); - [1]{$foo}(); - ${foo()}; - - Foo::$bar(); - Foo::{$bar[0]}(); - - $foo->$bar; - $foo->{$bar[0]}; - - [1=>&$a, 2=>list($b)]; - - __halt_compiler(); - - parsing process must be terminated - ` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 348, - StartPos: 5, - EndPos: 6319, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 20, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 19, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 8, - EndPos: 19, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 13, - EndPos: 18, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 16, - EndPos: 18, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 16, - EndPos: 18, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 39, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 38, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 27, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 27, - }, - Value: "foo", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 27, - EndPos: 38, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 30, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 32, - EndPos: 37, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 35, - EndPos: 37, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 35, - EndPos: 37, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 63, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 62, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 46, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 46, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 48, - EndPos: 51, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 51, - EndPos: 62, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 54, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 56, - EndPos: 61, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 59, - EndPos: 61, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 59, - EndPos: 61, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 86, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 85, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, - }, - Value: "foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 74, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 85, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 79, - EndPos: 84, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 82, - EndPos: 84, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 82, - EndPos: 84, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 110, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 109, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 93, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 93, - }, - Value: "foo", - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 95, - EndPos: 98, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 98, - EndPos: 109, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 101, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 103, - EndPos: 108, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 106, - EndPos: 108, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 106, - EndPos: 108, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 132, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 131, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 120, - EndPos: 131, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 125, - EndPos: 130, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 128, - EndPos: 130, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 128, - EndPos: 130, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 160, - EndPos: 185, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 160, - EndPos: 184, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 184, - }, - PhpDocComment: "/** anonymous class */", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 170, - EndPos: 181, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 173, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 175, - EndPos: 180, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 178, - EndPos: 180, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 178, - EndPos: 180, - }, - Value: "b", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 188, - EndPos: 201, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 188, - EndPos: 200, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 192, - EndPos: 200, - }, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 204, - EndPos: 213, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 204, - EndPos: 212, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 208, - EndPos: 212, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 208, - EndPos: 212, - }, - Value: "foo", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 216, - EndPos: 228, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 216, - EndPos: 227, - }, - Class: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 227, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 224, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 220, - EndPos: 224, - }, - Value: "foo", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 225, - EndPos: 226, - }, - Value: "1", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 231, - EndPos: 246, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 231, - EndPos: 245, - }, - Class: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 245, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 239, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 235, - EndPos: 239, - }, - Value: "foo", - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 240, - EndPos: 244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 240, - EndPos: 244, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 249, - EndPos: 263, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 249, - EndPos: 262, - }, - Class: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 262, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 257, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 253, - EndPos: 257, - }, - Value: "foo", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 259, - EndPos: 262, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 266, - EndPos: 281, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 266, - EndPos: 280, - }, - Class: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 280, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 274, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 270, - EndPos: 274, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 276, - EndPos: 280, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 276, - EndPos: 280, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 284, - EndPos: 301, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 284, - EndPos: 300, - }, - Class: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 288, - EndPos: 300, - }, - Class: &node.Identifier{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 288, - EndPos: 294, - }, - Value: "static", - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 296, - EndPos: 300, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 296, - EndPos: 300, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 305, - EndPos: 350, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 314, - EndPos: 317, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 318, - EndPos: 332, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 318, - EndPos: 322, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 319, - EndPos: 322, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 323, - EndPos: 327, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 323, - EndPos: 327, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 328, - EndPos: 332, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 346, - }, - Variadic: true, - ByRef: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 337, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 334, - EndPos: 337, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 342, - EndPos: 346, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 342, - EndPos: 346, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 353, - EndPos: 417, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 359, - EndPos: 362, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 364, - EndPos: 416, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 380, - EndPos: 383, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 364, - EndPos: 370, - }, - Value: "public", - }, - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 384, - EndPos: 398, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 384, - EndPos: 388, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 385, - EndPos: 388, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 389, - EndPos: 393, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 389, - EndPos: 393, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 394, - EndPos: 398, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 412, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 403, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 400, - EndPos: 403, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 408, - EndPos: 412, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 408, - EndPos: 412, - }, - Value: "baz", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 414, - EndPos: 416, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 420, - EndPos: 462, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 420, - EndPos: 461, - }, - PhpDocComment: "", - ReturnsRef: false, - Static: false, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 429, - EndPos: 443, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 429, - EndPos: 433, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 430, - EndPos: 433, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 434, - EndPos: 438, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 434, - EndPos: 438, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 439, - EndPos: 443, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 457, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 448, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 445, - EndPos: 448, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 453, - EndPos: 457, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 453, - EndPos: 457, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 465, - EndPos: 514, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 465, - EndPos: 513, - }, - PhpDocComment: "", - ReturnsRef: false, - Static: true, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 481, - EndPos: 495, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Nullable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 481, - EndPos: 485, - }, - Expr: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 482, - EndPos: 485, - }, - Value: "bar", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 486, - EndPos: 490, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 486, - EndPos: 490, - }, - Value: "bar", - }, - }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 491, - EndPos: 495, - }, - Value: "null", - }, - }, - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 509, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 500, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 497, - EndPos: 500, - }, - Value: "baz", - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 505, - EndPos: 509, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 505, - EndPos: 509, - }, - Value: "baz", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 518, - EndPos: 538, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 518, - EndPos: 537, - }, - Value: "1234567890123456789", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 541, - EndPos: 562, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 541, - EndPos: 561, - }, - Value: "12345678901234567890", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 565, - EndPos: 568, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 565, - EndPos: 567, - }, - Value: "0.", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 571, - EndPos: 638, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 571, - EndPos: 637, - }, - Value: "0b0111111111111111111111111111111111111111111111111111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 641, - EndPos: 708, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 641, - EndPos: 707, - }, - Value: "0b1111111111111111111111111111111111111111111111111111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 711, - EndPos: 732, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 711, - EndPos: 731, - }, - Value: "0x007111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 735, - EndPos: 754, - }, - Expr: &scalar.Dnumber{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 735, - EndPos: 753, - }, - Value: "0x8111111111111111", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 757, - EndPos: 767, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 757, - EndPos: 766, - }, - Value: "__CLASS__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 770, - EndPos: 778, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 770, - EndPos: 777, - }, - Value: "__DIR__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 781, - EndPos: 790, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 781, - EndPos: 789, - }, - Value: "__FILE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 793, - EndPos: 806, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 793, - EndPos: 805, - }, - Value: "__FUNCTION__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 818, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 817, - }, - Value: "__LINE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 821, - EndPos: 835, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 821, - EndPos: 834, - }, - Value: "__NAMESPACE__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 838, - EndPos: 849, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 838, - EndPos: 848, - }, - Value: "__METHOD__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 852, - EndPos: 862, - }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 852, - EndPos: 861, - }, - Value: "__TRAIT__", - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 866, - EndPos: 878, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 866, - EndPos: 877, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 867, - EndPos: 872, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 872, - EndPos: 876, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 872, - EndPos: 876, - }, - Value: "var", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 881, - EndPos: 896, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 881, - EndPos: 895, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 882, - EndPos: 887, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 894, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 891, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 887, - EndPos: 891, - }, - Value: "var", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 892, - EndPos: 893, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 899, - EndPos: 915, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 899, - EndPos: 914, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 900, - EndPos: 905, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 913, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 909, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 905, - EndPos: 909, - }, - Value: "var", - }, - }, - Dim: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 910, - EndPos: 912, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 910, - EndPos: 912, - }, - Value: "1", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 918, - EndPos: 972, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 918, - EndPos: 971, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 919, - EndPos: 924, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 970, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 928, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 924, - EndPos: 928, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 929, - EndPos: 969, - }, - Value: "1234567890123456789012345678901234567890", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 975, - EndPos: 1030, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 975, - EndPos: 1029, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 976, - EndPos: 981, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 1028, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 985, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 981, - EndPos: 985, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 986, - EndPos: 1027, - }, - Value: "-1234567890123456789012345678901234567890", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1033, - EndPos: 1050, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1033, - EndPos: 1049, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1034, - EndPos: 1039, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1048, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1043, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1039, - EndPos: 1043, - }, - Value: "var", - }, - }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 1044, - EndPos: 1047, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1053, - EndPos: 1071, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1053, - EndPos: 1070, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1054, - EndPos: 1059, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1069, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1063, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1059, - EndPos: 1063, - }, - Value: "var", - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1064, - EndPos: 1068, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 1064, - EndPos: 1068, - }, - Value: "bar", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1074, - EndPos: 1086, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1074, - EndPos: 1085, - }, - Parts: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1079, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1075, - EndPos: 1079, - }, - Value: "foo", - }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1079, - EndPos: 1080, - }, - Value: " ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1084, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 1080, - EndPos: 1084, - }, - Value: "bar", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1089, - EndPos: 1108, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1089, - EndPos: 1107, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1090, - EndPos: 1095, - }, - Value: "test ", - }, - &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1104, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1099, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1095, - EndPos: 1099, - }, - Value: "foo", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1101, - EndPos: 1104, - }, - Value: "bar", - }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1104, - EndPos: 1106, - }, - Value: "()", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1111, - EndPos: 1125, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1111, - EndPos: 1124, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1112, - EndPos: 1117, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1117, - EndPos: 1123, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1119, - EndPos: 1122, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1128, - EndPos: 1145, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1128, - EndPos: 1144, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1129, - EndPos: 1134, - }, - Value: "test ", - }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1134, - EndPos: 1143, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1136, - EndPos: 1139, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1136, - EndPos: 1139, - }, - Value: "foo", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1140, - EndPos: 1141, - }, - Value: "0", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1148, - EndPos: 1163, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1148, - EndPos: 1162, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1149, - EndPos: 1154, - }, - Value: "test ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1154, - EndPos: 1161, - }, - VarName: &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1156, - EndPos: 1160, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1156, - EndPos: 1160, - }, - Value: "foo", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1166, - EndPos: 1187, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1166, - EndPos: 1186, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1167, - EndPos: 1172, - }, - Value: "test ", - }, - &expr.MethodCall{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1184, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1177, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1173, - EndPos: 1177, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1179, - EndPos: 1182, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1182, - EndPos: 1184, - }, - }, - }, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 53, - EndLine: 54, - StartPos: 1191, - EndPos: 1209, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1195, - EndPos: 1197, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1195, - EndPos: 1197, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 55, - EndLine: 57, - StartPos: 1212, - EndPos: 1245, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1216, - EndPos: 1218, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1216, - EndPos: 1218, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 56, - EndLine: -1, - StartPos: 1224, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1232, - EndPos: 1234, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1232, - EndPos: 1234, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 58, - EndLine: 60, - StartPos: 1248, - EndPos: 1274, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1252, - EndPos: 1254, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1252, - EndPos: 1254, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 59, - EndLine: -1, - StartPos: 1260, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 61, - EndLine: 65, - StartPos: 1277, - EndPos: 1333, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1281, - EndPos: 1283, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1281, - EndPos: 1283, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 62, - EndLine: -1, - StartPos: 1289, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1297, - EndPos: 1299, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1297, - EndPos: 1299, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 63, - EndLine: -1, - StartPos: 1304, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1314, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1314, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 64, - EndLine: -1, - StartPos: 1319, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1337, - EndPos: 1357, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1344, - EndPos: 1345, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1347, - EndPos: 1357, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1349, - EndPos: 1355, - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1360, - EndPos: 1382, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1367, - EndPos: 1368, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1370, - EndPos: 1382, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1372, - EndPos: 1380, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1378, - EndPos: 1379, - }, - Value: "2", - }, - }, - }, - }, - }, - &stmt.AltWhile{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1385, - EndPos: 1416, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1392, - EndPos: 1393, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1397, - EndPos: 1406, - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1397, - EndPos: 1406, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1403, - EndPos: 1404, - }, - Value: "3", - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1419, - EndPos: 1462, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1425, - EndPos: 1428, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1430, - EndPos: 1460, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1430, - EndPos: 1436, - }, - Value: "public", - }, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1443, - EndPos: 1450, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1443, - EndPos: 1446, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1449, - EndPos: 1450, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1452, - EndPos: 1459, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1452, - EndPos: 1455, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1458, - EndPos: 1459, - }, - Value: "2", - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1465, - EndPos: 1501, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1471, - EndPos: 1474, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1476, - EndPos: 1499, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1482, - EndPos: 1489, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1482, - EndPos: 1485, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1488, - EndPos: 1489, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1491, - EndPos: 1498, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1491, - EndPos: 1494, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1497, - EndPos: 1498, - }, - Value: "2", - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1504, - EndPos: 1534, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1510, - EndPos: 1513, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1515, - EndPos: 1532, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1524, - EndPos: 1527, - }, - Value: "bar", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1530, - EndPos: 1532, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1537, - EndPos: 1582, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1543, - EndPos: 1546, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1548, - EndPos: 1580, - }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1572, - EndPos: 1575, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1548, - EndPos: 1554, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1555, - EndPos: 1561, - }, - Value: "static", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1578, - EndPos: 1580, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1585, - EndPos: 1636, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1591, - EndPos: 1594, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1596, - EndPos: 1634, - }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1620, - EndPos: 1623, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1596, - EndPos: 1602, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1603, - EndPos: 1609, - }, - Value: "static", - }, - }, - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1627, - EndPos: 1631, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1627, - EndPos: 1631, - }, - Value: "void", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1632, - EndPos: 1634, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1639, - EndPos: 1660, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1654, - EndPos: 1657, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1639, - EndPos: 1647, - }, - Value: "abstract", - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1663, - EndPos: 1694, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1675, - EndPos: 1678, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1663, - EndPos: 1668, - }, - Value: "final", - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1679, - EndPos: 1690, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1687, - EndPos: 1690, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1687, - EndPos: 1690, - }, - Value: "bar", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1697, - EndPos: 1731, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1709, - EndPos: 1712, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1697, - EndPos: 1702, - }, - Value: "final", - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1713, - EndPos: 1727, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1724, - EndPos: 1727, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1724, - EndPos: 1727, - }, - Value: "bar", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1734, - EndPos: 1773, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1746, - EndPos: 1749, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1734, - EndPos: 1739, - }, - Value: "final", - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1750, - EndPos: 1769, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1761, - EndPos: 1764, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1761, - EndPos: 1764, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1766, - EndPos: 1769, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1766, - EndPos: 1769, - }, - Value: "baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1776, - EndPos: 1824, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1776, - EndPos: 1823, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1780, - EndPos: 1823, - }, - PhpDocComment: "", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1785, - EndPos: 1787, - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1788, - EndPos: 1799, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1796, - EndPos: 1799, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1796, - EndPos: 1799, - }, - Value: "foo", - }, - }, - }, - }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1800, - EndPos: 1819, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1811, - EndPos: 1814, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1811, - EndPos: 1814, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1816, - EndPos: 1819, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1816, - EndPos: 1819, - }, - Value: "baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.ConstList{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1828, - EndPos: 1851, - }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1834, - EndPos: 1841, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1834, - EndPos: 1837, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1840, - EndPos: 1841, - }, - Value: "1", - }, - }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1843, - EndPos: 1850, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1843, - EndPos: 1846, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1849, - EndPos: 1850, - }, - Value: "2", - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1854, - EndPos: 1877, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1861, - EndPos: 1862, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1864, - EndPos: 1877, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1866, - EndPos: 1875, - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1880, - EndPos: 1905, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1887, - EndPos: 1888, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1890, - EndPos: 1905, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1892, - EndPos: 1903, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1901, - EndPos: 1902, - }, - Value: "2", - }, - }, - }, - }, - }, - &stmt.While{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1908, - EndPos: 1934, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1915, - EndPos: 1916, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1918, - EndPos: 1934, - }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1920, - EndPos: 1932, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1929, - EndPos: 1930, - }, - Value: "3", - }, - }, - }, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1937, - EndPos: 1954, - }, - Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1945, - EndPos: 1952, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1945, - EndPos: 1950, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1951, - EndPos: 1952, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1953, - EndPos: 1954, - }, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1957, - EndPos: 1976, - }, - Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1965, - EndPos: 1972, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1965, - EndPos: 1970, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1971, - EndPos: 1972, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1974, - EndPos: 1976, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1979, - EndPos: 2008, - }, - Alt: true, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1987, - EndPos: 1994, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1987, - EndPos: 1992, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1993, - EndPos: 1994, - }, - Value: "1", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Do{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2011, - EndPos: 2026, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2014, - EndPos: 2016, - }, - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 2023, - EndPos: 2024, - }, - Value: "1", - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2029, - EndPos: 2040, - }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2034, - EndPos: 2036, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2034, - EndPos: 2036, - }, - Value: "a", - }, - }, - &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2038, - EndPos: 2039, - }, - Value: "1", - }, - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2043, - EndPos: 2052, - }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2048, - EndPos: 2050, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2048, - EndPos: 2050, - }, - Value: "a", - }, - }, - }, - }, - &stmt.For{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2055, - EndPos: 2090, - }, - Init: []node.Node{ - &assign.Assign{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2065, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2061, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2059, - EndPos: 2061, - }, - Value: "i", - }, - }, - Expression: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2064, - EndPos: 2065, - }, - Value: "0", - }, - }, - }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2074, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2069, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2067, - EndPos: 2069, - }, - Value: "i", - }, - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2072, - EndPos: 2074, - }, - Value: "10", - }, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2080, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2078, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2076, - EndPos: 2078, - }, - Value: "i", - }, - }, - }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2086, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2084, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2082, - EndPos: 2084, - }, - Value: "i", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2088, - EndPos: 2090, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltFor{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2093, - EndPos: 2129, - }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2106, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2101, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2099, - EndPos: 2101, - }, - Value: "i", - }, - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2104, - EndPos: 2106, - }, - Value: "10", - }, - }, - }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2112, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2110, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2108, - EndPos: 2110, - }, - Value: "i", - }, - }, - }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2118, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2116, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 2114, - EndPos: 2116, - }, - Value: "i", - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2132, - EndPos: 2153, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2141, - EndPos: 2143, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2141, - EndPos: 2143, - }, - Value: "a", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2147, - EndPos: 2149, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2147, - EndPos: 2149, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 2151, - EndPos: 2153, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltForeach{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2156, - EndPos: 2188, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2165, - EndPos: 2167, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2165, - EndPos: 2167, - }, - Value: "a", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2171, - EndPos: 2173, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2171, - EndPos: 2173, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2191, - EndPos: 2218, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2200, - EndPos: 2202, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2200, - EndPos: 2202, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2206, - EndPos: 2208, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2206, - EndPos: 2208, - }, - Value: "k", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2212, - EndPos: 2214, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2212, - EndPos: 2214, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2216, - EndPos: 2218, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2221, - EndPos: 2249, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2230, - EndPos: 2232, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2230, - EndPos: 2232, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2236, - EndPos: 2238, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2236, - EndPos: 2238, - }, - Value: "k", - }, - }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2242, - EndPos: 2245, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2243, - EndPos: 2245, - }, - Value: "v", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2247, - EndPos: 2249, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2252, - EndPos: 2285, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2261, - EndPos: 2263, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2261, - EndPos: 2263, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2267, - EndPos: 2269, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2267, - EndPos: 2269, - }, - Value: "k", - }, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2273, - EndPos: 2281, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2278, - EndPos: 2280, - }, - Value: "v", - }, - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2283, - EndPos: 2285, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2288, - EndPos: 2317, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2297, - EndPos: 2299, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2297, - EndPos: 2299, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2303, - EndPos: 2305, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2303, - EndPos: 2305, - }, - Value: "k", - }, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2309, - EndPos: 2313, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2310, - EndPos: 2312, - }, - Value: "v", - }, - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2315, - EndPos: 2317, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2320, - EndPos: 2337, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2329, - EndPos: 2332, - }, - Value: "foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2340, - EndPos: 2364, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2349, - EndPos: 2352, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2356, - EndPos: 2363, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2367, - EndPos: 2394, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2377, - EndPos: 2380, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2384, - EndPos: 2393, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2391, - EndPos: 2392, - }, - Value: "1", - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2397, - EndPos: 2421, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2407, - EndPos: 2410, - }, - Value: "foo", - }, - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2414, - EndPos: 2418, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2414, - EndPos: 2418, - }, - Value: "void", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Global{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2424, - EndPos: 2438, - }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2431, - EndPos: 2433, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2431, - EndPos: 2433, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2435, - EndPos: 2437, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2435, - EndPos: 2437, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Label{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2441, - EndPos: 2443, - }, - LabelName: &node.Identifier{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2441, - EndPos: 2442, - }, - Value: "a", - }, - }, - &stmt.Goto{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2447, - EndPos: 2454, - }, - Label: &node.Identifier{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2452, - EndPos: 2453, - }, - Value: "a", - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2457, - EndPos: 2467, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2463, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2461, - EndPos: 2463, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2465, - EndPos: 2467, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2470, - EndPos: 2495, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2474, - EndPos: 2476, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2474, - EndPos: 2476, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2478, - EndPos: 2480, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2481, - EndPos: 2495, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2491, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2491, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2493, - EndPos: 2495, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2498, - EndPos: 2516, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2502, - EndPos: 2504, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2502, - EndPos: 2504, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2506, - EndPos: 2508, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2509, - EndPos: 2516, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2514, - EndPos: 2516, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2519, - EndPos: 2567, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2523, - EndPos: 2525, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2523, - EndPos: 2525, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2527, - EndPos: 2529, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2530, - EndPos: 2544, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2538, - EndPos: 2540, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2538, - EndPos: 2540, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2542, - EndPos: 2544, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2545, - EndPos: 2559, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2553, - EndPos: 2555, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2553, - EndPos: 2555, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2557, - EndPos: 2559, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2560, - EndPos: 2567, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2565, - EndPos: 2567, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.If{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2570, - EndPos: 2619, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2574, - EndPos: 2576, - }, - Value: "a", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2578, - EndPos: 2580, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2581, - EndPos: 2595, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2589, - EndPos: 2591, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2589, - EndPos: 2591, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2593, - EndPos: 2595, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2596, - EndPos: 2619, - }, - Stmt: &stmt.If{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2601, - EndPos: 2619, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2605, - EndPos: 2607, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2605, - EndPos: 2607, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2609, - EndPos: 2611, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2612, - EndPos: 2619, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2617, - EndPos: 2619, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - }, - &stmt.Nop{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2622, - EndPos: 2624, - }, - }, - &stmt.InlineHtml{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2624, - EndPos: 2637, - }, - Value: "
", - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2642, - EndPos: 2658, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2652, - EndPos: 2655, - }, - Value: "Foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2661, - EndPos: 2689, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2671, - EndPos: 2674, - }, - Value: "Foo", - }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2675, - EndPos: 2686, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2683, - EndPos: 2686, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2683, - EndPos: 2686, - }, - Value: "Bar", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2692, - EndPos: 2725, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2702, - EndPos: 2705, - }, - Value: "Foo", - }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2706, - EndPos: 2722, - }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2714, - EndPos: 2717, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2714, - EndPos: 2717, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2719, - EndPos: 2722, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2719, - EndPos: 2722, - }, - Value: "Baz", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2728, - EndPos: 2742, - }, - NamespaceName: &name.Name{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2738, - EndPos: 2741, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2738, - EndPos: 2741, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2745, - EndPos: 2761, - }, - NamespaceName: &name.Name{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2755, - EndPos: 2758, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2755, - EndPos: 2758, - }, - Value: "Foo", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 117, - EndLine: 117, - StartPos: 2764, - EndPos: 2776, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2779, - EndPos: 2798, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2785, - EndPos: 2788, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.PropertyList{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2797, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2790, - EndPos: 2793, - }, - Value: "var", - }, - }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2794, - EndPos: 2796, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2801, - EndPos: 2838, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2807, - EndPos: 2810, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.PropertyList{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2837, - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2812, - EndPos: 2818, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2819, - EndPos: 2825, - }, - Value: "static", - }, - }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2826, - EndPos: 2828, - }, - Value: "a", - }, - }, - }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2836, - }, - PhpDocComment: "", - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2832, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2830, - EndPos: 2832, - }, - Value: "b", - }, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2835, - EndPos: 2836, - }, - Value: "1", - }, - }, - }, - }, - }, - }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2841, - EndPos: 2859, - }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2848, - EndPos: 2850, - }, - Value: "a", - }, - }, - }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2858, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2854, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2852, - EndPos: 2854, - }, - Value: "b", - }, - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2857, - EndPos: 2858, - }, - Value: "1", - }, - }, - }, - }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 122, - EndLine: 126, - StartPos: 2863, - EndPos: 2922, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 122, - EndLine: 122, - StartPos: 2871, - EndPos: 2872, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 123, - EndLine: -1, - StartPos: 2879, - EndPos: -1, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 123, - EndLine: -1, - StartPos: 2879, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 123, - EndLine: 123, - StartPos: 2884, - EndPos: 2885, - }, - Value: "1", - }, - Stmts: []node.Node{}, - }, - &stmt.Default{ - Position: &position.Position{ - StartLine: 124, - EndLine: -1, - StartPos: 2890, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2902, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 125, - EndLine: 125, - StartPos: 2907, - EndPos: 2908, - }, - Value: "2", - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 128, - EndLine: 131, - StartPos: 2926, - EndPos: 2974, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 128, - EndLine: 128, - StartPos: 2934, - EndPos: 2935, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 129, - EndLine: -1, - StartPos: 2943, - EndPos: -1, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 129, - EndLine: -1, - StartPos: 2943, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2948, - EndPos: 2949, - }, - Value: "1", - }, - Stmts: []node.Node{}, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 130, - EndLine: -1, - StartPos: 2954, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2959, - EndPos: 2960, - }, - Value: "2", - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 133, - EndLine: 136, - StartPos: 2980, - EndPos: 3032, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 133, - EndLine: 133, - StartPos: 2988, - EndPos: 2989, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 133, - EndLine: 136, - StartPos: 2991, - EndPos: 3032, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2996, - EndPos: 3010, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 3001, - EndPos: 3002, - }, - Value: "1", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 3004, - EndPos: 3010, - }, - }, - }, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3014, - EndPos: 3028, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3019, - EndPos: 3020, - }, - Value: "2", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 3022, - EndPos: 3028, - }, - }, - }, - }, - }, - }, - }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 138, - EndLine: 141, - StartPos: 3038, - EndPos: 3091, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 3046, - EndPos: 3047, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 138, - EndLine: 141, - StartPos: 3049, - EndPos: 3091, - }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3055, - EndPos: 3069, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3060, - EndPos: 3061, - }, - Value: "1", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 3063, - EndPos: 3069, - }, - }, - }, - }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3073, - EndPos: 3087, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3078, - EndPos: 3079, - }, - Value: "2", - }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3081, - EndPos: 3087, - }, - }, - }, - }, - }, - }, - }, - &stmt.Throw{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3095, - EndPos: 3104, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3101, - EndPos: 3103, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3101, - EndPos: 3103, - }, - Value: "e", - }, - }, - }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 3108, - EndPos: 3120, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 3114, - EndPos: 3117, - }, - Value: "Foo", - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3123, - EndPos: 3145, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3129, - EndPos: 3132, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3135, - EndPos: 3143, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3139, - EndPos: 3142, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3139, - EndPos: 3142, - }, - Value: "Bar", - }, - }, - }, - }, - TraitAdaptationList: &stmt.Nop{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 3142, - EndPos: 3143, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3148, - EndPos: 3177, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3154, - EndPos: 3157, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3160, - EndPos: 3175, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3164, - EndPos: 3167, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3164, - EndPos: 3167, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3169, - EndPos: 3172, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3169, - EndPos: 3172, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3173, - EndPos: 3175, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3180, - EndPos: 3226, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3186, - EndPos: 3189, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3192, - EndPos: 3224, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3196, - EndPos: 3199, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3196, - EndPos: 3199, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3201, - EndPos: 3204, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3201, - EndPos: 3204, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3205, - EndPos: 3224, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3221, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3210, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3207, - EndPos: 3210, - }, - Value: "one", - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3214, - EndPos: 3221, - }, - Value: "include", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3229, - EndPos: 3274, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3235, - EndPos: 3238, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3241, - EndPos: 3272, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3245, - EndPos: 3248, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3245, - EndPos: 3248, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3250, - EndPos: 3253, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3250, - EndPos: 3253, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3254, - EndPos: 3272, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3269, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3259, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3256, - EndPos: 3259, - }, - Value: "one", - }, - }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3263, - EndPos: 3269, - }, - Value: "public", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3277, - EndPos: 3326, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3283, - EndPos: 3286, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3289, - EndPos: 3324, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3293, - EndPos: 3296, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3293, - EndPos: 3296, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3298, - EndPos: 3301, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3298, - EndPos: 3301, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3302, - EndPos: 3324, - }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3321, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3307, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3304, - EndPos: 3307, - }, - Value: "one", - }, - }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3311, - EndPos: 3317, - }, - Value: "public", - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3318, - EndPos: 3321, - }, - Value: "two", - }, - }, - }, - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3329, - EndPos: 3406, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3335, - EndPos: 3338, - }, - Value: "Foo", - }, - Stmts: []node.Node{ - &stmt.TraitUse{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3341, - EndPos: 3404, - }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3345, - EndPos: 3348, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3345, - EndPos: 3348, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3350, - EndPos: 3353, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3350, - EndPos: 3353, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3354, - EndPos: 3404, - }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3384, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3364, - }, - Trait: &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3359, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3356, - EndPos: 3359, - }, - Value: "Bar", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3361, - EndPos: 3364, - }, - Value: "one", - }, - }, - Insteadof: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3375, - EndPos: 3378, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3375, - EndPos: 3378, - }, - Value: "Baz", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3380, - EndPos: 3384, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3380, - EndPos: 3384, - }, - Value: "Quux", - }, - }, - }, - }, - }, - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3401, - }, - Ref: &stmt.TraitMethodRef{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3394, - }, - Trait: &name.Name{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3389, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3386, - EndPos: 3389, - }, - Value: "Baz", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3391, - EndPos: 3394, - }, - Value: "one", - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3398, - EndPos: 3401, - }, - Value: "two", - }, - }, - }, - }, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 153, - EndLine: -1, - StartPos: 3410, - EndPos: -1, - }, - Stmts: []node.Node{}, - Catches: []node.Node{}, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3419, - EndPos: 3449, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3426, - EndPos: 3449, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3433, - EndPos: 3442, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3433, - EndPos: 3442, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3443, - EndPos: 3445, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3443, - EndPos: 3445, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3452, - EndPos: 3499, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3459, - EndPos: 3499, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3466, - EndPos: 3475, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3466, - EndPos: 3475, - }, - Value: "Exception", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3476, - EndPos: 3492, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3476, - EndPos: 3492, - }, - Value: "RuntimeException", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3493, - EndPos: 3495, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3493, - EndPos: 3495, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3502, - EndPos: 3563, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3509, - EndPos: 3532, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3516, - EndPos: 3525, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3516, - EndPos: 3525, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3526, - EndPos: 3528, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3526, - EndPos: 3528, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3533, - EndPos: 3563, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3540, - EndPos: 3556, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3540, - EndPos: 3556, - }, - Value: "RuntimeException", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3557, - EndPos: 3559, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3557, - EndPos: 3559, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3566, - EndPos: 3607, - }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3573, - EndPos: 3596, - }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3580, - EndPos: 3589, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3580, - EndPos: 3589, - }, - Value: "Exception", - }, - }, - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3590, - EndPos: 3592, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3590, - EndPos: 3592, - }, - Value: "e", - }, - }, - Stmts: []node.Node{}, - }, - }, - Finally: &stmt.Finally{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3597, - EndPos: 3607, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Unset{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3611, - EndPos: 3626, - }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3617, - EndPos: 3619, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3617, - EndPos: 3619, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3621, - EndPos: 3623, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3621, - EndPos: 3623, - }, - Value: "b", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3630, - EndPos: 3638, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3634, - EndPos: 3637, - }, - Value: "Foo", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3641, - EndPos: 3650, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3646, - EndPos: 3649, - }, - Value: "Foo", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3653, - EndPos: 3669, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3668, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3661, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3658, - EndPos: 3661, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3665, - EndPos: 3668, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3672, - EndPos: 3685, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3676, - EndPos: 3679, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3681, - EndPos: 3684, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3688, - EndPos: 3708, - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3692, - EndPos: 3695, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3707, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3700, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3697, - EndPos: 3700, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3704, - EndPos: 3707, - }, - Value: "Baz", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3711, - EndPos: 3734, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3715, - EndPos: 3723, - }, - Value: "function", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3724, - EndPos: 3727, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3730, - EndPos: 3733, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3737, - EndPos: 3774, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3741, - EndPos: 3749, - }, - Value: "function", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3760, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3753, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3750, - EndPos: 3753, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3757, - EndPos: 3760, - }, - Value: "foo", - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3773, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3766, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3763, - EndPos: 3766, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3770, - EndPos: 3773, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3777, - EndPos: 3797, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3781, - EndPos: 3786, - }, - Value: "const", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3787, - EndPos: 3790, - }, - Value: "Foo", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3793, - EndPos: 3796, - }, - Value: "Bar", - }, - }, - }, - }, - }, - }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3800, - EndPos: 3834, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3804, - EndPos: 3809, - }, - Value: "const", - }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3820, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3813, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3810, - EndPos: 3813, - }, - Value: "Foo", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3817, - EndPos: 3820, - }, - Value: "foo", - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3833, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3826, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3823, - EndPos: 3826, - }, - Value: "Bar", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3830, - EndPos: 3833, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3838, - EndPos: 3858, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3843, - EndPos: 3846, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3843, - EndPos: 3846, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3848, - EndPos: 3851, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3853, - EndPos: 3856, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3861, - EndPos: 3888, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3868, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3865, - EndPos: 3868, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3870, - EndPos: 3873, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3886, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3878, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3875, - EndPos: 3878, - }, - Value: "Baz", - }, - }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3882, - EndPos: 3886, - }, - Value: "quux", - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3891, - EndPos: 3919, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3895, - EndPos: 3903, - }, - Value: "function", - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3904, - EndPos: 3907, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3909, - EndPos: 3912, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3914, - EndPos: 3917, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3922, - EndPos: 3948, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3926, - EndPos: 3931, - }, - Value: "const", - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3933, - EndPos: 3936, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3933, - EndPos: 3936, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3938, - EndPos: 3941, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3943, - EndPos: 3946, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.GroupUse{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3951, - EndPos: 3985, - }, - Prefix: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3958, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3955, - EndPos: 3958, - }, - Value: "Foo", - }, - }, - }, - UseList: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3960, - EndPos: 3965, - }, - Value: "const", - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3966, - EndPos: 3969, - }, - Value: "Bar", - }, - }, - }, - }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - UseType: &node.Identifier{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3971, - EndPos: 3979, - }, - Value: "function", - }, - Use: &name.Name{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3980, - EndPos: 3983, - }, - Value: "Baz", - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3995, - }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3994, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3991, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3989, - EndPos: 3991, - }, - Value: "a", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3992, - EndPos: 3993, - }, - Value: "1", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4007, - }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4006, - }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4003, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4000, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3998, - EndPos: 4000, - }, - Value: "a", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 4001, - EndPos: 4002, - }, - Value: "1", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 4004, - EndPos: 4005, - }, - Value: "2", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 4010, - EndPos: 4018, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 4010, - EndPos: 4017, - }, - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4021, - EndPos: 4030, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4021, - EndPos: 4029, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4027, - EndPos: 4028, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 4027, - EndPos: 4028, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4033, - EndPos: 4051, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4033, - EndPos: 4050, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4039, - EndPos: 4043, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4039, - EndPos: 4040, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4042, - EndPos: 4043, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4045, - EndPos: 4048, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4045, - EndPos: 4048, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4046, - EndPos: 4048, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4046, - EndPos: 4048, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4054, - EndPos: 4058, - }, - Expr: &expr.BitwiseNot{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4054, - EndPos: 4057, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4057, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4055, - EndPos: 4057, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4061, - EndPos: 4065, - }, - Expr: &expr.BooleanNot{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4061, - EndPos: 4064, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4062, - EndPos: 4064, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4062, - EndPos: 4064, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4078, - }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4077, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4072, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4069, - EndPos: 4072, - }, - Value: "Foo", - }, - }, - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4074, - EndPos: 4077, - }, - Value: "Bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4091, - }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4090, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4085, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4081, - EndPos: 4085, - }, - Value: "foo", - }, - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4087, - EndPos: 4090, - }, - Value: "Bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4094, - EndPos: 4104, - }, - Expr: &expr.Clone{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4094, - EndPos: 4102, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4100, - EndPos: 4102, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4100, - EndPos: 4102, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4107, - EndPos: 4116, - }, - Expr: &expr.Clone{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4107, - EndPos: 4115, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4113, - EndPos: 4115, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4113, - EndPos: 4115, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4119, - EndPos: 4132, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4119, - EndPos: 4131, - }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4135, - EndPos: 4169, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4135, - EndPos: 4168, - }, - Static: false, - PhpDocComment: "", - ReturnsRef: false, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4144, - EndPos: 4146, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4148, - EndPos: 4150, - }, - Value: "b", - }, - }, - }, - }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4152, - EndPos: 4165, - }, - Uses: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4157, - EndPos: 4159, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4157, - EndPos: 4159, - }, - Value: "c", - }, - }, - &expr.Reference{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4161, - EndPos: 4164, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4162, - EndPos: 4164, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4162, - EndPos: 4164, - }, - Value: "d", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4172, - EndPos: 4192, - }, - Expr: &expr.Closure{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4172, - EndPos: 4191, - }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4188, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4184, - EndPos: 4188, - }, - Value: "void", - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4199, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4195, - EndPos: 4198, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4216, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4215, - }, - Constant: &name.Relative{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4202, - EndPos: 4215, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4212, - EndPos: 4215, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4224, - }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4223, - }, - Constant: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4219, - EndPos: 4223, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4220, - EndPos: 4223, - }, - Value: "foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4228, - EndPos: 4238, - }, - Expr: &expr.Empty{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4228, - EndPos: 4237, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4234, - EndPos: 4236, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4234, - EndPos: 4236, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4241, - EndPos: 4245, - }, - Expr: &expr.ErrorSuppress{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4241, - EndPos: 4244, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4242, - EndPos: 4244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 4242, - EndPos: 4244, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4248, - EndPos: 4257, - }, - Expr: &expr.Eval{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4248, - EndPos: 4256, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4253, - EndPos: 4255, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4253, - EndPos: 4255, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4260, - EndPos: 4265, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4260, - EndPos: 4264, - }, - Die: false, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4268, - EndPos: 4277, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4268, - EndPos: 4276, - }, - Die: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4273, - EndPos: 4275, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4273, - EndPos: 4275, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4280, - EndPos: 4284, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4280, - EndPos: 4283, - }, - Die: true, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4287, - EndPos: 4295, - }, - Expr: &expr.Exit{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4287, - EndPos: 4294, - }, - Die: true, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4291, - EndPos: 4293, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 4291, - EndPos: 4293, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4304, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4303, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4301, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4298, - EndPos: 4301, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4301, - EndPos: 4303, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4323, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4322, - }, - Function: &name.Relative{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4307, - EndPos: 4320, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4317, - EndPos: 4320, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4320, - EndPos: 4322, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4333, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4332, - }, - Function: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4326, - EndPos: 4330, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4327, - EndPos: 4330, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4330, - EndPos: 4332, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4343, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4342, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4340, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4336, - EndPos: 4340, - }, - Value: "foo", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4340, - EndPos: 4342, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4352, - }, - Expr: &expr.PostDec{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4351, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4349, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4347, - EndPos: 4349, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4360, - }, - Expr: &expr.PostInc{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4359, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4357, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4355, - EndPos: 4357, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4363, - EndPos: 4368, - }, - Expr: &expr.PreDec{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4363, - EndPos: 4367, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4365, - EndPos: 4367, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4365, - EndPos: 4367, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4371, - EndPos: 4376, - }, - Expr: &expr.PreInc{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4371, - EndPos: 4375, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4373, - EndPos: 4375, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4373, - EndPos: 4375, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4380, - EndPos: 4391, - }, - Expr: &expr.Include{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4380, - EndPos: 4390, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4388, - EndPos: 4390, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4388, - EndPos: 4390, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4394, - EndPos: 4410, - }, - Expr: &expr.IncludeOnce{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4394, - EndPos: 4409, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4407, - EndPos: 4409, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4407, - EndPos: 4409, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4413, - EndPos: 4424, - }, - Expr: &expr.Require{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4413, - EndPos: 4423, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4427, - EndPos: 4443, - }, - Expr: &expr.RequireOnce{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4427, - EndPos: 4442, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4440, - EndPos: 4442, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4440, - EndPos: 4442, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4465, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4464, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4449, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4447, - EndPos: 4449, - }, - Value: "a", - }, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4461, - EndPos: 4464, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4461, - EndPos: 4464, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4496, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4495, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4470, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4468, - EndPos: 4470, - }, - Value: "a", - }, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4482, - EndPos: 4495, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4492, - EndPos: 4495, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4518, - }, - Expr: &expr.InstanceOf{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4517, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4501, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4499, - EndPos: 4501, - }, - Value: "a", - }, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4513, - EndPos: 4517, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4514, - EndPos: 4517, - }, - Value: "Foo", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4522, - EndPos: 4536, - }, - Expr: &expr.Isset{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4522, - EndPos: 4535, - }, - Variables: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4530, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4530, - }, - Value: "a", - }, - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4532, - EndPos: 4534, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4532, - EndPos: 4534, - }, - Value: "b", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4553, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4552, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4539, - EndPos: 4547, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4544, - EndPos: 4546, - }, - Value: "a", - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4552, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4550, - EndPos: 4552, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4572, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4571, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4556, - EndPos: 4566, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4565, - }, - Val: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4565, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4563, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4561, - EndPos: 4563, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4569, - EndPos: 4571, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4569, - EndPos: 4571, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4595, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4594, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4575, - EndPos: 4589, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4580, - EndPos: 4588, - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4580, - EndPos: 4588, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4585, - EndPos: 4587, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4592, - EndPos: 4594, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4592, - EndPos: 4594, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4609, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4608, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4601, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4599, - EndPos: 4601, - }, - Value: "a", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4603, - EndPos: 4606, - }, - Value: "foo", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4606, - EndPos: 4608, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4612, - EndPos: 4622, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4612, - EndPos: 4621, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4616, - EndPos: 4619, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4616, - EndPos: 4619, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4619, - EndPos: 4621, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4625, - EndPos: 4645, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4625, - EndPos: 4644, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4629, - EndPos: 4642, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4639, - EndPos: 4642, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4642, - EndPos: 4644, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4648, - EndPos: 4659, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4648, - EndPos: 4658, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4652, - EndPos: 4656, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4653, - EndPos: 4656, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4656, - EndPos: 4658, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4662, - EndPos: 4687, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4662, - EndPos: 4686, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4666, - EndPos: 4686, - }, - PhpDocComment: "", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4672, - EndPos: 4683, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4673, - EndPos: 4675, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4677, - EndPos: 4682, - }, - IsReference: false, - Variadic: true, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4680, - EndPos: 4682, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4680, - EndPos: 4682, - }, - Value: "b", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4690, - EndPos: 4700, - }, - Expr: &expr.Print{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4690, - EndPos: 4698, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4696, - EndPos: 4698, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4696, - EndPos: 4698, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4711, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4710, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4705, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4703, - EndPos: 4705, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4707, - EndPos: 4710, - }, - Value: "foo", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4714, - EndPos: 4723, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4714, - EndPos: 4722, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4715, - EndPos: 4719, - }, - Value: "cmd ", - }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4719, - EndPos: 4721, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4719, - EndPos: 4721, - }, - Value: "a", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4726, - EndPos: 4732, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4726, - EndPos: 4731, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4727, - EndPos: 4730, - }, - Value: "cmd", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4735, - EndPos: 4738, - }, - Expr: &expr.ShellExec{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4735, - EndPos: 4737, - }, - Parts: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4741, - EndPos: 4744, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4741, - EndPos: 4743, - }, - Items: []node.Node{}, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4747, - EndPos: 4751, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4747, - EndPos: 4750, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4748, - EndPos: 4749, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4748, - EndPos: 4749, - }, - Value: "1", - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4754, - EndPos: 4767, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4754, - EndPos: 4766, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4755, - EndPos: 4759, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4755, - EndPos: 4756, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4758, - EndPos: 4759, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4764, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4764, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4762, - EndPos: 4764, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4762, - EndPos: 4764, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4781, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4780, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4771, - EndPos: 4775, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4772, - EndPos: 4774, - }, - Value: "a", - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4778, - EndPos: 4780, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4778, - EndPos: 4780, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4796, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4795, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4784, - EndPos: 4790, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4789, - }, - Val: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4789, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4787, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4785, - EndPos: 4787, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4795, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4793, - EndPos: 4795, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4815, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4814, - }, - Variable: &expr.ShortList{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4799, - EndPos: 4809, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4800, - EndPos: 4808, - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4800, - EndPos: 4808, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4805, - EndPos: 4807, - }, - Value: "a", - }, - }, - }, - }, - }, - }, - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4812, - EndPos: 4814, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4812, - EndPos: 4814, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4829, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4828, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4821, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4818, - EndPos: 4821, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4823, - EndPos: 4826, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4826, - EndPos: 4828, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4853, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4852, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4832, - EndPos: 4845, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4842, - EndPos: 4845, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4847, - EndPos: 4850, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4850, - EndPos: 4852, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4868, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4867, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4856, - EndPos: 4860, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4857, - EndPos: 4860, - }, - Value: "Foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4862, - EndPos: 4865, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4865, - EndPos: 4867, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4881, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4880, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4874, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4871, - EndPos: 4874, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4876, - EndPos: 4880, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4876, - EndPos: 4880, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4895, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4894, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4888, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4884, - EndPos: 4888, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4890, - EndPos: 4894, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4890, - EndPos: 4894, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4918, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4917, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4898, - EndPos: 4911, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4908, - EndPos: 4911, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4913, - EndPos: 4917, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4913, - EndPos: 4917, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4932, - }, - Expr: &expr.StaticPropertyFetch{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4931, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4921, - EndPos: 4925, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4922, - EndPos: 4925, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4927, - EndPos: 4931, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4927, - EndPos: 4931, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4948, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4947, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4937, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4935, - EndPos: 4937, - }, - Value: "a", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4940, - EndPos: 4942, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4940, - EndPos: 4942, - }, - Value: "b", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4945, - EndPos: 4947, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4945, - EndPos: 4947, - }, - Value: "c", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4961, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4960, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4953, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4951, - EndPos: 4953, - }, - Value: "a", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4958, - EndPos: 4960, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4958, - EndPos: 4960, - }, - Value: "c", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4987, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4986, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4966, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4964, - EndPos: 4966, - }, - Value: "a", - }, - }, - IfTrue: &expr.Ternary{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4981, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4971, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4969, - EndPos: 4971, - }, - Value: "b", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4974, - EndPos: 4976, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4974, - EndPos: 4976, - }, - Value: "c", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4979, - EndPos: 4981, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4979, - EndPos: 4981, - }, - Value: "d", - }, - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4984, - EndPos: 4986, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4984, - EndPos: 4986, - }, - Value: "e", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5013, - }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5012, - }, - Condition: &expr.Ternary{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 5002, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 4992, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4990, - EndPos: 4992, - }, - Value: "a", - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4995, - EndPos: 4997, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4995, - EndPos: 4997, - }, - Value: "b", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5000, - EndPos: 5002, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5000, - EndPos: 5002, - }, - Value: "c", - }, - }, - }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5005, - EndPos: 5007, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5005, - EndPos: 5007, - }, - Value: "d", - }, - }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5010, - EndPos: 5012, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 5010, - EndPos: 5012, - }, - Value: "e", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5016, - EndPos: 5020, - }, - Expr: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5016, - EndPos: 5019, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5019, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5017, - EndPos: 5019, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5023, - EndPos: 5027, - }, - Expr: &expr.UnaryPlus{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5023, - EndPos: 5026, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5024, - EndPos: 5026, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 5024, - EndPos: 5026, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5034, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5030, - EndPos: 5033, - }, - VarName: &expr.Variable{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5031, - EndPos: 5033, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5031, - EndPos: 5033, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5037, - EndPos: 5043, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5037, - EndPos: 5042, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5046, - EndPos: 5055, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5046, - EndPos: 5054, - }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5052, - EndPos: 5054, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5052, - EndPos: 5054, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5058, - EndPos: 5073, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5058, - EndPos: 5072, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5064, - EndPos: 5066, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5064, - EndPos: 5066, - }, - Value: "a", - }, - }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5070, - EndPos: 5072, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5070, - EndPos: 5072, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5076, - EndPos: 5090, - }, - Expr: &expr.YieldFrom{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5076, - EndPos: 5089, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5089, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5087, - EndPos: 5089, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5096, - EndPos: 5106, - }, - Expr: &cast.Array{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5096, - EndPos: 5105, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5103, - EndPos: 5105, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5103, - EndPos: 5105, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5109, - EndPos: 5121, - }, - Expr: &cast.Bool{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5109, - EndPos: 5120, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5120, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5118, - EndPos: 5120, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5124, - EndPos: 5133, - }, - Expr: &cast.Bool{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5124, - EndPos: 5132, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5130, - EndPos: 5132, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5130, - EndPos: 5132, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5147, - }, - Expr: &cast.Double{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5146, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5144, - EndPos: 5146, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5144, - EndPos: 5146, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5150, - EndPos: 5160, - }, - Expr: &cast.Double{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5150, - EndPos: 5159, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5157, - EndPos: 5159, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 5157, - EndPos: 5159, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5163, - EndPos: 5175, - }, - Expr: &cast.Int{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5163, - EndPos: 5174, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5174, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5172, - EndPos: 5174, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5178, - EndPos: 5186, - }, - Expr: &cast.Int{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5178, - EndPos: 5185, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5183, - EndPos: 5185, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5183, - EndPos: 5185, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5189, - EndPos: 5200, - }, - Expr: &cast.Object{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5189, - EndPos: 5199, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5197, - EndPos: 5199, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5197, - EndPos: 5199, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5203, - EndPos: 5214, - }, - Expr: &cast.String{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5203, - EndPos: 5213, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5213, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5211, - EndPos: 5213, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5217, - EndPos: 5227, - }, - Expr: &cast.Unset{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5217, - EndPos: 5226, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5224, - EndPos: 5226, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5224, - EndPos: 5226, - }, - Value: "a", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5239, - }, - Expr: &binary.BitwiseAnd{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5238, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5233, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5231, - EndPos: 5233, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5236, - EndPos: 5238, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5236, - EndPos: 5238, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5250, - }, - Expr: &binary.BitwiseOr{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5249, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5244, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5242, - EndPos: 5244, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5247, - EndPos: 5249, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5247, - EndPos: 5249, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5261, - }, - Expr: &binary.BitwiseXor{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5260, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5255, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5253, - EndPos: 5255, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5258, - EndPos: 5260, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5258, - EndPos: 5260, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5273, - }, - Expr: &binary.BooleanAnd{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5272, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5266, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5264, - EndPos: 5266, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5270, - EndPos: 5272, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5270, - EndPos: 5272, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5285, - }, - Expr: &binary.BooleanOr{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5284, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5278, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5276, - EndPos: 5278, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5282, - EndPos: 5284, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5282, - EndPos: 5284, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5297, - }, - Expr: &binary.Coalesce{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5296, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5290, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5288, - EndPos: 5290, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5294, - EndPos: 5296, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5294, - EndPos: 5296, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5308, - }, - Expr: &binary.Concat{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5307, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5302, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5300, - EndPos: 5302, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5305, - EndPos: 5307, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5305, - EndPos: 5307, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5319, - }, - Expr: &binary.Div{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5318, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5313, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5311, - EndPos: 5313, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5316, - EndPos: 5318, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5316, - EndPos: 5318, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5331, - }, - Expr: &binary.Equal{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5330, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5324, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5322, - EndPos: 5324, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5328, - EndPos: 5330, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5328, - EndPos: 5330, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5343, - }, - Expr: &binary.GreaterOrEqual{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5342, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5336, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5334, - EndPos: 5336, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5340, - EndPos: 5342, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5340, - EndPos: 5342, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5354, - }, - Expr: &binary.Greater{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5353, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5348, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5346, - EndPos: 5348, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5351, - EndPos: 5353, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5351, - EndPos: 5353, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5367, - }, - Expr: &binary.Identical{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5366, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5359, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5357, - EndPos: 5359, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5364, - EndPos: 5366, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5364, - EndPos: 5366, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5380, - }, - Expr: &binary.LogicalAnd{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5379, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5372, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5370, - EndPos: 5372, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5377, - EndPos: 5379, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5377, - EndPos: 5379, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5392, - }, - Expr: &binary.LogicalOr{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5391, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5385, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5383, - EndPos: 5385, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5389, - EndPos: 5391, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5389, - EndPos: 5391, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5405, - }, - Expr: &binary.LogicalXor{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5404, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5397, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5395, - EndPos: 5397, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5402, - EndPos: 5404, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5402, - EndPos: 5404, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5416, - }, - Expr: &binary.Minus{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5415, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5410, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5408, - EndPos: 5410, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5413, - EndPos: 5415, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5413, - EndPos: 5415, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5427, - }, - Expr: &binary.Mod{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5426, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5421, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5419, - EndPos: 5421, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5424, - EndPos: 5426, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5424, - EndPos: 5426, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5438, - }, - Expr: &binary.Mul{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5437, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5432, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5430, - EndPos: 5432, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5435, - EndPos: 5437, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5435, - EndPos: 5437, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5450, - }, - Expr: &binary.NotEqual{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5449, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5443, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5441, - EndPos: 5443, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5447, - EndPos: 5449, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5447, - EndPos: 5449, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5463, - }, - Expr: &binary.NotIdentical{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5462, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5455, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5453, - EndPos: 5455, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5460, - EndPos: 5462, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 5460, - EndPos: 5462, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5474, - }, - Expr: &binary.Plus{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5473, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5468, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5466, - EndPos: 5468, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5471, - EndPos: 5473, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5471, - EndPos: 5473, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5486, - }, - Expr: &binary.Pow{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5485, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5479, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5477, - EndPos: 5479, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5483, - EndPos: 5485, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5483, - EndPos: 5485, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5498, - }, - Expr: &binary.ShiftLeft{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5497, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5491, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5489, - EndPos: 5491, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5495, - EndPos: 5497, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5495, - EndPos: 5497, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5510, - }, - Expr: &binary.ShiftRight{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5509, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5503, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5501, - EndPos: 5503, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5507, - EndPos: 5509, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5507, - EndPos: 5509, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5522, - }, - Expr: &binary.SmallerOrEqual{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5521, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5515, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5513, - EndPos: 5515, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5519, - EndPos: 5521, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5519, - EndPos: 5521, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5533, - }, - Expr: &binary.Smaller{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5532, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5527, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5525, - EndPos: 5527, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5530, - EndPos: 5532, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5530, - EndPos: 5532, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5546, - }, - Expr: &binary.Spaceship{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5545, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5538, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5536, - EndPos: 5538, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5543, - EndPos: 5545, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5543, - EndPos: 5545, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5559, - }, - Expr: &assign.Reference{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5558, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5552, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5550, - EndPos: 5552, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5556, - EndPos: 5558, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5556, - EndPos: 5558, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5570, - }, - Expr: &assign.Assign{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5569, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5564, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5562, - EndPos: 5564, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5567, - EndPos: 5569, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5567, - EndPos: 5569, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5582, - }, - Expr: &assign.BitwiseAnd{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5581, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5575, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5573, - EndPos: 5575, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5579, - EndPos: 5581, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5579, - EndPos: 5581, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5594, - }, - Expr: &assign.BitwiseOr{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5593, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5587, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5585, - EndPos: 5587, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5591, - EndPos: 5593, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5591, - EndPos: 5593, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5606, - }, - Expr: &assign.BitwiseXor{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5605, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5599, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5597, - EndPos: 5599, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5603, - EndPos: 5605, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5603, - EndPos: 5605, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5618, - }, - Expr: &assign.Concat{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5617, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5611, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5609, - EndPos: 5611, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5615, - EndPos: 5617, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5615, - EndPos: 5617, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5630, - }, - Expr: &assign.Div{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5629, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5623, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5621, - EndPos: 5623, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5627, - EndPos: 5629, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5627, - EndPos: 5629, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5642, - }, - Expr: &assign.Minus{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5641, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5635, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5633, - EndPos: 5635, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5641, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5641, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5654, - }, - Expr: &assign.Mod{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5653, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5647, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5645, - EndPos: 5647, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5651, - EndPos: 5653, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5651, - EndPos: 5653, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5666, - }, - Expr: &assign.Mul{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5665, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5659, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5657, - EndPos: 5659, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5663, - EndPos: 5665, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5663, - EndPos: 5665, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5678, - }, - Expr: &assign.Plus{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5677, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5671, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5669, - EndPos: 5671, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5675, - EndPos: 5677, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5675, - EndPos: 5677, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5691, - }, - Expr: &assign.Pow{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5690, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5683, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5681, - EndPos: 5683, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5688, - EndPos: 5690, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5688, - EndPos: 5690, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5704, - }, - Expr: &assign.ShiftLeft{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5703, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5696, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5694, - EndPos: 5696, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5701, - EndPos: 5703, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5701, - EndPos: 5703, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5717, - }, - Expr: &assign.ShiftRight{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5716, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5709, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5707, - EndPos: 5709, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5714, - EndPos: 5716, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5714, - EndPos: 5716, - }, - Value: "b", - }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5721, - EndPos: 5760, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5727, - EndPos: 5730, - }, - Value: "foo", - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5732, - EndPos: 5758, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5748, - EndPos: 5753, - }, - Value: "class", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5732, - EndPos: 5738, - }, - Value: "public", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5756, - EndPos: 5758, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5774, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5773, - }, - Function: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5763, - EndPos: 5771, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5764, - EndPos: 5767, - }, - Value: "foo", - }, - &name.NamePart{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5768, - EndPos: 5771, - }, - Value: "bar", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5771, - EndPos: 5773, - }, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 320, - EndLine: 326, - StartPos: 5778, - EndPos: 5905, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5787, - EndPos: 5790, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5791, - EndPos: 5794, - }, - ByRef: true, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5792, - EndPos: 5794, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5792, - EndPos: 5794, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5796, - EndPos: 5801, - }, - ByRef: false, - Variadic: true, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5799, - EndPos: 5801, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5799, - EndPos: 5801, - }, - Value: "b", - }, - }, - }, - }, - Stmts: []node.Node{ - &stmt.Function{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5830, - EndPos: 5847, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5839, - EndPos: 5842, - }, - Value: "bar", - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5851, - EndPos: 5863, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5857, - EndPos: 5860, - }, - Value: "Baz", - }, - Stmts: []node.Node{}, - }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5867, - EndPos: 5879, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5873, - EndPos: 5877, - }, - Value: "Quux", - }, - Stmts: []node.Node{}, - }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5883, - EndPos: 5901, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5893, - EndPos: 5898, - }, - Value: "Quuux", - }, - Stmts: []node.Node{}, - }, - }, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5911, - EndPos: 5954, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5920, - EndPos: 5923, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5924, - EndPos: 5931, - }, - ByRef: true, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5925, - EndPos: 5927, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5925, - EndPos: 5927, - }, - Value: "a", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5930, - EndPos: 5931, - }, - Value: "1", - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5933, - EndPos: 5942, - }, - ByRef: false, - Variadic: true, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - Value: "b", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5941, - EndPos: 5942, - }, - Value: "1", - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5950, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5946, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5944, - EndPos: 5946, - }, - Value: "c", - }, - }, - DefaultValue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5949, - EndPos: 5950, - }, - Value: "1", - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5957, - EndPos: 5995, - }, - PhpDocComment: "", - ReturnsRef: false, - FunctionName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5966, - EndPos: 5969, - }, - Value: "foo", - }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5970, - EndPos: 5978, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5970, - EndPos: 5975, - }, - Value: "array", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5976, - EndPos: 5978, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5976, - EndPos: 5978, - }, - Value: "a", - }, - }, - }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5980, - EndPos: 5991, - }, - Variadic: false, - ByRef: false, - VariableType: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5980, - EndPos: 5988, - }, - Value: "callable", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5989, - EndPos: 5991, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5989, - EndPos: 5991, - }, - Value: "b", - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 6100, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6019, - EndPos: 6022, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5998, - EndPos: 6006, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6007, - EndPos: 6012, - }, - Value: "final", - }, - }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6025, - EndPos: 6066, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6060, - EndPos: 6063, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6025, - EndPos: 6033, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6034, - EndPos: 6043, - }, - Value: "protected", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6044, - EndPos: 6050, - }, - Value: "static", - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6065, - EndPos: 6066, - }, - }, - }, - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6067, - EndPos: 6098, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6090, - EndPos: 6093, - }, - Value: "baz", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6067, - EndPos: 6072, - }, - Value: "final", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6073, - EndPos: 6080, - }, - Value: "private", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 6096, - EndPos: 6098, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6119, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6118, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6105, - EndPos: 6112, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6109, - EndPos: 6112, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6109, - EndPos: 6112, - }, - Value: "Foo", - }, - }, - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6115, - EndPos: 6118, - }, - Value: "bar", - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6134, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6133, - }, - Function: &expr.New{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6123, - EndPos: 6130, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6130, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6127, - EndPos: 6130, - }, - Value: "Foo", - }, - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6131, - EndPos: 6133, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6149, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6148, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6146, - }, - Variable: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6137, - EndPos: 6143, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6138, - EndPos: 6142, - }, - Value: "foo", - }, - }, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6144, - EndPos: 6145, - }, - Value: "0", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6146, - EndPos: 6148, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6161, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6160, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6158, - }, - Variable: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6152, - EndPos: 6155, - }, - Value: "foo", - }, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6156, - EndPos: 6157, - }, - Value: "1", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6158, - EndPos: 6160, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6172, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6171, - }, - Function: &scalar.String{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6164, - EndPos: 6169, - }, - Value: "\"foo\"", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6169, - EndPos: 6171, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6187, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6186, - }, - Function: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6184, - }, - Variable: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6175, - EndPos: 6178, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6176, - EndPos: 6177, - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6176, - EndPos: 6177, - }, - Value: "1", - }, - }, - }, - }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6179, - EndPos: 6183, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6179, - EndPos: 6183, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6184, - EndPos: 6186, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6190, - EndPos: 6199, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6190, - EndPos: 6198, - }, - VarName: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6197, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6195, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6192, - EndPos: 6195, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6195, - EndPos: 6197, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6215, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6214, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6206, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6203, - EndPos: 6206, - }, - Value: "Foo", - }, - }, - }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6208, - EndPos: 6212, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6208, - EndPos: 6212, - }, - Value: "bar", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6212, - EndPos: 6214, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6235, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6234, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6221, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6218, - EndPos: 6221, - }, - Value: "Foo", - }, - }, - }, - Call: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6231, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6228, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6224, - EndPos: 6228, - }, - Value: "bar", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6229, - EndPos: 6230, - }, - Value: "0", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6232, - EndPos: 6234, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6252, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6251, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6245, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6241, - EndPos: 6245, - }, - Value: "foo", - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6247, - EndPos: 6251, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6247, - EndPos: 6251, - }, - Value: "bar", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6271, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6269, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6259, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6255, - EndPos: 6259, - }, - Value: "foo", - }, - }, - Property: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6269, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6266, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6262, - EndPos: 6266, - }, - Value: "bar", - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6267, - EndPos: 6268, - }, - Value: "0", - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6275, - EndPos: 6297, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6275, - EndPos: 6296, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6276, - EndPos: 6282, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6276, - EndPos: 6277, - }, - Value: "1", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6279, - EndPos: 6282, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6280, - EndPos: 6282, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6280, - EndPos: 6282, - }, - Value: "a", - }, - }, - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6284, - EndPos: 6295, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6284, - EndPos: 6285, - }, - Value: "2", - }, - Val: &expr.List{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6287, - EndPos: 6295, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6292, - EndPos: 6294, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - }, - }, - &stmt.HaltCompiler{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6301, - EndPos: 6319, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestPhp5Strings(t *testing.T) { - src := `", strings.Repeat(" ", v.depth), key, ":\n") @@ -90,14 +89,14 @@ func (v *testVisitor) Identifier(_ *ast.Identifier) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Identifier") } -func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { +func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ArgumentList") } -func (v *testVisitor) Argument(_ *ast.Argument) { +func (v *testVisitor) Argument(_ *ast.Argument) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Argument") } -func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { +func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ScalarDnumber") } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index b8b486e..99b34a3 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -8,6 +8,7 @@ import ( type Node struct { StartTokens []token.Token EndTokens []token.Token + Tokens token.Collection Position *position.Position } @@ -52,7 +53,7 @@ func (n *Parameter) Accept(v NodeVisitor) { // Identifier node type Identifier struct { Node - Value string + Value []byte } func (n *Identifier) Accept(v NodeVisitor) { @@ -84,7 +85,7 @@ func (n *Argument) Accept(v NodeVisitor) { // ScalarDnumber node type ScalarDnumber struct { Node - Value string + Value []byte } func (n *ScalarDnumber) Accept(v NodeVisitor) { @@ -104,7 +105,7 @@ func (n *ScalarEncapsed) Accept(v NodeVisitor) { // ScalarEncapsedStringPart node type ScalarEncapsedStringPart struct { Node - Value string + Value []byte } func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { @@ -114,7 +115,7 @@ func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { // ScalarHeredoc node type ScalarHeredoc struct { Node - Label string + Label []byte Parts []Vertex } @@ -125,7 +126,7 @@ func (n *ScalarHeredoc) Accept(v NodeVisitor) { // ScalarLnumber node type ScalarLnumber struct { Node - Value string + Value []byte } func (n *ScalarLnumber) Accept(v NodeVisitor) { @@ -135,7 +136,7 @@ func (n *ScalarLnumber) Accept(v NodeVisitor) { // ScalarMagicConstant node type ScalarMagicConstant struct { Node - Value string + Value []byte } func (n *ScalarMagicConstant) Accept(v NodeVisitor) { @@ -145,7 +146,7 @@ func (n *ScalarMagicConstant) Accept(v NodeVisitor) { // ScalarString node type ScalarString struct { Node - Value string + Value []byte } func (n *ScalarString) Accept(v NodeVisitor) { @@ -550,7 +551,7 @@ func (n *StmtIf) Accept(v NodeVisitor) { // StmtInlineHtml node type StmtInlineHtml struct { Node - Value string + Value []byte } func (n *StmtInlineHtml) Accept(v NodeVisitor) { @@ -1803,3 +1804,39 @@ type ExprBinarySpaceship struct { func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { v.ExprBinarySpaceship(n) } + +type NameName struct { + Node + Parts []Vertex +} + +func (n *NameName) Accept(v NodeVisitor) { + v.NameName(n) +} + +type NameFullyQualified struct { + Node + Parts []Vertex +} + +func (n *NameFullyQualified) Accept(v NodeVisitor) { + v.NameFullyQualified(n) +} + +type NameRelative struct { + Node + Parts []Vertex +} + +func (n *NameRelative) Accept(v NodeVisitor) { + v.NameRelative(n) +} + +type NameNamePart struct { + Node + Value []byte +} + +func (n *NameNamePart) Accept(v NodeVisitor) { + v.NameNamePart(n) +} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index b013607..a000a59 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -73,7 +73,7 @@ func (v *Dump) EnterNode(n ast.Vertex) bool { } n.Accept(v) - + return true } diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 5d2277d..b1f5153 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -13,8 +13,7 @@ func ExampleDump() { &ast.Identifier{}, &ast.Parameter{ Variadic: true, - Var: &ast.ExprVariable{ - }, + Var: &ast.ExprVariable{}, }, &ast.StmtInlineHtml{ Value: "foo", diff --git a/errors/error.go b/pkg/errors/error.go similarity index 90% rename from errors/error.go rename to pkg/errors/error.go index 63e480e..623dc07 100644 --- a/errors/error.go +++ b/pkg/errors/error.go @@ -3,7 +3,7 @@ package errors import ( "fmt" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/pkg/position" ) // Error parsing error diff --git a/errors/error_test.go b/pkg/errors/error_test.go similarity index 100% rename from errors/error_test.go rename to pkg/errors/error_test.go diff --git a/parser/parser.go b/pkg/parser/parser.go similarity index 59% rename from parser/parser.go rename to pkg/parser/parser.go index c05b22d..9f804c3 100644 --- a/parser/parser.go +++ b/pkg/parser/parser.go @@ -1,19 +1,19 @@ package parser import ( - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/version" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/version" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" ) // Parser interface type Parser interface { Parse() int - GetRootNode() node.Node + GetRootNode() ast.Vertex GetErrors() []*errors.Error - WithFreeFloating() + WithTokens() } func NewParser(src []byte, v string) (Parser, error) { diff --git a/freefloating/string.go b/pkg/token/position.go similarity index 66% rename from freefloating/string.go rename to pkg/token/position.go index ee05c36..209ed9d 100644 --- a/freefloating/string.go +++ b/pkg/token/position.go @@ -1,17 +1,9 @@ -package freefloating - -import "github.com/z7zmey/php-parser/position" - -type StringType int - -const ( - WhiteSpaceType StringType = iota - CommentType - TokenType -) +package token type Position int +type Collection map[Position][]Token + //go:generate stringer -type=Position -output ./position_string.go const ( Start Position = iota @@ -94,20 +86,3 @@ const ( OpenParenthesisToken CloseParenthesisToken ) - -type String struct { - StringType StringType - Value string - Position *position.Position -} - -type Collection map[Position][]String - -func (c Collection) IsEmpty() bool { - for _, v := range c { - if len(v) > 0 { - return false - } - } - return true -} diff --git a/freefloating/position_string.go b/pkg/token/position_string.go similarity index 99% rename from freefloating/position_string.go rename to pkg/token/position_string.go index 2428f22..cc51fe2 100644 --- a/freefloating/position_string.go +++ b/pkg/token/position_string.go @@ -1,6 +1,6 @@ // Code generated by "stringer -type=Position -output ./position_string.go"; DO NOT EDIT. -package freefloating +package token import "strconv" diff --git a/pkg/token/token.go b/pkg/token/token.go index a79915d..6ba52d6 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -1,9 +1,9 @@ package token -type TokenID int +type ID int const ( - T_INCLUDE TokenID = iota + 57346 + T_INCLUDE ID = iota + 57346 T_INCLUDE_ONCE T_EXIT T_IF @@ -144,6 +144,6 @@ const ( ) type Token struct { - ID TokenID + ID ID Value []byte } diff --git a/position/position.go b/position/position.go deleted file mode 100644 index d4099cd..0000000 --- a/position/position.go +++ /dev/null @@ -1,27 +0,0 @@ -package position - -import ( - "fmt" -) - -// Position represents node position -type Position struct { - StartLine int - EndLine int - StartPos int - EndPos int -} - -// NewPosition Position constructor -func NewPosition(StartLine int, EndLine int, StartPos int, EndPos int) *Position { - return &Position{ - StartLine: StartLine, - EndLine: EndLine, - StartPos: StartPos, - EndPos: EndPos, - } -} - -func (p Position) String() string { - return fmt.Sprintf("Pos{Line: %d-%d Pos: %d-%d}", p.StartLine, p.EndLine, p.StartPos, p.EndPos) -} diff --git a/position/position_test.go b/position/position_test.go deleted file mode 100644 index 0e322b6..0000000 --- a/position/position_test.go +++ /dev/null @@ -1,19 +0,0 @@ -package position_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/position" -) - -func TestPrintPosition(t *testing.T) { - pos := position.NewPosition(1, 1, 2, 5) - - expected := "Pos{Line: 1-1 Pos: 2-5}" - - actual := pos.String() - - if expected != actual { - t.Errorf("expected and actual are not equal\n") - } -} diff --git a/positionbuilder/position_builder_test.go b/positionbuilder/position_builder_test.go deleted file mode 100644 index fd8fa2b..0000000 --- a/positionbuilder/position_builder_test.go +++ /dev/null @@ -1,463 +0,0 @@ -package positionbuilder_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/positionbuilder" - - "github.com/z7zmey/php-parser/scanner" -) - -func TestNewTokenPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - pos := builder.NewTokenPosition(tkn) - - if pos.String() != `Pos{Line: 1-1 Pos: 0-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 6, - } - - pos := builder.NewTokensPosition(token1, token2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-6}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodePosition(t *testing.T) { - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodePosition(n) - - if pos.String() != `Pos{Line: 1-1 Pos: 0-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokenNodePosition(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 12, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewTokenNodePosition(tkn, n) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-12}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeTokenPosition(t *testing.T) { - n := node.NewIdentifier("test node") - n.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeTokenPosition(n, tkn) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-12}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListPosition([]node.Node{n1, n2}) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-19}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodesPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodesPosition(n1, n2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-19}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListTokenPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }) - - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 3, - EndLine: 3, - StartPos: 20, - EndPos: 22, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition([]node.Node{n1, n2}, tkn) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-22}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewTokenNodeListPosition(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 2, - } - - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 10, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 11, - EndPos: 20, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewTokenNodeListPosition(tkn, []node.Node{n1, n2}) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-20}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeNodeListPosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, []node.Node{n2, n3}) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-26}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewNodeListNodePosition(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListNodePosition([]node.Node{n1, n2}, n3) - - if pos.String() != `Pos{Line: 1-3 Pos: 0-26}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewOptionalListTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 6, - } - - pos := builder.NewOptionalListTokensPosition(nil, token1, token2) - - if pos.String() != `Pos{Line: 1-2 Pos: 0-6}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNewOptionalListTokensPosition2(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - n2 := node.NewIdentifier("test node") - n2.SetPosition(&position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }) - n3 := node.NewIdentifier("test node") - n3.SetPosition(&position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }) - - builder := positionbuilder.PositionBuilder{} - - token1 := &scanner.Token{ - Value: `foo`, - StartLine: 4, - EndLine: 4, - StartPos: 27, - EndPos: 29, - } - token2 := &scanner.Token{ - Value: `foo`, - StartLine: 5, - EndLine: 5, - StartPos: 30, - EndPos: 32, - } - - pos := builder.NewOptionalListTokensPosition([]node.Node{n2, n3}, token1, token2) - - if pos.String() != `Pos{Line: 2-5 Pos: 9-32}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodePos(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodesPosition(nil, nil) - - if pos.String() != `Pos{Line: -1--1 Pos: -1--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodeListPos(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, nil) - - if pos.String() != `Pos{Line: 1--1 Pos: 0--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestNilNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition(nil, token) - - if pos.String() != `Pos{Line: -1-1 Pos: -1-3}` { - t.Errorf("token value is not equal\n") - } -} - -func TestEmptyNodeListPos(t *testing.T) { - n1 := node.NewIdentifier("test node") - n1.SetPosition(&position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }) - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeNodeListPosition(n1, []node.Node{}) - - if pos.String() != `Pos{Line: 1--1 Pos: 0--1}` { - t.Errorf("token value is not equal\n") - } -} - -func TestEmptyNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - builder := positionbuilder.PositionBuilder{} - - pos := builder.NewNodeListTokenPosition([]node.Node{}, token) - - if pos.String() != `Pos{Line: -1-1 Pos: -1-3}` { - t.Errorf("token value is not equal\n") - } -} diff --git a/scanner/token.go b/scanner/token.go deleted file mode 100644 index fcd66a4..0000000 --- a/scanner/token.go +++ /dev/null @@ -1,35 +0,0 @@ -package scanner - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/position" -) - -// Token value returned by lexer -type Token struct { - Value string - FreeFloating []freefloating.String - StartLine int - EndLine int - StartPos int - EndPos int -} - -func (t *Token) String() string { - return string(t.Value) -} - -func (t *Token) GetFreeFloatingToken() []freefloating.String { - return []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: t.Value, - Position: &position.Position{ - StartLine: t.StartLine, - EndLine: t.EndLine, - StartPos: t.StartPos, - EndPos: t.EndPos, - }, - }, - } -} diff --git a/scanner/token_test.go b/scanner/token_test.go deleted file mode 100644 index 0edf072..0000000 --- a/scanner/token_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package scanner_test - -import ( - "reflect" - "testing" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/scanner" -) - -func TestToken(t *testing.T) { - tkn := &scanner.Token{ - Value: `foo`, - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - } - - c := []freefloating.String{ - { - Value: "test comment", - StringType: freefloating.CommentType, - Position: nil, - }, - } - - tkn.FreeFloating = c - - if !reflect.DeepEqual(tkn.FreeFloating, c) { - t.Errorf("comments are not equal\n") - } - - if tkn.String() != `foo` { - t.Errorf("token value is not equal\n") - } -} diff --git a/visitor/dumper.go b/visitor/dumper.go deleted file mode 100644 index 785679a..0000000 --- a/visitor/dumper.go +++ /dev/null @@ -1,83 +0,0 @@ -// Package visitor contains walker.visitor implementations -package visitor - -import ( - "fmt" - "io" - "reflect" - "strings" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/walker" -) - -// Dumper writes ast hierarchy to an io.Writer -// Also prints comments and positions attached to nodes -type Dumper struct { - Writer io.Writer - Indent string - NsResolver *NamespaceResolver -} - -// EnterNode is invoked at every node in hierarchy -func (d *Dumper) EnterNode(w walker.Walkable) bool { - n := w.(node.Node) - - fmt.Fprintf(d.Writer, "%v[%v]\n", d.Indent, reflect.TypeOf(n)) - - if n.GetPosition() != nil { - fmt.Fprintf(d.Writer, "%v\"Position\": %s\n", d.Indent+" ", n.GetPosition()) - } - - if d.NsResolver != nil { - if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { - fmt.Fprintf(d.Writer, "%v\"NamespacedName\": %q\n", d.Indent+" ", namespacedName) - } - } - - if !n.GetFreeFloating().IsEmpty() { - fmt.Fprintf(d.Writer, "%v\"freefloating\":\n", d.Indent+" ") - for key, freeFloatingStrings := range *n.GetFreeFloating() { - for _, freeFloatingString := range freeFloatingStrings { - fmt.Fprintf(d.Writer, "%v%q: %q\n", d.Indent+" ", key.String(), freeFloatingString.Value) - } - } - } - - if a := n.Attributes(); len(a) > 0 { - for key, attr := range a { - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "%v\"%v\": %q\n", d.Indent+" ", key, attr) - default: - fmt.Fprintf(d.Writer, "%v\"%v\": %v\n", d.Indent+" ", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *Dumper) LeaveNode(n walker.Walkable) { - // do nothing -} - -// GetChildrenVisitor is invoked at every node parameter that contains children nodes -func (d *Dumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) - d.Indent = d.Indent + " " -} - -func (d *Dumper) LeaveChildNode(key string, w walker.Walkable) { - d.Indent = strings.TrimSuffix(d.Indent, " ") -} - -func (d *Dumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, "%v%q:\n", d.Indent+" ", key) - d.Indent = d.Indent + " " -} - -func (d *Dumper) LeaveChildList(key string, w walker.Walkable) { - d.Indent = strings.TrimSuffix(d.Indent, " ") -} diff --git a/visitor/dumper_test.go b/visitor/dumper_test.go deleted file mode 100644 index cdfc78d..0000000 --- a/visitor/dumper_test.go +++ /dev/null @@ -1,151 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleDumper() { - src := ` 0 { - for key, attr := range a { - printIndent(d.Writer, d.depth) - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "%s: %q,\n", key, attr) - default: - fmt.Fprintf(d.Writer, "%s: %v,\n", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *GoDumper) LeaveNode(n walker.Walkable) { - d.depth-- - printIndent(d.Writer, d.depth) - if d.depth != 0 { - io.WriteString(d.Writer, "},\n") - } else { - io.WriteString(d.Writer, "}\n") - } -} - -func (d *GoDumper) EnterChildNode(key string, w walker.Walkable) { - printIndent(d.Writer, d.depth) - io.WriteString(d.Writer, key+": ") - d.isChildNode = true -} - -func (d *GoDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *GoDumper) EnterChildList(key string, w walker.Walkable) { - printIndent(d.Writer, d.depth) - io.WriteString(d.Writer, key+": []node.Node{\n") - d.depth++ -} - -func (d *GoDumper) LeaveChildList(key string, w walker.Walkable) { - d.depth-- - printIndent(d.Writer, d.depth) - if d.depth != 0 { - io.WriteString(d.Writer, "},\n") - } -} diff --git a/visitor/go_dumper_test.go b/visitor/go_dumper_test.go deleted file mode 100644 index 2970615..0000000 --- a/visitor/go_dumper_test.go +++ /dev/null @@ -1,528 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleGoDumper() { - src := ` 0 { - var attributes []string - for key := range n.Attributes() { - attributes = append(attributes, key) - } - - sort.Strings(attributes) - - for _, attributeName := range attributes { - attr := a[attributeName] - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, ",\"%s\":%q", attributeName, attr) - default: - fmt.Fprintf(d.Writer, ",\"%s\":%v", attributeName, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *JsonDumper) LeaveNode(n walker.Walkable) { - fmt.Fprint(d.Writer, "}") -} - -func (d *JsonDumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, ",%q:", key) - d.isChildNode = true -} - -func (d *JsonDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *JsonDumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprintf(d.Writer, ",%q:[", key) - d.isNotFirstNode = false - -} - -func (d *JsonDumper) LeaveChildList(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, "]") -} diff --git a/visitor/json_dumper_test.go b/visitor/json_dumper_test.go deleted file mode 100644 index b803fc3..0000000 --- a/visitor/json_dumper_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExampleJsonDumper() { - src := ` 1 { - // if name qualified, replace first part by alias - return aliasName + "\\" + concatNameParts(n.Parts[1:]), nil - } - - return aliasName, nil - } - - return "", errors.New("must be instance of name.Names") -} - -// ResolveAlias returns alias or error if not found -func (ns *Namespace) ResolveAlias(nameNode node.Node, aliasType string) (string, error) { - aliasType = strings.ToLower(aliasType) - nameParts := nameNode.(*name.Name).Parts - - firstPartStr := nameParts[0].(*name.NamePart).Value - - if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type - firstPartStr = strings.ToLower(firstPartStr) - aliasType = "" - } else { - if aliasType != "const" { // constants are case-sensitive - firstPartStr = strings.ToLower(firstPartStr) - } - } - - aliasName, ok := ns.Aliases[aliasType][firstPartStr] - if !ok { - return "", errors.New("Not found") - } - - return aliasName, nil -} - -func concatNameParts(parts ...[]node.Node) string { - str := "" - - for _, p := range parts { - for _, n := range p { - if str == "" { - str = n.(*name.NamePart).Value - } else { - str = str + "\\" + n.(*name.NamePart).Value - } - } - } - - return str -} diff --git a/visitor/namespace_resolver_test.go b/visitor/namespace_resolver_test.go deleted file mode 100644 index d626dbb..0000000 --- a/visitor/namespace_resolver_test.go +++ /dev/null @@ -1,976 +0,0 @@ -package visitor_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/visitor" -) - -func TestResolveStaticCall(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.StaticCall{ - Class: nameBC, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveStaticPropertyFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.StaticPropertyFetch{ - Class: nameBC, - Property: &node.Identifier{Value: "foo"}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClassConstFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.ClassConstFetch{ - Class: nameBC, - ConstantName: &node.Identifier{Value: "FOO"}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveNew(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.New{ - Class: nameBC, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInstanceOf(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Class: nameBC, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInstanceCatch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - nameDE := &name.Name{Parts: []node.Node{&name.NamePart{Value: "D"}, &name.NamePart{Value: "E"}}} - nameF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - &stmt.Use{ - Use: nameDE, - Alias: &node.Identifier{Value: "F"}, - }, - }, - }, - &stmt.Try{ - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - nameBC, - nameF, - }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Stmts: []node.Node{}, - }, - }, - }, - }, - } - - expected := map[node.Node]string{ - nameBC: "A\\B\\C", - nameF: "D\\E", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveFunctionCall(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.FunctionCall{ - Function: nameB, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveConstFetch(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - UseType: &node.Identifier{Value: "const"}, - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &expr.ConstFetch{ - Constant: nameB, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveGroupUse(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "D"}}} - nameE := &name.Name{Parts: []node.Node{&name.NamePart{Value: "E"}}} - nameC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}}} - nameF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.GroupUse{ - Prefix: nameAB, - UseList: []node.Node{ - &stmt.Use{ - UseType: &node.Identifier{Value: "Function"}, - Use: nameF, - }, - &stmt.Use{ - UseType: &node.Identifier{Value: "const"}, - Use: nameC, - }, - }, - }, - &stmt.GroupUse{ - Prefix: nameBD, - UseType: &node.Identifier{Value: "Function"}, - UseList: []node.Node{ - &stmt.Use{ - Use: nameE, - }, - }, - }, - &expr.ConstFetch{ - Constant: nameC, - }, - &expr.FunctionCall{ - Function: nameF, - ArgumentList: &node.ArgumentList{}, - }, - &expr.FunctionCall{ - Function: nameE, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{ - nameC: "A\\B\\C", - nameF: "A\\B\\F", - nameE: "B\\D\\E", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveTraitUse(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}}} - nameD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "D"}}} - - fullyQualifiedNameB := &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "B"}}} - fullyQualifiedNameBC := &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - relativeNameB := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "B"}}} - relativeNameBC := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAB, - }, - }, - }, - &stmt.TraitUse{ - Traits: []node.Node{ - nameB, - relativeNameB, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: fullyQualifiedNameB, - Method: &node.Identifier{Value: "foo"}, - }, - Insteadof: []node.Node{fullyQualifiedNameBC}, - }, - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: relativeNameBC, - Method: &node.Identifier{Value: "foo"}, - }, - Alias: &node.Identifier{Value: "bar"}, - }, - }, - }, - }, - &stmt.TraitUse{ - Traits: []node.Node{ - nameD, - }, - }, - }, - } - - expected := map[node.Node]string{ - nameB: "A\\B", - nameD: "D", - relativeNameB: "B", - fullyQualifiedNameB: "B", - fullyQualifiedNameBC: "B\\C", - relativeNameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClassName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - class := &stmt.Class{ - PhpDocComment: "", - ClassName: &node.Identifier{Value: "A"}, - Extends: &stmt.ClassExtends{ - ClassName: nameAB, - }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - nameBC, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - class, - }, - } - - expected := map[node.Node]string{ - class: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveInterfaceName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - interfaceNode := &stmt.Interface{ - PhpDocComment: "", - InterfaceName: &node.Identifier{Value: "A"}, - Extends: &stmt.InterfaceExtends{ - InterfaceNames: []node.Node{ - nameAB, - nameBC, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - interfaceNode, - }, - } - - expected := map[node.Node]string{ - interfaceNode: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveTraitName(t *testing.T) { - traitNode := &stmt.Trait{ - PhpDocComment: "", - TraitName: &node.Identifier{Value: "A"}, - Stmts: []node.Node{}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - traitNode, - }, - } - - expected := map[node.Node]string{ - traitNode: "A", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveFunctionName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - functionNode := &stmt.Function{ - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{Value: "A"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmts: []node.Node{}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - functionNode, - }, - } - - expected := map[node.Node]string{ - functionNode: "A", - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveMethodName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - methodNode := &stmt.ClassMethod{ - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{Value: "A"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{}, - }, - } - - expected := map[node.Node]string{ - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - methodNode.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveClosureName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - nameBC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "B"}, &name.NamePart{Value: "C"}}} - - closureNode := &expr.Closure{ - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - ByRef: false, - Variadic: false, - VariableType: nameAB, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - }, - }, - ReturnType: &node.Nullable{Expr: nameBC}, - Stmts: []node.Node{}, - } - - expected := map[node.Node]string{ - nameAB: "A\\B", - nameBC: "B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - closureNode.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveConstantsName(t *testing.T) { - nameAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - - constantB := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "B"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - constantC := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "C"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: nameAB, - }, - &stmt.ConstList{ - Consts: []node.Node{ - constantB, - constantC, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantB: "A\\B\\B", - constantC: "A\\B\\C", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveNamespaces(t *testing.T) { - namespaceAB := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "B"}}} - namespaceCD := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "D"}}} - - nameAC := &name.Name{Parts: []node.Node{&name.NamePart{Value: "A"}, &name.NamePart{Value: "C"}}} - nameCF := &name.Name{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "F"}}} - nameFG := &name.Name{Parts: []node.Node{&name.NamePart{Value: "F"}, &name.NamePart{Value: "G"}}} - relativeNameCE := &name.Relative{Parts: []node.Node{&name.NamePart{Value: "C"}, &name.NamePart{Value: "E"}}} - - constantB := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "B"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - constantC := &stmt.Constant{ - PhpDocComment: "", - ConstantName: &node.Identifier{Value: "C"}, - Expr: &scalar.Lnumber{Value: "1"}, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: namespaceAB, - }, - &stmt.ConstList{ - Consts: []node.Node{ - constantB, - constantC, - }, - }, - &expr.StaticCall{ - Class: nameFG, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - &stmt.Namespace{ - Stmts: []node.Node{}, - }, - &stmt.Namespace{ - NamespaceName: namespaceCD, - Stmts: []node.Node{ - &stmt.UseList{ - Uses: []node.Node{ - &stmt.Use{ - Use: nameAC, - }, - }, - }, - &expr.StaticCall{ - Class: relativeNameCE, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - &expr.StaticCall{ - Class: nameCF, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantB: "A\\B\\B", - constantC: "A\\B\\C", - nameFG: "A\\B\\F\\G", - relativeNameCE: "C\\D\\C\\E", - nameCF: "A\\C\\F", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestResolveStaticCallDinamicClassName(t *testing.T) { - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &expr.StaticCall{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Call: &node.Identifier{Value: "foo"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - } - - expected := map[node.Node]string{} - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedConstants(t *testing.T) { - namespaceName := &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}} - - constantTrue := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "True"}, - }, - } - - constantFalse := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "False"}, - }, - } - - constantNull := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "NULL"}, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: namespaceName, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantTrue, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantFalse, - }, - }, - &stmt.Expression{ - Expr: &expr.ConstFetch{ - Constant: constantNull, - }, - }, - }, - } - - expected := map[node.Node]string{ - constantTrue: "true", - constantFalse: "false", - constantNull: "null", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedNames(t *testing.T) { - - nameInt := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "int"}, - }, - } - - nameFloat := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "float"}, - }, - } - - nameBool := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "bool"}, - }, - } - - nameString := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "string"}, - }, - } - - nameVoid := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "void"}, - }, - } - - nameIterable := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "iterable"}, - }, - } - - nameObject := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "object"}, - }, - } - - function := &stmt.Function{ - FunctionName: &node.Identifier{Value: "bar"}, - Params: []node.Node{ - &node.Parameter{ - VariableType: nameInt, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Int"}, - }, - }, - &node.Parameter{ - VariableType: nameFloat, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Float"}, - }, - }, - &node.Parameter{ - VariableType: nameBool, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Bool"}, - }, - }, - &node.Parameter{ - VariableType: nameString, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "String"}, - }, - }, - &node.Parameter{ - VariableType: nameVoid, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Void"}, - }, - }, - &node.Parameter{ - VariableType: nameIterable, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Iterable"}, - }, - }, - &node.Parameter{ - VariableType: nameObject, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "Object"}, - }, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - function, - }, - } - - expected := map[node.Node]string{ - function: "Foo\\bar", - nameInt: "int", - nameFloat: "float", - nameBool: "bool", - nameString: "string", - nameVoid: "void", - nameIterable: "iterable", - nameObject: "object", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} - -func TestDoNotResolveReservedSpecialNames(t *testing.T) { - - nameSelf := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Self"}, - }, - } - - nameStatic := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Static"}, - }, - } - - nameParent := &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Parent"}, - }, - } - - cls := &stmt.Class{ - ClassName: &node.Identifier{Value: "Bar"}, - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameSelf, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameStatic, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - &stmt.Expression{ - Expr: &expr.StaticCall{ - Class: nameParent, - Call: &node.Identifier{Value: "func"}, - ArgumentList: &node.ArgumentList{}, - }, - }, - }, - } - - ast := &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, - }, - }, - }, - cls, - }, - } - - expected := map[node.Node]string{ - cls: "Foo\\Bar", - nameSelf: "self", - nameStatic: "static", - nameParent: "parent", - } - - nsResolver := visitor.NewNamespaceResolver() - ast.Walk(nsResolver) - - assert.DeepEqual(t, expected, nsResolver.ResolvedNames) -} diff --git a/visitor/pretty_json_dumper.go b/visitor/pretty_json_dumper.go deleted file mode 100644 index 547e486..0000000 --- a/visitor/pretty_json_dumper.go +++ /dev/null @@ -1,187 +0,0 @@ -// Package visitor contains walker.visitor implementations -package visitor - -import ( - "fmt" - "io" - "reflect" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/walker" -) - -type PrettyJsonDumper struct { - Writer io.Writer - NsResolver *NamespaceResolver - depth int - isChildNode bool - isNotFirstNode bool -} - -func NewPrettyJsonDumper(Writer io.Writer, NsResolver *NamespaceResolver) *PrettyJsonDumper { - return &PrettyJsonDumper{ - Writer: Writer, - NsResolver: NsResolver, - depth: 0, - isChildNode: false, - isNotFirstNode: false, - } -} - -func (d *PrettyJsonDumper) printIndent(w io.Writer) { - for i := 0; i < d.depth; i++ { - fmt.Fprint(d.Writer, " ") - } -} - -// EnterNode is invoked at every node in hierarchy -func (d *PrettyJsonDumper) EnterNode(w walker.Walkable) bool { - n := w.(node.Node) - - nodeType := reflect.TypeOf(n).String() - - if d.isChildNode { - d.isChildNode = false - } else if d.isNotFirstNode { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - } else { - d.printIndent(d.Writer) - d.isNotFirstNode = true - } - - fmt.Fprint(d.Writer, "{\n") - d.depth++ - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q", "type", nodeType) - - if p := n.GetPosition(); p != nil { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: {\n", "position") - d.depth++ - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startPos", p.StartPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "endPos", p.EndPos) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d,\n", "startLine", p.StartLine) - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %d\n", "endLine", p.EndLine) - d.depth-- - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - if d.NsResolver != nil { - if namespacedName, ok := d.NsResolver.ResolvedNames[n]; ok { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "\"namespacedName\": %q", namespacedName) - } - } - - if !n.GetFreeFloating().IsEmpty() { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "\"freefloating\": {\n") - d.depth++ - i := 0 - for key, freeFloatingStrings := range *n.GetFreeFloating() { - if i != 0 { - fmt.Fprint(d.Writer, ",\n") - } - i++ - - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: [\n", key) - d.depth++ - - j := 0 - for _, freeFloatingString := range freeFloatingStrings { - if j != 0 { - fmt.Fprint(d.Writer, ",\n") - } - j++ - - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "{\n") - d.depth++ - d.printIndent(d.Writer) - switch freeFloatingString.StringType { - case freefloating.CommentType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.CommentType") - case freefloating.WhiteSpaceType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.WhiteSpaceType") - case freefloating.TokenType: - fmt.Fprintf(d.Writer, "%q: %q,\n", "type", "freefloating.TokenType") - } - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: %q\n", "value", freeFloatingString.Value) - d.depth-- - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") - } - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") - } - - if a := n.Attributes(); len(a) > 0 { - for key, attr := range a { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - switch attr.(type) { - case string: - fmt.Fprintf(d.Writer, "\"%s\": %q", key, attr) - default: - fmt.Fprintf(d.Writer, "\"%s\": %v", key, attr) - } - } - } - - return true -} - -// LeaveNode is invoked after node process -func (d *PrettyJsonDumper) LeaveNode(n walker.Walkable) { - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "}") -} - -func (d *PrettyJsonDumper) EnterChildNode(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: ", key) - d.isChildNode = true -} - -func (d *PrettyJsonDumper) LeaveChildNode(key string, w walker.Walkable) { - // do nothing -} - -func (d *PrettyJsonDumper) EnterChildList(key string, w walker.Walkable) { - fmt.Fprint(d.Writer, ",\n") - d.printIndent(d.Writer) - fmt.Fprintf(d.Writer, "%q: [\n", key) - d.depth++ - - d.isNotFirstNode = false -} - -func (d *PrettyJsonDumper) LeaveChildList(key string, w walker.Walkable) { - d.depth-- - fmt.Fprint(d.Writer, "\n") - d.printIndent(d.Writer) - fmt.Fprint(d.Writer, "]") -} diff --git a/visitor/pretty_json_dumper_test.go b/visitor/pretty_json_dumper_test.go deleted file mode 100644 index 307581d..0000000 --- a/visitor/pretty_json_dumper_test.go +++ /dev/null @@ -1,509 +0,0 @@ -package visitor_test - -import ( - "os" - - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/visitor" -) - -func ExamplePrettyJsonDumper() { - src := ` Date: Wed, 13 May 2020 20:18:53 +0300 Subject: [PATCH 006/140] refactor php5 --- internal/php5/parser.go | 104 +- internal/php5/php5.go | Bin 348627 -> 351465 bytes internal/php5/php5.y | 4207 +++-- internal/php5/php5_bench_test.go | 2 +- internal/php5/php5_test.go | 24628 +++++++++++++++++------------ internal/php7/php7.go | Bin 287586 -> 288574 bytes 6 files changed, 16494 insertions(+), 12447 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 311e544..060be97 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -1,15 +1,14 @@ package php5 import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "strings" + "bytes" "github.com/z7zmey/php-parser/internal/positionbuilder" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" - "github.com/z7zmey/php-parser/scanner" + "github.com/z7zmey/php-parser/pkg/token" ) func (lval *yySymType) Token(t *scanner.Token) { @@ -56,7 +55,7 @@ func (l *Parser) Error(msg string) { } func (l *Parser) WithTokens() { - l.Lexer.SetWithFreeFloating(true) + l.Lexer.SetWithTokens(true) } // Parse the php7 Parser entrypoint @@ -83,14 +82,14 @@ func (l *Parser) GetErrors() []*errors.Error { // helpers -func lastNode(nn []node.Node) node.Node { +func lastNode(nn []ast.Vertex) ast.Vertex { if len(nn) == 0 { return nil } return nn[len(nn)-1] } -func firstNode(nn []node.Node) node.Node { +func firstNode(nn []ast.Vertex) ast.Vertex { return nn[0] } @@ -98,20 +97,20 @@ func isDollar(r rune) bool { return r == '$' } -func (l *Parser) MoveFreeFloating(src node.Node, dst node.Node) { +func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { if l.Lexer.GetWithFreeFloating() == false { return } - if src.GetFreeFloating() == nil { + if src.GetNode().Tokens == nil { return } - l.setFreeFloating(dst, freefloating.Start, (*src.GetFreeFloating())[freefloating.Start]) - delete((*src.GetFreeFloating()), freefloating.Start) + l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + delete(src.GetNode().Tokens, token.Start) } -func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings []freefloating.String) { +func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { if l.Lexer.GetWithFreeFloating() == false { return } @@ -120,100 +119,65 @@ func (l *Parser) setFreeFloating(dst node.Node, p freefloating.Position, strings return } - dstCollection := dst.GetFreeFloating() + dstCollection := &dst.GetNode().Tokens if *dstCollection == nil { - *dstCollection = make(freefloating.Collection) + *dstCollection = make(token.Collection) } (*dstCollection)[p] = strings } -func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []freefloating.String { +func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { if l.Lexer.GetWithFreeFloating() == false { - return []freefloating.String{} + return []token.Token{} } - return t.GetFreeFloatingToken() + tokens := make([]token.Token, len(t.Tokens)) + copy(tokens, t.Tokens) + + return tokens } -func (l *Parser) addDollarToken(v node.Node) { +func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { if l.Lexer.GetWithFreeFloating() == false { return } - l.setFreeFloating(v, freefloating.Dollar, []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: "$", - Position: &position.Position{ - StartLine: v.GetPosition().StartLine, - EndLine: v.GetPosition().StartLine, - StartPos: v.GetPosition().StartPos, - EndPos: v.GetPosition().StartPos + 1, - }, - }, - }) -} - -func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode node.Node, prevNode node.Node) { - if l.Lexer.GetWithFreeFloating() == false { - return - } - - semiColon := (*prevNode.GetFreeFloating())[freefloating.SemiColon] - delete((*prevNode.GetFreeFloating()), freefloating.SemiColon) + semiColon := prevNode.GetNode().Tokens[token.SemiColon] + delete(prevNode.GetNode().Tokens, token.SemiColon) if len(semiColon) == 0 { return } - p := semiColon[0].Position if semiColon[0].Value[0] == ';' { - l.setFreeFloating(prevNode, freefloating.SemiColon, []freefloating.String{ + l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ { - StringType: freefloating.TokenType, - Value: ";", - Position: &position.Position{ - StartLine: p.StartLine, - EndLine: p.StartLine, - StartPos: p.StartPos, - EndPos: p.StartPos + 1, - }, + ID: token.ID(';'), + Value: semiColon[0].Value[0:1], }, }) } vlen := len(semiColon[0].Value) tlen := 2 - if strings.HasSuffix(semiColon[0].Value, "?>\n") { + if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { tlen = 3 } - phpCloseTag := []freefloating.String{} + phpCloseTag := []token.Token{} if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[1 : vlen-tlen], - Position: &position.Position{ - StartLine: p.StartLine, - EndLine: p.EndLine, - StartPos: p.StartPos + 1, - EndPos: p.EndPos - tlen, - }, + phpCloseTag = append(phpCloseTag, token.Token{ + ID: token.T_WHITESPACE, + Value: semiColon[0].Value[1 : vlen-tlen], }) } - phpCloseTag = append(phpCloseTag, freefloating.String{ - StringType: freefloating.WhiteSpaceType, - Value: semiColon[0].Value[vlen-tlen:], - Position: &position.Position{ - StartLine: p.EndLine, - EndLine: p.EndLine, - StartPos: p.EndPos - tlen, - EndPos: p.EndPos, - }, + phpCloseTag = append(phpCloseTag, token.Token{ + ID: T_CLOSE_TAG, + Value: semiColon[0].Value[vlen-tlen:], }) - l.setFreeFloating(htmlNode, freefloating.Start, append(phpCloseTag, (*htmlNode.GetFreeFloating())[freefloating.Start]...)) + l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8bb529143389ff7306da4c7c6a57bfb985b9dbb3..0b7071c7ed8af7138587147591722e79b8bc60c7 100644 GIT binary patch literal 351465 zcmeFa`F0d%nm+h9Tt&7|SN))jWMxF;=4$s02Dz+h3=ER1x)1GP(jo!1g`^`Tw$;_1 zyPDgWYntbI-fxYJ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ZP8HRkRP|kWh1kbifr?K`*yos>#Wza-XEp16V?Mx$H<4mCw(%1 zz^ETt3^dtk92dfiYb+b4Wo7m(0YQr(({*Km944bkGhljYMV?UlTWS0#CJgFO>IQNr zA*|p`6az!FK8{}$X~NP6hQaETx}(HKl%b6p<>soml!%+CrNl;(c>|L^nWtiS1B;

ZST`^bG6QT({b;o)uFfA9I~5iC$J7Ie+t=^x8)H3FwKZZ{Aj*X$@z&GLzGCb(u%aL4h$yUezVa!rMkt$>8QiDwl9 zKw@_RLVoTZRmU~+IuTOhb9Z%3Z$zSZ*7u8Gl=VXVz5IN8xOea;zTobALUZ-Iz@J>x zcJcS}NT*xjzQ}I@!YE2IfO_}g{{Hsxr)uRl>l2T?b>ORQ;@Fz$ivk~+p{g#VoArq+ z?h$-HY%bS#SJb=fc#12b?z;fR`gXftiI~S|TnrCgeIb>wtA&qgeN$L1GMB^IyRpvY z7>CF5vDMza*<5z}*HXYgAhQk}#b5D~`pch}Ch743oZimq*xay628=j(bpv8aT^$kv zM!*~8Tb5(_90QX0<*1HndBF8!_RqW3u2UN!bR(o9v z4e5i;K?Kh`>o4@PD7l_ehlA{62N+5SLSAfdiW3);0m&9tr;26+b1{Z9YQM-61}x@d zDcPXms^h1ny>2Om_>x>#HSIbZ3^dJe%#;inO}HbrTyo)&q{x6IMK}W;>Y|AD2TBIe z9B7&>=3%+J$qodGt%XWw#Z6U{GeZo1UI6m;FSeWg;gzU%b;1#`MbCP9e{Kk32SfSa z8v&X$|EFhuJoC`_CwUMK{-@facKGk`4~ETC z(2RKgf$={ic_a@0%|-Ve{yY4i7XG1t`(_KZP51Zv!}9XKdVl_=m;c8m`$hcMA?rca T6C8hm2i<$${P_>R{o#KApOwaG diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 9102dd8..fc42063 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2,33 +2,26 @@ package php5 import ( - "strings" + "bytes" "strconv" - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/scanner" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" + "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" ) %} %union{ - node node.Node + node ast.Vertex token *scanner.Token - list []node.Node + list []ast.Vertex simpleIndirectReference simpleIndirectReference - ClassExtends *stmt.ClassExtends - ClassImplements *stmt.ClassImplements - InterfaceExtends *stmt.InterfaceExtends - ClosureUse *expr.ClosureUse + ClassExtends *ast.StmtClassExtends + ClassImplements *ast.StmtClassImplements + InterfaceExtends *ast.StmtInterfaceExtends + ClosureUse *ast.ExprClosureUse } %type $unk @@ -281,10 +274,10 @@ import ( start: top_statement_list { - yylex.(*Parser).rootNode = node.NewRoot($1) - yylex.(*Parser).rootNode.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} + yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, freefloating.End, yylex.(*Parser).currentToken.FreeFloating) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -293,7 +286,7 @@ start: top_statement_list: top_statement_list top_statement { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } @@ -306,7 +299,7 @@ top_statement_list: } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -315,28 +308,28 @@ top_statement_list: namespace_name: T_STRING { - namePart := name.NewNamePart($1.Value) - $$ = []node.Node{namePart} + namePart := &ast.NameNamePart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{namePart} // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_NS_SEPARATOR T_STRING { - namePart := name.NewNamePart($3.Value) + namePart := &ast.NameNamePart{ast.Node{}, $3.Value} $$ = append($1, namePart) // save position - namePart.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(namePart, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -352,131 +345,131 @@ top_statement: } | statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { - $$ = stmt.NewHaltCompiler() + $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE namespace_name ';' { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { - name := name.NewName($2) - $$ = stmt.NewNamespace(name, $4) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtNamespace{ast.Node{}, name, $4} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE '{' top_statement_list '}' { - $$ = stmt.NewNamespace(nil, $3) + $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE use_declarations ';' { - $$ = stmt.NewUseList(nil, $2) + $$ = &ast.StmtUseList{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_FUNCTION use_function_declarations ';' { - useType := node.NewIdentifier($2.Value) - $$ = stmt.NewUseList(useType, $3) + useType := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_CONST use_const_declarations ';' { - useType := node.NewIdentifier($2.Value) - $$ = stmt.NewUseList(useType, $3) + useType := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(useType, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.UseDeclarationList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -485,11 +478,11 @@ top_statement: $$ = $1 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -501,13 +494,13 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -516,12 +509,12 @@ use_declarations: use_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -530,55 +523,55 @@ use_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -590,13 +583,13 @@ use_function_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_function_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -605,12 +598,12 @@ use_function_declarations: use_function_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -619,55 +612,55 @@ use_function_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -679,13 +672,13 @@ use_const_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_const_declaration { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -694,12 +687,12 @@ use_const_declarations: use_const_declaration: namespace_name { - name := name.NewName($1) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -708,55 +701,55 @@ use_const_declaration: } | namespace_name T_AS T_STRING { - name := name.NewName($1) - alias := node.NewIdentifier($3.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $1} + alias := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewName($2) - $$ = stmt.NewUse(nil, name, nil) + name := &ast.NameName{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - name := name.NewName($2) - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewUse(nil, name, alias) + name := &ast.NameName{ast.Node{}, $2} + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, freefloating.End, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -765,41 +758,41 @@ use_const_declaration: constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") - constList := $1.(*stmt.ConstList) + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} + constList := $1.(*ast.StmtConstList) lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts) // save comments - yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONST T_STRING '=' static_scalar { - name := node.NewIdentifier($2.Value) - constant := stmt.NewConstant(name, $4, "") - constList := []node.Node{constant} - $$ = stmt.NewConstList(constList) + name := &ast.Identifier{ast.Node{}, $2.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $4} + constList := []ast.Vertex{constant} + $$ = &ast.StmtConstList{ast.Node{}, constList} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -808,7 +801,7 @@ constant_declaration: inner_statement_list: inner_statement_list inner_statement { - if inlineHtmlNode, ok := $2.(*stmt.InlineHtml); ok && len($1) > 0 { + if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { prevNode := lastNode($1) yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) } @@ -821,7 +814,7 @@ inner_statement_list: } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -838,35 +831,35 @@ inner_statement: } | statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { - $$ = stmt.NewHaltCompiler() + $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.HaltCompiller, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.OpenParenthesisToken, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -876,22 +869,22 @@ inner_statement: statement: unticked_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STRING ':' { - label := node.NewIdentifier($1.Value) - $$ = stmt.NewLabel(label) + label := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtLabel{ast.Node{}, label} // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -900,119 +893,119 @@ statement: unticked_statement: '{' inner_statement_list '}' { - $$ = stmt.NewStmtList($2) + $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IF parenthesis_expr statement elseif_list else_single { - $$ = stmt.NewIf($2, $3, $4, $5) + $$ = &ast.StmtIf{ast.Node{}, $2, $3, $4, $5} // save position if $5 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) } else if len($4) > 0 { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { - stmts := stmt.NewStmtList($4) - $$ = stmt.NewAltIf($2, stmts, $5, $6) + stmts := &ast.StmtStmtList{ast.Node{}, $4} + $$ = &ast.StmtAltIf{ast.Node{}, $2, stmts, $5, $6} // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.If, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $8.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_WHILE parenthesis_expr while_statement { switch n := $3.(type) { - case *stmt.While : + case *ast.StmtWhile : n.Cond = $2 - case *stmt.AltWhile : + case *ast.StmtAltWhile : n.Cond = $2 } $$ = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DO statement T_WHILE parenthesis_expr ';' { - $$ = stmt.NewDo($2, $4) + $$ = &ast.StmtDo{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - if len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.While, (*$4.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + if len($4.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$4.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$4.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$4.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($4.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { switch n := $9.(type) { - case *stmt.For : + case *ast.StmtFor : n.Init = $3 n.Cond = $5 n.Loop = $7 - case *stmt.AltFor : + case *ast.StmtAltFor : n.Init = $3 n.Cond = $5 n.Loop = $7 @@ -1021,23 +1014,23 @@ unticked_statement: $$ = $9 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.For, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.InitExpr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CondExpr, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.IncExpr, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_SWITCH parenthesis_expr switch_case_list { switch n := $3.(type) { - case *stmt.Switch: + case *ast.StmtSwitch: n.Cond = $2 - case *stmt.AltSwitch: + case *ast.StmtAltSwitch: n.Cond = $2 default: panic("unexpected node type") @@ -1046,213 +1039,213 @@ unticked_statement: $$ = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Switch, (*$2.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$2.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BREAK ';' { - $$ = stmt.NewBreak(nil) + $$ = &ast.StmtBreak{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BREAK expr ';' { - $$ = stmt.NewBreak($2) + $$ = &ast.StmtBreak{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONTINUE ';' { - $$ = stmt.NewContinue(nil) + $$ = &ast.StmtContinue{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONTINUE expr ';' { - $$ = stmt.NewContinue($2) + $$ = &ast.StmtContinue{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN ';' { - $$ = stmt.NewReturn(nil) + $$ = &ast.StmtReturn{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN expr_without_variable ';' { - $$ = stmt.NewReturn($2) + $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_RETURN variable ';' { - $$ = stmt.NewReturn($2) + $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | yield_expr ';' { - $$ = stmt.NewExpression($1) + $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_GLOBAL global_var_list ';' { - $$ = stmt.NewGlobal($2) + $$ = &ast.StmtGlobal{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC static_var_list ';' { - $$ = stmt.NewStatic($2) + $$ = &ast.StmtStatic{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ECHO echo_expr_list ';' { - $$ = stmt.NewEcho($2) + $$ = &ast.StmtEcho{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INLINE_HTML { - $$ = stmt.NewInlineHtml($1.Value) + $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr ';' { - $$ = stmt.NewExpression($1) + $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_UNSET '(' unset_variables ')' ';' { - $$ = stmt.NewUnset($3) + $$ = &ast.StmtUnset{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Unset, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.CloseParenthesisToken, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1260,39 +1253,39 @@ unticked_statement: { if $6 == nil { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : + n.Var = $5 + case *ast.StmtAltForeach : n.Expr = $3 - n.Variable = $5 + n.Var = $5 } } else { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 - case *stmt.AltForeach : + n.Var = $6 + case *ast.StmtAltForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 + n.Var = $6 } } - + $$ = $8 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1300,116 +1293,116 @@ unticked_statement: { if $6 == nil { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 - n.Variable = $5 - case *stmt.AltForeach : + n.Var = $5 + case *ast.StmtAltForeach : n.Expr = $3 - n.Variable = $5 + n.Var = $5 } } else { switch n := $8.(type) { - case *stmt.Foreach : + case *ast.StmtForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 - case *stmt.AltForeach : + n.Var = $6 + case *ast.StmtAltForeach : n.Expr = $3 n.Key = $5 - n.Variable = $6 + n.Var = $6 } } - + // save position $$ = $8 - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Foreach, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Key, (*$6.GetFreeFloating())[freefloating.Key]); delete((*$6.GetFreeFloating()), freefloating.Key) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DECLARE '(' declare_list ')' declare_statement { $$ = $5 - $$.(*stmt.Declare).Consts = $3 + $$.(*ast.StmtDeclare).Consts = $3 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Declare, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ';' { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { - $$ = stmt.NewTry($3, $5, $6) + $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} // save position if $6 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Try, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_THROW expr ';' { - $$ = stmt.NewThrow($2) + $$ = &ast.StmtThrow{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_GOTO T_STRING ';' { - label := node.NewIdentifier($2.Value) - $$ = stmt.NewGoto(label) + label := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtGoto{ast.Node{}, label} // save position - label.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(label, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Label, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1418,30 +1411,29 @@ unticked_statement: catch_statement: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - catchNode := stmt.NewCatch([]node.Node{$3}, variable, $7) - $$ = append([]node.Node{catchNode}, $9...) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + catchNode := &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} + $$ = append([]ast.Vertex{catchNode}, $9...) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - catchNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + catchNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Catch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Var, $5.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Cond, $6.FreeFloating) - yylex.(*Parser).setFreeFloating(catchNode, freefloating.Stmts, $8.FreeFloating) + yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1450,21 +1442,21 @@ catch_statement: finally_statement: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINALLY '{' inner_statement_list '}' { - $$ = stmt.NewFinally($3) + $$ = &ast.StmtFinally{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Finally, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1473,13 +1465,13 @@ finally_statement: additional_catches: non_empty_additional_catches { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1488,13 +1480,13 @@ additional_catches: non_empty_additional_catches: additional_catch { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_additional_catches additional_catch { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1503,23 +1495,22 @@ non_empty_additional_catches: additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = stmt.NewCatch([]node.Node{$3}, variable, $7) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Catch, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $8.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1528,7 +1519,7 @@ additional_catch: unset_variables: unset_variable { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1537,7 +1528,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1546,7 +1537,7 @@ unset_variables: unset_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1555,7 +1546,7 @@ unset_variable: function_declaration_statement: unticked_function_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1564,7 +1555,7 @@ function_declaration_statement: class_declaration_statement: unticked_class_declaration_statement { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1595,25 +1586,25 @@ is_variadic: unticked_function_declaration_statement: function is_reference T_STRING '(' parameter_list ')' '{' inner_statement_list '}' { - name := node.NewIdentifier($3.Value) - $$ = stmt.NewFunction(name, $2 != nil, $5, nil, $8, "") + name := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $5, nil, $8} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParamList, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Params, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Params, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1622,15 +1613,15 @@ unticked_function_declaration_statement: unticked_class_declaration_statement: class_entry_type T_STRING extends_from implements_list '{' class_statement_list '}' { - name := node.NewIdentifier($2.Value) + name := &ast.Identifier{ast.Node{}, $2.Value} switch n := $1.(type) { - case *stmt.Class : + case *ast.StmtClass : n.ClassName = name n.Stmts = $6 n.Extends = $3 n.Implements = $4 - case *stmt.Trait : + case *ast.StmtTrait : // TODO: is it possible that trait extend or implement n.TraitName = name n.Stmts = $6 @@ -1638,30 +1629,30 @@ unticked_class_declaration_statement: $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $7.FreeFloating) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { - name := node.NewIdentifier($2.Value) - $$ = stmt.NewInterface(name, $3, $5, "") + name := &ast.Identifier{ast.Node{}, $2.Value} + $$ = &ast.StmtInterface{ast.Node{}, name, $3, $5} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $6.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1671,55 +1662,55 @@ unticked_class_declaration_statement: class_entry_type: T_CLASS { - $$ = stmt.NewClass(nil, nil, nil, nil, nil, nil, "") + $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ABSTRACT T_CLASS { - classModifier := node.NewIdentifier($1.Value) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + classModifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRAIT { - $$ = stmt.NewTrait(nil, nil, "") + $$ = &ast.StmtTrait{ast.Node{}, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINAL T_CLASS { - classModifier := node.NewIdentifier($1.Value) - $$ = stmt.NewClass(nil, []node.Node{classModifier}, nil, nil, nil, nil, "") + classModifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1728,19 +1719,19 @@ class_entry_type: extends_from: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS fully_qualified_class_name { - $$ = stmt.NewClassExtends($2); + $$ = &ast.StmtClassExtends{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1756,19 +1747,19 @@ interface_entry: interface_extends_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS interface_list { - $$ = stmt.NewInterfaceExtends($2); + $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1777,19 +1768,19 @@ interface_extends_list: implements_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IMPLEMENTS interface_list { - $$ = stmt.NewClassImplements($2); + $$ = &ast.StmtClassImplements{ast.Node{}, $2}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1798,7 +1789,7 @@ implements_list: interface_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1807,7 +1798,7 @@ interface_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1816,7 +1807,7 @@ interface_list: foreach_optional_arg: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1825,7 +1816,7 @@ foreach_optional_arg: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Key, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Key, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1834,33 +1825,33 @@ foreach_optional_arg: foreach_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' variable { - $$ = expr.NewReference($2) + $$ = &ast.ExprReference{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' assignment_list ')' { - $$ = expr.NewList($3) + $$ = &ast.ExprList{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1869,27 +1860,27 @@ foreach_variable: for_statement: statement { - $$ = stmt.NewFor(nil, nil, nil, $1) + $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltFor(nil, nil, nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1898,27 +1889,27 @@ for_statement: foreach_statement: statement { - $$ = stmt.NewForeach(nil, nil, nil, $1) + $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltForeach(nil, nil, nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1928,27 +1919,27 @@ foreach_statement: declare_statement: statement { - $$ = stmt.NewDeclare(nil, $1, false) + $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewDeclare(nil, stmtList, true) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1958,34 +1949,34 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - name := node.NewIdentifier($1.Value) - constant := stmt.NewConstant(name, $3, "") - $$ = []node.Node{constant} + name := &ast.Identifier{ast.Node{}, $1.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $3} + $$ = []ast.Vertex{constant} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | declare_list ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} $$ = append($1, constant) // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1995,68 +1986,68 @@ declare_list: switch_case_list: '{' case_list '}' { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' ';' case_list '}' { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' case_list T_ENDSWITCH ';' { - caseList := stmt.NewCaseList($2) - $$ = stmt.NewAltSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $2} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' ';' case_list T_ENDSWITCH ';' { - caseList := stmt.NewCaseList($3) - $$ = stmt.NewAltSwitch(nil, caseList) + caseList := &ast.StmtCaseList{ast.Node{}, $3} + $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5)) + caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListStart, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, freefloating.CaseListEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2066,37 +2057,37 @@ switch_case_list: case_list: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_CASE expr case_separator inner_statement_list { - _case := stmt.NewCase($3, $5) + _case := &ast.StmtCase{ast.Node{}, $3, $5} $$ = append($1, _case) // save position - _case.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(_case, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_DEFAULT case_separator inner_statement_list { - _default := stmt.NewDefault($4) + _default := &ast.StmtDefault{ast.Node{}, $4} $$ = append($1, _default) // save position - _default.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4)) + _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.Default, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_default, freefloating.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2118,27 +2109,27 @@ case_separator: while_statement: statement { - $$ = stmt.NewWhile(nil, $1) + $$ = &ast.StmtWhile{ast.Node{}, nil, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := stmt.NewStmtList($2) - $$ = stmt.NewAltWhile(nil, stmtList) + stmtList := &ast.StmtStmtList{ast.Node{}, $2} + $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AltEnd, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2149,25 +2140,25 @@ while_statement: elseif_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | elseif_list T_ELSEIF parenthesis_expr statement { - _elseIf := stmt.NewElseIf($3, $4) + _elseIf := &ast.StmtElseIf{ast.Node{}, $3, $4} $$ = append($1, _elseIf) // save position - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2178,29 +2169,29 @@ elseif_list: new_elseif_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { - stmts := stmt.NewStmtList($5) - _elseIf := stmt.NewAltElseIf($3, stmts) + stmts := &ast.StmtStmtList{ast.Node{}, $5} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmts} $$ = append($1, _elseIf) // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($5)) - _elseIf.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5)) + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($5) + _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Start, $2.FreeFloating) - if len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.ElseIf, (*$3.GetFreeFloating())[freefloating.OpenParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.OpenParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } - if len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Expr, (*$3.GetFreeFloating())[freefloating.CloseParenthesisToken][:len((*$3.GetFreeFloating())[freefloating.CloseParenthesisToken])-1]); delete((*$3.GetFreeFloating()), freefloating.CloseParenthesisToken) + if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating(_elseIf, freefloating.Cond, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2210,19 +2201,19 @@ new_elseif_list: else_single: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE statement { - $$ = stmt.NewElse($2) + $$ = &ast.StmtElse{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2232,22 +2223,22 @@ else_single: new_else_single: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE ':' inner_statement_list { - stmts := stmt.NewStmtList($3) - $$ = stmt.NewAltElse(stmts) + stmts := &ast.StmtStmtList{ast.Node{}, $3} + $$ = &ast.StmtAltElse{ast.Node{}, stmts} // save position - stmts.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Else, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Else, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2257,13 +2248,13 @@ new_else_single: parameter_list: non_empty_parameter_list { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2272,7 +2263,7 @@ parameter_list: non_empty_parameter_list: parameter { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2281,7 +2272,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2290,21 +2281,21 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, nil, $2 != nil, $3 != nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) } // save comments @@ -2312,44 +2303,43 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = node.NewParameter($1, variable, $6, $2 != nil, $3 != nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) } else if $2 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) } // save comments @@ -2357,24 +2347,23 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Variadic, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, (*$$.GetFreeFloating())[freefloating.Variadic]); delete((*$$.GetFreeFloating()), freefloating.Variadic) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.OptionalType, (*$$.GetFreeFloating())[freefloating.Ampersand]); delete((*$$.GetFreeFloating()), freefloating.Ampersand) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, (*$$.GetFreeFloating())[freefloating.OptionalType]); delete((*$$.GetFreeFloating()), freefloating.OptionalType) + yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2385,37 +2374,37 @@ parameter: optional_class_type: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CALLABLE { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | fully_qualified_class_name { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2425,42 +2414,42 @@ optional_class_type: function_call_parameter_list: '(' ')' { - $$ = node.NewArgumentList(nil) + $$ = &ast.ArgumentList{ast.Node{}, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' non_empty_function_call_parameter_list ')' { - $$ = node.NewArgumentList($2) + $$ = &ast.ArgumentList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' yield_expr ')' { - arg := node.NewArgument($2, false, false) - $$ = node.NewArgumentList([]node.Node{arg}) + arg := &ast.Argument{ast.Node{}, false, false, $2} + $$ = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} // save position - arg.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + arg.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArgumentList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2470,7 +2459,7 @@ function_call_parameter_list: non_empty_function_call_parameter_list: function_call_parameter { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2479,7 +2468,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2488,10 +2477,10 @@ non_empty_function_call_parameter_list: function_call_parameter: expr_without_variable { - $$ = node.NewArgument($1, false, false) + $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2500,10 +2489,10 @@ function_call_parameter: } | variable { - $$ = node.NewArgument($1, false, false) + $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2512,25 +2501,25 @@ function_call_parameter: } | '&' w_variable { - $$ = node.NewArgument($2, false, true) + $$ = &ast.Argument{ast.Node{}, false, true, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELLIPSIS expr { - $$ = node.NewArgument($2, true, false) + $$ = &ast.Argument{ast.Node{}, true, false, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2542,13 +2531,13 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | global_var { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2558,44 +2547,43 @@ global_var_list: global_var: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' r_variable { - $$ = expr.NewVariable($2) + $$ = &ast.ExprVariable{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' '{' expr '}' { - $$ = expr.NewVariable($3) + $$ = &ast.ExprVariable{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2605,77 +2593,73 @@ global_var: static_var_list: static_var_list ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, nil) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} $$ = append($1, staticVar) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_var_list ',' T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, $5) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $5} $$ = append($1, staticVar) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, nil) - $$ = []node.Node{staticVar} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} + $$ = []ast.Vertex{staticVar} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - staticVar := stmt.NewStaticVar(variable, $3) - $$ = []node.Node{staticVar} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $3} + $$ = []ast.Vertex{staticVar} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - staticVar.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2685,13 +2669,13 @@ static_var_list: class_statement_list: class_statement_list class_statement { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2701,15 +2685,15 @@ class_statement_list: class_statement: variable_modifiers class_variable_declaration ';' { - $$ = stmt.NewPropertyList($1, nil, $2) + $$ = &ast.StmtPropertyList{ast.Node{}, $1, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.PropertyList, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2718,11 +2702,11 @@ class_statement: $$ = $1 // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.ConstList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2734,32 +2718,32 @@ class_statement: } | method_modifiers function is_reference T_STRING '(' parameter_list ')' method_body { - name := node.NewIdentifier($4.Value) - $$ = stmt.NewClassMethod(name, $1, $3 != nil, $6, nil, $8, "") + name := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $6, nil, $8} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) if $1 == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8) } // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, freefloating.ModifierList, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $7.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2768,13 +2752,13 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - $$ = stmt.NewTraitUse($2, $3) + $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2783,7 +2767,7 @@ trait_use_statement: trait_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2792,7 +2776,7 @@ trait_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2801,25 +2785,25 @@ trait_list: trait_adaptations: ';' { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' trait_adaptation_list '}' { - $$ = stmt.NewTraitAdaptationList($2) + $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.AdaptationList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2828,13 +2812,13 @@ trait_adaptations: trait_adaptation_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2843,13 +2827,13 @@ trait_adaptation_list: non_empty_trait_adaptation_list: trait_adaptation_statement { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list trait_adaptation_statement { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2861,8 +2845,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.NameList, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2871,8 +2855,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Alias, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2881,14 +2865,14 @@ trait_adaptation_statement: trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { - $$ = stmt.NewTraitUsePrecedence($1, $3) + $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2897,7 +2881,7 @@ trait_precedence: trait_reference_list: fully_qualified_class_name { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2906,7 +2890,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2915,21 +2899,21 @@ trait_reference_list: trait_method_reference: T_STRING { - name := node.NewIdentifier($1.Value) - $$ = stmt.NewTraitMethodRef(nil, name) + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference_fully_qualified { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,17 +2922,17 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = stmt.NewTraitMethodRef($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2957,30 +2941,30 @@ trait_method_reference_fully_qualified: trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { - alias := node.NewIdentifier($4.Value) - $$ = stmt.NewTraitUseAlias($1, $3, alias) + alias := &ast.Identifier{ast.Node{}, $4.Value} + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} // save position - alias.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) + alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(alias, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_method_reference T_AS member_modifier { - $$ = stmt.NewTraitUseAlias($1, $3, nil) + $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Ref, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2989,42 +2973,42 @@ trait_alias: trait_modifiers: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | member_modifier { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; method_body: - ';' /* abstract method */ + ';' /* abstract method */ { - $$ = stmt.NewNop() + $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' inner_statement_list '}' { - $$ = stmt.NewStmtList($2) + $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3033,20 +3017,20 @@ method_body: variable_modifiers: non_empty_member_modifiers { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VAR { - modifier := node.NewIdentifier($1.Value) - $$ = []node.Node{modifier} + modifier := &ast.Identifier{ast.Node{}, $1.Value} + $$ = []ast.Vertex{modifier} // save position - modifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3055,13 +3039,13 @@ variable_modifiers: method_modifiers: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3070,13 +3054,13 @@ method_modifiers: non_empty_member_modifiers: member_modifier { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers member_modifier { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3085,73 +3069,73 @@ non_empty_member_modifiers: member_modifier: T_PUBLIC { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PROTECTED { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PRIVATE { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ABSTRACT { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINAL { - $$ = node.NewIdentifier($1.Value) + $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3160,77 +3144,73 @@ member_modifier: class_variable_declaration: class_variable_declaration ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, nil, "") + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, nil} $$ = append($1, property) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, $5, "") + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, $5} $$ = append($1, property) - + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, freefloating.Var, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, nil, "") - $$ = []node.Node{property} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, nil} + $$ = []ast.Vertex{property} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' static_scalar { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - property := stmt.NewProperty(variable, $3, "") - $$ = []node.Node{property} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + property := &ast.StmtProperty{ast.Node{}, variable, $3} + $$ = []ast.Vertex{property} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - property.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating(property, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3239,40 +3219,40 @@ class_variable_declaration: class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { - name := node.NewIdentifier($3.Value) - constant := stmt.NewConstant(name, $5, "") - constList := $1.(*stmt.ClassConstList) + name := &ast.Identifier{ast.Node{}, $3.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $5} + constList := $1.(*ast.StmtClassConstList) lastConst := lastNode(constList.Consts) constList.Consts = append(constList.Consts, constant) $$ = $1 // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5)) - $1.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + $1.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating(lastConst, freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONST T_STRING '=' static_scalar { - name := node.NewIdentifier($2.Value) - constant := stmt.NewConstant(name, $4, "") - $$ = stmt.NewClassConstList(nil, []node.Node{constant}) + name := &ast.Identifier{ast.Node{}, $2.Value} + constant := &ast.StmtConstant{ast.Node{}, name, $4} + $$ = &ast.StmtClassConstList{ast.Node{}, nil, []ast.Vertex{constant}} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - constant.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(constant, freefloating.Name, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3284,13 +3264,13 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3300,13 +3280,13 @@ echo_expr_list: for_expr: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_for_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3318,13 +3298,13 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3333,13 +3313,13 @@ non_empty_for_expr: chaining_method_or_property: chaining_method_or_property variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_property { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3348,29 +3328,29 @@ chaining_method_or_property: chaining_dereference: chaining_dereference '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $2) - $$ = []node.Node{fetch} - + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $2} + $$ = []ast.Vertex{fetch} + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($2)) - + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3379,19 +3359,19 @@ chaining_dereference: chaining_instance_call: chaining_dereference chaining_method_or_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_method_or_property { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3400,13 +3380,13 @@ chaining_instance_call: instance_call: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_instance_call { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3417,15 +3397,15 @@ new_expr: { if $3 != nil { - $$ = expr.NewNew($2, $3.(*node.ArgumentList)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3)) + $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) } else { - $$ = expr.NewNew($2, nil) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$ = &ast.ExprNew{ast.Node{}, $2, nil} + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3434,691 +3414,691 @@ new_expr: expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { - listNode := expr.NewList($3) - $$ = assign.NewAssign(listNode, $6) + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6)) + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $5.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' expr { - $$ = assign.NewAssign($1, $3) + $$ = &ast.ExprAssign{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' variable { - $$ = assign.NewReference($1, $4) + $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable '=' '&' T_NEW class_name_reference ctor_arguments { - var _new *expr.New + var _new *ast.ExprNew if $6 != nil { - _new = expr.NewNew($5, $6.(*node.ArgumentList)) + _new = &ast.ExprNew{ast.Node{}, $5, $6.(*ast.ArgumentList)} } else { - _new = expr.NewNew($5, nil) + _new = &ast.ExprNew{ast.Node{}, $5, nil} } - $$ = assign.NewReference($1, _new) + $$ = &ast.ExprAssignReference{ast.Node{}, $1, _new} // save position if $6 != nil { - _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6)) + _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) } else { - _new.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5)) + _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5) } - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(_new, freefloating.Start, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLONE expr { - $$ = expr.NewClone($2) + $$ = &ast.ExprClone{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_PLUS_EQUAL expr { - $$ = assign.NewPlus($1, $3) + $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MINUS_EQUAL expr { - $$ = assign.NewMinus($1, $3) + $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MUL_EQUAL expr { - $$ = assign.NewMul($1, $3) + $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_POW_EQUAL expr { - $$ = assign.NewPow($1, $3) + $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_DIV_EQUAL expr { - $$ = assign.NewDiv($1, $3) + $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_CONCAT_EQUAL expr { - $$ = assign.NewConcat($1, $3) + $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_MOD_EQUAL expr { - $$ = assign.NewMod($1, $3) + $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_AND_EQUAL expr { - $$ = assign.NewBitwiseAnd($1, $3) + $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_OR_EQUAL expr { - $$ = assign.NewBitwiseOr($1, $3) + $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_XOR_EQUAL expr { - $$ = assign.NewBitwiseXor($1, $3) + $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SL_EQUAL expr { - $$ = assign.NewShiftLeft($1, $3) + $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable T_SR_EQUAL expr { - $$ = assign.NewShiftRight($1, $3) + $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | rw_variable T_INC { - $$ = expr.NewPostInc($1) + $$ = &ast.ExprPostInc{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INC rw_variable { - $$ = expr.NewPreInc($2) + $$ = &ast.ExprPreInc{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | rw_variable T_DEC { - $$ = expr.NewPostDec($1) + $$ = &ast.ExprPostDec{ast.Node{}, $1} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DEC rw_variable { - $$ = expr.NewPreDec($2) + $$ = &ast.ExprPreDec{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_OR expr { - $$ = binary.NewBooleanOr($1, $3) + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_BOOLEAN_AND expr { - $$ = binary.NewBooleanAnd($1, $3) + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_OR expr { - $$ = binary.NewLogicalOr($1, $3) + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_AND expr { - $$ = binary.NewLogicalAnd($1, $3) + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_LOGICAL_XOR expr { - $$ = binary.NewLogicalXor($1, $3) + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '|' expr { - $$ = binary.NewBitwiseOr($1, $3) + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '&' expr { - $$ = binary.NewBitwiseAnd($1, $3) + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '^' expr { - $$ = binary.NewBitwiseXor($1, $3) + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '.' expr { - $$ = binary.NewConcat($1, $3) + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '+' expr { - $$ = binary.NewPlus($1, $3) + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '-' expr { - $$ = binary.NewMinus($1, $3) + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '*' expr { - $$ = binary.NewMul($1, $3) + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_POW expr { - $$ = binary.NewPow($1, $3) + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '/' expr { - $$ = binary.NewDiv($1, $3) + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '%' expr { - $$ = binary.NewMod($1, $3) + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SL expr { - $$ = binary.NewShiftLeft($1, $3) + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_SR expr { - $$ = binary.NewShiftRight($1, $3) + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' expr %prec T_INC { - $$ = expr.NewUnaryPlus($2) + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' expr %prec T_INC { - $$ = expr.NewUnaryMinus($2) + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '!' expr { - $$ = expr.NewBooleanNot($2) + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '~' expr { - $$ = expr.NewBitwiseNot($2) + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_IDENTICAL expr { - $$ = binary.NewIdentical($1, $3) + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_IDENTICAL expr { - $$ = binary.NewNotIdentical($1, $3) + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_EQUAL expr { - $$ = binary.NewEqual($1, $3) + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_NOT_EQUAL expr { - $$ = binary.NewNotEqual($1, $3) + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '<' expr { - $$ = binary.NewSmaller($1, $3) + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_SMALLER_OR_EQUAL expr { - $$ = binary.NewSmallerOrEqual($1, $3) + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '>' expr { - $$ = binary.NewGreater($1, $3) + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_IS_GREATER_OR_EQUAL expr { - $$ = binary.NewGreaterOrEqual($1, $3) + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_INSTANCEOF class_name_reference { - $$ = expr.NewInstanceOf($1, $3) + $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - yylex.(*Parser).setFreeFloating($1, freefloating.Start, append((*$1.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$1.GetFreeFloating())[freefloating.Start]...)); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($1, freefloating.End, append((*$1.GetFreeFloating())[freefloating.End], (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]...)); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($1, token.Start, append($1.GetNode().Tokens[token.OpenParenthesisToken], $1.GetNode().Tokens[token.Start]...)); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($1, token.End, append($1.GetNode().Tokens[token.End], $1.GetNode().Tokens[token.CloseParenthesisToken]...)); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } | new_expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4127,294 +4107,294 @@ expr_without_variable: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) for _, n := range($4) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ + case *ast.ExprArrayDimFetch: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, n)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, n) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' expr ':' expr { - $$ = expr.NewTernary($1, $3, $5) + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' ':' expr { - $$ = expr.NewTernary($1, nil, $4) + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | internal_functions_in_yacc { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INT_CAST expr { - $$ = cast.NewInt($2) + $$ = &ast.ExprCastInt{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOUBLE_CAST expr { - $$ = cast.NewDouble($2) + $$ = &ast.ExprCastDouble{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STRING_CAST expr { - $$ = cast.NewString($2) + $$ = &ast.ExprCastString{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY_CAST expr { - $$ = cast.NewArray($2) + $$ = &ast.ExprCastArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_OBJECT_CAST expr { - $$ = cast.NewObject($2) + $$ = &ast.ExprCastObject{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_BOOL_CAST expr { - $$ = cast.NewBool($2) + $$ = &ast.ExprCastBool{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_UNSET_CAST expr { - $$ = cast.NewUnset($2) + $$ = &ast.ExprCastUnset{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXIT exit_expr { - e := $2.(*expr.Exit) + e := $2.(*ast.ExprExit) $$ = $2 - if (strings.EqualFold($1.Value, "die")) { + if (bytes.EqualFold($1.Value, []byte("die"))) { e.Die = true } // save position - if $2.GetPosition() == nil { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + if $2.GetNode().Position == nil { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) } // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '@' expr { - $$ = expr.NewErrorSuppress($2) + $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '`' backticks_expr '`' { - $$ = expr.NewShellExec($2) + $$ = &ast.ExprShellExec{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_PRINT expr { - $$ = expr.NewPrint($2) + $$ = &ast.ExprPrint{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD { - $$ = expr.NewYield(nil, nil) + $$ = &ast.ExprYield{ast.Node{}, nil, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($4, $6, nil, $8, false, $2 != nil, "") + $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $4, $6, nil, $8} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $5.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $7.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $9.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) // normalize if $6 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = expr.NewClosure($5, $7, nil, $9, true, $3 != nil, "") + $$ = &ast.ExprClosure{ast.Node{}, $3 != nil, true, $5, $7, nil, $9} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Static, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Static, $2.Tokens) if $3 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, freefloating.Function, $3.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Ampersand, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, freefloating.ParameterList, $6.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVars, $8.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Stmts, $10.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Tokens) // normalize if $7 == nil { - yylex.(*Parser).setFreeFloating($$, freefloating.Params, (*$$.GetFreeFloating())[freefloating.LexicalVars]); delete((*$$.GetFreeFloating()), freefloating.LexicalVars) + yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4424,51 +4404,51 @@ expr_without_variable: yield_expr: T_YIELD expr_without_variable { - $$ = expr.NewYield(nil, $2) + $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD variable { - $$ = expr.NewYield(nil, $2) + $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { - $$ = expr.NewYield($2, $4) + $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_YIELD expr T_DOUBLE_ARROW variable { - $$ = expr.NewYield($2, $4) + $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4477,59 +4457,59 @@ yield_expr: combined_scalar_offset: combined_scalar '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { - str := scalar.NewString($1.Value) - $$ = expr.NewArrayDimFetch(str, $3) + str := &ast.ScalarString{ast.Node{}, $1.Value} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, str, $3} // save position - str.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4)) + str.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | general_constant '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4538,28 +4518,28 @@ combined_scalar_offset: combined_scalar: T_ARRAY '(' array_pair_list ')' { - $$ = expr.NewArray($3) + $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' array_pair_list ']' { - $$ = expr.NewShortArray($2) + $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,21 +4555,21 @@ function: lexical_vars: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE '(' lexical_var_list ')' { - $$ = expr.NewClosureUse($3) + $$ = &ast.ExprClosureUse{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Use, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.LexicalVarList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4598,73 +4578,69 @@ lexical_vars: lexical_var_list: lexical_var_list ',' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($3.Value, isDollar)) - variable := expr.NewVariable(identifier) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($3.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = append($1, variable) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | lexical_var_list ',' '&' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($4.Value, isDollar)) - variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + reference := &ast.ExprReference{ast.Node{}, variable} $$ = append($1, reference) // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($4)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $4.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = []node.Node{variable} + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = []ast.Vertex{variable} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($2.Value, isDollar)) - variable := expr.NewVariable(identifier) - reference := expr.NewReference(variable) - $$ = []node.Node{reference} - + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + reference := &ast.ExprReference{ast.Node{}, variable} + $$ = []ast.Vertex{reference} + // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) - + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(variable, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).addDollarToken(variable) + yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4673,12 +4649,12 @@ lexical_var_list: function_call: namespace_name function_call_parameter_list { - name := name.NewName($1) - $$ = expr.NewFunctionCall(name, $2.(*node.ArgumentList)) - + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprFunctionCall{ast.Node{}, name, $2.(*ast.ArgumentList)} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4687,91 +4663,91 @@ function_call: } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { - funcName := name.NewRelative($3) - $$ = expr.NewFunctionCall(funcName, $4.(*node.ArgumentList)) - + funcName := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $4.(*ast.ArgumentList)} + // save position - funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4)) + funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(funcName, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name function_call_parameter_list { - funcName := name.NewFullyQualified($2) - $$ = expr.NewFunctionCall(funcName, $3.(*node.ArgumentList)) - + funcName := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $3.(*ast.ArgumentList)} + // save position - funcName.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3)) + funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { - $$ = expr.NewStaticCall($1, $3, $4.(*node.ArgumentList)) - + $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_without_objects function_call_parameter_list { - $$ = expr.NewFunctionCall($1, $2.(*node.ArgumentList)) - + $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4783,23 +4759,23 @@ function_call: class_name: T_STATIC { - $$ = node.NewIdentifier($1.Value) - + $$ = &ast.Identifier{ast.Node{}, $1.Value} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | namespace_name + | namespace_name { - $$ = name.NewName($1) - + $$ = &ast.NameName{ast.Node{}, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4807,26 +4783,26 @@ class_name: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - $$ = name.NewRelative($3) - + $$ = &ast.NameRelative{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - $$ = name.NewFullyQualified($2) - + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4835,11 +4811,11 @@ class_name: fully_qualified_class_name: namespace_name { - $$ = name.NewName($1) - + $$ = &ast.NameName{ast.Node{}, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4847,26 +4823,26 @@ fully_qualified_class_name: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - $$ = name.NewRelative($3) - + $$ = &ast.NameRelative{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - $$ = name.NewFullyQualified($2) - + $$ = &ast.NameFullyQualified{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4875,13 +4851,13 @@ fully_qualified_class_name: class_name_reference: class_name { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dynamic_class_name_reference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4893,45 +4869,45 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } for _, n := range($4) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } - | base_variable + | base_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4941,13 +4917,13 @@ dynamic_class_name_reference: dynamic_class_name_variable_properties: dynamic_class_name_variable_properties dynamic_class_name_variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4958,9 +4934,9 @@ dynamic_class_name_variable_property: T_OBJECT_OPERATOR object_property { $$ = $2 - + // save comments - yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4969,62 +4945,62 @@ dynamic_class_name_variable_property: exit_expr: /* empty */ { - $$ = expr.NewExit(nil); + $$ = &ast.ExprExit{ast.Node{}, false, nil}; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' ')' { - $$ = expr.NewExit(nil); + $$ = &ast.ExprExit{ast.Node{}, false, nil}; // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr { - $$ = expr.NewExit($1); + $$ = &ast.ExprExit{ast.Node{}, false, $1}; // save position - if yylex.(*Parser).currentToken.Value == ")" { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition(yylex.(*Parser).currentToken)) + if bytes.Compare(yylex.(*Parser).currentToken.Value, []byte(")")) == 0 { + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition(yylex.(*Parser).currentToken) } else { - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Exit, (*$1.GetFreeFloating())[freefloating.OpenParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, (*$1.GetFreeFloating())[freefloating.CloseParenthesisToken]); delete((*$1.GetFreeFloating()), freefloating.CloseParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Exit, $1.GetNode().Tokens[token.OpenParenthesisToken]); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloating($$, token.Expr, $1.GetNode().Tokens[token.CloseParenthesisToken]); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } ; backticks_expr: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE { - part := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{part} + part := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{part} // save position - part.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list { - $$ = $1; + $$ = $1; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5033,13 +5009,13 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call_parameter_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5048,147 +5024,147 @@ ctor_arguments: common_scalar: T_LNUMBER { - $$ = scalar.NewLnumber($1.Value) + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DNUMBER { - $$ = scalar.NewDnumber($1.Value) + $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CONSTANT_ENCAPSED_STRING { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LINE { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FILE { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DIR { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_TRAIT_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_METHOD_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FUNC_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { - encapsed := scalar.NewEncapsedStringPart($2.Value) - $$ = scalar.NewHeredoc($1.Value, []node.Node{encapsed}) + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC T_END_HEREDOC { - $$ = scalar.NewHeredoc($1.Value, nil) + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5197,17 +5173,17 @@ common_scalar: static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) - + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} + // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5216,7 +5192,7 @@ static_class_constant: static_scalar: static_scalar_value { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5225,24 +5201,24 @@ static_scalar: static_scalar_value: common_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_class_name_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { - name := name.NewName($1) - $$ = expr.NewConstFetch(name) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5251,81 +5227,81 @@ static_scalar_value: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := name.NewRelative($3) - $$ = expr.NewConstFetch(name) - + name := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewFullyQualified($2) - $$ = expr.NewConstFetch(name) + name := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY '(' static_array_pair_list ')' { - $$ = expr.NewArray($3) + $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Array, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '[' static_array_pair_list ']' { - $$ = expr.NewShortArray($2) + $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.ArrayPairList, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_class_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_operation { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5334,417 +5310,417 @@ static_scalar_value: static_operation: static_scalar_value '[' static_scalar_value ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '+' static_scalar_value { - $$ = binary.NewPlus($1, $3) + $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '-' static_scalar_value { - $$ = binary.NewMinus($1, $3) + $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '*' static_scalar_value { - $$ = binary.NewMul($1, $3) + $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_POW static_scalar_value { - $$ = binary.NewPow($1, $3) + $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '/' static_scalar_value { - $$ = binary.NewDiv($1, $3) + $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '%' static_scalar_value { - $$ = binary.NewMod($1, $3) + $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '!' static_scalar_value { - $$ = expr.NewBooleanNot($2) + $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '~' static_scalar_value { - $$ = expr.NewBitwiseNot($2) - + $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '|' static_scalar_value { - $$ = binary.NewBitwiseOr($1, $3) + $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '&' static_scalar_value { - $$ = binary.NewBitwiseAnd($1, $3) + $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '^' static_scalar_value { - $$ = binary.NewBitwiseXor($1, $3) + $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_SL static_scalar_value { - $$ = binary.NewShiftLeft($1, $3) + $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_SR static_scalar_value { - $$ = binary.NewShiftRight($1, $3) + $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '.' static_scalar_value { - $$ = binary.NewConcat($1, $3) + $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_XOR static_scalar_value { - $$ = binary.NewLogicalXor($1, $3) + $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_AND static_scalar_value { - $$ = binary.NewLogicalAnd($1, $3) + $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_LOGICAL_OR static_scalar_value { - $$ = binary.NewLogicalOr($1, $3) + $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_BOOLEAN_AND static_scalar_value { - $$ = binary.NewBooleanAnd($1, $3) + $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_BOOLEAN_OR static_scalar_value { - $$ = binary.NewBooleanOr($1, $3) + $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_IDENTICAL static_scalar_value { - $$ = binary.NewIdentical($1, $3) + $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { - $$ = binary.NewNotIdentical($1, $3) + $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_EQUAL static_scalar_value { - $$ = binary.NewEqual($1, $3) + $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { - $$ = binary.NewNotEqual($1, $3) + $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '<' static_scalar_value { - $$ = binary.NewSmaller($1, $3) + $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '>' static_scalar_value { - $$ = binary.NewGreater($1, $3) + $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { - $$ = binary.NewSmallerOrEqual($1, $3) + $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { - $$ = binary.NewGreaterOrEqual($1, $3) + $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '?' ':' static_scalar_value { - $$ = expr.NewTernary($1, nil, $4) + $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value '?' static_scalar_value ':' static_scalar_value { - $$ = expr.NewTernary($1, $3, $5) + $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Cond, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.True, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '+' static_scalar_value { - $$ = expr.NewUnaryPlus($2) - + $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '-' static_scalar_value { - $$ = expr.NewUnaryMinus($2) - + $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5753,8 +5729,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5763,18 +5739,18 @@ static_operation: general_constant: class_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { - name := name.NewName($1) - $$ = expr.NewConstFetch(name) + name := &ast.NameName{ast.Node{}, $1} + $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewNodeListPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5783,30 +5759,30 @@ general_constant: } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := name.NewRelative($3) - $$ = expr.NewConstFetch(name) - + name := &ast.NameRelative{ast.Node{}, $3} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(name, freefloating.Namespace, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR namespace_name { - name := name.NewFullyQualified($2) - $$ = expr.NewConstFetch(name) - + name := &ast.NameFullyQualified{ast.Node{}, $2} + $$ = &ast.ExprConstFetch{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(name)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5815,69 +5791,69 @@ general_constant: scalar: T_STRING_VARNAME { - name := node.NewIdentifier($1.Value) - $$ = expr.NewVariable(name) - + name := &ast.Identifier{ast.Node{}, $1.Value} + $$ = &ast.ExprVariable{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | general_constant { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | common_scalar { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '"' encaps_list '"' { - $$ = scalar.NewEncapsed($2) + $$ = &ast.ScalarEncapsed{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_START_HEREDOC encaps_list T_END_HEREDOC { - $$ = scalar.NewHeredoc($1.Value, $2) + $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS_C { - $$ = scalar.NewMagicConstant($1.Value) + $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5886,7 +5862,7 @@ scalar: static_array_pair_list: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5896,7 +5872,7 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5917,54 +5893,54 @@ possible_comma: non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { - arrayItem := expr.NewArrayItem($3, $5, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_static_array_pair_list ',' static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { - arrayItem := expr.NewArrayItem($1, $3, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value { - arrayItem := expr.NewArrayItem(nil, $1, false) - $$ = []node.Node{arrayItem} - + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + $$ = []ast.Vertex{arrayItem} + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -5976,13 +5952,13 @@ non_empty_static_array_pair_list: expr: r_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5994,14 +5970,14 @@ parenthesis_expr: $$ = $2 // save comments - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6010,14 +5986,14 @@ parenthesis_expr: $$ = $2 // save comments - if len((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.Start, append((*$2.GetFreeFloating())[freefloating.OpenParenthesisToken], (*$2.GetFreeFloating())[freefloating.Start]...)) + if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) } - if len((*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, freefloating.End, append((*$2.GetFreeFloating())[freefloating.End], (*$2.GetFreeFloating())[freefloating.CloseParenthesisToken]...)) + if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { + yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, freefloating.OpenParenthesisToken, append($1.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, freefloating.CloseParenthesisToken, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6027,7 +6003,7 @@ parenthesis_expr: r_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6037,7 +6013,7 @@ r_variable: w_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6046,7 +6022,7 @@ w_variable: rw_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6058,54 +6034,54 @@ variable: $$ = $1 if $4 != nil { - $4[0].(*expr.MethodCall).Method = $3[len($3)-1].(*expr.PropertyFetch).Property + $4[0].(*ast.ExprMethodCall).Method = $3[len($3)-1].(*ast.ExprPropertyFetch).Property $3 = append($3[:len($3)-1], $4...) } // save comments - yylex.(*Parser).setFreeFloating($3[0], freefloating.Var, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } for _, n := range($5) { switch nn := n.(type) { - case *expr.ArrayDimFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + case *ast.ExprArrayDimFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.PropertyFetch: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprPropertyFetch: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) - - case *expr.MethodCall: - nn.Variable = $$ - nn.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn)) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) + + case *ast.ExprMethodCall: + nn.Var = $$ + nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Variable, $$) + yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } @@ -6113,7 +6089,7 @@ variable: } | base_variable_with_function_calls { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6122,13 +6098,13 @@ variable: variable_properties: variable_properties variable_property { - $$ = append($1, $2...) + $$ = append($1, $2...) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6139,14 +6115,14 @@ variable_property: T_OBJECT_OPERATOR object_property method_or_not { if $3 != nil { - $3[0].(*expr.MethodCall).Method = $2[len($2)-1].(*expr.PropertyFetch).Property + $3[0].(*ast.ExprMethodCall).Method = $2[len($2)-1].(*ast.ExprPropertyFetch).Property $2 = append($2[:len($2)-1], $3...) } $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], freefloating.Var, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6155,29 +6131,29 @@ variable_property: array_method_dereference: array_method_dereference '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | method '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) - $$ = []node.Node{$1, fetch} + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} + $$ = []ast.Vertex{$1, fetch} // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6186,10 +6162,10 @@ array_method_dereference: method: function_call_parameter_list { - $$ = expr.NewMethodCall(nil, nil, $1.(*node.ArgumentList)) + $$ = &ast.ExprMethodCall{ast.Node{}, nil, nil, $1.(*ast.ArgumentList)} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6198,19 +6174,19 @@ method: method_or_not: method { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_method_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6219,16 +6195,16 @@ method_or_not: variable_without_objects: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { - $1.last.SetVarName($2) + $1.last.VarName = $2 for _, n := range($1.all) { - n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6240,27 +6216,27 @@ variable_without_objects: static_member: class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { - $$ = expr.NewStaticPropertyFetch($1, $3) + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { - $$ = expr.NewStaticPropertyFetch($1, $3) + $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6269,7 +6245,7 @@ static_member: variable_class_name: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6278,29 +6254,29 @@ variable_class_name: array_function_dereference: array_function_dereference '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6309,19 +6285,19 @@ array_function_dereference: base_variable_with_function_calls: base_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_function_dereference { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6331,16 +6307,16 @@ base_variable_with_function_calls: base_variable: reference_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { - $1.last.SetVarName($2) + $1.last.VarName = $2 for _, n := range($1.all) { - n.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2)) + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6349,7 +6325,7 @@ base_variable: } | static_member { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6358,35 +6334,35 @@ base_variable: reference_variable: reference_variable '[' dim_offset ']' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | reference_variable '{' expr '}' { - $$ = expr.NewArrayDimFetch($1, $3) + $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | compound_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6396,31 +6372,30 @@ reference_variable: compound_variable: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) - + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} + // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '$' '{' expr '}' { - $$ = expr.NewVariable($3) - + $$ = &ast.ExprVariable{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, freefloating.Start, append($2.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($2), (*$3.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, freefloating.End, append((*$3.GetFreeFloating())[freefloating.End], append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6429,13 +6404,13 @@ compound_variable: dim_offset: /* empty */ { - $$ = nil + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6443,19 +6418,19 @@ dim_offset: object_property: - object_dim_list + object_dim_list { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_without_objects { - fetch := expr.NewPropertyFetch(nil, $1) - $$ = []node.Node{fetch} + fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, $1} + $$ = []ast.Vertex{fetch} // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6464,39 +6439,39 @@ object_property: object_dim_list: object_dim_list '[' dim_offset ']' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | object_dim_list '{' expr '}' { - fetch := expr.NewArrayDimFetch(nil, $3) + fetch := &ast.ExprArrayDimFetch{ast.Node{}, nil, $3} $$ = append($1, fetch) - + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_name { - fetch := expr.NewPropertyFetch(nil, $1) - $$ = []node.Node{fetch} - + fetch := &ast.ExprPropertyFetch{ast.Node{}, nil, $1} + $$ = []ast.Vertex{fetch} + // save position - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6505,26 +6480,26 @@ object_dim_list: variable_name: T_STRING { - $$ = node.NewIdentifier($1.Value) - + $$ = &ast.Identifier{ast.Node{}, $1.Value} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' expr '}' { $$ = $2 - + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, append($1.FreeFloating, append(yylex.(*Parser).GetFreeFloatingToken($1), (*$$.GetFreeFloating())[freefloating.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append((*$$.GetFreeFloating())[freefloating.End], append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6533,33 +6508,33 @@ variable_name: simple_indirect_reference: '$' { - n := expr.NewVariable(nil) - $$ = simpleIndirectReference{[]*expr.Variable{n}, n} - + n := &ast.ExprVariable{ast.Node{}, nil} + $$ = simpleIndirectReference{[]*ast.ExprVariable{n}, n} + // save position - n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + // save comments - yylex.(*Parser).setFreeFloating(n, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating(n, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference '$' { - n := expr.NewVariable(nil) + n := &ast.ExprVariable{ast.Node{}, nil} - $1.last.SetVarName(n) + $1.last.VarName = n $1.all = append($1.all, n) $1.last = n $$ = $1 - + // save position - n.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - + n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + // save comments - yylex.(*Parser).setFreeFloating(n, freefloating.Start, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(n, freefloating.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating(n, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6569,22 +6544,22 @@ assignment_list: assignment_list ',' assignment_list_element { if len($1) == 0 { - $1 = []node.Node{expr.NewArrayItem(nil, nil, false)} + $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} } $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | assignment_list_element { - if $1.(*expr.ArrayItem).Key == nil && $1.(*expr.ArrayItem).Val == nil { - $$ = []node.Node{} + if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { + $$ = []ast.Vertex{} } else { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6595,10 +6570,10 @@ assignment_list: assignment_list_element: variable { - $$ = expr.NewArrayItem(nil, $1, false) - + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6607,23 +6582,23 @@ assignment_list_element: } | T_LIST '(' assignment_list ')' { - listNode := expr.NewList($3) - $$ = expr.NewArrayItem(nil, listNode, false) - + listNode := &ast.ExprList{ast.Node{}, $3} + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} + // save position - listNode.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition(listNode)) + listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(listNode) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.List, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(listNode, freefloating.ArrayPairList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { - $$ = expr.NewArrayItem(nil, nil, false) + $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6633,7 +6608,7 @@ assignment_list_element: array_pair_list: /* empty */ { - $$ = []node.Node{} + $$ = []ast.Vertex{} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6642,12 +6617,12 @@ array_pair_list: $$ = $1 if $2 != nil { - $$ = append($1, expr.NewArrayItem(nil, nil, false)) + $$ = append($1, &ast.ExprArrayItem{ast.Node{}, false, nil, nil}) } // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6657,54 +6632,54 @@ array_pair_list: non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { - arrayItem := expr.NewArrayItem($3, $5, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} $$ = append($1, arrayItem) // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' expr { - arrayItem := expr.NewArrayItem(nil, $3, false) + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} $$ = append($1, arrayItem) - + // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW expr { - arrayItem := expr.NewArrayItem($1, $3, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3)) - + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { - arrayItem := expr.NewArrayItem(nil, $1, false) - $$ = []node.Node{arrayItem} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} + $$ = []ast.Vertex{arrayItem} // save position - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodePosition($1)) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6713,67 +6688,67 @@ non_empty_array_pair_list: } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { - reference := expr.NewReference($6) - arrayItem := expr.NewArrayItem($3, reference, false) + reference := &ast.ExprReference{ast.Node{}, $6} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, reference} $$ = append($1, arrayItem) - + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $4.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $5.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' '&' w_variable { - reference := expr.NewReference($4) - arrayItem := expr.NewArrayItem(nil, reference, false) + reference := &ast.ExprReference{ast.Node{}, $4} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} $$ = append($1, arrayItem) - + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW '&' w_variable { - reference := expr.NewReference($4) - arrayItem := expr.NewArrayItem($1, reference, false) - $$ = []node.Node{arrayItem} - + reference := &ast.ExprReference{ast.Node{}, $4} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, reference} + $$ = []ast.Vertex{arrayItem} + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4)) + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Expr, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(reference, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' w_variable { - reference := expr.NewReference($2) - arrayItem := expr.NewArrayItem(nil, reference, false) - $$ = []node.Node{arrayItem} - + reference := &ast.ExprReference{ast.Node{}, $2} + arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} + $$ = []ast.Vertex{arrayItem} + // save position - reference.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - arrayItem.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) - + reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + // save comments - yylex.(*Parser).setFreeFloating(arrayItem, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6782,39 +6757,39 @@ non_empty_array_pair_list: encaps_list: encaps_list encaps_var { - $$ = append($1, $2) + $$ = append($1, $2) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list T_ENCAPSED_AND_WHITESPACE { - encapsed := scalar.NewEncapsedStringPart($2.Value) + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} $$ = append($1, encapsed) // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_var { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE encaps_var { - encapsed := scalar.NewEncapsedStringPart($1.Value) - $$ = []node.Node{encapsed, $2} + encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} + $$ = []ast.Vertex{encapsed, $2} // save position - encapsed.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6823,105 +6798,102 @@ encaps_list: encaps_var: T_VARIABLE { - name := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $3) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($2.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($4.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - variable := expr.NewVariable(identifier) - fetch := node.NewIdentifier($3.Value) - $$ = expr.NewPropertyFetch(variable, fetch) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + variable := &ast.ExprVariable{ast.Node{}, identifier} + fetch := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - fetch.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(fetch, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - variable := expr.NewVariable($2) + variable := &ast.ExprVariable{ast.Node{}, $2} $$ = variable // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { - name := node.NewIdentifier($2.Value) - variable := expr.NewVariable(name) + name := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, name} $$ = variable // save position - name.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3)) + name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { - identifier := node.NewIdentifier($2.Value) - variable := expr.NewVariable(identifier) - $$ = expr.NewArrayDimFetch(variable, $4) + identifier := &ast.Identifier{ast.Node{}, $2.Value} + variable := &ast.ExprVariable{ast.Node{}, identifier} + $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - variable.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($2)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.Var, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, append($5.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($6.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Tokens, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($6.Tokens, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6930,8 +6902,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, freefloating.End, append($3.FreeFloating, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6940,45 +6912,44 @@ encaps_var: encaps_var_offset: T_STRING { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NUM_STRING { // TODO: add option to handle 64 bit integer - if _, err := strconv.Atoi($1.Value); err == nil { - $$ = scalar.NewLnumber($1.Value) + if _, err := strconv.Atoi(string($1.Value)); err == nil { + $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} } else { - $$ = scalar.NewString($1.Value) + $$ = &ast.ScalarString{ast.Node{}, $1.Value} } // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE { - identifier := node.NewIdentifier(strings.TrimLeftFunc($1.Value, isDollar)) - $$ = expr.NewVariable(identifier) + identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position - identifier.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($1)) + identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).addDollarToken($$) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6987,105 +6958,105 @@ encaps_var_offset: internal_functions_in_yacc: T_ISSET '(' isset_variables ')' { - $$ = expr.NewIsset($3) - + $$ = &ast.ExprIsset{ast.Node{}, $3} + // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) - + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Isset, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.VarList, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' variable ')' { - $$ = expr.NewEmpty($3) + $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' expr ')' { - $$ = expr.NewEmpty($3) + $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Empty, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INCLUDE expr { - $$ = expr.NewInclude($2) + $$ = &ast.ExprInclude{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INCLUDE_ONCE expr { - $$ = expr.NewIncludeOnce($2) + $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EVAL '(' expr ')' { - $$ = expr.NewEval($3) + $$ = &ast.ExprEval{ast.Node{}, $3} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Eval, $2.FreeFloating) - yylex.(*Parser).setFreeFloating($$, freefloating.Expr, $4.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_REQUIRE expr { - $$ = expr.NewRequire($2) + $$ = &ast.ExprRequire{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_REQUIRE_ONCE expr { - $$ = expr.NewRequireOnce($2) + $$ = &ast.ExprRequireOnce{ast.Node{}, $2} // save position - $$.SetPosition(yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2)) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, freefloating.Start, $1.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7094,7 +7065,7 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = []node.Node{$1} + $$ = []ast.Vertex{$1} yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7103,7 +7074,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), freefloating.End, $2.FreeFloating) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7112,13 +7083,13 @@ isset_variables: isset_variable: variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { - $$ = $1 + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7127,33 +7098,33 @@ isset_variable: class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7162,17 +7133,17 @@ class_constant: static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7181,17 +7152,17 @@ static_class_name_scalar: class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := node.NewIdentifier($3.Value) - $$ = expr.NewClassConstFetch($1, target) + target := &ast.Identifier{ast.Node{}, $3.Value} + $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.SetPosition(yylex.(*Parser).positionBuilder.NewTokenPosition($3)) - $$.SetPosition(yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3)) + target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, freefloating.Name, $2.FreeFloating) - yylex.(*Parser).setFreeFloating(target, freefloating.Start, $3.FreeFloating) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7200,6 +7171,6 @@ class_name_scalar: %% type simpleIndirectReference struct { - all []*expr.Variable - last *expr.Variable + all []*ast.ExprVariable + last *ast.ExprVariable } diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 1cdd5aa..2c7d11c 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -3,7 +3,7 @@ package php5_test import ( "testing" - "github.com/z7zmey/php-parser/php5" + "github.com/z7zmey/php-parser/internal/php5" ) func BenchmarkPhp5(b *testing.B) { diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 3cbb727..295e0b0 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -1,21 +1,13 @@ package php5_test import ( + "gotest.tools/assert" "testing" - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" ) func TestPhp5(t *testing.T) { @@ -402,106 +394,130 @@ func TestPhp5(t *testing.T) { parsing process must be terminated ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 379, - StartPos: 5, - EndPos: 6944, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 379, + StartPos: 5, + EndPos: 6944, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 20, - }, - Expr: &expr.FunctionCall{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 19, + EndPos: 20, }, - Function: &name.Name{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 8, + EndPos: 19, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 8, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 8, - EndPos: 19, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 8, + EndPos: 19, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 11, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 9, EndPos: 11, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 9, EndPos: 11, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 13, - EndPos: 18, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 16, + StartPos: 13, EndPos: 18, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 16, EndPos: 18, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), }, }, }, @@ -509,96 +525,118 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 39, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, - EndPos: 38, + EndPos: 39, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, - EndPos: 27, + EndPos: 38, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 23, EndPos: 27, }, - Value: "foo", }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 27, - EndPos: 38, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 30, + StartPos: 23, + EndPos: 27, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 27, + EndPos: 38, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 28, EndPos: 30, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 28, EndPos: 30, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 30, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 32, - EndPos: 37, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 35, + StartPos: 32, EndPos: 37, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 35, EndPos: 37, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 35, + EndPos: 37, + }, + }, + Value: []byte("b"), }, }, }, @@ -606,105 +644,129 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 63, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, - EndPos: 62, + EndPos: 63, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, - EndPos: 46, + EndPos: 62, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 42, EndPos: 46, }, - Value: "foo", }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 48, - EndPos: 51, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 51, - EndPos: 62, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 52, - EndPos: 54, + StartPos: 42, + EndPos: 46, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 48, + EndPos: 51, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 51, + EndPos: 62, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, EndPos: 54, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, EndPos: 54, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 56, - EndPos: 61, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 59, + StartPos: 56, EndPos: 61, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 59, EndPos: 61, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("b"), }, }, }, @@ -712,107 +774,131 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 86, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 66, - EndPos: 85, + EndPos: 86, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 66, - EndPos: 69, + EndPos: 85, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 69, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 74, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 85, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 85, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 77, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, EndPos: 77, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, EndPos: 77, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 79, - EndPos: 84, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 82, + StartPos: 79, EndPos: 84, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 82, EndPos: 84, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("b"), }, }, }, @@ -820,105 +906,129 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 110, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, - EndPos: 109, + EndPos: 110, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, - EndPos: 93, + EndPos: 109, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 89, EndPos: 93, }, - Value: "foo", }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 95, - EndPos: 98, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 98, - EndPos: 109, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 99, - EndPos: 101, + StartPos: 89, + EndPos: 93, }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ + }, + Value: []byte("foo"), + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 95, + EndPos: 98, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 98, + EndPos: 109, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, EndPos: 101, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, EndPos: 101, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 103, - EndPos: 108, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 106, + StartPos: 103, EndPos: 108, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 106, EndPos: 108, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("b"), }, }, }, @@ -926,98 +1036,120 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 132, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 113, - EndPos: 131, + EndPos: 132, }, - Class: &name.Name{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 117, - EndPos: 120, + StartPos: 113, + EndPos: 131, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 117, - EndPos: 120, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 120, - EndPos: 131, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 131, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 123, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, EndPos: 123, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, EndPos: 123, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("a"), }, }, }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 125, - EndPos: 130, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 128, + StartPos: 125, EndPos: 130, }, - VarName: &node.Identifier{ + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 128, EndPos: 130, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + Value: []byte("b"), }, }, }, @@ -1025,4643 +1157,5639 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 136, - EndPos: 180, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 145, - EndPos: 148, + StartPos: 136, + EndPos: 180, }, - Value: "foo", }, - Params: []node.Node{ - &node.Parameter{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 149, - EndPos: 162, + StartPos: 145, + EndPos: 148, }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 149, - EndPos: 152, + EndPos: 162, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 149, - EndPos: 152, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 149, + EndPos: 152, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 149, + EndPos: 152, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 153, - EndPos: 157, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 153, EndPos: 157, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 153, + EndPos: 157, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 158, EndPos: 162, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 158, + EndPos: 162, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 158, + EndPos: 162, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 176, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 164, - EndPos: 167, + EndPos: 176, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 164, - EndPos: 167, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 167, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 167, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 176, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, StartPos: 172, EndPos: 176, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 176, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 183, - EndPos: 246, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 189, - EndPos: 192, + StartPos: 183, + EndPos: 246, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 194, - EndPos: 245, + StartPos: 189, + EndPos: 192, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 210, - EndPos: 213, + StartPos: 194, + EndPos: 245, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 194, - EndPos: 200, + StartPos: 210, + EndPos: 213, }, - Value: "public", + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 194, + EndPos: 200, + }, + }, + Value: []byte("public"), }, }, - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 214, - EndPos: 227, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 214, - EndPos: 217, + EndPos: 227, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 214, - EndPos: 217, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 214, + EndPos: 217, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 214, + EndPos: 217, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 218, - EndPos: 222, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 218, EndPos: 222, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 218, + EndPos: 222, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 223, - EndPos: 227, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 223, EndPos: 227, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 223, - EndPos: 227, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 223, + EndPos: 227, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 223, + EndPos: 227, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 229, - EndPos: 241, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 229, - EndPos: 232, + EndPos: 241, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 229, - EndPos: 232, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 229, + EndPos: 232, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 229, + EndPos: 232, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 237, - EndPos: 241, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 10, EndLine: 10, StartPos: 237, EndPos: 241, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 237, + EndPos: 241, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 243, - EndPos: 245, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 243, + EndPos: 245, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 249, - EndPos: 290, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 249, - EndPos: 289, + EndPos: 290, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 258, - EndPos: 271, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 249, + EndPos: 289, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 258, - EndPos: 261, + EndPos: 271, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 258, - EndPos: 261, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 258, + EndPos: 261, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 258, + EndPos: 261, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 262, - EndPos: 266, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 262, EndPos: 266, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 262, + EndPos: 266, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 267, - EndPos: 271, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 267, EndPos: 271, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 267, - EndPos: 271, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 267, + EndPos: 271, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 267, + EndPos: 271, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 273, - EndPos: 285, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 273, - EndPos: 276, + EndPos: 285, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 273, - EndPos: 276, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 273, + EndPos: 276, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 273, + EndPos: 276, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 281, - EndPos: 285, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 11, EndLine: 11, StartPos: 281, EndPos: 285, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 281, + EndPos: 285, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 293, - EndPos: 341, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 293, - EndPos: 340, + EndPos: 341, }, - ReturnsRef: false, - Static: true, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 309, - EndPos: 322, - }, - ByRef: false, - Variadic: false, - VariableType: &name.Name{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 293, + EndPos: 340, + }, + }, + ReturnsRef: false, + Static: true, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 309, - EndPos: 312, + EndPos: 322, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 309, - EndPos: 312, + }, + ByRef: false, + Variadic: false, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 309, + EndPos: 312, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 309, + EndPos: 312, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 313, - EndPos: 317, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 313, EndPos: 317, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 313, + EndPos: 317, + }, + }, + Value: []byte("bar"), }, }, - DefaultValue: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 318, - EndPos: 322, - }, - Constant: &name.Name{ + DefaultValue: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 318, EndPos: 322, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 318, - EndPos: 322, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 318, + EndPos: 322, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 318, + EndPos: 322, + }, }, - Value: "null", + Value: []byte("null"), }, }, }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 324, - EndPos: 336, - }, - ByRef: true, - Variadic: true, - VariableType: &name.Name{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 324, - EndPos: 327, + EndPos: 336, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 324, - EndPos: 327, + }, + ByRef: true, + Variadic: true, + Type: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 324, + EndPos: 327, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 324, + EndPos: 327, + }, }, - Value: "baz", + Value: []byte("baz"), }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 332, - EndPos: 336, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 12, EndLine: 12, StartPos: 332, EndPos: 336, }, - Value: "baz", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 332, + EndPos: 336, + }, + }, + Value: []byte("baz"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 345, - EndPos: 365, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 14, EndLine: 14, StartPos: 345, - EndPos: 364, + EndPos: 365, }, - Value: "1234567890123456789", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 14, + EndLine: 14, + StartPos: 345, + EndPos: 364, + }, + }, + Value: []byte("1234567890123456789"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 368, - EndPos: 389, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 15, EndLine: 15, StartPos: 368, - EndPos: 388, + EndPos: 389, }, - Value: "12345678901234567890", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 15, + EndLine: 15, + StartPos: 368, + EndPos: 388, + }, + }, + Value: []byte("12345678901234567890"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 392, - EndPos: 395, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 16, EndLine: 16, StartPos: 392, - EndPos: 394, + EndPos: 395, }, - Value: "0.", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 16, + EndLine: 16, + StartPos: 392, + EndPos: 394, + }, + }, + Value: []byte("0."), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 17, - EndLine: 17, - StartPos: 398, - EndPos: 465, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 17, EndLine: 17, StartPos: 398, - EndPos: 464, + EndPos: 465, }, - Value: "0b0111111111111111111111111111111111111111111111111111111111111111", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 398, + EndPos: 464, + }, + }, + Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 468, - EndPos: 535, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, StartPos: 468, - EndPos: 534, + EndPos: 535, }, - Value: "0b1111111111111111111111111111111111111111111111111111111111111111", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 468, + EndPos: 534, + }, + }, + Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 538, - EndPos: 559, - }, - Expr: &scalar.Lnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, StartPos: 538, - EndPos: 558, + EndPos: 559, }, - Value: "0x007111111111111111", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 538, + EndPos: 558, + }, + }, + Value: []byte("0x007111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 562, - EndPos: 581, - }, - Expr: &scalar.Dnumber{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, StartPos: 562, - EndPos: 580, + EndPos: 581, }, - Value: "0x8111111111111111", + }, + Expr: &ast.ScalarDnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 562, + EndPos: 580, + }, + }, + Value: []byte("0x8111111111111111"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 584, - EndPos: 594, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, StartPos: 584, - EndPos: 593, + EndPos: 594, }, - Value: "__CLASS__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 584, + EndPos: 593, + }, + }, + Value: []byte("__CLASS__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 22, - EndLine: 22, - StartPos: 597, - EndPos: 605, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 22, EndLine: 22, StartPos: 597, - EndPos: 604, + EndPos: 605, }, - Value: "__DIR__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 22, + EndLine: 22, + StartPos: 597, + EndPos: 604, + }, + }, + Value: []byte("__DIR__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 608, - EndPos: 617, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 23, EndLine: 23, StartPos: 608, - EndPos: 616, + EndPos: 617, }, - Value: "__FILE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 23, + EndLine: 23, + StartPos: 608, + EndPos: 616, + }, + }, + Value: []byte("__FILE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 620, - EndPos: 633, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 24, EndLine: 24, StartPos: 620, - EndPos: 632, + EndPos: 633, }, - Value: "__FUNCTION__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 620, + EndPos: 632, + }, + }, + Value: []byte("__FUNCTION__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 636, - EndPos: 645, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 25, EndLine: 25, StartPos: 636, - EndPos: 644, + EndPos: 645, }, - Value: "__LINE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 636, + EndPos: 644, + }, + }, + Value: []byte("__LINE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 648, - EndPos: 662, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 26, EndLine: 26, StartPos: 648, - EndPos: 661, + EndPos: 662, }, - Value: "__NAMESPACE__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 26, + EndLine: 26, + StartPos: 648, + EndPos: 661, + }, + }, + Value: []byte("__NAMESPACE__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 665, - EndPos: 676, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 27, EndLine: 27, StartPos: 665, - EndPos: 675, + EndPos: 676, }, - Value: "__METHOD__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 27, + EndLine: 27, + StartPos: 665, + EndPos: 675, + }, + }, + Value: []byte("__METHOD__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 679, - EndPos: 689, - }, - Expr: &scalar.MagicConstant{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 28, EndLine: 28, StartPos: 679, - EndPos: 688, + EndPos: 689, }, - Value: "__TRAIT__", + }, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 679, + EndPos: 688, + }, + }, + Value: []byte("__TRAIT__"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 693, - EndPos: 705, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 30, EndLine: 30, StartPos: 693, - EndPos: 704, + EndPos: 705, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 694, - EndPos: 699, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 693, + EndPos: 704, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 699, - EndPos: 703, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 694, + EndPos: 699, + }, }, - VarName: &node.Identifier{ + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 30, EndLine: 30, StartPos: 699, EndPos: 703, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 30, + EndLine: 30, + StartPos: 699, + EndPos: 703, + }, + }, + Value: []byte("var"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 708, - EndPos: 723, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 708, - EndPos: 722, + EndPos: 723, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 709, - EndPos: 714, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 708, + EndPos: 722, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 714, - EndPos: 721, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 709, + EndPos: 714, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 714, - EndPos: 718, + EndPos: 721, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 31, EndLine: 31, StartPos: 714, EndPos: 718, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 714, + EndPos: 718, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 719, - EndPos: 720, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 31, + EndLine: 31, + StartPos: 719, + EndPos: 720, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 726, - EndPos: 780, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 726, - EndPos: 779, + EndPos: 780, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 727, - EndPos: 732, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 726, + EndPos: 779, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 732, - EndPos: 778, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 727, + EndPos: 732, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 732, - EndPos: 736, + EndPos: 778, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 32, EndLine: 32, StartPos: 732, EndPos: 736, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 732, + EndPos: 736, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 737, - EndPos: 777, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 32, + EndLine: 32, + StartPos: 737, + EndPos: 777, + }, }, - Value: "1234567890123456789012345678901234567890", + Value: []byte("1234567890123456789012345678901234567890"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 783, - EndPos: 800, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 783, - EndPos: 799, + EndPos: 800, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 784, - EndPos: 789, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 783, + EndPos: 799, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 789, - EndPos: 798, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 784, + EndPos: 789, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 789, - EndPos: 793, + EndPos: 798, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 33, EndLine: 33, StartPos: 789, EndPos: 793, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 789, + EndPos: 793, + }, + }, + Value: []byte("var"), }, }, - Dim: &scalar.String{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 794, - EndPos: 797, + Dim: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 33, + EndLine: 33, + StartPos: 794, + EndPos: 797, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 803, - EndPos: 821, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 803, - EndPos: 820, + EndPos: 821, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 804, - EndPos: 809, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 803, + EndPos: 820, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 809, - EndPos: 819, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 804, + EndPos: 809, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 809, - EndPos: 813, + EndPos: 819, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 809, EndPos: 813, }, - Value: "var", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 809, + EndPos: 813, + }, + }, + Value: []byte("var"), }, }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 814, - EndPos: 818, - }, - VarName: &node.Identifier{ + Dim: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 34, EndLine: 34, StartPos: 814, EndPos: 818, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 34, + EndLine: 34, + StartPos: 814, + EndPos: 818, + }, + }, + Value: []byte("bar"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 824, - EndPos: 836, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 824, - EndPos: 835, + EndPos: 836, }, - Parts: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 825, - EndPos: 829, - }, - VarName: &node.Identifier{ + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 824, + EndPos: 835, + }, + }, + Parts: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 825, EndPos: 829, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 825, + EndPos: 829, + }, + }, + Value: []byte("foo"), }, }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 829, - EndPos: 830, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 829, + EndPos: 830, + }, }, - Value: " ", + Value: []byte(" "), }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 830, - EndPos: 834, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 35, EndLine: 35, StartPos: 830, EndPos: 834, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 35, + EndLine: 35, + StartPos: 830, + EndPos: 834, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 839, - EndPos: 858, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 839, - EndPos: 857, + EndPos: 858, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 840, - EndPos: 845, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 839, + EndPos: 857, }, - &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 845, - EndPos: 854, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 840, + EndPos: 845, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 845, - EndPos: 849, + EndPos: 854, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, StartPos: 845, EndPos: 849, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 845, + EndPos: 849, + }, + }, + Value: []byte("foo"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 36, + EndLine: 36, + StartPos: 851, + EndPos: 854, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 36, EndLine: 36, - StartPos: 851, - EndPos: 854, + StartPos: 854, + EndPos: 856, }, - Value: "bar", }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 854, - EndPos: 856, - }, - Value: "()", + Value: []byte("()"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 861, - EndPos: 875, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 37, EndLine: 37, StartPos: 861, - EndPos: 874, + EndPos: 875, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 862, - EndPos: 867, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 861, + EndPos: 874, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 867, - EndPos: 873, - }, - VarName: &node.Identifier{ + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 37, EndLine: 37, - StartPos: 869, - EndPos: 872, + StartPos: 862, + EndPos: 867, }, - Value: "foo", + }, + Value: []byte("test "), + }, + &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 867, + EndPos: 873, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 37, + EndLine: 37, + StartPos: 869, + EndPos: 872, + }, + }, + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 878, - EndPos: 895, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, StartPos: 878, - EndPos: 894, + EndPos: 895, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 879, - EndPos: 884, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 878, + EndPos: 894, }, - &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 884, - EndPos: 893, - }, - Variable: &expr.Variable{ + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, - StartPos: 886, - EndPos: 889, + StartPos: 879, + EndPos: 884, }, - VarName: &node.Identifier{ + }, + Value: []byte("test "), + }, + &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 884, + EndPos: 893, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 38, EndLine: 38, StartPos: 886, EndPos: 889, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 886, + EndPos: 889, + }, + }, + Value: []byte("foo"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 890, - EndPos: 891, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 38, + EndLine: 38, + StartPos: 890, + EndPos: 891, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 898, - EndPos: 919, - }, - Expr: &scalar.Encapsed{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 898, - EndPos: 918, + EndPos: 919, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 899, - EndPos: 904, - }, - Value: "test ", + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 898, + EndPos: 918, }, - &expr.MethodCall{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 905, - EndPos: 916, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 899, + EndPos: 904, + }, }, - Variable: &expr.Variable{ + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 905, - EndPos: 909, + EndPos: 916, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 39, EndLine: 39, StartPos: 905, EndPos: 909, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 905, + EndPos: 909, + }, + }, + Value: []byte("foo"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 911, - EndPos: 914, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 911, + EndPos: 914, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 914, - EndPos: 916, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 39, + EndLine: 39, + StartPos: 914, + EndPos: 916, + }, }, }, }, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 41, - EndLine: 42, - StartPos: 923, - EndPos: 941, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 41, - EndLine: 41, - StartPos: 927, - EndPos: 929, + EndLine: 42, + StartPos: 923, + EndPos: 941, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 41, EndLine: 41, StartPos: 927, EndPos: 929, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 41, + EndLine: 41, + StartPos: 927, + EndPos: 929, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 43, - EndLine: 45, - StartPos: 944, - EndPos: 977, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 43, - EndLine: 43, - StartPos: 948, - EndPos: 950, + EndLine: 45, + StartPos: 944, + EndPos: 977, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 43, EndLine: 43, StartPos: 948, EndPos: 950, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 43, + EndLine: 43, + StartPos: 948, + EndPos: 950, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 44, + StartLine: -1, EndLine: -1, - StartPos: 956, + StartPos: -1, EndPos: -1, }, - Cond: &expr.Variable{ + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 44, - EndLine: 44, - StartPos: 964, - EndPos: 966, + EndLine: -1, + StartPos: 956, + EndPos: -1, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 44, EndLine: 44, StartPos: 964, EndPos: 966, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 44, + EndLine: 44, + StartPos: 964, + EndPos: 966, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 46, - EndLine: 48, - StartPos: 980, - EndPos: 1006, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 46, - EndLine: 46, - StartPos: 984, - EndPos: 986, + EndLine: 48, + StartPos: 980, + EndPos: 1006, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 46, EndLine: 46, StartPos: 984, EndPos: 986, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 46, + EndLine: 46, + StartPos: 984, + EndPos: 986, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 47, - EndLine: -1, - StartPos: 992, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1, }, - Stmts: []node.Node{}, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 47, + EndLine: -1, + StartPos: 992, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.AltIf{ - Position: &position.Position{ - StartLine: 49, - EndLine: 53, - StartPos: 1009, - EndPos: 1065, - }, - Cond: &expr.Variable{ + &ast.StmtAltIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 49, - EndLine: 49, - StartPos: 1013, - EndPos: 1015, + EndLine: 53, + StartPos: 1009, + EndPos: 1065, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 49, EndLine: 49, StartPos: 1013, EndPos: 1015, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 49, + EndLine: 49, + StartPos: 1013, + EndPos: 1015, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 50, - EndLine: -1, - StartPos: 1021, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1029, - EndPos: 1031, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1029, - EndPos: 1031, - }, - Value: "b", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.AltElseIf{ - Position: &position.Position{ - StartLine: 51, - EndLine: -1, - StartPos: 1036, - EndPos: -1, - }, - Cond: &expr.Variable{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1044, - EndPos: 1046, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1044, - EndPos: 1046, - }, - Value: "c", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - }, - Else: &stmt.AltElse{ - Position: &position.Position{ - StartLine: 52, - EndLine: -1, - StartPos: 1051, - EndPos: -1, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1, }, - Stmts: []node.Node{}, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: -1, + StartPos: 1021, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1029, + EndPos: 1031, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 50, + EndLine: 50, + StartPos: 1029, + EndPos: 1031, + }, + }, + Value: []byte("b"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtAltElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: -1, + StartPos: 1036, + EndPos: -1, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1044, + EndPos: 1046, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 51, + EndLine: 51, + StartPos: 1044, + EndPos: 1046, + }, + }, + Value: []byte("c"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + Else: &ast.StmtAltElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 52, + EndLine: -1, + StartPos: 1051, + EndPos: -1, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1069, - EndPos: 1089, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 55, EndLine: 55, - StartPos: 1076, - EndPos: 1077, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1079, + StartPos: 1069, EndPos: 1089, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1081, - EndPos: 1087, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1076, + EndPos: 1077, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1079, + EndPos: 1089, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 55, + EndLine: 55, + StartPos: 1081, + EndPos: 1087, + }, }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1092, - EndPos: 1114, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1099, - EndPos: 1100, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1102, + StartPos: 1092, EndPos: 1114, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1104, - EndPos: 1112, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1099, + EndPos: 1100, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1102, + EndPos: 1114, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1110, - EndPos: 1111, + StartPos: 1104, + EndPos: 1112, }, - Value: "2", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 56, + EndLine: 56, + StartPos: 1110, + EndPos: 1111, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.AltWhile{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1117, - EndPos: 1148, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 57, EndLine: 57, - StartPos: 1124, - EndPos: 1125, + StartPos: 1117, + EndPos: 1148, }, - Value: "1", }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1129, - EndPos: 1138, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1124, + EndPos: 1125, + }, }, - Stmts: []node.Node{ - &stmt.Break{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1129, - EndPos: 1138, - }, - Expr: &scalar.Lnumber{ + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1129, + EndPos: 1138, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ Position: &position.Position{ StartLine: 57, EndLine: 57, - StartPos: 1135, - EndPos: 1136, + StartPos: 1129, + EndPos: 1138, }, - Value: "3", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 57, + EndLine: 57, + StartPos: 1135, + EndPos: 1136, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1151, - EndPos: 1187, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1157, - EndPos: 1160, + StartPos: 1151, + EndPos: 1187, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassConstList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1162, - EndPos: 1185, + StartPos: 1157, + EndPos: 1160, }, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1168, - EndPos: 1175, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1162, + EndPos: 1185, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, StartPos: 1168, - EndPos: 1171, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1174, EndPos: 1175, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1168, + EndPos: 1171, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1174, + EndPos: 1175, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1177, - EndPos: 1184, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 58, EndLine: 58, StartPos: 1177, - EndPos: 1180, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1183, EndPos: 1184, }, - Value: "2", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1177, + EndPos: 1180, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 58, + EndLine: 58, + StartPos: 1183, + EndPos: 1184, + }, + }, + Value: []byte("2"), }, }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1190, - EndPos: 1220, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1196, - EndPos: 1199, + StartPos: 1190, + EndPos: 1220, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1201, - EndPos: 1218, + StartPos: 1196, + EndPos: 1199, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 59, EndLine: 59, - StartPos: 1210, - EndPos: 1213, - }, - Value: "bar", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1216, + StartPos: 1201, EndPos: 1218, }, - Stmts: []node.Node{}, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1210, + EndPos: 1213, + }, + }, + Value: []byte("bar"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 59, + EndLine: 59, + StartPos: 1216, + EndPos: 1218, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1223, - EndPos: 1268, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1229, - EndPos: 1232, + StartPos: 1223, + EndPos: 1268, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1234, - EndPos: 1266, + StartPos: 1229, + EndPos: 1232, }, - ReturnsRef: true, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 60, EndLine: 60, - StartPos: 1258, - EndPos: 1261, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1234, - EndPos: 1240, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1241, - EndPos: 1247, - }, - Value: "static", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1264, + StartPos: 1234, EndPos: 1266, }, - Stmts: []node.Node{}, + }, + ReturnsRef: true, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1258, + EndPos: 1261, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1234, + EndPos: 1240, + }, + }, + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1241, + EndPos: 1247, + }, + }, + Value: []byte("static"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 60, + EndLine: 60, + StartPos: 1264, + EndPos: 1266, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1271, - EndPos: 1343, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1277, - EndPos: 1280, + StartPos: 1271, + EndPos: 1343, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.ClassMethod{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1282, - EndPos: 1313, + StartPos: 1277, + EndPos: 1280, }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1305, - EndPos: 1308, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1282, - EndPos: 1287, - }, - Value: "final", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1288, - EndPos: 1295, - }, - Value: "private", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1311, + StartPos: 1282, EndPos: 1313, }, - Stmts: []node.Node{}, }, - }, - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1314, - EndPos: 1341, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1333, - EndPos: 1336, - }, - Value: "baz", - }, - Modifiers: []node.Node{ - &node.Identifier{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1314, - EndPos: 1323, + StartPos: 1305, + EndPos: 1308, }, - Value: "protected", + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1282, + EndPos: 1287, + }, + }, + Value: []byte("final"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1288, + EndPos: 1295, + }, + }, + Value: []byte("private"), }, }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1311, + EndPos: 1313, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1339, + StartPos: 1314, EndPos: 1341, }, - Stmts: []node.Node{}, + }, + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1333, + EndPos: 1336, + }, + }, + Value: []byte("baz"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1314, + EndPos: 1323, + }, + }, + Value: []byte("protected"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 61, + EndLine: 61, + StartPos: 1339, + EndPos: 1341, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1346, - EndPos: 1399, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1361, - EndPos: 1364, + StartPos: 1346, + EndPos: 1399, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1346, - EndPos: 1354, + StartPos: 1361, + EndPos: 1364, }, - Value: "abstract", + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1346, + EndPos: 1354, + }, + }, + Value: []byte("abstract"), }, }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1366, - EndPos: 1397, - }, - ReturnsRef: false, - PhpDocComment: "", - MethodName: &node.Identifier{ + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1391, - EndPos: 1394, - }, - Value: "bar", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1366, - EndPos: 1374, - }, - Value: "abstract", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1375, - EndPos: 1381, - }, - Value: "public", - }, - }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1396, + StartPos: 1366, EndPos: 1397, }, }, - }, - }, - }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1402, - EndPos: 1433, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1414, - EndPos: 1417, - }, - Value: "foo", - }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1402, - EndPos: 1407, - }, - Value: "final", - }, - }, - Extends: &stmt.ClassExtends{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1418, - EndPos: 1429, - }, - ClassName: &name.Name{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1426, - EndPos: 1429, - }, - Parts: []node.Node{ - &name.NamePart{ + ReturnsRef: false, + MethodName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1426, - EndPos: 1429, + StartLine: 62, + EndLine: 62, + StartPos: 1391, + EndPos: 1394, + }, + }, + Value: []byte("bar"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1366, + EndPos: 1374, + }, + }, + Value: []byte("abstract"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1375, + EndPos: 1381, + }, + }, + Value: []byte("public"), + }, + }, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 62, + EndLine: 62, + StartPos: 1396, + EndPos: 1397, }, - Value: "bar", }, }, }, }, - Stmts: []node.Node{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1436, - EndPos: 1470, + &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1402, + EndPos: 1433, + }, }, - PhpDocComment: "", - ClassName: &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1414, + EndPos: 1417, + }, + }, + Value: []byte("foo"), + }, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1402, + EndPos: 1407, + }, + }, + Value: []byte("final"), + }, + }, + Extends: &ast.StmtClassExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1418, + EndPos: 1429, + }, + }, + ClassName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1426, + EndPos: 1429, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 63, + EndLine: 63, + StartPos: 1426, + EndPos: 1429, + }, + }, + Value: []byte("bar"), + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1448, - EndPos: 1451, + StartPos: 1436, + EndPos: 1470, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1436, - EndPos: 1441, + StartPos: 1448, + EndPos: 1451, }, - Value: "final", }, + Value: []byte("foo"), }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1452, - EndPos: 1466, - }, - InterfaceNames: []node.Node{ - &name.Name{ + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 64, EndLine: 64, - StartPos: 1463, - EndPos: 1466, + StartPos: 1436, + EndPos: 1441, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1463, - EndPos: 1466, + }, + Value: []byte("final"), + }, + }, + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1452, + EndPos: 1466, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1463, + EndPos: 1466, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 64, + EndLine: 64, + StartPos: 1463, + EndPos: 1466, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1473, - EndPos: 1512, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1485, - EndPos: 1488, + StartPos: 1473, + EndPos: 1512, }, - Value: "foo", }, - Modifiers: []node.Node{ - &node.Identifier{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1473, - EndPos: 1478, + StartPos: 1485, + EndPos: 1488, }, - Value: "final", }, + Value: []byte("foo"), }, - Implements: &stmt.ClassImplements{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1489, - EndPos: 1508, - }, - InterfaceNames: []node.Node{ - &name.Name{ + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 65, EndLine: 65, - StartPos: 1500, - EndPos: 1503, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1500, - EndPos: 1503, - }, - Value: "bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1505, - EndPos: 1508, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1505, - EndPos: 1508, - }, - Value: "baz", - }, + StartPos: 1473, + EndPos: 1478, }, }, + Value: []byte("final"), }, }, - Stmts: []node.Node{}, - }, - &stmt.ConstList{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1516, - EndPos: 1539, - }, - Consts: []node.Node{ - &stmt.Constant{ + Implements: &ast.StmtClassImplements{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1522, - EndPos: 1529, + StartLine: 65, + EndLine: 65, + StartPos: 1489, + EndPos: 1508, }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1500, + EndPos: 1503, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1500, + EndPos: 1503, + }, + }, + Value: []byte("bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1505, + EndPos: 1508, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 65, + EndLine: 65, + StartPos: 1505, + EndPos: 1508, + }, + }, + Value: []byte("baz"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtConstList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1516, + EndPos: 1539, + }, + }, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 67, EndLine: 67, StartPos: 1522, - EndPos: 1525, - }, - Value: "FOO", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1528, EndPos: 1529, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1522, + EndPos: 1525, + }, + }, + Value: []byte("FOO"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1528, + EndPos: 1529, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1531, - EndPos: 1538, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 67, EndLine: 67, StartPos: 1531, - EndPos: 1534, - }, - Value: "BAR", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1537, EndPos: 1538, }, - Value: "2", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1531, + EndPos: 1534, + }, + }, + Value: []byte("BAR"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 67, + EndLine: 67, + StartPos: 1537, + EndPos: 1538, + }, + }, + Value: []byte("2"), }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1542, - EndPos: 1565, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1549, - EndPos: 1550, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1552, + StartPos: 1542, EndPos: 1565, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1554, - EndPos: 1563, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1549, + EndPos: 1550, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1552, + EndPos: 1565, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 68, + EndLine: 68, + StartPos: 1554, + EndPos: 1563, + }, }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1568, - EndPos: 1593, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1575, - EndPos: 1576, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1578, + StartPos: 1568, EndPos: 1593, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1580, - EndPos: 1591, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1575, + EndPos: 1576, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1578, + EndPos: 1593, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1589, - EndPos: 1590, + StartPos: 1580, + EndPos: 1591, }, - Value: "2", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 69, + EndLine: 69, + StartPos: 1589, + EndPos: 1590, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.While{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1596, - EndPos: 1622, - }, - Cond: &scalar.Lnumber{ + &ast.StmtWhile{ + Node: ast.Node{ Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1603, - EndPos: 1604, - }, - Value: "1", - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1606, + StartPos: 1596, EndPos: 1622, }, - Stmts: []node.Node{ - &stmt.Continue{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1608, - EndPos: 1620, - }, - Expr: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1603, + EndPos: 1604, + }, + }, + Value: []byte("1"), + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1606, + EndPos: 1622, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtContinue{ + Node: ast.Node{ Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1617, - EndPos: 1618, + StartPos: 1608, + EndPos: 1620, }, - Value: "3", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 70, + EndLine: 70, + StartPos: 1617, + EndPos: 1618, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1625, - EndPos: 1642, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1625, + EndPos: 1642, + }, }, Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1633, - EndPos: 1640, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 71, EndLine: 71, StartPos: 1633, - EndPos: 1638, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1639, EndPos: 1640, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1633, + EndPos: 1638, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1639, + EndPos: 1640, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.Nop{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1641, - EndPos: 1642, + Stmt: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 71, + EndLine: 71, + StartPos: 1641, + EndPos: 1642, + }, }, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1645, - EndPos: 1680, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1645, + EndPos: 1680, + }, }, Alt: false, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1653, - EndPos: 1660, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 72, EndLine: 72, StartPos: 1653, - EndPos: 1658, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1659, EndPos: 1660, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1653, + EndPos: 1658, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1659, + EndPos: 1660, + }, + }, + Value: []byte("1"), }, }, - &stmt.Constant{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1662, - EndPos: 1676, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 72, EndLine: 72, StartPos: 1662, - EndPos: 1674, - }, - Value: "strict_types", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1675, EndPos: 1676, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1662, + EndPos: 1674, + }, + }, + Value: []byte("strict_types"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1675, + EndPos: 1676, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1678, - EndPos: 1680, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 72, + EndLine: 72, + StartPos: 1678, + EndPos: 1680, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Declare{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1683, - EndPos: 1712, + &ast.StmtDeclare{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1683, + EndPos: 1712, + }, }, Alt: true, - Consts: []node.Node{ - &stmt.Constant{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1691, - EndPos: 1698, - }, - PhpDocComment: "", - ConstantName: &node.Identifier{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ Position: &position.Position{ StartLine: 73, EndLine: 73, StartPos: 1691, - EndPos: 1696, - }, - Value: "ticks", - }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1697, EndPos: 1698, }, - Value: "1", + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1691, + EndPos: 1696, + }, + }, + Value: []byte("ticks"), + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 73, + EndLine: 73, + StartPos: 1697, + EndPos: 1698, + }, + }, + Value: []byte("1"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - Stmts: []node.Node{}, - }, - }, - &stmt.Do{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1715, - EndPos: 1730, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1718, - EndPos: 1720, - }, - Stmts: []node.Node{}, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1727, - EndPos: 1728, - }, - Value: "1", - }, - }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1733, - EndPos: 1744, - }, - Exprs: []node.Node{ - &expr.Variable{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1738, - EndPos: 1740, + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, }, - VarName: &node.Identifier{ + }, + Stmts: []ast.Vertex{}, + }, + }, + &ast.StmtDo{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1715, + EndPos: 1730, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1718, + EndPos: 1720, + }, + }, + Stmts: []ast.Vertex{}, + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 74, + EndLine: 74, + StartPos: 1727, + EndPos: 1728, + }, + }, + Value: []byte("1"), + }, + }, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1733, + EndPos: 1744, + }, + }, + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 75, EndLine: 75, StartPos: 1738, EndPos: 1740, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1738, + EndPos: 1740, + }, + }, + Value: []byte("a"), }, }, - &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1742, - EndPos: 1743, + &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 75, + EndLine: 75, + StartPos: 1742, + EndPos: 1743, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Echo{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1747, - EndPos: 1756, + &ast.StmtEcho{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1747, + EndPos: 1756, + }, }, - Exprs: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1752, - EndPos: 1754, - }, - VarName: &node.Identifier{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 76, EndLine: 76, StartPos: 1752, EndPos: 1754, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 76, + EndLine: 76, + StartPos: 1752, + EndPos: 1754, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.For{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1759, - EndPos: 1794, + &ast.StmtFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1759, + EndPos: 1794, + }, }, - Init: []node.Node{ - &assign.Assign{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1763, - EndPos: 1769, - }, - Variable: &expr.Variable{ + Init: []ast.Vertex{ + &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1763, - EndPos: 1765, + EndPos: 1769, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1763, EndPos: 1765, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1763, + EndPos: 1765, + }, + }, + Value: []byte("i"), }, }, - Expression: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1768, - EndPos: 1769, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1768, + EndPos: 1769, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1771, - EndPos: 1778, - }, - Left: &expr.Variable{ + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1771, - EndPos: 1773, + EndPos: 1778, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1771, EndPos: 1773, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1771, + EndPos: 1773, + }, + }, + Value: []byte("i"), }, }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1776, - EndPos: 1778, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1776, + EndPos: 1778, + }, }, - Value: "10", + Value: []byte("10"), }, }, }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1780, - EndPos: 1784, - }, - Variable: &expr.Variable{ + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1780, - EndPos: 1782, + EndPos: 1784, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1780, EndPos: 1782, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1780, + EndPos: 1782, + }, + }, + Value: []byte("i"), }, }, }, - &expr.PostInc{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1786, - EndPos: 1790, - }, - Variable: &expr.Variable{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1786, - EndPos: 1788, + EndPos: 1790, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 77, EndLine: 77, StartPos: 1786, EndPos: 1788, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1786, + EndPos: 1788, + }, + }, + Value: []byte("i"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1792, - EndPos: 1794, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 77, + EndLine: 77, + StartPos: 1792, + EndPos: 1794, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltFor{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1797, - EndPos: 1827, + &ast.StmtAltFor{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1797, + EndPos: 1827, + }, }, - Cond: []node.Node{ - &binary.Smaller{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1803, - EndPos: 1810, - }, - Left: &expr.Variable{ + Cond: []ast.Vertex{ + &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1803, - EndPos: 1805, + EndPos: 1810, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1803, EndPos: 1805, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1803, + EndPos: 1805, + }, + }, + Value: []byte("i"), }, }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1808, - EndPos: 1810, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1808, + EndPos: 1810, + }, }, - Value: "10", + Value: []byte("10"), }, }, }, - Loop: []node.Node{ - &expr.PostInc{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1812, - EndPos: 1816, - }, - Variable: &expr.Variable{ + Loop: []ast.Vertex{ + &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1812, - EndPos: 1814, + EndPos: 1816, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 78, EndLine: 78, StartPos: 1812, EndPos: 1814, }, - Value: "i", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 78, + EndLine: 78, + StartPos: 1812, + EndPos: 1814, + }, + }, + Value: []byte("i"), }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1830, - EndPos: 1851, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1839, - EndPos: 1841, + StartPos: 1830, + EndPos: 1851, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, StartPos: 1839, EndPos: 1841, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1839, + EndPos: 1841, + }, + }, + Value: []byte("a"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1845, - EndPos: 1847, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 79, EndLine: 79, StartPos: 1845, EndPos: 1847, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1845, + EndPos: 1847, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1849, - EndPos: 1851, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 79, + EndLine: 79, + StartPos: 1849, + EndPos: 1851, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1854, - EndPos: 1875, - }, - Expr: &expr.ShortArray{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 80, EndLine: 80, - StartPos: 1863, - EndPos: 1865, + StartPos: 1854, + EndPos: 1875, }, - Items: []node.Node{}, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1869, - EndPos: 1871, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1863, + EndPos: 1865, + }, }, - VarName: &node.Identifier{ + Items: []ast.Vertex{}, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 80, EndLine: 80, StartPos: 1869, EndPos: 1871, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1869, + EndPos: 1871, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1873, - EndPos: 1875, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 80, + EndLine: 80, + StartPos: 1873, + EndPos: 1875, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.AltForeach{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1878, - EndPos: 1910, - }, - Expr: &expr.Variable{ + &ast.StmtAltForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1887, - EndPos: 1889, + StartPos: 1878, + EndPos: 1910, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, StartPos: 1887, EndPos: 1889, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1887, + EndPos: 1889, + }, + }, + Value: []byte("a"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1893, - EndPos: 1895, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 81, EndLine: 81, StartPos: 1893, EndPos: 1895, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 81, + EndLine: 81, + StartPos: 1893, + EndPos: 1895, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: -1, + EndLine: -1, + StartPos: -1, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1913, - EndPos: 1940, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1922, - EndPos: 1924, + StartPos: 1913, + EndPos: 1940, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1922, EndPos: 1924, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1922, + EndPos: 1924, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1928, - EndPos: 1930, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1928, EndPos: 1930, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1928, + EndPos: 1930, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1934, - EndPos: 1936, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 82, EndLine: 82, StartPos: 1934, EndPos: 1936, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1934, + EndPos: 1936, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1938, - EndPos: 1940, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 82, + EndLine: 82, + StartPos: 1938, + EndPos: 1940, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1943, - EndPos: 1970, - }, - Expr: &expr.ShortArray{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1952, - EndPos: 1954, + StartPos: 1943, + EndPos: 1970, }, - Items: []node.Node{}, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1958, - EndPos: 1960, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1952, + EndPos: 1954, + }, }, - VarName: &node.Identifier{ + Items: []ast.Vertex{}, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, StartPos: 1958, EndPos: 1960, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1958, + EndPos: 1960, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1964, - EndPos: 1966, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 83, EndLine: 83, StartPos: 1964, EndPos: 1966, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1964, + EndPos: 1966, + }, + }, + Value: []byte("v"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1968, - EndPos: 1970, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 83, + EndLine: 83, + StartPos: 1968, + EndPos: 1970, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1973, - EndPos: 2001, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1982, - EndPos: 1984, + StartPos: 1973, + EndPos: 2001, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1982, EndPos: 1984, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1982, + EndPos: 1984, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1988, - EndPos: 1990, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1988, EndPos: 1990, }, - Value: "k", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1988, + EndPos: 1990, + }, + }, + Value: []byte("k"), }, }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1994, - EndPos: 1997, - }, - Variable: &expr.Variable{ + Var: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1995, + StartPos: 1994, EndPos: 1997, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 84, EndLine: 84, StartPos: 1995, EndPos: 1997, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1995, + EndPos: 1997, + }, + }, + Value: []byte("v"), }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1999, - EndPos: 2001, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 84, + EndLine: 84, + StartPos: 1999, + EndPos: 2001, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2004, - EndPos: 2037, - }, - Expr: &expr.Variable{ + &ast.StmtForeach{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 2013, - EndPos: 2015, + StartPos: 2004, + EndPos: 2037, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2013, EndPos: 2015, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2013, + EndPos: 2015, + }, + }, + Value: []byte("a"), }, }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2019, - EndPos: 2021, - }, - VarName: &node.Identifier{ + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2019, EndPos: 2021, }, - Value: "k", }, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2025, - EndPos: 2033, - }, - Items: []node.Node{ - &expr.ArrayItem{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 2030, - EndPos: 2032, + StartPos: 2019, + EndPos: 2021, }, - Val: &expr.Variable{ + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2025, + EndPos: 2033, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2030, EndPos: 2032, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, StartPos: 2030, EndPos: 2032, }, - Value: "v", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2030, + EndPos: 2032, + }, + }, + Value: []byte("v"), }, }, }, }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 2035, - EndPos: 2037, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 85, + EndLine: 85, + StartPos: 2035, + EndPos: 2037, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 2040, - EndPos: 2057, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 2049, - EndPos: 2052, + StartPos: 2040, + EndPos: 2057, }, - Value: "foo", }, - Stmts: []node.Node{}, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 86, + EndLine: 86, + StartPos: 2049, + EndPos: 2052, + }, + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 88, - EndLine: 92, - StartPos: 2061, - EndPos: 2132, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 88, - EndLine: 88, - StartPos: 2070, - EndPos: 2073, + EndLine: 92, + StartPos: 2061, + EndPos: 2132, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.Function{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 2081, - EndPos: 2098, + StartLine: 88, + EndLine: 88, + StartPos: 2070, + EndPos: 2073, }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2090, - EndPos: 2093, + StartPos: 2081, + EndPos: 2098, }, - Value: "bar", }, - Stmts: []node.Node{}, + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 89, + EndLine: 89, + StartPos: 2090, + EndPos: 2093, + }, + }, + Value: []byte("bar"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 2102, - EndPos: 2114, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 90, EndLine: 90, - StartPos: 2108, - EndPos: 2111, + StartPos: 2102, + EndPos: 2114, }, - Value: "Baz", }, - Stmts: []node.Node{}, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 90, + EndLine: 90, + StartPos: 2108, + EndPos: 2111, + }, + }, + Value: []byte("Baz"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Return{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 2118, - EndPos: 2128, - }, - Expr: &expr.Variable{ + &ast.StmtReturn{ + Node: ast.Node{ Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2125, - EndPos: 2127, + StartPos: 2118, + EndPos: 2128, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 91, EndLine: 91, StartPos: 2125, EndPos: 2127, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 91, + EndLine: 91, + StartPos: 2125, + EndPos: 2127, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2138, - EndPos: 2183, - }, - ReturnsRef: false, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2147, - EndPos: 2150, + StartPos: 2138, + EndPos: 2183, }, - Value: "foo", }, - Params: []node.Node{ - &node.Parameter{ + ReturnsRef: false, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2151, - EndPos: 2159, + StartPos: 2147, + EndPos: 2150, }, - Variadic: false, - ByRef: false, - VariableType: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2151, - EndPos: 2156, - }, - Value: "array", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2157, EndPos: 2159, }, - VarName: &node.Identifier{ + }, + Variadic: false, + ByRef: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2151, + EndPos: 2156, + }, + }, + Value: []byte("array"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2157, EndPos: 2159, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2157, + EndPos: 2159, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2161, - EndPos: 2172, - }, - ByRef: false, - Variadic: false, - VariableType: &node.Identifier{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2161, - EndPos: 2169, - }, - Value: "callable", - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2170, EndPos: 2172, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2161, + EndPos: 2169, + }, + }, + Value: []byte("callable"), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 94, EndLine: 94, StartPos: 2170, EndPos: 2172, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2170, + EndPos: 2172, + }, + }, + Value: []byte("b"), }, }, }, }, - Stmts: []node.Node{ - &stmt.Return{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2175, - EndPos: 2182, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 94, + EndLine: 94, + StartPos: 2175, + EndPos: 2182, + }, }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2186, - EndPos: 2213, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2196, - EndPos: 2199, + StartPos: 2186, + EndPos: 2213, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.Return{ + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2203, - EndPos: 2212, + StartPos: 2196, + EndPos: 2199, }, - Expr: &scalar.Lnumber{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtReturn{ + Node: ast.Node{ Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2210, - EndPos: 2211, + StartPos: 2203, + EndPos: 2212, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 95, + EndLine: 95, + StartPos: 2210, + EndPos: 2211, + }, + }, + Value: []byte("1"), }, }, }, }, - &stmt.Function{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2216, - EndPos: 2234, - }, - ReturnsRef: true, - PhpDocComment: "", - FunctionName: &node.Identifier{ + &ast.StmtFunction{ + Node: ast.Node{ Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2226, - EndPos: 2229, + StartPos: 2216, + EndPos: 2234, }, - Value: "foo", }, - Stmts: []node.Node{}, - }, - &stmt.Global{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2237, - EndPos: 2266, - }, - Vars: []node.Node{ - &expr.Variable{ + ReturnsRef: true, + FunctionName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2244, - EndPos: 2246, + StartLine: 96, + EndLine: 96, + StartPos: 2226, + EndPos: 2229, }, - VarName: &node.Identifier{ + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtGlobal{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2237, + EndPos: 2266, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2244, EndPos: 2246, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2244, + EndPos: 2246, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2248, - EndPos: 2250, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2248, EndPos: 2250, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2248, + EndPos: 2250, + }, + }, + Value: []byte("b"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2252, - EndPos: 2255, - }, - VarName: &expr.Variable{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2253, + StartPos: 2252, EndPos: 2255, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2253, EndPos: 2255, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2253, + EndPos: 2255, + }, + }, + Value: []byte("c"), }, }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2257, - EndPos: 2265, - }, - VarName: &expr.FunctionCall{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2259, - EndPos: 2264, + StartPos: 2257, + EndPos: 2265, }, - Function: &name.Name{ + }, + VarName: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 97, EndLine: 97, StartPos: 2259, - EndPos: 2262, + EndPos: 2264, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2259, - EndPos: 2262, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2259, + EndPos: 2262, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2259, + EndPos: 2262, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2262, - EndPos: 2264, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 97, + EndLine: 97, + StartPos: 2262, + EndPos: 2264, + }, }, }, }, }, }, }, - &stmt.Label{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2269, - EndPos: 2271, - }, - LabelName: &node.Identifier{ + &ast.StmtLabel{ + Node: ast.Node{ Position: &position.Position{ StartLine: 98, EndLine: 98, StartPos: 2269, - EndPos: 2270, + EndPos: 2271, }, - Value: "a", + }, + LabelName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 98, + EndLine: 98, + StartPos: 2269, + EndPos: 2270, + }, + }, + Value: []byte("a"), }, }, - &stmt.Goto{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2275, - EndPos: 2282, - }, - Label: &node.Identifier{ + &ast.StmtGoto{ + Node: ast.Node{ Position: &position.Position{ StartLine: 99, EndLine: 99, - StartPos: 2280, - EndPos: 2281, + StartPos: 2275, + EndPos: 2282, }, - Value: "a", + }, + Label: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 99, + EndLine: 99, + StartPos: 2280, + EndPos: 2281, + }, + }, + Value: []byte("a"), }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2285, - EndPos: 2295, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 100, EndLine: 100, - StartPos: 2289, - EndPos: 2291, + StartPos: 2285, + EndPos: 2295, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 100, EndLine: 100, StartPos: 2289, EndPos: 2291, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2289, + EndPos: 2291, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2293, - EndPos: 2295, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 100, + EndLine: 100, + StartPos: 2293, + EndPos: 2295, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2298, - EndPos: 2323, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2302, - EndPos: 2304, + StartPos: 2298, + EndPos: 2323, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, StartPos: 2302, EndPos: 2304, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2306, - EndPos: 2308, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2309, - EndPos: 2323, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2317, - EndPos: 2319, + StartPos: 2302, + EndPos: 2304, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2306, + EndPos: 2308, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2309, + EndPos: 2323, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 101, EndLine: 101, StartPos: 2317, EndPos: 2319, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2317, + EndPos: 2319, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2321, - EndPos: 2323, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 101, + EndLine: 101, + StartPos: 2321, + EndPos: 2323, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2326, - EndPos: 2344, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2330, - EndPos: 2332, + StartPos: 2326, + EndPos: 2344, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, StartPos: 2330, EndPos: 2332, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2330, + EndPos: 2332, + }, + }, + Value: []byte("a"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2334, - EndPos: 2336, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2337, - EndPos: 2344, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2342, + StartPos: 2334, + EndPos: 2336, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2337, EndPos: 2344, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 102, + EndLine: 102, + StartPos: 2342, + EndPos: 2344, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2347, - EndPos: 2395, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2351, - EndPos: 2353, + StartPos: 2347, + EndPos: 2395, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2351, EndPos: 2353, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2355, - EndPos: 2357, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2358, - EndPos: 2372, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2366, - EndPos: 2368, + StartPos: 2351, + EndPos: 2353, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2355, + EndPos: 2357, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2358, + EndPos: 2372, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2366, EndPos: 2368, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2366, + EndPos: 2368, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2370, - EndPos: 2372, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2370, + EndPos: 2372, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2373, - EndPos: 2387, - }, - Cond: &expr.Variable{ + &ast.StmtElseIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2381, - EndPos: 2383, + StartPos: 2373, + EndPos: 2387, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, StartPos: 2381, EndPos: 2383, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2381, + EndPos: 2383, + }, + }, + Value: []byte("c"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2385, - EndPos: 2387, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2385, + EndPos: 2387, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2388, - EndPos: 2395, - }, - Stmt: &stmt.StmtList{ + Else: &ast.StmtElse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2393, + StartPos: 2388, EndPos: 2395, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 103, + EndLine: 103, + StartPos: 2393, + EndPos: 2395, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2398, - EndPos: 2447, - }, - Cond: &expr.Variable{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2402, - EndPos: 2404, + StartPos: 2398, + EndPos: 2447, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2402, EndPos: 2404, }, - Value: "a", }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2406, - EndPos: 2408, - }, - Stmts: []node.Node{}, - }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2409, - EndPos: 2423, - }, - Cond: &expr.Variable{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2417, - EndPos: 2419, + StartPos: 2402, + EndPos: 2404, }, - VarName: &node.Identifier{ + }, + Value: []byte("a"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2406, + EndPos: 2408, + }, + }, + Stmts: []ast.Vertex{}, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2409, + EndPos: 2423, + }, + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2417, EndPos: 2419, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2417, + EndPos: 2419, + }, + }, + Value: []byte("b"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2421, - EndPos: 2423, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2421, + EndPos: 2423, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2424, - EndPos: 2447, - }, - Stmt: &stmt.If{ + Else: &ast.StmtElse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2429, + StartPos: 2424, EndPos: 2447, }, - Cond: &expr.Variable{ + }, + Stmt: &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2433, - EndPos: 2435, + StartPos: 2429, + EndPos: 2447, }, - VarName: &node.Identifier{ + }, + Cond: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, StartPos: 2433, EndPos: 2435, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2433, + EndPos: 2435, + }, + }, + Value: []byte("c"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2437, - EndPos: 2439, - }, - Stmts: []node.Node{}, - }, - Else: &stmt.Else{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2440, - EndPos: 2447, - }, - Stmt: &stmt.StmtList{ + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2445, + StartPos: 2437, + EndPos: 2439, + }, + }, + Stmts: []ast.Vertex{}, + }, + Else: &ast.StmtElse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2440, EndPos: 2447, }, - Stmts: []node.Node{}, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 104, + EndLine: 104, + StartPos: 2445, + EndPos: 2447, + }, + }, + Stmts: []ast.Vertex{}, }, }, }, }, }, - &stmt.Nop{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2450, - EndPos: 2452, + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2450, + EndPos: 2452, + }, }, }, - &stmt.InlineHtml{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2452, - EndPos: 2465, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 105, + EndLine: 105, + StartPos: 2452, + EndPos: 2465, + }, }, - Value: "

", + Value: []byte("
"), }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2470, - EndPos: 2486, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2480, - EndPos: 2483, + StartPos: 2470, + EndPos: 2486, }, - Value: "Foo", }, - Stmts: []node.Node{}, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 106, + EndLine: 106, + StartPos: 2480, + EndPos: 2483, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2489, - EndPos: 2517, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2499, - EndPos: 2502, + StartPos: 2489, + EndPos: 2517, }, - Value: "Foo", }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2503, - EndPos: 2514, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2499, + EndPos: 2502, + }, }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2511, - EndPos: 2514, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2503, + EndPos: 2514, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2511, + EndPos: 2514, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2511, - EndPos: 2514, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 107, + EndLine: 107, + StartPos: 2511, + EndPos: 2514, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Interface{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2520, - EndPos: 2553, - }, - PhpDocComment: "", - InterfaceName: &node.Identifier{ + &ast.StmtInterface{ + Node: ast.Node{ Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2530, - EndPos: 2533, + StartPos: 2520, + EndPos: 2553, }, - Value: "Foo", }, - Extends: &stmt.InterfaceExtends{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2534, - EndPos: 2550, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2530, + EndPos: 2533, + }, }, - InterfaceNames: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2542, - EndPos: 2545, + Value: []byte("Foo"), + }, + Extends: &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2534, + EndPos: 2550, + }, + }, + InterfaceNames: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2542, + EndPos: 2545, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2542, - EndPos: 2545, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2542, + EndPos: 2545, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - &name.Name{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2547, - EndPos: 2550, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2547, + EndPos: 2550, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2547, - EndPos: 2550, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 108, + EndLine: 108, + StartPos: 2547, + EndPos: 2550, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2556, - EndPos: 2570, - }, - NamespaceName: &name.Name{ + &ast.StmtNamespace{ + Node: ast.Node{ Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2566, - EndPos: 2569, + StartPos: 2556, + EndPos: 2570, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2566, - EndPos: 2569, + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2566, + EndPos: 2569, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 109, + EndLine: 109, + StartPos: 2566, + EndPos: 2569, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2573, - EndPos: 2593, - }, - NamespaceName: &name.Name{ + &ast.StmtNamespace{ + Node: ast.Node{ Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2583, - EndPos: 2590, + StartPos: 2573, + EndPos: 2593, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2583, - EndPos: 2586, - }, - Value: "Foo", + }, + NamespaceName: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2583, + EndPos: 2590, }, - &name.NamePart{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2587, - EndPos: 2590, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2583, + EndPos: 2586, + }, }, - Value: "Bar", + Value: []byte("Foo"), + }, + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 110, + EndLine: 110, + StartPos: 2587, + EndPos: 2590, + }, + }, + Value: []byte("Bar"), }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Namespace{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2596, - EndPos: 2608, + &ast.StmtNamespace{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 111, + EndLine: 111, + StartPos: 2596, + EndPos: 2608, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2611, - EndPos: 2630, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2617, - EndPos: 2620, + StartPos: 2611, + EndPos: 2630, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2622, - EndPos: 2629, + StartPos: 2617, + EndPos: 2620, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2622, - EndPos: 2625, - }, - Value: "var", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2622, + EndPos: 2629, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2626, - EndPos: 2628, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2622, + EndPos: 2625, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("var"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, StartPos: 2626, EndPos: 2628, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 112, EndLine: 112, StartPos: 2626, EndPos: 2628, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 112, + EndLine: 112, + StartPos: 2626, + EndPos: 2628, + }, + }, + Value: []byte("a"), }, }, }, @@ -5669,221 +6797,263 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2633, - EndPos: 2670, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2639, - EndPos: 2642, + StartPos: 2633, + EndPos: 2670, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2644, - EndPos: 2669, + StartPos: 2639, + EndPos: 2642, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2644, - EndPos: 2650, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2651, - EndPos: 2657, - }, - Value: "static", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2644, + EndPos: 2669, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2658, - EndPos: 2660, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2644, + EndPos: 2650, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2651, + EndPos: 2657, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2658, EndPos: 2660, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2658, EndPos: 2660, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2658, + EndPos: 2660, + }, + }, + Value: []byte("a"), }, }, }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2662, - EndPos: 2668, - }, - PhpDocComment: "", - Variable: &expr.Variable{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2662, - EndPos: 2664, + EndPos: 2668, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 113, EndLine: 113, StartPos: 2662, EndPos: 2664, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2662, + EndPos: 2664, + }, + }, + Value: []byte("b"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2667, - EndPos: 2668, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 113, + EndLine: 113, + StartPos: 2667, + EndPos: 2668, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2673, - EndPos: 2710, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2679, - EndPos: 2682, + StartPos: 2673, + EndPos: 2710, }, - Value: "foo", }, - Stmts: []node.Node{ - &stmt.PropertyList{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2684, - EndPos: 2709, + StartPos: 2679, + EndPos: 2682, }, - Modifiers: []node.Node{ - &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2684, - EndPos: 2690, - }, - Value: "public", - }, - &node.Identifier{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2691, - EndPos: 2697, - }, - Value: "static", + }, + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtPropertyList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2684, + EndPos: 2709, }, }, - Properties: []node.Node{ - &stmt.Property{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2698, - EndPos: 2704, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2684, + EndPos: 2690, + }, }, - PhpDocComment: "", - Variable: &expr.Variable{ + Value: []byte("public"), + }, + &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2691, + EndPos: 2697, + }, + }, + Value: []byte("static"), + }, + }, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2698, - EndPos: 2700, + EndPos: 2704, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2698, EndPos: 2700, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2698, + EndPos: 2700, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2703, - EndPos: 2704, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2703, + EndPos: 2704, + }, }, - Value: "1", + Value: []byte("1"), }, }, - &stmt.Property{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2706, - EndPos: 2708, - }, - PhpDocComment: "", - Variable: &expr.Variable{ + &ast.StmtProperty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2706, EndPos: 2708, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 114, EndLine: 114, StartPos: 2706, EndPos: 2708, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 114, + EndLine: 114, + StartPos: 2706, + EndPos: 2708, + }, + }, + Value: []byte("b"), }, }, }, @@ -5891,353 +7061,433 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2713, - EndPos: 2731, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2713, + EndPos: 2731, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2720, - EndPos: 2722, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2720, EndPos: 2722, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2720, EndPos: 2722, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2720, + EndPos: 2722, + }, + }, + Value: []byte("a"), }, }, }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2724, - EndPos: 2730, - }, - Variable: &expr.Variable{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2724, - EndPos: 2726, + EndPos: 2730, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 115, EndLine: 115, StartPos: 2724, EndPos: 2726, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2724, + EndPos: 2726, + }, + }, + Value: []byte("b"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2729, - EndPos: 2730, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 115, + EndLine: 115, + StartPos: 2729, + EndPos: 2730, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2734, - EndPos: 2752, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2734, + EndPos: 2752, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2741, - EndPos: 2747, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2741, - EndPos: 2743, + EndPos: 2747, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2741, EndPos: 2743, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2741, + EndPos: 2743, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2746, - EndPos: 2747, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2746, + EndPos: 2747, + }, }, - Value: "1", + Value: []byte("1"), }, }, - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2749, - EndPos: 2751, - }, - Variable: &expr.Variable{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2749, EndPos: 2751, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 116, EndLine: 116, StartPos: 2749, EndPos: 2751, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 116, + EndLine: 116, + StartPos: 2749, + EndPos: 2751, + }, + }, + Value: []byte("b"), }, }, }, }, }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 118, - EndLine: 122, - StartPos: 2756, - EndPos: 2815, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 118, - EndLine: 118, - StartPos: 2764, - EndPos: 2765, + EndLine: 122, + StartPos: 2756, + EndPos: 2815, }, - Value: "1", }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 119, - EndLine: -1, - StartPos: 2772, - EndPos: -1, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 118, + EndLine: 118, + StartPos: 2764, + EndPos: 2765, + }, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 119, - EndLine: -1, - StartPos: 2772, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: -1, + StartPos: 2772, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 119, - EndLine: 119, - StartPos: 2777, - EndPos: 2778, + EndLine: -1, + StartPos: 2772, + EndPos: -1, }, - Value: "1", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 119, + EndLine: 119, + StartPos: 2777, + EndPos: 2778, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Default{ - Position: &position.Position{ - StartLine: 120, - EndLine: -1, - StartPos: 2783, - EndPos: -1, + &ast.StmtDefault{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 120, + EndLine: -1, + StartPos: 2783, + EndPos: -1, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 121, - EndLine: -1, - StartPos: 2795, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 121, - EndLine: 121, - StartPos: 2800, - EndPos: 2801, + EndLine: -1, + StartPos: 2795, + EndPos: -1, }, - Value: "2", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 121, + EndLine: 121, + StartPos: 2800, + EndPos: 2801, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.AltSwitch{ - Position: &position.Position{ - StartLine: 124, - EndLine: 127, - StartPos: 2819, - EndPos: 2867, - }, - Cond: &scalar.Lnumber{ + &ast.StmtAltSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 124, - EndLine: 124, - StartPos: 2827, - EndPos: 2828, + EndLine: 127, + StartPos: 2819, + EndPos: 2867, }, - Value: "1", }, - CaseList: &stmt.CaseList{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2836, - EndPos: -1, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 124, + EndLine: 124, + StartPos: 2827, + EndPos: 2828, + }, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2836, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: -1, + StartPos: 2836, + EndPos: -1, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 125, - EndLine: 125, - StartPos: 2841, - EndPos: 2842, + EndLine: -1, + StartPos: 2836, + EndPos: -1, }, - Value: "1", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 125, + EndLine: 125, + StartPos: 2841, + EndPos: 2842, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 126, - EndLine: -1, - StartPos: 2847, - EndPos: -1, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 126, - EndLine: 126, - StartPos: 2852, - EndPos: 2853, + EndLine: -1, + StartPos: 2847, + EndPos: -1, }, - Value: "2", }, - Stmts: []node.Node{}, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 126, + EndLine: 126, + StartPos: 2852, + EndPos: 2853, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{}, }, }, }, }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 129, - EndLine: 132, - StartPos: 2873, - EndPos: 2925, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2881, - EndPos: 2882, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ + &ast.StmtSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 129, EndLine: 132, - StartPos: 2884, + StartPos: 2873, EndPos: 2925, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2889, - EndPos: 2903, - }, - Cond: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 129, + StartPos: 2881, + EndPos: 2882, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 129, + EndLine: 132, + StartPos: 2884, + EndPos: 2925, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 130, EndLine: 130, - StartPos: 2894, - EndPos: 2895, + StartPos: 2889, + EndPos: 2903, }, - Value: "1", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 130, EndLine: 130, - StartPos: 2897, - EndPos: 2903, + StartPos: 2894, + EndPos: 2895, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 130, + EndLine: 130, + StartPos: 2897, + EndPos: 2903, + }, }, }, }, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 131, - EndLine: 131, - StartPos: 2907, - EndPos: 2921, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 131, EndLine: 131, - StartPos: 2912, - EndPos: 2913, + StartPos: 2907, + EndPos: 2921, }, - Value: "2", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 131, EndLine: 131, - StartPos: 2915, - EndPos: 2921, + StartPos: 2912, + EndPos: 2913, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 131, + EndLine: 131, + StartPos: 2915, + EndPos: 2921, + }, }, }, }, @@ -6245,80 +7495,98 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Switch{ - Position: &position.Position{ - StartLine: 134, - EndLine: 137, - StartPos: 2931, - EndPos: 2984, - }, - Cond: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2939, - EndPos: 2940, - }, - Value: "1", - }, - CaseList: &stmt.CaseList{ + &ast.StmtSwitch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 134, EndLine: 137, - StartPos: 2942, + StartPos: 2931, EndPos: 2984, }, - Cases: []node.Node{ - &stmt.Case{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2948, - EndPos: 2962, - }, - Cond: &scalar.Lnumber{ + }, + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 134, + StartPos: 2939, + EndPos: 2940, + }, + }, + Value: []byte("1"), + }, + CaseList: &ast.StmtCaseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 134, + EndLine: 137, + StartPos: 2942, + EndPos: 2984, + }, + }, + Cases: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 2953, - EndPos: 2954, + StartPos: 2948, + EndPos: 2962, }, - Value: "1", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 2956, - EndPos: 2962, + StartPos: 2953, + EndPos: 2954, + }, + }, + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 135, + EndLine: 135, + StartPos: 2956, + EndPos: 2962, + }, }, }, }, }, - &stmt.Case{ - Position: &position.Position{ - StartLine: 136, - EndLine: 136, - StartPos: 2966, - EndPos: 2980, - }, - Cond: &scalar.Lnumber{ + &ast.StmtCase{ + Node: ast.Node{ Position: &position.Position{ StartLine: 136, EndLine: 136, - StartPos: 2971, - EndPos: 2972, + StartPos: 2966, + EndPos: 2980, }, - Value: "2", }, - Stmts: []node.Node{ - &stmt.Break{ + Cond: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 136, EndLine: 136, - StartPos: 2974, - EndPos: 2980, + StartPos: 2971, + EndPos: 2972, + }, + }, + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 136, + EndLine: 136, + StartPos: 2974, + EndPos: 2980, + }, }, }, }, @@ -6326,288 +7594,346 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Throw{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2987, - EndPos: 2996, - }, - Expr: &expr.Variable{ + &ast.StmtThrow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 138, EndLine: 138, - StartPos: 2993, - EndPos: 2995, + StartPos: 2987, + EndPos: 2996, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 138, EndLine: 138, StartPos: 2993, EndPos: 2995, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 138, + EndLine: 138, + StartPos: 2993, + EndPos: 2995, + }, + }, + Value: []byte("e"), }, }, }, - &stmt.Trait{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2999, - EndPos: 3011, - }, - PhpDocComment: "", - TraitName: &node.Identifier{ + &ast.StmtTrait{ + Node: ast.Node{ Position: &position.Position{ StartLine: 139, EndLine: 139, - StartPos: 3005, - EndPos: 3008, + StartPos: 2999, + EndPos: 3011, }, - Value: "Foo", }, - Stmts: []node.Node{}, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 139, + EndLine: 139, + StartPos: 3005, + EndPos: 3008, + }, + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{}, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3014, - EndPos: 3036, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3020, - EndPos: 3023, + StartPos: 3014, + EndPos: 3036, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3026, - EndPos: 3034, + StartPos: 3020, + EndPos: 3023, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3030, - EndPos: 3033, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 3030, - EndPos: 3033, - }, - Value: "Bar", - }, - }, - }, - }, - TraitAdaptationList: &stmt.Nop{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3033, + StartPos: 3026, EndPos: 3034, }, }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3030, + EndPos: 3033, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3030, + EndPos: 3033, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 140, + EndLine: 140, + StartPos: 3033, + EndPos: 3034, + }, + }, + }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3039, - EndPos: 3068, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3045, - EndPos: 3048, + StartPos: 3039, + EndPos: 3068, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3051, - EndPos: 3066, + StartPos: 3045, + EndPos: 3048, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3055, - EndPos: 3058, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3055, - EndPos: 3058, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3060, - EndPos: 3063, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 3060, - EndPos: 3063, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 141, EndLine: 141, - StartPos: 3064, + StartPos: 3051, EndPos: 3066, }, }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3055, + EndPos: 3058, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3055, + EndPos: 3058, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3060, + EndPos: 3063, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3060, + EndPos: 3063, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 141, + EndLine: 141, + StartPos: 3064, + EndPos: 3066, + }, + }, + }, }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3071, - EndPos: 3116, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3077, - EndPos: 3080, + StartPos: 3071, + EndPos: 3116, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3083, - EndPos: 3114, + StartPos: 3077, + EndPos: 3080, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3087, - EndPos: 3090, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3087, - EndPos: 3090, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3092, - EndPos: 3095, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3092, - EndPos: 3095, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3096, + StartPos: 3083, EndPos: 3114, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, - StartPos: 3098, - EndPos: 3111, + StartPos: 3087, + EndPos: 3090, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3087, + EndPos: 3090, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3092, + EndPos: 3095, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3092, + EndPos: 3095, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3096, + EndPos: 3114, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, StartPos: 3098, - EndPos: 3101, + EndPos: 3111, }, - Method: &node.Identifier{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 142, EndLine: 142, StartPos: 3098, EndPos: 3101, }, - Value: "one", + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3098, + EndPos: 3101, + }, + }, + Value: []byte("one"), }, }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 3105, - EndPos: 3111, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 142, + EndLine: 142, + StartPos: 3105, + EndPos: 3111, + }, }, - Value: "public", + Value: []byte("public"), }, }, }, @@ -6615,120 +7941,145 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3119, - EndPos: 3168, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3125, - EndPos: 3128, + StartPos: 3119, + EndPos: 3168, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3131, - EndPos: 3166, + StartPos: 3125, + EndPos: 3128, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3135, - EndPos: 3138, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3135, - EndPos: 3138, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3140, - EndPos: 3143, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3140, - EndPos: 3143, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3144, + StartPos: 3131, EndPos: 3166, }, - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3146, - EndPos: 3163, + StartPos: 3135, + EndPos: 3138, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3135, + EndPos: 3138, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3140, + EndPos: 3143, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3140, + EndPos: 3143, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3144, + EndPos: 3166, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, StartPos: 3146, - EndPos: 3149, + EndPos: 3163, }, - Method: &node.Identifier{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 143, EndLine: 143, StartPos: 3146, EndPos: 3149, }, - Value: "one", + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3146, + EndPos: 3149, + }, + }, + Value: []byte("one"), }, }, - Modifier: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3153, - EndPos: 3159, + Modifier: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3153, + EndPos: 3159, + }, }, - Value: "public", + Value: []byte("public"), }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 3160, - EndPos: 3163, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 143, + EndLine: 143, + StartPos: 3160, + EndPos: 3163, + }, }, - Value: "two", + Value: []byte("two"), }, }, }, @@ -6736,214 +8087,259 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Class{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3171, - EndPos: 3248, - }, - PhpDocComment: "", - ClassName: &node.Identifier{ + &ast.StmtClass{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3177, - EndPos: 3180, + StartPos: 3171, + EndPos: 3248, }, - Value: "Foo", }, - Stmts: []node.Node{ - &stmt.TraitUse{ + ClassName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3183, - EndPos: 3246, + StartPos: 3177, + EndPos: 3180, }, - Traits: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3187, - EndPos: 3190, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3187, - EndPos: 3190, - }, - Value: "Bar", - }, - }, - }, - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3192, - EndPos: 3195, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3192, - EndPos: 3195, - }, - Value: "Baz", - }, - }, - }, - }, - TraitAdaptationList: &stmt.TraitAdaptationList{ + }, + Value: []byte("Foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtTraitUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3196, + StartPos: 3183, EndPos: 3246, }, - Adaptations: []node.Node{ - &stmt.TraitUsePrecedence{ + }, + Traits: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3198, - EndPos: 3226, + StartPos: 3187, + EndPos: 3190, }, - Ref: &stmt.TraitMethodRef{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3187, + EndPos: 3190, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3192, + EndPos: 3195, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3192, + EndPos: 3195, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3196, + EndPos: 3246, + }, + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3198, - EndPos: 3206, + EndPos: 3226, }, - Trait: &name.Name{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3198, - EndPos: 3201, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3198, - EndPos: 3201, - }, - Value: "Bar", - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3203, EndPos: 3206, }, - Value: "one", }, - }, - Insteadof: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3217, - EndPos: 3220, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3198, + EndPos: 3201, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3217, - EndPos: 3220, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3198, + EndPos: 3201, + }, }, - Value: "Baz", + Value: []byte("Bar"), }, }, }, - &name.Name{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3222, - EndPos: 3226, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3203, + EndPos: 3206, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3222, - EndPos: 3226, + Value: []byte("one"), + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3217, + EndPos: 3220, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3217, + EndPos: 3220, + }, }, - Value: "Quux", + Value: []byte("Baz"), + }, + }, + }, + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3222, + EndPos: 3226, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3222, + EndPos: 3226, + }, + }, + Value: []byte("Quux"), }, }, }, }, }, - &stmt.TraitUseAlias{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3228, - EndPos: 3243, - }, - Ref: &stmt.TraitMethodRef{ + &ast.StmtTraitUseAlias{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3228, - EndPos: 3236, + EndPos: 3243, }, - Trait: &name.Name{ + }, + Ref: &ast.StmtTraitMethodRef{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, StartPos: 3228, - EndPos: 3231, + EndPos: 3236, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3228, - EndPos: 3231, + }, + Trait: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3228, + EndPos: 3231, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3228, + EndPos: 3231, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, - Method: &node.Identifier{ + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 144, + EndLine: 144, + StartPos: 3233, + EndPos: 3236, + }, + }, + Value: []byte("one"), + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 144, EndLine: 144, - StartPos: 3233, - EndPos: 3236, + StartPos: 3240, + EndPos: 3243, }, - Value: "one", }, - }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3240, - EndPos: 3243, - }, - Value: "two", + Value: []byte("two"), }, }, }, @@ -6951,1311 +8347,1599 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 146, - EndLine: -1, - StartPos: 3252, - EndPos: -1, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 146, + EndLine: -1, + StartPos: 3252, + EndPos: -1, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{}, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{}, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3261, - EndPos: 3291, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3261, + EndPos: 3291, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3268, - EndPos: 3291, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3268, + EndPos: 3291, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3275, - EndPos: 3284, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3275, + EndPos: 3284, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3275, - EndPos: 3284, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3275, + EndPos: 3284, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3285, - EndPos: 3287, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 147, EndLine: 147, StartPos: 3285, EndPos: 3287, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 147, + EndLine: 147, + StartPos: 3285, + EndPos: 3287, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3294, - EndPos: 3355, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3294, + EndPos: 3355, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3301, - EndPos: 3324, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3301, + EndPos: 3324, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3308, - EndPos: 3317, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3308, + EndPos: 3317, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3308, - EndPos: 3317, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3308, + EndPos: 3317, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3318, - EndPos: 3320, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 148, EndLine: 148, StartPos: 3318, EndPos: 3320, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3318, + EndPos: 3320, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3325, - EndPos: 3355, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3325, + EndPos: 3355, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3332, - EndPos: 3348, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3332, + EndPos: 3348, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3332, - EndPos: 3348, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3332, + EndPos: 3348, + }, }, - Value: "RuntimeException", + Value: []byte("RuntimeException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3349, - EndPos: 3351, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 148, EndLine: 148, StartPos: 3349, EndPos: 3351, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 148, + EndLine: 148, + StartPos: 3349, + EndPos: 3351, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3358, - EndPos: 3462, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3358, + EndPos: 3462, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3365, - EndPos: 3388, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3365, + EndPos: 3388, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3372, - EndPos: 3381, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3372, + EndPos: 3381, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3372, - EndPos: 3381, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3372, + EndPos: 3381, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3382, - EndPos: 3384, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3382, EndPos: 3384, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3382, + EndPos: 3384, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3389, - EndPos: 3420, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3389, + EndPos: 3420, + }, }, - Types: []node.Node{ - &name.FullyQualified{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3396, - EndPos: 3413, + Types: []ast.Vertex{ + &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3396, + EndPos: 3413, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3397, - EndPos: 3413, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3397, + EndPos: 3413, + }, }, - Value: "RuntimeException", + Value: []byte("RuntimeException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3414, - EndPos: 3416, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3414, EndPos: 3416, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3414, + EndPos: 3416, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, - &stmt.Catch{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3421, - EndPos: 3462, + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3421, + EndPos: 3462, + }, }, - Types: []node.Node{ - &name.Relative{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3428, - EndPos: 3455, + Types: []ast.Vertex{ + &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3428, + EndPos: 3455, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3438, - EndPos: 3455, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3438, + EndPos: 3455, + }, }, - Value: "AdditionException", + Value: []byte("AdditionException"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3456, - EndPos: 3458, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 149, EndLine: 149, StartPos: 3456, EndPos: 3458, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 149, + EndLine: 149, + StartPos: 3456, + EndPos: 3458, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, }, - &stmt.Try{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3465, - EndPos: 3506, + &ast.StmtTry{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3465, + EndPos: 3506, + }, }, - Stmts: []node.Node{}, - Catches: []node.Node{ - &stmt.Catch{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3472, - EndPos: 3495, + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3472, + EndPos: 3495, + }, }, - Types: []node.Node{ - &name.Name{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3479, - EndPos: 3488, + Types: []ast.Vertex{ + &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3479, + EndPos: 3488, + }, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3479, - EndPos: 3488, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3479, + EndPos: 3488, + }, }, - Value: "Exception", + Value: []byte("Exception"), }, }, }, }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3489, - EndPos: 3491, - }, - VarName: &node.Identifier{ + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 150, EndLine: 150, StartPos: 3489, EndPos: 3491, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3489, + EndPos: 3491, + }, + }, + Value: []byte("e"), }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - Finally: &stmt.Finally{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3496, - EndPos: 3506, + Finally: &ast.StmtFinally{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 150, + EndLine: 150, + StartPos: 3496, + EndPos: 3506, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Unset{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3510, - EndPos: 3524, + &ast.StmtUnset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3510, + EndPos: 3524, + }, }, - Vars: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3516, - EndPos: 3518, - }, - VarName: &node.Identifier{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 152, EndLine: 152, StartPos: 3516, EndPos: 3518, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3516, + EndPos: 3518, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3520, - EndPos: 3522, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 152, EndLine: 152, StartPos: 3520, EndPos: 3522, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 152, + EndLine: 152, + StartPos: 3520, + EndPos: 3522, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3528, - EndPos: 3536, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3528, + EndPos: 3536, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3532, - EndPos: 3535, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 154, EndLine: 154, StartPos: 3532, EndPos: 3535, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3532, - EndPos: 3535, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3532, + EndPos: 3535, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3532, + EndPos: 3535, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3539, - EndPos: 3548, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3539, + EndPos: 3548, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3544, - EndPos: 3547, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 155, EndLine: 155, StartPos: 3544, EndPos: 3547, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3544, - EndPos: 3547, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3544, + EndPos: 3547, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3544, + EndPos: 3547, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3551, - EndPos: 3567, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3551, + EndPos: 3567, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3556, - EndPos: 3566, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 156, EndLine: 156, StartPos: 3556, - EndPos: 3559, + EndPos: 3566, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3556, - EndPos: 3559, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3556, + EndPos: 3559, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3556, + EndPos: 3559, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3563, - EndPos: 3566, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3563, + EndPos: 3566, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3570, - EndPos: 3583, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3570, + EndPos: 3583, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3574, - EndPos: 3577, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 157, EndLine: 157, StartPos: 3574, EndPos: 3577, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3574, - EndPos: 3577, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3574, + EndPos: 3577, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3574, + EndPos: 3577, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3582, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 157, EndLine: 157, StartPos: 3579, EndPos: 3582, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3579, - EndPos: 3582, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3582, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3579, + EndPos: 3582, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3586, - EndPos: 3606, + &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3586, + EndPos: 3606, + }, }, - Uses: []node.Node{ - &stmt.Use{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3590, - EndPos: 3593, - }, - Use: &name.Name{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3590, EndPos: 3593, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3590, - EndPos: 3593, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3590, + EndPos: 3593, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3590, + EndPos: 3593, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3605, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3595, - EndPos: 3598, + EndPos: 3605, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3595, - EndPos: 3598, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3598, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3595, + EndPos: 3598, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3602, - EndPos: 3605, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3602, + EndPos: 3605, + }, }, - Value: "Baz", + Value: []byte("Baz"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3609, - EndPos: 3632, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3613, - EndPos: 3621, + StartPos: 3609, + EndPos: 3632, }, - Value: "function", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3622, - EndPos: 3625, + StartPos: 3613, + EndPos: 3621, }, - Use: &name.Name{ + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3622, EndPos: 3625, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3622, - EndPos: 3625, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3622, + EndPos: 3625, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3622, + EndPos: 3625, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3628, - EndPos: 3631, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3628, EndPos: 3631, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3628, - EndPos: 3631, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3628, + EndPos: 3631, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3628, + EndPos: 3631, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3635, - EndPos: 3672, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, - StartPos: 3639, - EndPos: 3647, + StartPos: 3635, + EndPos: 3672, }, - Value: "function", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, - StartPos: 3648, - EndPos: 3658, + StartPos: 3639, + EndPos: 3647, }, - Use: &name.Name{ + }, + Value: []byte("function"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3648, - EndPos: 3651, + EndPos: 3658, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3648, - EndPos: 3651, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3648, + EndPos: 3651, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3648, + EndPos: 3651, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3655, - EndPos: 3658, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3655, + EndPos: 3658, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3661, - EndPos: 3671, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3661, - EndPos: 3664, + EndPos: 3671, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3661, - EndPos: 3664, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3661, + EndPos: 3664, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3661, + EndPos: 3664, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3668, - EndPos: 3671, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3668, + EndPos: 3671, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3675, - EndPos: 3695, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3679, - EndPos: 3684, + StartPos: 3675, + EndPos: 3695, }, - Value: "const", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3685, - EndPos: 3688, + StartPos: 3679, + EndPos: 3684, }, - Use: &name.Name{ + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3685, EndPos: 3688, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3685, - EndPos: 3688, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3685, + EndPos: 3688, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3685, + EndPos: 3688, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3691, - EndPos: 3694, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3691, EndPos: 3694, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3691, - EndPos: 3694, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3691, + EndPos: 3694, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3691, + EndPos: 3694, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, }, }, }, - &stmt.UseList{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3698, - EndPos: 3732, - }, - UseType: &node.Identifier{ + &ast.StmtUseList{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3702, - EndPos: 3707, + StartPos: 3698, + EndPos: 3732, }, - Value: "const", }, - Uses: []node.Node{ - &stmt.Use{ + UseType: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3708, - EndPos: 3718, + StartPos: 3702, + EndPos: 3707, }, - Use: &name.Name{ + }, + Value: []byte("const"), + }, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3708, - EndPos: 3711, + EndPos: 3718, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3708, - EndPos: 3711, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3708, + EndPos: 3711, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3708, + EndPos: 3711, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3715, - EndPos: 3718, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3715, + EndPos: 3718, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, - &stmt.Use{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3721, - EndPos: 3731, - }, - Use: &name.Name{ + &ast.StmtUse{ + Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3721, - EndPos: 3724, + EndPos: 3731, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3721, - EndPos: 3724, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3721, + EndPos: 3724, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3721, + EndPos: 3724, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - Alias: &node.Identifier{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3728, - EndPos: 3731, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3728, + EndPos: 3731, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3736, - EndPos: 3742, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, - EndPos: 3741, + EndPos: 3742, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, - EndPos: 3738, + EndPos: 3741, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 164, EndLine: 164, StartPos: 3736, EndPos: 3738, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3736, + EndPos: 3738, + }, + }, + Value: []byte("a"), }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3739, - EndPos: 3740, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3739, + EndPos: 3740, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3745, - EndPos: 3754, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3753, + EndPos: 3754, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3750, + EndPos: 3753, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, - EndPos: 3747, + EndPos: 3750, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3745, EndPos: 3747, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3745, + EndPos: 3747, + }, + }, + Value: []byte("a"), }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3748, + EndPos: 3749, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3748, - EndPos: 3749, + StartPos: 3751, + EndPos: 3752, }, - Value: "1", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3751, - EndPos: 3752, - }, - Value: "2", + Value: []byte("2"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3757, - EndPos: 3765, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3757, - EndPos: 3764, + EndPos: 3765, }, - Items: []node.Node{}, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3757, + EndPos: 3764, + }, + }, + Items: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3768, - EndPos: 3777, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3768, - EndPos: 3776, + EndPos: 3777, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3774, - EndPos: 3775, - }, - Val: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3768, + EndPos: 3776, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3774, EndPos: 3775, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3774, + EndPos: 3775, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3780, - EndPos: 3798, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3780, - EndPos: 3797, + EndPos: 3798, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3786, - EndPos: 3790, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3780, + EndPos: 3797, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3786, - EndPos: 3787, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3789, EndPos: 3790, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3786, + EndPos: 3787, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3789, + EndPos: 3790, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3792, - EndPos: 3795, - }, - Val: &expr.Reference{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3792, EndPos: 3795, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3793, + StartPos: 3792, EndPos: 3795, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3793, EndPos: 3795, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3793, + EndPos: 3795, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{}, + &ast.ExprArrayItem{}, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3801, - EndPos: 3816, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3801, - EndPos: 3815, + EndPos: 3816, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3807, - EndPos: 3814, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3801, + EndPos: 3815, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3807, - EndPos: 3808, - }, - Value: "3", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3811, EndPos: 3814, }, - Variable: &expr.Variable{ + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3812, + StartPos: 3807, + EndPos: 3808, + }, + }, + Value: []byte("3"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3811, EndPos: 3814, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3812, EndPos: 3814, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3812, + EndPos: 3814, + }, + }, + Value: []byte("b"), }, }, }, @@ -8263,135 +9947,167 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3819, - EndPos: 3848, - }, - Expr: &expr.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3819, - EndPos: 3847, + EndPos: 3848, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3825, - EndPos: 3828, - }, - Val: &expr.Reference{ + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3819, + EndPos: 3847, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3825, EndPos: 3828, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, - StartPos: 3826, + StartPos: 3825, EndPos: 3828, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3826, EndPos: 3828, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3826, + EndPos: 3828, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3830, - EndPos: 3834, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3830, - EndPos: 3831, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3833, EndPos: 3834, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3830, + EndPos: 3831, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3833, + EndPos: 3834, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3836, - EndPos: 3837, - }, - Val: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3836, EndPos: 3837, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3836, + EndPos: 3837, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3839, - EndPos: 3846, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3839, - EndPos: 3840, - }, - Value: "3", - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3843, EndPos: 3846, }, - Variable: &expr.Variable{ + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, - StartPos: 3844, + StartPos: 3839, + EndPos: 3840, + }, + }, + Value: []byte("3"), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3843, EndPos: 3846, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 170, EndLine: 170, StartPos: 3844, EndPos: 3846, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 170, + EndLine: 170, + StartPos: 3844, + EndPos: 3846, + }, + }, + Value: []byte("b"), }, }, }, @@ -8399,935 +10115,1145 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3851, - EndPos: 3855, - }, - Expr: &expr.BitwiseNot{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3851, - EndPos: 3854, + EndPos: 3855, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3852, + StartPos: 3851, EndPos: 3854, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3852, EndPos: 3854, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3852, + EndPos: 3854, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3858, - EndPos: 3862, - }, - Expr: &expr.BooleanNot{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3858, - EndPos: 3861, + EndPos: 3862, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3859, + StartPos: 3858, EndPos: 3861, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3859, EndPos: 3861, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3859, + EndPos: 3861, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3866, - EndPos: 3875, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3866, - EndPos: 3874, + EndPos: 3875, }, - Class: &name.Name{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3866, - EndPos: 3869, + EndPos: 3874, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3866, - EndPos: 3869, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3866, + EndPos: 3869, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3866, + EndPos: 3869, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3871, - EndPos: 3874, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3871, + EndPos: 3874, + }, }, - Value: "Bar", + Value: []byte("Bar"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3878, - EndPos: 3888, - }, - Expr: &expr.Clone{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3878, - EndPos: 3886, + EndPos: 3888, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3884, + StartPos: 3878, EndPos: 3886, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3884, EndPos: 3886, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3884, + EndPos: 3886, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3891, - EndPos: 3900, - }, - Expr: &expr.Clone{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, StartPos: 3891, - EndPos: 3899, + EndPos: 3900, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprClone{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, - StartPos: 3897, + StartPos: 3891, EndPos: 3899, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 176, EndLine: 176, StartPos: 3897, EndPos: 3899, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 176, + EndLine: 176, + StartPos: 3897, + EndPos: 3899, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3903, - EndPos: 3916, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 177, EndLine: 177, StartPos: 3903, - EndPos: 3915, + EndPos: 3916, }, - Static: false, - PhpDocComment: "", - ReturnsRef: false, - Stmts: []node.Node{}, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 177, + EndLine: 177, + StartPos: 3903, + EndPos: 3915, + }, + }, + Static: false, + ReturnsRef: false, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3919, - EndPos: 3953, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3919, - EndPos: 3952, + EndPos: 3953, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3928, - EndPos: 3930, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3919, + EndPos: 3952, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3928, EndPos: 3930, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3928, EndPos: 3930, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3928, + EndPos: 3930, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3932, - EndPos: 3934, - }, - Variadic: false, - ByRef: false, - Variable: &expr.Variable{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3932, EndPos: 3934, }, - VarName: &node.Identifier{ + }, + Variadic: false, + ByRef: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3932, EndPos: 3934, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3932, + EndPos: 3934, + }, + }, + Value: []byte("b"), }, }, }, }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3936, - EndPos: 3949, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3936, + EndPos: 3949, + }, }, - Uses: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3941, - EndPos: 3943, - }, - VarName: &node.Identifier{ + Uses: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3941, EndPos: 3943, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3941, + EndPos: 3943, + }, + }, + Value: []byte("c"), }, }, - &expr.Reference{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3945, - EndPos: 3948, - }, - Variable: &expr.Variable{ + &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3946, + StartPos: 3945, EndPos: 3948, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 178, EndLine: 178, StartPos: 3946, EndPos: 3948, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 178, + EndLine: 178, + StartPos: 3946, + EndPos: 3948, + }, + }, + Value: []byte("d"), }, }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3956, - EndPos: 3990, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3956, - EndPos: 3989, + EndPos: 3990, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Params: []node.Node{ - &node.Parameter{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3965, - EndPos: 3967, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3956, + EndPos: 3989, + }, + }, + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3965, EndPos: 3967, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3965, EndPos: 3967, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3965, + EndPos: 3967, + }, + }, + Value: []byte("a"), }, }, }, - &node.Parameter{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3969, - EndPos: 3971, - }, - ByRef: false, - Variadic: false, - Variable: &expr.Variable{ + &ast.Parameter{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3969, EndPos: 3971, }, - VarName: &node.Identifier{ + }, + ByRef: false, + Variadic: false, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3969, EndPos: 3971, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3969, + EndPos: 3971, + }, + }, + Value: []byte("b"), }, }, }, }, - ClosureUse: &expr.ClosureUse{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3973, - EndPos: 3986, + ClosureUse: &ast.ExprClosureUse{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3973, + EndPos: 3986, + }, }, - Uses: []node.Node{ - &expr.Reference{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3978, - EndPos: 3981, - }, - Variable: &expr.Variable{ + Uses: []ast.Vertex{ + &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, - StartPos: 3979, + StartPos: 3978, EndPos: 3981, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3979, EndPos: 3981, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3979, + EndPos: 3981, + }, + }, + Value: []byte("c"), }, }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3983, - EndPos: 3985, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 179, EndLine: 179, StartPos: 3983, EndPos: 3985, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 179, + EndLine: 179, + StartPos: 3983, + EndPos: 3985, + }, + }, + Value: []byte("d"), }, }, }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3993, - EndPos: 4007, - }, - Expr: &expr.Closure{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 180, EndLine: 180, StartPos: 3993, - EndPos: 4006, + EndPos: 4007, }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Stmts: []node.Node{}, + }, + Expr: &ast.ExprClosure{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 180, + EndLine: 180, + StartPos: 3993, + EndPos: 4006, + }, + }, + ReturnsRef: false, + Static: false, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4010, - EndPos: 4014, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 181, EndLine: 181, StartPos: 4010, - EndPos: 4013, + EndPos: 4014, }, - Constant: &name.Name{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 181, EndLine: 181, StartPos: 4010, EndPos: 4013, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 4010, - EndPos: 4013, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4010, + EndPos: 4013, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 181, + EndLine: 181, + StartPos: 4010, + EndPos: 4013, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4017, - EndPos: 4031, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 182, EndLine: 182, StartPos: 4017, - EndPos: 4030, + EndPos: 4031, }, - Constant: &name.Relative{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 182, EndLine: 182, StartPos: 4017, EndPos: 4030, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 4027, - EndPos: 4030, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4017, + EndPos: 4030, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 182, + EndLine: 182, + StartPos: 4027, + EndPos: 4030, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4034, - EndPos: 4039, - }, - Expr: &expr.ConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 183, EndLine: 183, StartPos: 4034, - EndPos: 4038, + EndPos: 4039, }, - Constant: &name.FullyQualified{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 183, EndLine: 183, StartPos: 4034, EndPos: 4038, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 4035, - EndPos: 4038, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4034, + EndPos: 4038, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 183, + EndLine: 183, + StartPos: 4035, + EndPos: 4038, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 4043, - EndPos: 4053, - }, - Expr: &expr.Empty{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, StartPos: 4043, - EndPos: 4052, + EndPos: 4053, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4049, - EndPos: 4051, + StartPos: 4043, + EndPos: 4052, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 185, EndLine: 185, StartPos: 4049, EndPos: 4051, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 185, + EndLine: 185, + StartPos: 4049, + EndPos: 4051, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4056, - EndPos: 4067, - }, - Expr: &expr.Empty{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, StartPos: 4056, - EndPos: 4066, + EndPos: 4067, }, - Expr: &expr.ConstFetch{ + }, + Expr: &ast.ExprEmpty{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4062, - EndPos: 4065, + StartPos: 4056, + EndPos: 4066, }, - Constant: &name.Name{ + }, + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 186, EndLine: 186, StartPos: 4062, EndPos: 4065, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 4062, - EndPos: 4065, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4062, + EndPos: 4065, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 186, + EndLine: 186, + StartPos: 4062, + EndPos: 4065, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 4070, - EndPos: 4074, - }, - Expr: &expr.ErrorSuppress{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, StartPos: 4070, - EndPos: 4073, + EndPos: 4074, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprErrorSuppress{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4071, + StartPos: 4070, EndPos: 4073, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 187, EndLine: 187, StartPos: 4071, EndPos: 4073, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 187, + EndLine: 187, + StartPos: 4071, + EndPos: 4073, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 4077, - EndPos: 4086, - }, - Expr: &expr.Eval{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, StartPos: 4077, - EndPos: 4085, + EndPos: 4086, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprEval{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4082, - EndPos: 4084, + StartPos: 4077, + EndPos: 4085, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 188, EndLine: 188, StartPos: 4082, EndPos: 4084, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 188, + EndLine: 188, + StartPos: 4082, + EndPos: 4084, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 4089, - EndPos: 4094, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 189, EndLine: 189, StartPos: 4089, - EndPos: 4093, + EndPos: 4094, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 189, + EndLine: 189, + StartPos: 4089, + EndPos: 4093, + }, }, Die: false, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 4097, - EndPos: 4106, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, StartPos: 4097, - EndPos: 4105, + EndPos: 4106, }, - Die: false, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4102, - EndPos: 4104, + StartPos: 4097, + EndPos: 4105, }, - VarName: &node.Identifier{ + }, + Die: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, StartPos: 4102, EndPos: 4104, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 190, + EndLine: 190, + StartPos: 4102, + EndPos: 4104, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 4109, - EndPos: 4115, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 191, EndLine: 191, StartPos: 4109, - EndPos: 4114, + EndPos: 4115, + }, + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 191, + EndLine: 191, + StartPos: 4109, + EndPos: 4114, + }, }, Die: true, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 4118, - EndPos: 4126, - }, - Expr: &expr.Exit{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, StartPos: 4118, - EndPos: 4125, + EndPos: 4126, }, - Die: true, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprExit{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4122, - EndPos: 4124, + StartPos: 4118, + EndPos: 4125, }, - VarName: &node.Identifier{ + }, + Die: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 192, EndLine: 192, StartPos: 4122, EndPos: 4124, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 192, + EndLine: 192, + StartPos: 4122, + EndPos: 4124, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4129, - EndPos: 4135, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 193, EndLine: 193, StartPos: 4129, - EndPos: 4134, + EndPos: 4135, }, - Function: &name.Name{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 193, EndLine: 193, StartPos: 4129, - EndPos: 4132, + EndPos: 4134, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4129, - EndPos: 4132, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4129, + EndPos: 4132, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4129, + EndPos: 4132, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 4132, - EndPos: 4134, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 193, + EndLine: 193, + StartPos: 4132, + EndPos: 4134, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4138, - EndPos: 4157, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4138, - EndPos: 4156, + EndPos: 4157, }, - Function: &name.Relative{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4138, - EndPos: 4151, + EndPos: 4156, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4148, - EndPos: 4151, + }, + Function: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4138, + EndPos: 4151, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4148, + EndPos: 4151, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4151, - EndPos: 4156, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4151, + EndPos: 4156, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 4153, - EndPos: 4155, - }, - Variadic: false, - IsReference: true, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4153, EndPos: 4155, }, - VarName: &node.Identifier{ + }, + Variadic: false, + IsReference: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 194, EndLine: 194, StartPos: 4153, EndPos: 4155, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 194, + EndLine: 194, + StartPos: 4153, + EndPos: 4155, + }, + }, + Value: []byte("a"), }, }, }, @@ -9335,140 +11261,172 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4160, - EndPos: 4169, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4160, - EndPos: 4168, + EndPos: 4169, }, - Function: &name.FullyQualified{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4160, - EndPos: 4164, + EndPos: 4168, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4161, - EndPos: 4164, + }, + Function: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4160, + EndPos: 4164, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4161, + EndPos: 4164, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4164, - EndPos: 4168, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4164, + EndPos: 4168, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 4165, - EndPos: 4167, - }, - Variadic: false, - IsReference: false, - Expr: &expr.ShortArray{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 195, EndLine: 195, StartPos: 4165, EndPos: 4167, }, - Items: []node.Node{}, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 195, + EndLine: 195, + StartPos: 4165, + EndPos: 4167, + }, + }, + Items: []ast.Vertex{}, }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4172, - EndPos: 4187, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, - EndPos: 4186, + EndPos: 4187, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, - EndPos: 4176, + EndPos: 4186, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4172, EndPos: 4176, }, - Value: "foo", }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 4176, - EndPos: 4186, - }, - Arguments: []node.Node{ - &node.Argument{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4177, - EndPos: 4185, + StartPos: 4172, + EndPos: 4176, }, - IsReference: false, - Variadic: false, - Expr: &expr.Yield{ + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4176, + EndPos: 4186, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4177, EndPos: 4185, }, - Value: &expr.Variable{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4183, + StartPos: 4177, EndPos: 4185, }, - VarName: &node.Identifier{ + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 196, EndLine: 196, StartPos: 4183, EndPos: 4185, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 196, + EndLine: 196, + StartPos: 4183, + EndPos: 4185, + }, + }, + Value: []byte("a"), }, }, }, @@ -9477,516 +11435,638 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 4191, - EndPos: 4196, - }, - Expr: &expr.PostDec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, - EndPos: 4195, + EndPos: 4196, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPostDec{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, - EndPos: 4193, + EndPos: 4195, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 198, EndLine: 198, StartPos: 4191, EndPos: 4193, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 198, + EndLine: 198, + StartPos: 4191, + EndPos: 4193, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 4199, - EndPos: 4204, - }, - Expr: &expr.PostInc{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, - EndPos: 4203, + EndPos: 4204, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPostInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, - EndPos: 4201, + EndPos: 4203, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 199, EndLine: 199, StartPos: 4199, EndPos: 4201, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 199, + EndLine: 199, + StartPos: 4199, + EndPos: 4201, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 4207, - EndPos: 4212, - }, - Expr: &expr.PreDec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, StartPos: 4207, - EndPos: 4211, + EndPos: 4212, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPreDec{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4209, + StartPos: 4207, EndPos: 4211, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, StartPos: 4209, EndPos: 4211, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 200, + EndLine: 200, + StartPos: 4209, + EndPos: 4211, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 4215, - EndPos: 4220, - }, - Expr: &expr.PreInc{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, StartPos: 4215, - EndPos: 4219, + EndPos: 4220, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPreInc{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, - StartPos: 4217, + StartPos: 4215, EndPos: 4219, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 201, EndLine: 201, StartPos: 4217, EndPos: 4219, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 201, + EndLine: 201, + StartPos: 4217, + EndPos: 4219, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 4224, - EndPos: 4235, - }, - Expr: &expr.Include{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, StartPos: 4224, - EndPos: 4234, + EndPos: 4235, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInclude{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4232, + StartPos: 4224, EndPos: 4234, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 203, EndLine: 203, StartPos: 4232, EndPos: 4234, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 203, + EndLine: 203, + StartPos: 4232, + EndPos: 4234, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 4238, - EndPos: 4254, - }, - Expr: &expr.IncludeOnce{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, StartPos: 4238, - EndPos: 4253, + EndPos: 4254, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprIncludeOnce{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4251, + StartPos: 4238, EndPos: 4253, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 204, EndLine: 204, StartPos: 4251, EndPos: 4253, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 204, + EndLine: 204, + StartPos: 4251, + EndPos: 4253, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 4257, - EndPos: 4268, - }, - Expr: &expr.Require{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, StartPos: 4257, - EndPos: 4267, + EndPos: 4268, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprRequire{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4265, + StartPos: 4257, EndPos: 4267, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 205, EndLine: 205, StartPos: 4265, EndPos: 4267, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 205, + EndLine: 205, + StartPos: 4265, + EndPos: 4267, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 4271, - EndPos: 4287, - }, - Expr: &expr.RequireOnce{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, StartPos: 4271, - EndPos: 4286, + EndPos: 4287, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprRequireOnce{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4284, + StartPos: 4271, EndPos: 4286, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 206, EndLine: 206, StartPos: 4284, EndPos: 4286, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 206, + EndLine: 206, + StartPos: 4284, + EndPos: 4286, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4291, - EndPos: 4309, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, - EndPos: 4308, + EndPos: 4309, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, - EndPos: 4293, + EndPos: 4308, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, StartPos: 4291, EndPos: 4293, }, - Value: "a", }, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 4305, - EndPos: 4308, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4305, - EndPos: 4308, + StartPos: 4291, + EndPos: 4293, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4305, + EndPos: 4308, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 208, + EndLine: 208, + StartPos: 4305, + EndPos: 4308, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4312, - EndPos: 4340, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, - EndPos: 4339, + EndPos: 4340, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, - EndPos: 4314, + EndPos: 4339, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, StartPos: 4312, EndPos: 4314, }, - Value: "a", }, - }, - Class: &name.Relative{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4326, - EndPos: 4339, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4336, - EndPos: 4339, + StartPos: 4312, + EndPos: 4314, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4326, + EndPos: 4339, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 209, + EndLine: 209, + StartPos: 4336, + EndPos: 4339, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4343, - EndPos: 4362, - }, - Expr: &expr.InstanceOf{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, - EndPos: 4361, + EndPos: 4362, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprInstanceOf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, - EndPos: 4345, + EndPos: 4361, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, StartPos: 4343, EndPos: 4345, }, - Value: "a", }, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4357, - EndPos: 4361, - }, - Parts: []node.Node{ - &name.NamePart{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4358, - EndPos: 4361, + StartPos: 4343, + EndPos: 4345, }, - Value: "Foo", + }, + Value: []byte("a"), + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4357, + EndPos: 4361, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 210, + EndLine: 210, + StartPos: 4358, + EndPos: 4361, + }, + }, + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4366, - EndPos: 4380, - }, - Expr: &expr.Isset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4366, - EndPos: 4379, + EndPos: 4380, }, - Variables: []node.Node{ - &expr.Variable{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4372, - EndPos: 4374, - }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4366, + EndPos: 4379, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4372, EndPos: 4374, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4372, + EndPos: 4374, + }, + }, + Value: []byte("a"), }, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4376, - EndPos: 4378, - }, - VarName: &node.Identifier{ + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 212, EndLine: 212, StartPos: 4376, EndPos: 4378, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 212, + EndLine: 212, + StartPos: 4376, + EndPos: 4378, + }, + }, + Value: []byte("b"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4383, - EndPos: 4394, - }, - Expr: &expr.Isset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 213, EndLine: 213, StartPos: 4383, - EndPos: 4393, + EndPos: 4394, }, - Variables: []node.Node{ - &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4389, - EndPos: 4392, - }, - Constant: &name.Name{ + }, + Expr: &ast.ExprIsset{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4383, + EndPos: 4393, + }, + }, + Vars: []ast.Vertex{ + &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 213, EndLine: 213, StartPos: 4389, EndPos: 4392, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4389, - EndPos: 4392, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4389, + EndPos: 4392, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 213, + EndLine: 213, + StartPos: 4389, + EndPos: 4392, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -9994,276 +12074,342 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4397, - EndPos: 4409, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4397, - EndPos: 4408, + EndPos: 4409, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4397, - EndPos: 4403, - }, - Items: []node.Node{}, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4406, EndPos: 4408, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4397, + EndPos: 4403, + }, + }, + Items: []ast.Vertex{}, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 214, EndLine: 214, StartPos: 4406, EndPos: 4408, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 214, + EndLine: 214, + StartPos: 4406, + EndPos: 4408, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4412, - EndPos: 4430, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4412, - EndPos: 4429, + EndPos: 4430, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4412, - EndPos: 4424, + EndPos: 4429, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4417, - EndPos: 4419, - }, - Val: &expr.Variable{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4412, + EndPos: 4424, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4417, EndPos: 4419, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4417, EndPos: 4419, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4417, + EndPos: 4419, + }, + }, + Value: []byte("a"), }, }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4421, - EndPos: 4423, - }, - Val: &expr.Variable{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4421, EndPos: 4423, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4421, EndPos: 4423, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4421, + EndPos: 4423, + }, + }, + Value: []byte("b"), }, }, }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4427, - EndPos: 4429, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 215, EndLine: 215, StartPos: 4427, EndPos: 4429, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 215, + EndLine: 215, + StartPos: 4427, + EndPos: 4429, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4433, - EndPos: 4449, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4433, - EndPos: 4448, + EndPos: 4449, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4433, - EndPos: 4443, + EndPos: 4448, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4438, - EndPos: 4442, - }, - Val: &expr.ArrayDimFetch{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4433, + EndPos: 4443, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, EndPos: 4442, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, - EndPos: 4440, + EndPos: 4442, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4438, EndPos: 4440, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4438, + EndPos: 4440, + }, + }, + Value: []byte("a"), }, }, }, }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4446, - EndPos: 4448, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 216, EndLine: 216, StartPos: 4446, EndPos: 4448, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 216, + EndLine: 216, + StartPos: 4446, + EndPos: 4448, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4452, - EndPos: 4472, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4452, - EndPos: 4471, + EndPos: 4472, }, - Variable: &expr.List{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4452, - EndPos: 4466, + EndPos: 4471, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4457, - EndPos: 4465, - }, - Val: &expr.List{ + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4452, + EndPos: 4466, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4457, EndPos: 4465, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4462, - EndPos: 4464, - }, - Val: &expr.Variable{ + }, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4457, + EndPos: 4465, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4462, EndPos: 4464, }, - VarName: &node.Identifier{ + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4462, EndPos: 4464, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4462, + EndPos: 4464, + }, + }, + Value: []byte("a"), }, }, }, @@ -10272,3654 +12418,4522 @@ func TestPhp5(t *testing.T) { }, }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4469, - EndPos: 4471, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 217, EndLine: 217, StartPos: 4469, EndPos: 4471, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 217, + EndLine: 217, + StartPos: 4469, + EndPos: 4471, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4476, - EndPos: 4486, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, - EndPos: 4485, + EndPos: 4486, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, - EndPos: 4478, + EndPos: 4485, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 219, EndLine: 219, StartPos: 4476, EndPos: 4478, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4476, + EndPos: 4478, + }, + }, + Value: []byte("a"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4480, - EndPos: 4483, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4480, + EndPos: 4483, + }, }, - Value: "foo", + Value: []byte("foo"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4483, - EndPos: 4485, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 219, + EndLine: 219, + StartPos: 4483, + EndPos: 4485, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4489, - EndPos: 4497, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 220, EndLine: 220, StartPos: 4489, - EndPos: 4496, + EndPos: 4497, }, - Class: &name.Name{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4493, + StartPos: 4489, EndPos: 4496, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4493, - EndPos: 4496, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4493, + EndPos: 4496, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 220, + EndLine: 220, + StartPos: 4493, + EndPos: 4496, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4500, - EndPos: 4520, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 221, EndLine: 221, StartPos: 4500, - EndPos: 4519, + EndPos: 4520, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 221, EndLine: 221, - StartPos: 4504, - EndPos: 4517, + StartPos: 4500, + EndPos: 4519, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4514, - EndPos: 4517, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4504, + EndPos: 4517, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4514, + EndPos: 4517, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4517, - EndPos: 4519, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 221, + EndLine: 221, + StartPos: 4517, + EndPos: 4519, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4523, - EndPos: 4534, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 222, EndLine: 222, StartPos: 4523, - EndPos: 4533, + EndPos: 4534, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4527, - EndPos: 4531, + StartPos: 4523, + EndPos: 4533, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4528, - EndPos: 4531, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4527, + EndPos: 4531, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4528, + EndPos: 4531, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4531, - EndPos: 4533, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 222, + EndLine: 222, + StartPos: 4531, + EndPos: 4533, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4537, - EndPos: 4547, - }, - Expr: &expr.Print{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, StartPos: 4537, - EndPos: 4545, + EndPos: 4547, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprPrint{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4543, + StartPos: 4537, EndPos: 4545, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 223, EndLine: 223, StartPos: 4543, EndPos: 4545, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 223, + EndLine: 223, + StartPos: 4543, + EndPos: 4545, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4550, - EndPos: 4558, - }, - Expr: &expr.PropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, - EndPos: 4557, + EndPos: 4558, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, - EndPos: 4552, + EndPos: 4557, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 224, EndLine: 224, StartPos: 4550, EndPos: 4552, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4550, + EndPos: 4552, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4554, - EndPos: 4557, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 224, + EndLine: 224, + StartPos: 4554, + EndPos: 4557, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4561, - EndPos: 4572, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4570, + EndPos: 4572, }, - Variable: &expr.PropertyFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4568, + EndPos: 4570, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, - EndPos: 4563, + EndPos: 4568, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, StartPos: 4561, EndPos: 4563, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4561, + EndPos: 4563, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 225, + EndLine: 225, + StartPos: 4565, + EndPos: 4568, + }, + }, + Value: []byte("foo"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4565, - EndPos: 4568, + StartPos: 4569, + EndPos: 4570, }, - Value: "foo", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4569, - EndPos: 4570, - }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4575, - EndPos: 4604, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4602, + EndPos: 4604, }, - Variable: &expr.PropertyFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4600, + EndPos: 4602, }, - Variable: &expr.MethodCall{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4594, + EndPos: 4600, }, - Variable: &expr.PropertyFetch{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4587, + EndPos: 4594, }, - Variable: &expr.PropertyFetch{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4582, + EndPos: 4587, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, - EndPos: 4577, + EndPos: 4582, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, StartPos: 4575, EndPos: 4577, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4575, + EndPos: 4577, + }, + }, + Value: []byte("a"), }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4579, + EndPos: 4582, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4579, - EndPos: 4582, + StartPos: 4584, + EndPos: 4587, }, - Value: "foo", }, + Value: []byte("bar"), }, - Property: &node.Identifier{ + }, + Method: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4584, - EndPos: 4587, + StartPos: 4589, + EndPos: 4592, }, - Value: "bar", }, + Value: []byte("baz"), }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4589, - EndPos: 4592, - }, - Value: "baz", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4592, - EndPos: 4594, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4592, + EndPos: 4594, + }, }, }, }, - Property: &node.Identifier{ + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 226, + EndLine: 226, + StartPos: 4596, + EndPos: 4600, + }, + }, + Value: []byte("quux"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 226, EndLine: 226, - StartPos: 4596, - EndPos: 4600, + StartPos: 4601, + EndPos: 4602, }, - Value: "quux", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4601, - EndPos: 4602, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4607, - EndPos: 4623, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4621, + EndPos: 4623, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4618, + EndPos: 4621, }, - Variable: &expr.MethodCall{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4616, + EndPos: 4618, }, - Variable: &expr.Variable{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, - EndPos: 4609, + EndPos: 4616, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, StartPos: 4607, EndPos: 4609, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4607, + EndPos: 4609, + }, + }, + Value: []byte("a"), }, }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4611, - EndPos: 4614, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4611, + EndPos: 4614, + }, }, - Value: "foo", + Value: []byte("foo"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4614, - EndPos: 4616, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4614, + EndPos: 4616, + }, }, }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 227, + EndLine: 227, + StartPos: 4617, + EndPos: 4618, + }, + }, + Value: []byte("1"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4617, - EndPos: 4618, + StartPos: 4620, + EndPos: 4621, }, - Value: "1", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4620, - EndPos: 4621, - }, - Value: "1", + Value: []byte("1"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4626, - EndPos: 4635, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 228, EndLine: 228, StartPos: 4626, - EndPos: 4634, + EndPos: 4635, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4627, - EndPos: 4631, - }, - Value: "cmd ", + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4626, + EndPos: 4634, }, - &expr.Variable{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4631, - EndPos: 4633, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4627, + EndPos: 4631, + }, }, - VarName: &node.Identifier{ + Value: []byte("cmd "), + }, + &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 228, EndLine: 228, StartPos: 4631, EndPos: 4633, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 228, + EndLine: 228, + StartPos: 4631, + EndPos: 4633, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4638, - EndPos: 4644, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 229, EndLine: 229, StartPos: 4638, - EndPos: 4643, + EndPos: 4644, }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4639, - EndPos: 4642, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4638, + EndPos: 4643, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 229, + EndLine: 229, + StartPos: 4639, + EndPos: 4642, + }, }, - Value: "cmd", + Value: []byte("cmd"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4647, - EndPos: 4650, - }, - Expr: &expr.ShellExec{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 230, EndLine: 230, StartPos: 4647, - EndPos: 4649, + EndPos: 4650, }, - Parts: []node.Node{}, + }, + Expr: &ast.ExprShellExec{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 230, + EndLine: 230, + StartPos: 4647, + EndPos: 4649, + }, + }, + Parts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4653, - EndPos: 4656, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 231, EndLine: 231, StartPos: 4653, - EndPos: 4655, + EndPos: 4656, }, - Items: []node.Node{}, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 231, + EndLine: 231, + StartPos: 4653, + EndPos: 4655, + }, + }, + Items: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4659, - EndPos: 4663, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 232, EndLine: 232, StartPos: 4659, - EndPos: 4662, + EndPos: 4663, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4660, - EndPos: 4661, - }, - Val: &scalar.Lnumber{ + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4659, + EndPos: 4662, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 232, EndLine: 232, StartPos: 4660, EndPos: 4661, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 232, + EndLine: 232, + StartPos: 4660, + EndPos: 4661, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4666, - EndPos: 4679, - }, - Expr: &expr.ShortArray{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4666, - EndPos: 4678, + EndPos: 4679, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4667, - EndPos: 4671, - }, - Key: &scalar.Lnumber{ + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4666, + EndPos: 4678, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4667, - EndPos: 4668, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4670, EndPos: 4671, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4667, + EndPos: 4668, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4670, + EndPos: 4671, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4673, - EndPos: 4676, - }, - Val: &expr.Reference{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4673, EndPos: 4676, }, - Variable: &expr.Variable{ + }, + Val: &ast.ExprReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4674, + StartPos: 4673, EndPos: 4676, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 233, EndLine: 233, StartPos: 4674, EndPos: 4676, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 233, + EndLine: 233, + StartPos: 4674, + EndPos: 4676, + }, + }, + Value: []byte("b"), }, }, }, }, - &expr.ArrayItem{}, + &ast.ExprArrayItem{}, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4683, - EndPos: 4694, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 235, EndLine: 235, StartPos: 4683, - EndPos: 4693, + EndPos: 4694, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 235, EndLine: 235, StartPos: 4683, - EndPos: 4686, + EndPos: 4693, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4683, - EndPos: 4686, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4683, + EndPos: 4686, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4683, + EndPos: 4686, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4688, - EndPos: 4691, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4688, + EndPos: 4691, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4691, - EndPos: 4693, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 235, + EndLine: 235, + StartPos: 4691, + EndPos: 4693, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4697, - EndPos: 4718, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 236, EndLine: 236, StartPos: 4697, - EndPos: 4717, + EndPos: 4718, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 236, EndLine: 236, StartPos: 4697, - EndPos: 4710, + EndPos: 4717, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4707, - EndPos: 4710, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4697, + EndPos: 4710, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4707, + EndPos: 4710, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4712, - EndPos: 4715, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4712, + EndPos: 4715, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4715, - EndPos: 4717, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 236, + EndLine: 236, + StartPos: 4715, + EndPos: 4717, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4721, - EndPos: 4733, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 237, EndLine: 237, StartPos: 4721, - EndPos: 4732, + EndPos: 4733, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 237, EndLine: 237, StartPos: 4721, - EndPos: 4725, + EndPos: 4732, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4722, - EndPos: 4725, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4721, + EndPos: 4725, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4722, + EndPos: 4725, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4727, - EndPos: 4730, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4727, + EndPos: 4730, + }, }, - Value: "bar", + Value: []byte("bar"), }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4730, - EndPos: 4732, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 237, + EndLine: 237, + StartPos: 4730, + EndPos: 4732, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4736, - EndPos: 4748, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4736, - EndPos: 4747, + EndPos: 4748, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4736, - EndPos: 4739, + EndPos: 4747, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4736, - EndPos: 4739, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4736, + EndPos: 4739, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4736, + EndPos: 4739, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4741, - EndPos: 4745, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 238, EndLine: 238, StartPos: 4741, EndPos: 4745, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4741, + EndPos: 4745, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4745, - EndPos: 4747, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 238, + EndLine: 238, + StartPos: 4745, + EndPos: 4747, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4751, - EndPos: 4764, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, - EndPos: 4763, + EndPos: 4764, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, - EndPos: 4755, + EndPos: 4763, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4751, EndPos: 4755, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4751, + EndPos: 4755, + }, + }, + Value: []byte("foo"), }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4757, - EndPos: 4761, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 239, EndLine: 239, StartPos: 4757, EndPos: 4761, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4757, + EndPos: 4761, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4761, - EndPos: 4763, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 239, + EndLine: 239, + StartPos: 4761, + EndPos: 4763, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4767, - EndPos: 4777, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4767, - EndPos: 4776, + EndPos: 4777, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4767, - EndPos: 4770, + EndPos: 4776, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4767, - EndPos: 4770, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4767, + EndPos: 4770, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4767, + EndPos: 4770, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4772, - EndPos: 4776, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 240, EndLine: 240, StartPos: 4772, EndPos: 4776, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 240, + EndLine: 240, + StartPos: 4772, + EndPos: 4776, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4780, - EndPos: 4800, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4780, - EndPos: 4799, + EndPos: 4800, }, - Class: &name.Relative{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4780, - EndPos: 4793, + EndPos: 4799, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4790, - EndPos: 4793, + }, + Class: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4780, + EndPos: 4793, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4790, + EndPos: 4793, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4795, - EndPos: 4799, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 241, EndLine: 241, StartPos: 4795, EndPos: 4799, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 241, + EndLine: 241, + StartPos: 4795, + EndPos: 4799, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4803, - EndPos: 4814, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4803, - EndPos: 4813, + EndPos: 4814, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4803, - EndPos: 4807, + EndPos: 4813, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4804, - EndPos: 4807, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4803, + EndPos: 4807, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4804, + EndPos: 4807, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4809, - EndPos: 4813, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 242, EndLine: 242, StartPos: 4809, EndPos: 4813, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 242, + EndLine: 242, + StartPos: 4809, + EndPos: 4813, + }, + }, + Value: []byte("bar"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4817, - EndPos: 4830, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, - EndPos: 4829, + EndPos: 4830, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, - EndPos: 4819, + EndPos: 4829, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4817, EndPos: 4819, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4817, + EndPos: 4819, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4822, - EndPos: 4824, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4822, EndPos: 4824, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4822, + EndPos: 4824, + }, + }, + Value: []byte("b"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4827, - EndPos: 4829, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 243, EndLine: 243, StartPos: 4827, EndPos: 4829, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 243, + EndLine: 243, + StartPos: 4827, + EndPos: 4829, + }, + }, + Value: []byte("c"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4833, - EndPos: 4843, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, - EndPos: 4842, + EndPos: 4843, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, - EndPos: 4835, + EndPos: 4842, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4833, EndPos: 4835, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4833, + EndPos: 4835, + }, + }, + Value: []byte("a"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4840, - EndPos: 4842, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 244, EndLine: 244, StartPos: 4840, EndPos: 4842, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 244, + EndLine: 244, + StartPos: 4840, + EndPos: 4842, + }, + }, + Value: []byte("c"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4846, - EndPos: 4869, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, - EndPos: 4868, + EndPos: 4869, }, - Condition: &expr.Variable{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, - EndPos: 4848, + EndPos: 4868, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4846, EndPos: 4848, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4846, + EndPos: 4848, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Ternary{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4851, - EndPos: 4863, - }, - Condition: &expr.Variable{ + IfTrue: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4851, - EndPos: 4853, + EndPos: 4863, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4851, EndPos: 4853, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4851, + EndPos: 4853, + }, + }, + Value: []byte("b"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4856, - EndPos: 4858, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4856, EndPos: 4858, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4856, + EndPos: 4858, + }, + }, + Value: []byte("c"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4861, - EndPos: 4863, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4861, EndPos: 4863, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4861, + EndPos: 4863, + }, + }, + Value: []byte("d"), }, }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4866, - EndPos: 4868, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 245, EndLine: 245, StartPos: 4866, EndPos: 4868, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 245, + EndLine: 245, + StartPos: 4866, + EndPos: 4868, + }, + }, + Value: []byte("e"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4872, - EndPos: 4895, - }, - Expr: &expr.Ternary{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4894, + EndPos: 4895, }, - Condition: &expr.Ternary{ + }, + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4884, + EndPos: 4894, }, - Condition: &expr.Variable{ + }, + Condition: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, - EndPos: 4874, + EndPos: 4884, }, - VarName: &node.Identifier{ + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4872, EndPos: 4874, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4872, + EndPos: 4874, + }, + }, + Value: []byte("a"), }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4877, - EndPos: 4879, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4877, EndPos: 4879, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4877, + EndPos: 4879, + }, + }, + Value: []byte("b"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4882, - EndPos: 4884, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4882, EndPos: 4884, }, - Value: "c", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4882, + EndPos: 4884, + }, + }, + Value: []byte("c"), }, }, }, - IfTrue: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4887, - EndPos: 4889, - }, - VarName: &node.Identifier{ + IfTrue: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4887, EndPos: 4889, }, - Value: "d", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4887, + EndPos: 4889, + }, + }, + Value: []byte("d"), }, }, - IfFalse: &expr.Variable{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4892, - EndPos: 4894, - }, - VarName: &node.Identifier{ + IfFalse: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 246, EndLine: 246, StartPos: 4892, EndPos: 4894, }, - Value: "e", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 246, + EndLine: 246, + StartPos: 4892, + EndPos: 4894, + }, + }, + Value: []byte("e"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4898, - EndPos: 4902, - }, - Expr: &expr.UnaryMinus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, StartPos: 4898, - EndPos: 4901, + EndPos: 4902, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4899, + StartPos: 4898, EndPos: 4901, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 247, EndLine: 247, StartPos: 4899, EndPos: 4901, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 247, + EndLine: 247, + StartPos: 4899, + EndPos: 4901, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4905, - EndPos: 4909, - }, - Expr: &expr.UnaryPlus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, StartPos: 4905, - EndPos: 4908, + EndPos: 4909, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4906, + StartPos: 4905, EndPos: 4908, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 248, EndLine: 248, StartPos: 4906, EndPos: 4908, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 248, + EndLine: 248, + StartPos: 4906, + EndPos: 4908, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4912, - EndPos: 4916, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, StartPos: 4912, - EndPos: 4915, + EndPos: 4916, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4913, + StartPos: 4912, EndPos: 4915, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 249, EndLine: 249, StartPos: 4913, EndPos: 4915, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 249, + EndLine: 249, + StartPos: 4913, + EndPos: 4915, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4919, - EndPos: 4924, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, StartPos: 4919, - EndPos: 4923, + EndPos: 4924, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4920, + StartPos: 4919, EndPos: 4923, }, - VarName: &expr.Variable{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4921, + StartPos: 4920, EndPos: 4923, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 250, EndLine: 250, StartPos: 4921, EndPos: 4923, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 250, + EndLine: 250, + StartPos: 4921, + EndPos: 4923, + }, + }, + Value: []byte("a"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4927, - EndPos: 4933, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 251, EndLine: 251, StartPos: 4927, - EndPos: 4932, + EndPos: 4933, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 251, + EndLine: 251, + StartPos: 4927, + EndPos: 4932, + }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4936, - EndPos: 4945, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, StartPos: 4936, - EndPos: 4944, + EndPos: 4945, }, - Value: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4942, + StartPos: 4936, EndPos: 4944, }, - VarName: &node.Identifier{ + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 252, EndLine: 252, StartPos: 4942, EndPos: 4944, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 252, + EndLine: 252, + StartPos: 4942, + EndPos: 4944, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4948, - EndPos: 4963, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4948, - EndPos: 4962, + EndPos: 4963, }, - Key: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4954, - EndPos: 4956, + StartPos: 4948, + EndPos: 4962, }, - VarName: &node.Identifier{ + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4954, EndPos: 4956, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4954, + EndPos: 4956, + }, + }, + Value: []byte("a"), }, }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4960, - EndPos: 4962, - }, - VarName: &node.Identifier{ + Value: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 253, EndLine: 253, StartPos: 4960, EndPos: 4962, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 253, + EndLine: 253, + StartPos: 4960, + EndPos: 4962, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4966, - EndPos: 4983, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, StartPos: 4966, - EndPos: 4982, + EndPos: 4983, }, - Value: &expr.ClassConstFetch{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4972, + StartPos: 4966, EndPos: 4982, }, - Class: &name.Name{ + }, + Value: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 254, EndLine: 254, StartPos: 4972, - EndPos: 4975, + EndPos: 4982, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4972, - EndPos: 4975, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4972, + EndPos: 4975, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4972, + EndPos: 4975, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4977, - EndPos: 4982, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 254, + EndLine: 254, + StartPos: 4977, + EndPos: 4982, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4986, - EndPos: 5009, - }, - Expr: &expr.Yield{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4986, - EndPos: 5008, + EndPos: 5009, }, - Key: &expr.Variable{ + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 4992, - EndPos: 4994, + StartPos: 4986, + EndPos: 5008, }, - VarName: &node.Identifier{ + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4992, EndPos: 4994, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4992, + EndPos: 4994, + }, + }, + Value: []byte("a"), }, }, - Value: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 5008, - }, - Class: &name.Name{ + Value: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 255, EndLine: 255, StartPos: 4998, - EndPos: 5001, + EndPos: 5008, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4998, - EndPos: 5001, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 5001, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 4998, + EndPos: 5001, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 5003, - EndPos: 5008, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 255, + EndLine: 255, + StartPos: 5003, + EndPos: 5008, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 5015, - EndPos: 5025, - }, - Expr: &cast.Array{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, StartPos: 5015, - EndPos: 5024, + EndPos: 5025, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastArray{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5022, + StartPos: 5015, EndPos: 5024, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 257, EndLine: 257, StartPos: 5022, EndPos: 5024, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 257, + EndLine: 257, + StartPos: 5022, + EndPos: 5024, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 5028, - EndPos: 5040, - }, - Expr: &cast.Bool{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, StartPos: 5028, - EndPos: 5039, + EndPos: 5040, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, - StartPos: 5037, + StartPos: 5028, EndPos: 5039, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 258, EndLine: 258, StartPos: 5037, EndPos: 5039, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 258, + EndLine: 258, + StartPos: 5037, + EndPos: 5039, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 5043, - EndPos: 5052, - }, - Expr: &cast.Bool{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, StartPos: 5043, - EndPos: 5051, + EndPos: 5052, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastBool{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5049, + StartPos: 5043, EndPos: 5051, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 259, EndLine: 259, StartPos: 5049, EndPos: 5051, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 259, + EndLine: 259, + StartPos: 5049, + EndPos: 5051, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 5055, - EndPos: 5066, - }, - Expr: &cast.Double{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, StartPos: 5055, - EndPos: 5065, + EndPos: 5066, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5063, + StartPos: 5055, EndPos: 5065, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 260, EndLine: 260, StartPos: 5063, EndPos: 5065, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 260, + EndLine: 260, + StartPos: 5063, + EndPos: 5065, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 5069, - EndPos: 5079, - }, - Expr: &cast.Double{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, StartPos: 5069, - EndPos: 5078, + EndPos: 5079, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastDouble{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5076, + StartPos: 5069, EndPos: 5078, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 261, EndLine: 261, StartPos: 5076, EndPos: 5078, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 261, + EndLine: 261, + StartPos: 5076, + EndPos: 5078, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 5082, - EndPos: 5094, - }, - Expr: &cast.Int{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, StartPos: 5082, - EndPos: 5093, + EndPos: 5094, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, - StartPos: 5091, + StartPos: 5082, EndPos: 5093, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 262, EndLine: 262, StartPos: 5091, EndPos: 5093, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 262, + EndLine: 262, + StartPos: 5091, + EndPos: 5093, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 5097, - EndPos: 5105, - }, - Expr: &cast.Int{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, StartPos: 5097, - EndPos: 5104, + EndPos: 5105, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastInt{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5102, + StartPos: 5097, EndPos: 5104, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 263, EndLine: 263, StartPos: 5102, EndPos: 5104, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 263, + EndLine: 263, + StartPos: 5102, + EndPos: 5104, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 5108, - EndPos: 5119, - }, - Expr: &cast.Object{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, StartPos: 5108, - EndPos: 5118, + EndPos: 5119, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastObject{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5116, + StartPos: 5108, EndPos: 5118, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 264, EndLine: 264, StartPos: 5116, EndPos: 5118, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 264, + EndLine: 264, + StartPos: 5116, + EndPos: 5118, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 5122, - EndPos: 5133, - }, - Expr: &cast.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, StartPos: 5122, - EndPos: 5132, + EndPos: 5133, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastString{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5130, + StartPos: 5122, EndPos: 5132, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 265, EndLine: 265, StartPos: 5130, EndPos: 5132, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 265, + EndLine: 265, + StartPos: 5130, + EndPos: 5132, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 5136, - EndPos: 5146, - }, - Expr: &cast.Unset{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, StartPos: 5136, - EndPos: 5145, + EndPos: 5146, }, - Expr: &expr.Variable{ + }, + Expr: &ast.ExprCastUnset{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5143, + StartPos: 5136, EndPos: 5145, }, - VarName: &node.Identifier{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 266, EndLine: 266, StartPos: 5143, EndPos: 5145, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 266, + EndLine: 266, + StartPos: 5143, + EndPos: 5145, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5150, - EndPos: 5158, - }, - Expr: &binary.BitwiseAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, - EndPos: 5157, + EndPos: 5158, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, - EndPos: 5152, + EndPos: 5157, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5150, EndPos: 5152, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5150, + EndPos: 5152, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 5155, - EndPos: 5157, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 268, EndLine: 268, StartPos: 5155, EndPos: 5157, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 268, + EndLine: 268, + StartPos: 5155, + EndPos: 5157, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5161, - EndPos: 5169, - }, - Expr: &binary.BitwiseOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, - EndPos: 5168, + EndPos: 5169, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, - EndPos: 5163, + EndPos: 5168, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5161, EndPos: 5163, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5161, + EndPos: 5163, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 5166, - EndPos: 5168, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 269, EndLine: 269, StartPos: 5166, EndPos: 5168, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 269, + EndLine: 269, + StartPos: 5166, + EndPos: 5168, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5172, - EndPos: 5180, - }, - Expr: &binary.BitwiseXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, - EndPos: 5179, + EndPos: 5180, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, - EndPos: 5174, + EndPos: 5179, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5172, EndPos: 5174, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5172, + EndPos: 5174, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 5177, - EndPos: 5179, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 270, EndLine: 270, StartPos: 5177, EndPos: 5179, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 270, + EndLine: 270, + StartPos: 5177, + EndPos: 5179, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5183, - EndPos: 5192, - }, - Expr: &binary.BooleanAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, - EndPos: 5191, + EndPos: 5192, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, - EndPos: 5185, + EndPos: 5191, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5183, EndPos: 5185, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5183, + EndPos: 5185, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 5189, - EndPos: 5191, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 271, EndLine: 271, StartPos: 5189, EndPos: 5191, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 271, + EndLine: 271, + StartPos: 5189, + EndPos: 5191, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5195, - EndPos: 5204, - }, - Expr: &binary.BooleanOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, - EndPos: 5203, + EndPos: 5204, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, - EndPos: 5197, + EndPos: 5203, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5195, EndPos: 5197, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5195, + EndPos: 5197, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 5201, - EndPos: 5203, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 272, EndLine: 272, StartPos: 5201, EndPos: 5203, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 272, + EndLine: 272, + StartPos: 5201, + EndPos: 5203, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 5207, - EndPos: 5215, - }, - Expr: &binary.Concat{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, - EndPos: 5214, + EndPos: 5215, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, - EndPos: 5209, + EndPos: 5214, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5207, EndPos: 5209, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5207, + EndPos: 5209, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 5212, - EndPos: 5214, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 273, EndLine: 273, StartPos: 5212, EndPos: 5214, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 273, + EndLine: 273, + StartPos: 5212, + EndPos: 5214, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5218, - EndPos: 5226, - }, - Expr: &binary.Div{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, - EndPos: 5225, + EndPos: 5226, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, - EndPos: 5220, + EndPos: 5225, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5218, EndPos: 5220, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5218, + EndPos: 5220, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 5223, - EndPos: 5225, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 274, EndLine: 274, StartPos: 5223, EndPos: 5225, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 274, + EndLine: 274, + StartPos: 5223, + EndPos: 5225, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5229, - EndPos: 5238, - }, - Expr: &binary.Equal{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, - EndPos: 5237, + EndPos: 5238, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, - EndPos: 5231, + EndPos: 5237, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5229, EndPos: 5231, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5229, + EndPos: 5231, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 5235, - EndPos: 5237, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 275, EndLine: 275, StartPos: 5235, EndPos: 5237, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 275, + EndLine: 275, + StartPos: 5235, + EndPos: 5237, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5241, - EndPos: 5250, - }, - Expr: &binary.GreaterOrEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, - EndPos: 5249, + EndPos: 5250, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, - EndPos: 5243, + EndPos: 5249, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5241, EndPos: 5243, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5241, + EndPos: 5243, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 5247, - EndPos: 5249, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 276, EndLine: 276, StartPos: 5247, EndPos: 5249, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 276, + EndLine: 276, + StartPos: 5247, + EndPos: 5249, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5253, - EndPos: 5261, - }, - Expr: &binary.Greater{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, - EndPos: 5260, + EndPos: 5261, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, - EndPos: 5255, + EndPos: 5260, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5253, EndPos: 5255, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5253, + EndPos: 5255, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 5258, - EndPos: 5260, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 277, EndLine: 277, StartPos: 5258, EndPos: 5260, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 277, + EndLine: 277, + StartPos: 5258, + EndPos: 5260, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5264, - EndPos: 5274, - }, - Expr: &binary.Identical{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, - EndPos: 5273, + EndPos: 5274, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, - EndPos: 5266, + EndPos: 5273, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5264, EndPos: 5266, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5264, + EndPos: 5266, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 5271, - EndPos: 5273, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 278, EndLine: 278, StartPos: 5271, EndPos: 5273, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 278, + EndLine: 278, + StartPos: 5271, + EndPos: 5273, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5277, - EndPos: 5287, - }, - Expr: &binary.LogicalAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, - EndPos: 5286, + EndPos: 5287, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, - EndPos: 5279, + EndPos: 5286, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5277, EndPos: 5279, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5277, + EndPos: 5279, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 5284, - EndPos: 5286, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 279, EndLine: 279, StartPos: 5284, EndPos: 5286, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 279, + EndLine: 279, + StartPos: 5284, + EndPos: 5286, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5290, - EndPos: 5299, - }, - Expr: &binary.LogicalOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, - EndPos: 5298, + EndPos: 5299, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, - EndPos: 5292, + EndPos: 5298, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5290, EndPos: 5292, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5290, + EndPos: 5292, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 5296, - EndPos: 5298, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 280, EndLine: 280, StartPos: 5296, EndPos: 5298, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 280, + EndLine: 280, + StartPos: 5296, + EndPos: 5298, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5302, - EndPos: 5312, - }, - Expr: &binary.LogicalXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, - EndPos: 5311, + EndPos: 5312, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, - EndPos: 5304, + EndPos: 5311, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5302, EndPos: 5304, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5302, + EndPos: 5304, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 5309, - EndPos: 5311, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 281, EndLine: 281, StartPos: 5309, EndPos: 5311, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 281, + EndLine: 281, + StartPos: 5309, + EndPos: 5311, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5315, - EndPos: 5323, - }, - Expr: &binary.Minus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, - EndPos: 5322, + EndPos: 5323, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, - EndPos: 5317, + EndPos: 5322, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5315, EndPos: 5317, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5315, + EndPos: 5317, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 5320, - EndPos: 5322, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 282, EndLine: 282, StartPos: 5320, EndPos: 5322, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 282, + EndLine: 282, + StartPos: 5320, + EndPos: 5322, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5326, - EndPos: 5334, - }, - Expr: &binary.Mod{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, - EndPos: 5333, + EndPos: 5334, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, - EndPos: 5328, + EndPos: 5333, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5326, EndPos: 5328, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5326, + EndPos: 5328, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 5331, - EndPos: 5333, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 283, EndLine: 283, StartPos: 5331, EndPos: 5333, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 283, + EndLine: 283, + StartPos: 5331, + EndPos: 5333, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5337, - EndPos: 5345, - }, - Expr: &binary.Mul{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, - EndPos: 5344, + EndPos: 5345, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, - EndPos: 5339, + EndPos: 5344, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5337, EndPos: 5339, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5337, + EndPos: 5339, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 5342, - EndPos: 5344, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 284, EndLine: 284, StartPos: 5342, EndPos: 5344, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 284, + EndLine: 284, + StartPos: 5342, + EndPos: 5344, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5348, - EndPos: 5357, - }, - Expr: &binary.NotEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, - EndPos: 5356, + EndPos: 5357, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, - EndPos: 5350, + EndPos: 5356, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5348, EndPos: 5350, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5348, + EndPos: 5350, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 5354, - EndPos: 5356, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 285, EndLine: 285, StartPos: 5354, EndPos: 5356, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 285, + EndLine: 285, + StartPos: 5354, + EndPos: 5356, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5360, - EndPos: 5370, - }, - Expr: &binary.NotIdentical{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, - EndPos: 5369, + EndPos: 5370, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, - EndPos: 5362, + EndPos: 5369, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5360, EndPos: 5362, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5360, + EndPos: 5362, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 5367, - EndPos: 5369, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 286, EndLine: 286, StartPos: 5367, EndPos: 5369, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 286, + EndLine: 286, + StartPos: 5367, + EndPos: 5369, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5373, - EndPos: 5381, - }, - Expr: &binary.Plus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, - EndPos: 5380, + EndPos: 5381, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, - EndPos: 5375, + EndPos: 5380, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5373, EndPos: 5375, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5373, + EndPos: 5375, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 5378, - EndPos: 5380, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 287, EndLine: 287, StartPos: 5378, EndPos: 5380, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 287, + EndLine: 287, + StartPos: 5378, + EndPos: 5380, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5384, - EndPos: 5393, - }, - Expr: &binary.Pow{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, - EndPos: 5392, + EndPos: 5393, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, - EndPos: 5386, + EndPos: 5392, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5384, EndPos: 5386, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5384, + EndPos: 5386, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 5390, - EndPos: 5392, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 288, EndLine: 288, StartPos: 5390, EndPos: 5392, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 288, + EndLine: 288, + StartPos: 5390, + EndPos: 5392, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5396, - EndPos: 5405, - }, - Expr: &binary.ShiftLeft{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, - EndPos: 5404, + EndPos: 5405, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, - EndPos: 5398, + EndPos: 5404, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5396, EndPos: 5398, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5396, + EndPos: 5398, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 5402, - EndPos: 5404, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 289, EndLine: 289, StartPos: 5402, EndPos: 5404, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 289, + EndLine: 289, + StartPos: 5402, + EndPos: 5404, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5408, - EndPos: 5417, - }, - Expr: &binary.ShiftRight{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, - EndPos: 5416, + EndPos: 5417, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, - EndPos: 5410, + EndPos: 5416, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5408, EndPos: 5410, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5408, + EndPos: 5410, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 5414, - EndPos: 5416, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 290, EndLine: 290, StartPos: 5414, EndPos: 5416, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 290, + EndLine: 290, + StartPos: 5414, + EndPos: 5416, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5420, - EndPos: 5429, - }, - Expr: &binary.SmallerOrEqual{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, - EndPos: 5428, + EndPos: 5429, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, - EndPos: 5422, + EndPos: 5428, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5420, EndPos: 5422, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5420, + EndPos: 5422, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 5426, - EndPos: 5428, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 291, EndLine: 291, StartPos: 5426, EndPos: 5428, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 291, + EndLine: 291, + StartPos: 5426, + EndPos: 5428, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5432, - EndPos: 5440, - }, - Expr: &binary.Smaller{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, - EndPos: 5439, + EndPos: 5440, }, - Left: &expr.Variable{ + }, + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, - EndPos: 5434, + EndPos: 5439, }, - VarName: &node.Identifier{ + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5432, EndPos: 5434, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5432, + EndPos: 5434, + }, + }, + Value: []byte("a"), }, }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 5437, - EndPos: 5439, - }, - VarName: &node.Identifier{ + Right: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 292, EndLine: 292, StartPos: 5437, EndPos: 5439, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 292, + EndLine: 292, + StartPos: 5437, + EndPos: 5439, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5444, - EndPos: 5453, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, - EndPos: 5452, + EndPos: 5453, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, - EndPos: 5446, + EndPos: 5452, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5444, EndPos: 5446, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5444, + EndPos: 5446, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 5450, - EndPos: 5452, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 294, EndLine: 294, StartPos: 5450, EndPos: 5452, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 294, + EndLine: 294, + StartPos: 5450, + EndPos: 5452, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5456, - EndPos: 5470, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, - EndPos: 5469, + EndPos: 5470, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, - EndPos: 5458, + EndPos: 5469, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, StartPos: 5456, EndPos: 5458, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5456, + EndPos: 5458, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.New{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5462, - EndPos: 5469, - }, - Class: &name.Name{ + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5466, + StartPos: 5462, EndPos: 5469, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 5466, - EndPos: 5469, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5466, + EndPos: 5469, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 295, + EndLine: 295, + StartPos: 5466, + EndPos: 5469, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5473, - EndPos: 5491, - }, - Expr: &assign.Reference{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, - EndPos: 5490, + EndPos: 5491, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignReference{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, - EndPos: 5475, + EndPos: 5490, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5473, EndPos: 5475, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5473, + EndPos: 5475, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.New{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5479, - EndPos: 5490, - }, - Class: &name.Name{ + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5483, - EndPos: 5486, + StartPos: 5479, + EndPos: 5490, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5483, - EndPos: 5486, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5483, + EndPos: 5486, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5483, + EndPos: 5486, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5486, - EndPos: 5490, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5486, + EndPos: 5490, + }, }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 5487, - EndPos: 5489, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5487, EndPos: 5489, }, - VarName: &node.Identifier{ + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 296, EndLine: 296, StartPos: 5487, EndPos: 5489, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 296, + EndLine: 296, + StartPos: 5487, + EndPos: 5489, + }, + }, + Value: []byte("b"), }, }, }, @@ -13928,765 +16942,885 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5494, - EndPos: 5502, - }, - Expr: &assign.Assign{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, - EndPos: 5501, + EndPos: 5502, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssign{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, - EndPos: 5496, + EndPos: 5501, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5494, EndPos: 5496, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5494, + EndPos: 5496, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 5499, - EndPos: 5501, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 297, EndLine: 297, StartPos: 5499, EndPos: 5501, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 297, + EndLine: 297, + StartPos: 5499, + EndPos: 5501, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5505, - EndPos: 5514, - }, - Expr: &assign.BitwiseAnd{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, - EndPos: 5513, + EndPos: 5514, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, - EndPos: 5507, + EndPos: 5513, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5505, EndPos: 5507, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5505, + EndPos: 5507, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 5511, - EndPos: 5513, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 298, EndLine: 298, StartPos: 5511, EndPos: 5513, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 298, + EndLine: 298, + StartPos: 5511, + EndPos: 5513, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5517, - EndPos: 5526, - }, - Expr: &assign.BitwiseOr{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, - EndPos: 5525, + EndPos: 5526, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, - EndPos: 5519, + EndPos: 5525, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5517, EndPos: 5519, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5517, + EndPos: 5519, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5523, - EndPos: 5525, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 299, EndLine: 299, StartPos: 5523, EndPos: 5525, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 299, + EndLine: 299, + StartPos: 5523, + EndPos: 5525, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5529, - EndPos: 5538, - }, - Expr: &assign.BitwiseXor{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, - EndPos: 5537, + EndPos: 5538, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, - EndPos: 5531, + EndPos: 5537, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5529, EndPos: 5531, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5529, + EndPos: 5531, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5535, - EndPos: 5537, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 300, EndLine: 300, StartPos: 5535, EndPos: 5537, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 300, + EndLine: 300, + StartPos: 5535, + EndPos: 5537, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5541, - EndPos: 5550, - }, - Expr: &assign.Concat{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, - EndPos: 5549, + EndPos: 5550, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, - EndPos: 5543, + EndPos: 5549, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5541, EndPos: 5543, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5541, + EndPos: 5543, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5547, - EndPos: 5549, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 301, EndLine: 301, StartPos: 5547, EndPos: 5549, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 301, + EndLine: 301, + StartPos: 5547, + EndPos: 5549, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5553, - EndPos: 5562, - }, - Expr: &assign.Div{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, - EndPos: 5561, + EndPos: 5562, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, - EndPos: 5555, + EndPos: 5561, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5553, EndPos: 5555, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5553, + EndPos: 5555, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5559, - EndPos: 5561, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 302, EndLine: 302, StartPos: 5559, EndPos: 5561, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 302, + EndLine: 302, + StartPos: 5559, + EndPos: 5561, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5565, - EndPos: 5574, - }, - Expr: &assign.Minus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, - EndPos: 5573, + EndPos: 5574, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, - EndPos: 5567, + EndPos: 5573, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5565, EndPos: 5567, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5565, + EndPos: 5567, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5571, - EndPos: 5573, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 303, EndLine: 303, StartPos: 5571, EndPos: 5573, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 303, + EndLine: 303, + StartPos: 5571, + EndPos: 5573, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5577, - EndPos: 5586, - }, - Expr: &assign.Mod{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, - EndPos: 5585, + EndPos: 5586, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, - EndPos: 5579, + EndPos: 5585, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5577, EndPos: 5579, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5577, + EndPos: 5579, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5583, - EndPos: 5585, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 304, EndLine: 304, StartPos: 5583, EndPos: 5585, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 304, + EndLine: 304, + StartPos: 5583, + EndPos: 5585, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5589, - EndPos: 5598, - }, - Expr: &assign.Mul{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, - EndPos: 5597, + EndPos: 5598, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, - EndPos: 5591, + EndPos: 5597, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5589, EndPos: 5591, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5589, + EndPos: 5591, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5595, - EndPos: 5597, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 305, EndLine: 305, StartPos: 5595, EndPos: 5597, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 305, + EndLine: 305, + StartPos: 5595, + EndPos: 5597, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5601, - EndPos: 5610, - }, - Expr: &assign.Plus{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, - EndPos: 5609, + EndPos: 5610, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, - EndPos: 5603, + EndPos: 5609, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5601, EndPos: 5603, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5601, + EndPos: 5603, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5607, - EndPos: 5609, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 306, EndLine: 306, StartPos: 5607, EndPos: 5609, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 306, + EndLine: 306, + StartPos: 5607, + EndPos: 5609, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5613, - EndPos: 5623, - }, - Expr: &assign.Pow{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, - EndPos: 5622, + EndPos: 5623, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, - EndPos: 5615, + EndPos: 5622, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5613, EndPos: 5615, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5613, + EndPos: 5615, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5620, - EndPos: 5622, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 307, EndLine: 307, StartPos: 5620, EndPos: 5622, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 307, + EndLine: 307, + StartPos: 5620, + EndPos: 5622, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5626, - EndPos: 5636, - }, - Expr: &assign.ShiftLeft{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, - EndPos: 5635, + EndPos: 5636, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, - EndPos: 5628, + EndPos: 5635, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5626, EndPos: 5628, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5626, + EndPos: 5628, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5633, - EndPos: 5635, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 308, EndLine: 308, StartPos: 5633, EndPos: 5635, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 308, + EndLine: 308, + StartPos: 5633, + EndPos: 5635, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5639, - EndPos: 5649, - }, - Expr: &assign.ShiftRight{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, - EndPos: 5648, + EndPos: 5649, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, - EndPos: 5641, + EndPos: 5648, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5639, EndPos: 5641, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5639, + EndPos: 5641, + }, + }, + Value: []byte("a"), }, }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5646, - EndPos: 5648, - }, - VarName: &node.Identifier{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 309, EndLine: 309, StartPos: 5646, EndPos: 5648, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 309, + EndLine: 309, + StartPos: 5646, + EndPos: 5648, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5655, - EndPos: 5667, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 312, EndLine: 312, StartPos: 5655, - EndPos: 5665, + EndPos: 5667, }, - Class: &name.FullyQualified{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5659, - EndPos: 5663, + StartPos: 5655, + EndPos: 5665, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5660, - EndPos: 5663, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5659, + EndPos: 5663, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5660, + EndPos: 5663, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5663, - EndPos: 5665, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 312, + EndLine: 312, + StartPos: 5663, + EndPos: 5665, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5695, - }, - Expr: &expr.PropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, StartPos: 5691, - EndPos: 5694, + EndPos: 5695, }, - Variable: &expr.MethodCall{ + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5687, - EndPos: 5689, + StartPos: 5691, + EndPos: 5694, }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5671, - EndPos: 5681, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5675, - EndPos: 5679, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5676, - EndPos: 5679, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5679, - EndPos: 5681, - }, - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5684, - EndPos: 5687, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ + }, + Var: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 313, EndLine: 313, @@ -14694,171 +17828,190 @@ func TestPhp5(t *testing.T) { EndPos: 5689, }, }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5691, - EndPos: 5694, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5671, + EndPos: 5681, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5675, + EndPos: 5679, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5676, + EndPos: 5679, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5679, + EndPos: 5681, + }, + }, + }, }, - Value: "baz", + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5684, + EndPos: 5687, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5687, + EndPos: 5689, + }, + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 313, + EndLine: 313, + StartPos: 5691, + EndPos: 5694, + }, + }, + Value: []byte("baz"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5714, - EndPos: 5717, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 314, EndLine: 314, StartPos: 5714, - EndPos: 5715, + EndPos: 5717, }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5711, - EndPos: 5712, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5699, - EndPos: 5709, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5703, - EndPos: 5707, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5704, - EndPos: 5707, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5707, - EndPos: 5709, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5711, - EndPos: 5712, - }, - Value: "0", - }, - }, - Dim: &scalar.Lnumber{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 314, EndLine: 314, StartPos: 5714, EndPos: 5715, }, - Value: "0", + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5711, + EndPos: 5712, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5699, + EndPos: 5709, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5703, + EndPos: 5707, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5704, + EndPos: 5707, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5707, + EndPos: 5709, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5711, + EndPos: 5712, + }, + }, + Value: []byte("0"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 314, + EndLine: 314, + StartPos: 5714, + EndPos: 5715, + }, + }, + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5740, - EndPos: 5743, - }, - Expr: &expr.MethodCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 315, EndLine: 315, StartPos: 5740, - EndPos: 5742, + EndPos: 5743, }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5733, - EndPos: 5734, - }, - Variable: &expr.New{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5721, - EndPos: 5731, - }, - Class: &name.FullyQualified{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5725, - EndPos: 5729, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5726, - EndPos: 5729, - }, - Value: "Foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5729, - EndPos: 5731, - }, - }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5733, - EndPos: 5734, - }, - Value: "0", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5737, - EndPos: 5740, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 315, EndLine: 315, @@ -14866,67 +18019,168 @@ func TestPhp5(t *testing.T) { EndPos: 5742, }, }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5733, + EndPos: 5734, + }, + }, + Var: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5721, + EndPos: 5731, + }, + }, + Class: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5725, + EndPos: 5729, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5726, + EndPos: 5729, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5729, + EndPos: 5731, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5733, + EndPos: 5734, + }, + }, + Value: []byte("0"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5737, + EndPos: 5740, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 315, + EndLine: 315, + StartPos: 5740, + EndPos: 5742, + }, + }, + }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5747, - EndPos: 5764, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5763, + EndPos: 5764, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5760, + EndPos: 5763, }, - Variable: &expr.Array{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5747, - EndPos: 5757, + EndPos: 5760, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5753, - EndPos: 5756, - }, - Val: &expr.ShortArray{ + }, + Var: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5747, + EndPos: 5757, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5753, EndPos: 5756, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5754, - EndPos: 5755, - }, - Val: &scalar.Lnumber{ + }, + Val: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5753, + EndPos: 5756, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, StartPos: 5754, EndPos: 5755, }, - Value: "0", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5754, + EndPos: 5755, + }, + }, + Value: []byte("0"), }, }, }, @@ -14934,2702 +18188,3324 @@ func TestPhp5(t *testing.T) { }, }, }, - Dim: &scalar.Lnumber{ + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 317, + EndLine: 317, + StartPos: 5758, + EndPos: 5759, + }, + }, + Value: []byte("0"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5758, - EndPos: 5759, + StartPos: 5761, + EndPos: 5762, }, - Value: "0", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5761, - EndPos: 5762, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5767, - EndPos: 5776, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 318, EndLine: 318, StartPos: 5767, - EndPos: 5775, + EndPos: 5776, }, - Variable: &scalar.String{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 318, EndLine: 318, StartPos: 5767, - EndPos: 5772, + EndPos: 5775, }, - Value: "\"foo\"", }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5773, - EndPos: 5774, + Var: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5767, + EndPos: 5772, + }, }, - Value: "0", + Value: []byte("\"foo\""), + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 318, + EndLine: 318, + StartPos: 5773, + EndPos: 5774, + }, + }, + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5779, - EndPos: 5786, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, - EndPos: 5785, + EndPos: 5786, }, - Variable: &expr.ConstFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, - EndPos: 5782, + EndPos: 5785, }, - Constant: &name.Name{ + }, + Var: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 319, EndLine: 319, StartPos: 5779, EndPos: 5782, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5779, - EndPos: 5782, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5779, + EndPos: 5782, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5779, + EndPos: 5782, + }, }, - Value: "foo", + Value: []byte("foo"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5783, - EndPos: 5784, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 319, + EndLine: 319, + StartPos: 5783, + EndPos: 5784, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5789, - EndPos: 5801, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, StartPos: 5789, - EndPos: 5800, + EndPos: 5801, }, - Class: &node.Identifier{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, StartPos: 5789, - EndPos: 5795, - }, - Value: "static", - }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5797, EndPos: 5800, }, - Value: "foo", + }, + Class: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5789, + EndPos: 5795, + }, + }, + Value: []byte("static"), + }, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5797, + EndPos: 5800, + }, + }, + Value: []byte("foo"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5805, - EndPos: 5814, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, StartPos: 5805, - EndPos: 5813, + EndPos: 5814, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, - StartPos: 5809, + StartPos: 5805, EndPos: 5813, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, StartPos: 5809, EndPos: 5813, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 322, + EndLine: 322, + StartPos: 5809, + EndPos: 5813, + }, + }, + Value: []byte("foo"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5817, - EndPos: 5832, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5817, - EndPos: 5831, + EndPos: 5832, }, - Class: &expr.StaticPropertyFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, - StartPos: 5821, + StartPos: 5817, EndPos: 5831, }, - Class: &expr.Variable{ + }, + Class: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5821, - EndPos: 5825, + EndPos: 5831, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5821, EndPos: 5825, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5821, + EndPos: 5825, + }, + }, + Value: []byte("foo"), }, }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5827, - EndPos: 5831, - }, - VarName: &node.Identifier{ + Property: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 323, EndLine: 323, StartPos: 5827, EndPos: 5831, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 323, + EndLine: 323, + StartPos: 5827, + EndPos: 5831, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5835, - EndPos: 5848, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, StartPos: 5835, - EndPos: 5846, + EndPos: 5848, }, - Class: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, - StartPos: 5845, + StartPos: 5835, EndPos: 5846, }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5843, - EndPos: 5846, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5839, - EndPos: 5844, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5839, - EndPos: 5841, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5843, - EndPos: 5844, - }, - Value: "b", - }, - }, - Dim: &scalar.Lnumber{ + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 324, EndLine: 324, StartPos: 5845, EndPos: 5846, }, - Value: "0", + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5843, + EndPos: 5846, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5839, + EndPos: 5844, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5839, + EndPos: 5841, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5843, + EndPos: 5844, + }, + }, + Value: []byte("b"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 324, + EndLine: 324, + StartPos: 5845, + EndPos: 5846, + }, + }, + Value: []byte("0"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5851, - EndPos: 5883, - }, - Expr: &expr.New{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5851, - EndPos: 5881, + EndPos: 5883, }, - Class: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, - StartPos: 5880, + StartPos: 5851, EndPos: 5881, }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5878, - EndPos: 5881, - }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5879, - }, - Variable: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5876, - }, - Variable: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5859, - EndPos: 5871, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5855, - EndPos: 5860, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5855, - EndPos: 5857, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5859, - EndPos: 5860, - }, - Value: "b", - }, - }, - Dim: &expr.Ternary{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5871, - }, - Condition: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5863, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5861, - EndPos: 5863, - }, - Value: "b", - }, - }, - IfFalse: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Constant: &name.Name{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5867, - EndPos: 5871, - }, - Value: "null", - }, - }, - }, - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5876, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5874, - EndPos: 5876, - }, - Value: "c", - }, - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5878, - EndPos: 5879, - }, - Value: "d", - }, - }, - Dim: &scalar.Lnumber{ + }, + Class: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5880, EndPos: 5881, }, - Value: "0", + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5878, + EndPos: 5881, + }, + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5879, + }, + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5876, + }, + }, + Var: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5859, + EndPos: 5871, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5855, + EndPos: 5860, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5855, + EndPos: 5857, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5859, + EndPos: 5860, + }, + }, + Value: []byte("b"), + }, + }, + Dim: &ast.ExprTernary{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5871, + }, + }, + Condition: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5863, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5861, + EndPos: 5863, + }, + }, + Value: []byte("b"), + }, + }, + IfFalse: &ast.ExprConstFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5867, + EndPos: 5871, + }, + }, + Value: []byte("null"), + }, + }, + }, + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5876, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5874, + EndPos: 5876, + }, + }, + Value: []byte("c"), + }, + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5878, + EndPos: 5879, + }, + }, + Value: []byte("d"), + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5880, + EndPos: 5881, + }, + }, + Value: []byte("0"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5883, - EndPos: 5902, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5883, + EndPos: 5902, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5890, - EndPos: 5901, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5890, - EndPos: 5892, + EndPos: 5901, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5890, EndPos: 5892, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5890, + EndPos: 5892, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5895, - EndPos: 5901, - }, - Variable: &expr.ShortArray{ + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5895, - EndPos: 5898, + EndPos: 5901, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5896, - EndPos: 5897, - }, - Val: &scalar.Lnumber{ + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5895, + EndPos: 5898, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 325, EndLine: 325, StartPos: 5896, EndPos: 5897, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5896, + EndPos: 5897, + }, + }, + Value: []byte("1"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5899, - EndPos: 5900, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 325, + EndLine: 325, + StartPos: 5899, + EndPos: 5900, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5906, - EndPos: 5921, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5906, + EndPos: 5921, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5913, - EndPos: 5920, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, StartPos: 5913, - EndPos: 5915, + EndPos: 5920, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, StartPos: 5913, EndPos: 5915, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5913, + EndPos: 5915, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.BooleanNot{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5918, - EndPos: 5920, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprBooleanNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 327, EndLine: 327, - StartPos: 5919, + StartPos: 5918, EndPos: 5920, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 327, + EndLine: 327, + StartPos: 5919, + EndPos: 5920, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5924, - EndPos: 5939, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5924, + EndPos: 5939, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5931, - EndPos: 5938, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, StartPos: 5931, - EndPos: 5933, + EndPos: 5938, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, StartPos: 5931, EndPos: 5933, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5931, + EndPos: 5933, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.BitwiseNot{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5936, - EndPos: 5938, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprBitwiseNot{ + Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5937, + StartPos: 5936, EndPos: 5938, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5937, + EndPos: 5938, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5942, - EndPos: 5957, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5942, + EndPos: 5957, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5949, - EndPos: 5956, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, StartPos: 5949, - EndPos: 5951, + EndPos: 5956, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, StartPos: 5949, EndPos: 5951, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5949, + EndPos: 5951, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.UnaryPlus{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5954, - EndPos: 5956, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprUnaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5955, + StartPos: 5954, EndPos: 5956, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 329, + EndLine: 329, + StartPos: 5955, + EndPos: 5956, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5960, - EndPos: 5975, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5960, + EndPos: 5975, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5967, - EndPos: 5974, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, StartPos: 5967, - EndPos: 5969, + EndPos: 5974, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, StartPos: 5967, EndPos: 5969, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5967, + EndPos: 5969, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.UnaryMinus{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5972, - EndPos: 5974, - }, - Expr: &scalar.Lnumber{ + Expr: &ast.ExprUnaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 5973, + StartPos: 5972, EndPos: 5974, }, - Value: "1", + }, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 330, + EndLine: 330, + StartPos: 5973, + EndPos: 5974, + }, + }, + Value: []byte("1"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5978, - EndPos: 5994, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5978, + EndPos: 5994, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5985, - EndPos: 5992, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 331, EndLine: 331, StartPos: 5985, - EndPos: 5987, + EndPos: 5992, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 331, EndLine: 331, StartPos: 5985, EndPos: 5987, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5985, + EndPos: 5987, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5991, - EndPos: 5992, + Expr: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 331, + EndLine: 331, + StartPos: 5991, + EndPos: 5992, + }, }, - Value: "1", + Value: []byte("1"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5997, - EndPos: 6016, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 5997, + EndPos: 6016, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6004, - EndPos: 6015, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6004, - EndPos: 6006, + EndPos: 6015, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6004, EndPos: 6006, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6004, + EndPos: 6006, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6009, - EndPos: 6015, - }, - Condition: &scalar.Lnumber{ + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 332, EndLine: 332, StartPos: 6009, - EndPos: 6010, - }, - Value: "1", - }, - IfFalse: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 6014, EndPos: 6015, }, - Value: "2", + }, + Condition: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6009, + EndPos: 6010, + }, + }, + Value: []byte("1"), + }, + IfFalse: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 332, + EndLine: 332, + StartPos: 6014, + EndPos: 6015, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6019, - EndPos: 6041, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6019, + EndPos: 6041, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6026, - EndPos: 6040, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6026, - EndPos: 6028, + EndPos: 6040, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6026, EndPos: 6028, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6026, + EndPos: 6028, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Ternary{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6031, - EndPos: 6040, - }, - Condition: &scalar.Lnumber{ + Expr: &ast.ExprTernary{ + Node: ast.Node{ Position: &position.Position{ StartLine: 333, EndLine: 333, StartPos: 6031, - EndPos: 6032, - }, - Value: "1", - }, - IfTrue: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6035, - EndPos: 6036, - }, - Value: "2", - }, - IfFalse: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 6039, EndPos: 6040, }, - Value: "3", + }, + Condition: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6031, + EndPos: 6032, + }, + }, + Value: []byte("1"), + }, + IfTrue: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6035, + EndPos: 6036, + }, + }, + Value: []byte("2"), + }, + IfFalse: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 333, + EndLine: 333, + StartPos: 6039, + EndPos: 6040, + }, + }, + Value: []byte("3"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6044, - EndPos: 6062, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6044, + EndPos: 6062, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6051, - EndPos: 6061, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6051, - EndPos: 6053, + EndPos: 6061, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6051, EndPos: 6053, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6051, + EndPos: 6053, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseAnd{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6056, - EndPos: 6061, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 334, EndLine: 334, StartPos: 6056, - EndPos: 6057, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 6060, EndPos: 6061, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6056, + EndPos: 6057, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 334, + EndLine: 334, + StartPos: 6060, + EndPos: 6061, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6065, - EndPos: 6083, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6065, + EndPos: 6083, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6072, - EndPos: 6082, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6072, - EndPos: 6074, + EndPos: 6082, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6072, EndPos: 6074, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6072, + EndPos: 6074, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseOr{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6077, - EndPos: 6082, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 335, EndLine: 335, StartPos: 6077, - EndPos: 6078, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 6081, EndPos: 6082, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6077, + EndPos: 6078, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 335, + EndLine: 335, + StartPos: 6081, + EndPos: 6082, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6086, - EndPos: 6104, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6086, + EndPos: 6104, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6093, - EndPos: 6103, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6093, - EndPos: 6095, + EndPos: 6103, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6093, EndPos: 6095, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6093, + EndPos: 6095, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BitwiseXor{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6098, - EndPos: 6103, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 336, EndLine: 336, StartPos: 6098, - EndPos: 6099, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 6102, EndPos: 6103, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6098, + EndPos: 6099, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 336, + EndLine: 336, + StartPos: 6102, + EndPos: 6103, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6107, - EndPos: 6126, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6107, + EndPos: 6126, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6114, - EndPos: 6125, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6114, - EndPos: 6116, + EndPos: 6125, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6114, EndPos: 6116, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6114, + EndPos: 6116, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BooleanAnd{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6119, - EndPos: 6125, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 337, EndLine: 337, StartPos: 6119, - EndPos: 6120, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 6124, EndPos: 6125, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6119, + EndPos: 6120, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 337, + EndLine: 337, + StartPos: 6124, + EndPos: 6125, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6129, - EndPos: 6148, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6129, + EndPos: 6148, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6136, - EndPos: 6147, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6136, - EndPos: 6138, + EndPos: 6147, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6136, EndPos: 6138, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6136, + EndPos: 6138, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.BooleanOr{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6141, - EndPos: 6147, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 338, EndLine: 338, StartPos: 6141, - EndPos: 6142, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 6146, EndPos: 6147, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6141, + EndPos: 6142, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 338, + EndLine: 338, + StartPos: 6146, + EndPos: 6147, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6151, - EndPos: 6169, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6151, + EndPos: 6169, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6158, - EndPos: 6168, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6158, - EndPos: 6160, + EndPos: 6168, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6158, EndPos: 6160, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6158, + EndPos: 6160, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Concat{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6163, - EndPos: 6168, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryConcat{ + Node: ast.Node{ Position: &position.Position{ StartLine: 339, EndLine: 339, StartPos: 6163, - EndPos: 6164, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 6167, EndPos: 6168, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6163, + EndPos: 6164, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 339, + EndLine: 339, + StartPos: 6167, + EndPos: 6168, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6172, - EndPos: 6190, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6172, + EndPos: 6190, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6179, - EndPos: 6189, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6179, - EndPos: 6181, + EndPos: 6189, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6179, EndPos: 6181, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6179, + EndPos: 6181, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Div{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6184, - EndPos: 6189, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryDiv{ + Node: ast.Node{ Position: &position.Position{ StartLine: 340, EndLine: 340, StartPos: 6184, - EndPos: 6185, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 6188, EndPos: 6189, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6184, + EndPos: 6185, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 340, + EndLine: 340, + StartPos: 6188, + EndPos: 6189, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6193, - EndPos: 6212, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6193, + EndPos: 6212, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6200, - EndPos: 6211, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6200, - EndPos: 6202, + EndPos: 6211, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6200, EndPos: 6202, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6200, + EndPos: 6202, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Equal{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6205, - EndPos: 6211, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 341, EndLine: 341, StartPos: 6205, - EndPos: 6206, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 6210, EndPos: 6211, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6205, + EndPos: 6206, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 341, + EndLine: 341, + StartPos: 6210, + EndPos: 6211, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6215, - EndPos: 6234, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6215, + EndPos: 6234, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6222, - EndPos: 6233, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6222, - EndPos: 6224, + EndPos: 6233, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6222, EndPos: 6224, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6222, + EndPos: 6224, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.GreaterOrEqual{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6227, - EndPos: 6233, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 342, EndLine: 342, StartPos: 6227, - EndPos: 6228, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 6232, EndPos: 6233, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6227, + EndPos: 6228, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 342, + EndLine: 342, + StartPos: 6232, + EndPos: 6233, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6237, - EndPos: 6255, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6237, + EndPos: 6255, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6244, - EndPos: 6254, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6244, - EndPos: 6246, + EndPos: 6254, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6244, EndPos: 6246, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6244, + EndPos: 6246, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Greater{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6249, - EndPos: 6254, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ Position: &position.Position{ StartLine: 343, EndLine: 343, StartPos: 6249, - EndPos: 6250, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 6253, EndPos: 6254, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6249, + EndPos: 6250, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 343, + EndLine: 343, + StartPos: 6253, + EndPos: 6254, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6258, - EndPos: 6278, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6258, + EndPos: 6278, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6265, - EndPos: 6277, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6265, - EndPos: 6267, + EndPos: 6277, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6265, EndPos: 6267, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6265, + EndPos: 6267, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Identical{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6270, - EndPos: 6277, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 344, EndLine: 344, StartPos: 6270, - EndPos: 6271, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 6276, EndPos: 6277, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6270, + EndPos: 6271, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 344, + EndLine: 344, + StartPos: 6276, + EndPos: 6277, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6281, - EndPos: 6301, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6281, + EndPos: 6301, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6288, - EndPos: 6300, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6288, - EndPos: 6290, + EndPos: 6300, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6288, EndPos: 6290, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6288, + EndPos: 6290, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalAnd{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6293, - EndPos: 6300, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ Position: &position.Position{ StartLine: 345, EndLine: 345, StartPos: 6293, - EndPos: 6294, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 6299, EndPos: 6300, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6293, + EndPos: 6294, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 345, + EndLine: 345, + StartPos: 6299, + EndPos: 6300, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6304, - EndPos: 6323, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6304, + EndPos: 6323, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6311, - EndPos: 6322, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6311, - EndPos: 6313, + EndPos: 6322, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6311, EndPos: 6313, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6311, + EndPos: 6313, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalOr{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6316, - EndPos: 6322, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ Position: &position.Position{ StartLine: 346, EndLine: 346, StartPos: 6316, - EndPos: 6317, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 6321, EndPos: 6322, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6316, + EndPos: 6317, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 346, + EndLine: 346, + StartPos: 6321, + EndPos: 6322, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6326, - EndPos: 6346, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6326, + EndPos: 6346, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6333, - EndPos: 6345, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6333, - EndPos: 6335, + EndPos: 6345, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6333, EndPos: 6335, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6333, + EndPos: 6335, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.LogicalXor{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6338, - EndPos: 6345, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ Position: &position.Position{ StartLine: 347, EndLine: 347, StartPos: 6338, - EndPos: 6339, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 6344, EndPos: 6345, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6338, + EndPos: 6339, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 347, + EndLine: 347, + StartPos: 6344, + EndPos: 6345, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6349, - EndPos: 6367, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6349, + EndPos: 6367, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6356, - EndPos: 6366, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6356, - EndPos: 6358, + EndPos: 6366, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6356, EndPos: 6358, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6356, + EndPos: 6358, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Minus{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6361, - EndPos: 6366, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMinus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 348, EndLine: 348, StartPos: 6361, - EndPos: 6362, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 6365, EndPos: 6366, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6361, + EndPos: 6362, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 348, + EndLine: 348, + StartPos: 6365, + EndPos: 6366, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6370, - EndPos: 6388, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6370, + EndPos: 6388, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6377, - EndPos: 6387, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6377, - EndPos: 6379, + EndPos: 6387, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6377, EndPos: 6379, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6377, + EndPos: 6379, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Mod{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6382, - EndPos: 6387, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMod{ + Node: ast.Node{ Position: &position.Position{ StartLine: 349, EndLine: 349, StartPos: 6382, - EndPos: 6383, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 6386, EndPos: 6387, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6382, + EndPos: 6383, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 349, + EndLine: 349, + StartPos: 6386, + EndPos: 6387, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6391, - EndPos: 6409, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6391, + EndPos: 6409, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6398, - EndPos: 6408, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6398, - EndPos: 6400, + EndPos: 6408, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6398, EndPos: 6400, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6398, + EndPos: 6400, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Mul{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6403, - EndPos: 6408, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryMul{ + Node: ast.Node{ Position: &position.Position{ StartLine: 350, EndLine: 350, StartPos: 6403, - EndPos: 6404, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 6407, EndPos: 6408, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6403, + EndPos: 6404, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 350, + EndLine: 350, + StartPos: 6407, + EndPos: 6408, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6412, - EndPos: 6431, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6412, + EndPos: 6431, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6419, - EndPos: 6430, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6419, - EndPos: 6421, + EndPos: 6430, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6419, EndPos: 6421, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6419, + EndPos: 6421, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.NotEqual{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6424, - EndPos: 6430, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryNotEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 351, EndLine: 351, StartPos: 6424, - EndPos: 6425, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 6429, EndPos: 6430, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6424, + EndPos: 6425, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 351, + EndLine: 351, + StartPos: 6429, + EndPos: 6430, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6434, - EndPos: 6454, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6434, + EndPos: 6454, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6441, - EndPos: 6453, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6441, - EndPos: 6443, + EndPos: 6453, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6441, EndPos: 6443, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6441, + EndPos: 6443, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.NotIdentical{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6446, - EndPos: 6453, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ Position: &position.Position{ StartLine: 352, EndLine: 352, StartPos: 6446, - EndPos: 6447, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 6452, EndPos: 6453, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6446, + EndPos: 6447, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 352, + EndLine: 352, + StartPos: 6452, + EndPos: 6453, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6457, - EndPos: 6475, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6457, + EndPos: 6475, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6464, - EndPos: 6474, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6464, - EndPos: 6466, + EndPos: 6474, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6464, EndPos: 6466, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6464, + EndPos: 6466, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Plus{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6469, - EndPos: 6474, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryPlus{ + Node: ast.Node{ Position: &position.Position{ StartLine: 353, EndLine: 353, StartPos: 6469, - EndPos: 6470, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 6473, EndPos: 6474, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6469, + EndPos: 6470, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 353, + EndLine: 353, + StartPos: 6473, + EndPos: 6474, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6478, - EndPos: 6497, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6478, + EndPos: 6497, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6485, - EndPos: 6496, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6485, - EndPos: 6487, + EndPos: 6496, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6485, EndPos: 6487, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6485, + EndPos: 6487, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Pow{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6490, - EndPos: 6496, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryPow{ + Node: ast.Node{ Position: &position.Position{ StartLine: 354, EndLine: 354, StartPos: 6490, - EndPos: 6491, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 6495, EndPos: 6496, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6490, + EndPos: 6491, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 354, + EndLine: 354, + StartPos: 6495, + EndPos: 6496, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6500, - EndPos: 6519, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6500, + EndPos: 6519, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6507, - EndPos: 6518, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6507, - EndPos: 6509, + EndPos: 6518, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6507, EndPos: 6509, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6507, + EndPos: 6509, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.ShiftLeft{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6512, - EndPos: 6518, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ Position: &position.Position{ StartLine: 355, EndLine: 355, StartPos: 6512, - EndPos: 6513, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 6517, EndPos: 6518, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6512, + EndPos: 6513, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 355, + EndLine: 355, + StartPos: 6517, + EndPos: 6518, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6522, - EndPos: 6541, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6522, + EndPos: 6541, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6529, - EndPos: 6540, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6529, - EndPos: 6531, + EndPos: 6540, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6529, EndPos: 6531, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6529, + EndPos: 6531, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.ShiftRight{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6534, - EndPos: 6540, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ Position: &position.Position{ StartLine: 356, EndLine: 356, StartPos: 6534, - EndPos: 6535, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 6539, EndPos: 6540, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6534, + EndPos: 6535, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 356, + EndLine: 356, + StartPos: 6539, + EndPos: 6540, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6544, - EndPos: 6563, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6544, + EndPos: 6563, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6551, - EndPos: 6562, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6551, - EndPos: 6553, + EndPos: 6562, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6551, EndPos: 6553, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6551, + EndPos: 6553, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.SmallerOrEqual{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6556, - EndPos: 6562, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ Position: &position.Position{ StartLine: 357, EndLine: 357, StartPos: 6556, - EndPos: 6557, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 6561, EndPos: 6562, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6556, + EndPos: 6557, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 357, + EndLine: 357, + StartPos: 6561, + EndPos: 6562, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6566, - EndPos: 6584, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6566, + EndPos: 6584, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6573, - EndPos: 6583, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6573, - EndPos: 6575, + EndPos: 6583, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6573, EndPos: 6575, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6573, + EndPos: 6575, + }, + }, + Value: []byte("a"), }, }, - Expr: &binary.Smaller{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6578, - EndPos: 6583, - }, - Left: &scalar.Lnumber{ + Expr: &ast.ExprBinarySmaller{ + Node: ast.Node{ Position: &position.Position{ StartLine: 358, EndLine: 358, StartPos: 6578, - EndPos: 6579, - }, - Value: "1", - }, - Right: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 6582, EndPos: 6583, }, - Value: "2", + }, + Left: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6578, + EndPos: 6579, + }, + }, + Value: []byte("1"), + }, + Right: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 358, + EndLine: 358, + StartPos: 6582, + EndPos: 6583, + }, + }, + Value: []byte("2"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6587, - EndPos: 6608, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6587, + EndPos: 6608, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6594, - EndPos: 6607, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6594, - EndPos: 6596, + EndPos: 6607, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6594, EndPos: 6596, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6594, + EndPos: 6596, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6599, - EndPos: 6607, - }, - Class: &name.Name{ + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 359, EndLine: 359, StartPos: 6599, - EndPos: 6602, + EndPos: 6607, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6599, - EndPos: 6602, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6599, + EndPos: 6602, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6599, + EndPos: 6602, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 6604, - EndPos: 6607, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 359, + EndLine: 359, + StartPos: 6604, + EndPos: 6607, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6611, - EndPos: 6634, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6611, + EndPos: 6634, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6618, - EndPos: 6633, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6618, - EndPos: 6620, + EndPos: 6633, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6618, EndPos: 6620, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6618, + EndPos: 6620, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ClassConstFetch{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6623, - EndPos: 6633, - }, - Class: &name.Name{ + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 360, EndLine: 360, StartPos: 6623, - EndPos: 6626, + EndPos: 6633, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6623, - EndPos: 6626, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6623, + EndPos: 6626, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6623, + EndPos: 6626, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6628, - EndPos: 6633, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 360, + EndLine: 360, + StartPos: 6628, + EndPos: 6633, + }, }, - Value: "class", + Value: []byte("class"), }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6637, - EndPos: 6659, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6637, + EndPos: 6659, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6644, - EndPos: 6658, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 361, EndLine: 361, StartPos: 6644, - EndPos: 6646, + EndPos: 6658, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 361, EndLine: 361, StartPos: 6644, EndPos: 6646, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6644, + EndPos: 6646, + }, + }, + Value: []byte("a"), }, }, - Expr: &scalar.MagicConstant{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6649, - EndPos: 6658, + Expr: &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 361, + EndLine: 361, + StartPos: 6649, + EndPos: 6658, + }, }, - Value: "__CLASS__", + Value: []byte("__CLASS__"), }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6662, - EndPos: 6678, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6662, + EndPos: 6678, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6669, - EndPos: 6677, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6669, - EndPos: 6671, + EndPos: 6677, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6669, EndPos: 6671, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6669, + EndPos: 6671, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6674, - EndPos: 6677, - }, - Constant: &name.Name{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 362, EndLine: 362, StartPos: 6674, EndPos: 6677, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6674, - EndPos: 6677, + }, + Const: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6674, + EndPos: 6677, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 362, + EndLine: 362, + StartPos: 6674, + EndPos: 6677, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17637,61 +21513,75 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6681, - EndPos: 6707, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6681, + EndPos: 6707, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6688, - EndPos: 6706, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6688, - EndPos: 6690, + EndPos: 6706, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6688, EndPos: 6690, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6688, + EndPos: 6690, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6693, - EndPos: 6706, - }, - Constant: &name.Relative{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 363, EndLine: 363, StartPos: 6693, EndPos: 6706, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6703, - EndPos: 6706, + }, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6693, + EndPos: 6706, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 363, + EndLine: 363, + StartPos: 6703, + EndPos: 6706, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17699,61 +21589,75 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6710, - EndPos: 6727, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6710, + EndPos: 6727, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6717, - EndPos: 6726, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6717, - EndPos: 6719, + EndPos: 6726, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6717, EndPos: 6719, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6717, + EndPos: 6719, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ConstFetch{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6722, - EndPos: 6726, - }, - Constant: &name.FullyQualified{ + Expr: &ast.ExprConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 364, EndLine: 364, StartPos: 6722, EndPos: 6726, }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6723, - EndPos: 6726, + }, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6722, + EndPos: 6726, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 364, + EndLine: 364, + StartPos: 6723, + EndPos: 6726, + }, }, - Value: "Foo", + Value: []byte("Foo"), }, }, }, @@ -17761,130 +21665,160 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6730, - EndPos: 6750, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6730, + EndPos: 6750, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6737, - EndPos: 6749, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 365, EndLine: 365, StartPos: 6737, - EndPos: 6739, + EndPos: 6749, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 365, EndLine: 365, StartPos: 6737, EndPos: 6739, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6737, + EndPos: 6739, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6742, - EndPos: 6749, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 365, + EndLine: 365, + StartPos: 6742, + EndPos: 6749, + }, }, }, }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6753, - EndPos: 6782, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6753, + EndPos: 6782, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6760, - EndPos: 6781, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6760, - EndPos: 6762, + EndPos: 6781, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6760, EndPos: 6762, }, - Value: "a", }, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6765, - EndPos: 6781, - }, - Items: []node.Node{ - &expr.ArrayItem{ + VarName: &ast.Identifier{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, - StartPos: 6771, - EndPos: 6777, + StartPos: 6760, + EndPos: 6762, }, - Key: &scalar.Lnumber{ + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6765, + EndPos: 6781, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6771, - EndPos: 6772, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6776, EndPos: 6777, }, - Value: "1", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6771, + EndPos: 6772, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6776, + EndPos: 6777, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6779, - EndPos: 6780, - }, - Val: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 366, EndLine: 366, StartPos: 6779, EndPos: 6780, }, - Value: "2", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 366, + EndLine: 366, + StartPos: 6779, + EndPos: 6780, + }, + }, + Value: []byte("2"), }, }, }, @@ -17892,510 +21826,630 @@ func TestPhp5(t *testing.T) { }, }, }, - &stmt.Static{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6785, - EndPos: 6812, + &ast.StmtStatic{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6785, + EndPos: 6812, + }, }, - Vars: []node.Node{ - &stmt.StaticVar{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6792, - EndPos: 6811, - }, - Variable: &expr.Variable{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6792, - EndPos: 6794, + EndPos: 6811, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6792, EndPos: 6794, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6792, + EndPos: 6794, + }, + }, + Value: []byte("a"), }, }, - Expr: &expr.ArrayDimFetch{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6797, - EndPos: 6811, - }, - Variable: &expr.ShortArray{ + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6797, - EndPos: 6808, + EndPos: 6811, }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6798, - EndPos: 6799, - }, - Val: &scalar.Lnumber{ + }, + Var: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6797, + EndPos: 6808, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6798, EndPos: 6799, }, - Value: "1", + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6798, + EndPos: 6799, + }, + }, + Value: []byte("1"), }, }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6801, - EndPos: 6807, - }, - Key: &scalar.Lnumber{ + &ast.ExprArrayItem{ + Node: ast.Node{ Position: &position.Position{ StartLine: 367, EndLine: 367, StartPos: 6801, - EndPos: 6802, - }, - Value: "2", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6806, EndPos: 6807, }, - Value: "2", + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6801, + EndPos: 6802, + }, + }, + Value: []byte("2"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6806, + EndPos: 6807, + }, + }, + Value: []byte("2"), }, }, }, }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6809, - EndPos: 6810, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 367, + EndLine: 367, + StartPos: 6809, + EndPos: 6810, + }, }, - Value: "0", + Value: []byte("0"), }, }, }, }, }, - &stmt.If{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6816, - EndPos: 6831, - }, - Cond: &expr.Yield{ + &ast.StmtIf{ + Node: ast.Node{ Position: &position.Position{ StartLine: 369, EndLine: 369, - StartPos: 6820, - EndPos: 6827, + StartPos: 6816, + EndPos: 6831, }, - Value: &scalar.Lnumber{ + }, + Cond: &ast.ExprYield{ + Node: ast.Node{ Position: &position.Position{ StartLine: 369, EndLine: 369, - StartPos: 6826, + StartPos: 6820, EndPos: 6827, }, - Value: "1", + }, + Value: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6826, + EndPos: 6827, + }, + }, + Value: []byte("1"), }, }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6829, - EndPos: 6831, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 369, + EndLine: 369, + StartPos: 6829, + EndPos: 6831, + }, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6834, - EndPos: 6845, - }, - Expr: &expr.StaticPropertyFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6834, - EndPos: 6844, + EndPos: 6845, }, - Class: &name.Name{ + }, + Expr: &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6834, - EndPos: 6837, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6834, - EndPos: 6837, - }, - Value: "Foo", - }, - }, - }, - Property: &expr.Variable{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6839, EndPos: 6844, }, - VarName: &expr.Variable{ + }, + Class: &ast.NameName{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, - StartPos: 6840, + StartPos: 6834, + EndPos: 6837, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6834, + EndPos: 6837, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6839, EndPos: 6844, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 370, EndLine: 370, StartPos: 6840, EndPos: 6844, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 370, + EndLine: 370, + StartPos: 6840, + EndPos: 6844, + }, + }, + Value: []byte("bar"), }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6849, - EndPos: 6856, - }, - Expr: &expr.FunctionCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, - EndPos: 6855, + EndPos: 6856, }, - Function: &expr.Variable{ + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, - EndPos: 6853, + EndPos: 6855, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 372, EndLine: 372, StartPos: 6849, EndPos: 6853, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6849, + EndPos: 6853, + }, + }, + Value: []byte("foo"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6853, - EndPos: 6855, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 372, + EndLine: 372, + StartPos: 6853, + EndPos: 6855, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6859, - EndPos: 6872, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6871, + EndPos: 6872, }, - Variable: &expr.ArrayDimFetch{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6868, + EndPos: 6871, }, - Variable: &expr.FunctionCall{ + }, + Var: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6865, + EndPos: 6868, }, - Function: &expr.Variable{ + }, + Var: &ast.ExprFunctionCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, - EndPos: 6863, + EndPos: 6865, }, - VarName: &node.Identifier{ + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, StartPos: 6859, EndPos: 6863, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 373, + EndLine: 373, + StartPos: 6859, + EndPos: 6863, + }, + }, + Value: []byte("foo"), }, }, - ArgumentList: &node.ArgumentList{ + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 373, + EndLine: 373, + StartPos: 6863, + EndPos: 6865, + }, + }, + }, + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, - StartPos: 6863, - EndPos: 6865, + StartPos: 6866, + EndPos: 6867, }, }, + Value: []byte("0"), }, - Dim: &scalar.Lnumber{ + }, + Dim: &ast.ScalarLnumber{ + Node: ast.Node{ Position: &position.Position{ StartLine: 373, EndLine: 373, - StartPos: 6866, - EndPos: 6867, + StartPos: 6869, + EndPos: 6870, }, - Value: "0", }, - }, - Dim: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6869, - EndPos: 6870, - }, - Value: "0", + Value: []byte("0"), }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6875, - EndPos: 6882, - }, - Expr: &expr.ArrayDimFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, - EndPos: 6881, + EndPos: 6882, }, - Variable: &expr.Variable{ + }, + Expr: &ast.ExprArrayDimFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, - EndPos: 6877, + EndPos: 6881, }, - VarName: &node.Identifier{ + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6875, EndPos: 6877, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6875, + EndPos: 6877, + }, + }, + Value: []byte("a"), }, }, - Dim: &expr.Variable{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6878, - EndPos: 6880, - }, - VarName: &node.Identifier{ + Dim: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 374, EndLine: 374, StartPos: 6878, EndPos: 6880, }, - Value: "b", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 374, + EndLine: 374, + StartPos: 6878, + EndPos: 6880, + }, + }, + Value: []byte("b"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6885, - EndPos: 6891, - }, - Expr: &expr.Variable{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, StartPos: 6885, - EndPos: 6890, + EndPos: 6891, }, - VarName: &expr.Variable{ + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, - StartPos: 6887, - EndPos: 6889, + StartPos: 6885, + EndPos: 6890, }, - VarName: &node.Identifier{ + }, + VarName: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 375, EndLine: 375, StartPos: 6887, EndPos: 6889, }, - Value: "a", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 375, + EndLine: 375, + StartPos: 6887, + EndPos: 6889, + }, + }, + Value: []byte("a"), }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6894, - EndPos: 6909, - }, - Expr: &expr.StaticCall{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, - EndPos: 6908, + EndPos: 6909, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, - EndPos: 6898, + EndPos: 6908, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, StartPos: 6894, EndPos: 6898, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6894, + EndPos: 6898, + }, + }, + Value: []byte("foo"), }, }, - Call: &expr.Variable{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6900, - EndPos: 6906, - }, - VarName: &node.Identifier{ + Call: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 376, EndLine: 376, - StartPos: 6901, - EndPos: 6905, + StartPos: 6900, + EndPos: 6906, }, - Value: "bar", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6901, + EndPos: 6905, + }, + }, + Value: []byte("bar"), }, }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6906, - EndPos: 6908, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 376, + EndLine: 376, + StartPos: 6906, + EndPos: 6908, + }, }, }, }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6912, - EndPos: 6922, - }, - Expr: &expr.ClassConstFetch{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, - EndPos: 6921, + EndPos: 6922, }, - Class: &expr.Variable{ + }, + Expr: &ast.ExprClassConstFetch{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, - EndPos: 6916, + EndPos: 6921, }, - VarName: &node.Identifier{ + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ Position: &position.Position{ StartLine: 377, EndLine: 377, StartPos: 6912, EndPos: 6916, }, - Value: "foo", + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6912, + EndPos: 6916, + }, + }, + Value: []byte("foo"), }, }, - ConstantName: &node.Identifier{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6918, - EndPos: 6921, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 377, + EndLine: 377, + StartPos: 6918, + EndPos: 6921, + }, }, - Value: "bar", + Value: []byte("bar"), }, }, }, - &stmt.HaltCompiler{ - Position: &position.Position{ - StartLine: 379, - EndLine: 379, - StartPos: 6926, - EndPos: 6944, + &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 379, + EndLine: 379, + StartPos: 6926, + EndPos: 6944, + }, }, }, }, @@ -18420,97 +22474,119 @@ func TestPhp5Strings(t *testing.T) { '; ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 10, - StartPos: 5, - EndPos: 70, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 10, + StartPos: 5, + EndPos: 70, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 5, - EndPos: 12, - }, - Expr: &scalar.String{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 11, + EndPos: 12, }, - Value: "\"test\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 11, + }, + }, + Value: []byte("\"test\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 15, - EndPos: 24, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 15, - EndPos: 23, + EndPos: 24, }, - Value: "\"\\$test\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 15, + EndPos: 23, + }, + }, + Value: []byte("\"\\$test\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 6, - StartPos: 27, - EndPos: 41, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 6, StartPos: 27, - EndPos: 40, + EndPos: 41, }, - Value: "\"\n\t\t\ttest\n\t\t\"", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 6, + StartPos: 27, + EndPos: 40, + }, + }, + Value: []byte("\"\n\t\t\ttest\n\t\t\""), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 44, - EndPos: 52, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 44, - EndPos: 51, + EndPos: 52, }, - Value: "'$test'", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 44, + EndPos: 51, + }, + }, + Value: []byte("'$test'"), }, }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 8, - EndLine: 10, - StartPos: 55, - EndPos: 70, - }, - Expr: &scalar.String{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 8, EndLine: 10, StartPos: 55, - EndPos: 69, + EndPos: 70, }, - Value: "'\n\t\t\t$test\n\t\t'", + }, + Expr: &ast.ScalarString{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 8, + EndLine: 10, + StartPos: 55, + EndPos: 69, + }, + }, + Value: []byte("'\n\t\t\t$test\n\t\t'"), }, }, }, @@ -18540,165 +22616,201 @@ CAD; CAD; ` - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 15, - StartPos: 5, - EndPos: 120, + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 15, + StartPos: 5, + EndPos: 120, + }, }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 3, - StartPos: 5, - EndPos: 16, - }, - Expr: &scalar.Heredoc{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 3, StartPos: 5, - EndPos: 15, + EndPos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sO7~FZE5*$EX ziK;N-5W~ke?Fh?*DULqMbjE(g_bGga7v-N(+Xu*C^YYkLO$Oq z)c8GH4>Q_Y$;u$|n^g?oBf~jX2~G4mk4>CMAkr_e55V86hP6P9k#&gpl&k3fLV+Vc zV)rwzq15p@f-(dm{)Rg8=Wn8x{$BuMSiRDA+(K>qZPZ$BvtOWsCwCNTZBXdhT|Cl! zY!j}0pg_TW3=!F^UX-^Vu*neY)j>)DXNY)QI|k|bLgjR)8dlWX zM#HBn&{l(&Ld4oB^r5|mzgQ+XXn5VfaMa+s&+4i~S7#-z?gk?Fb475&RV$UZqPRP* zo6|%49Ja>OO$!2)?yljxThLqE4%~FT))lVBx;|PGbmi==m4kZENBa}hw*J~=iFn)~ zP5x*R!v|~f*RGEH57qMJb!!}|-GY^OhifpwqDX@#fA@)1qqNR|a>rPbfO?!tAmnuP1o>lJ4b3$fO~hA773C6iq`OTs+g^n gLcHyBwHct&1xmdbiz?4sgk8*kL&JBZFiy+ From 12086ef6b69970e6ea0aa32b894bc959d26208f1 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Wed, 13 May 2020 21:05:15 +0300 Subject: [PATCH 007/140] refactor cmd --- Makefile | 2 +- main.go => cmd/php-parser/main.go | 63 +- pkg/ast/traverser/dfs.go | 2774 +++++++++++++++++--- pkg/ast/visitor/dump.go | 39 +- pkg/ast/visitor/dump_test.go | 2 +- pkg/ast/visitor/namespace_resolver.go | 399 +++ pkg/ast/visitor/namespace_resolver_test.go | 986 +++++++ pkg/ast/visitor/null.go | 16 + 8 files changed, 3924 insertions(+), 357 deletions(-) rename main.go => cmd/php-parser/main.go (70%) create mode 100644 pkg/ast/visitor/namespace_resolver.go create mode 100644 pkg/ast/visitor/namespace_resolver_test.go diff --git a/Makefile b/Makefile index a5b8399..5f88103 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ fmt: build: go generate ./... - go build + go build ./cmd/... run: ./php-parser -d go $(PHPFILE) diff --git a/main.go b/cmd/php-parser/main.go similarity index 70% rename from main.go rename to cmd/php-parser/main.go index a1ad92c..569dd30 100644 --- a/main.go +++ b/cmd/php-parser/main.go @@ -1,9 +1,9 @@ package main import ( - "bytes" "flag" "fmt" + "github.com/z7zmey/php-parser/pkg/ast/traverser" "io/ioutil" "log" "os" @@ -13,15 +13,14 @@ import ( "github.com/pkg/profile" "github.com/yookoala/realpath" - "github.com/z7zmey/php-parser/parser" - "github.com/z7zmey/php-parser/printer" - "github.com/z7zmey/php-parser/visitor" + "github.com/z7zmey/php-parser/pkg/parser" + "github.com/z7zmey/php-parser/pkg/ast/visitor" ) var wg sync.WaitGroup var phpVersion string -var dumpType string var profiler string +var dump *bool var withFreeFloating *bool var showResolvedNs *bool var printBack *bool @@ -42,7 +41,7 @@ func main() { showResolvedNs = flag.Bool("r", false, "resolve names") printBack = flag.Bool("pb", false, "print AST back into the parsed file") printPath = flag.Bool("p", false, "print filepath") - flag.StringVar(&dumpType, "d", "", "dump format: [custom, go, json, pretty_json]") + dump = flag.Bool("d", false, "dump") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") flag.StringVar(&phpVersion, "phpver", "7.4", "php version") @@ -115,7 +114,7 @@ func parserWorker(fileCh <-chan *file, r chan<- result) { } if *withFreeFloating { - parserWorker.WithFreeFloating() + parserWorker.WithTokens() } parserWorker.Parse() @@ -143,44 +142,26 @@ func printerWorker(r <-chan result) { fmt.Fprintf(os.Stdout, "==> %s\n", e) } - if *printBack { - o := bytes.NewBuffer([]byte{}) - p := printer.NewPrinter(o) - p.Print(res.parser.GetRootNode()) + //if *printBack { + // o := bytes.NewBuffer([]byte{}) + // p := printer.NewPrinter(o) + // p.Print(res.parser.GetRootNode()) + // + // err := ioutil.WriteFile(res.path, o.Bytes(), 0644) + // checkErr(err) + //} - err := ioutil.WriteFile(res.path, o.Bytes(), 0644) - checkErr(err) - } - - var nsResolver *visitor.NamespaceResolver if *showResolvedNs { - nsResolver = visitor.NewNamespaceResolver() - res.parser.GetRootNode().Walk(nsResolver) + v := visitor.NewNamespaceResolver() + t := traverser.NewDFS(v) + t.Traverse(res.parser.GetRootNode()) + fmt.Printf("%+v", v.ResolvedNames) } - switch dumpType { - case "custom": - dumper := &visitor.Dumper{ - Writer: os.Stdout, - Indent: "| ", - NsResolver: nsResolver, - } - res.parser.GetRootNode().Walk(dumper) - case "json": - dumper := &visitor.JsonDumper{ - Writer: os.Stdout, - NsResolver: nsResolver, - } - res.parser.GetRootNode().Walk(dumper) - case "pretty_json": - dumper := &visitor.PrettyJsonDumper{ - Writer: os.Stdout, - NsResolver: nsResolver, - } - res.parser.GetRootNode().Walk(dumper) - case "go": - dumper := &visitor.GoDumper{Writer: os.Stdout} - res.parser.GetRootNode().Walk(dumper) + if *dump == true { + v := visitor.NewDump(os.Stdout) + t := traverser.NewDFS(v) + t.Traverse(res.parser.GetRootNode()) } wg.Done() diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index f3d745e..4618bc9 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -13,479 +13,2641 @@ func NewDFS(visitor ast.Visitor) *DFS { } func (t *DFS) Traverse(n ast.Vertex) { - if n == nil { - return - } - - if !t.visitor.EnterNode(n) { - return - } - switch nn := n.(type) { case *ast.Root: - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.Nullable: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.Parameter: - t.traverseSingle("Type", nn.Type) - t.traverseSingle("Var", nn.Var) - t.traverseSingle("DefaultValue", nn.DefaultValue) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Type != nil { + t.visitor.Enter("Type", true) + t.Traverse(nn.Type) + t.visitor.Leave("Type", true) + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.DefaultValue != nil { + t.visitor.Enter("DefaultValue", true) + t.Traverse(nn.DefaultValue) + t.visitor.Leave("DefaultValue", true) + } case *ast.Identifier: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.ArgumentList: - t.traverseArray("Arguments", nn.Arguments) + if nn.Arguments != nil { + t.visitor.Enter("Arguments", false) + for _, c := range nn.Arguments { + t.Traverse(c) + } + t.visitor.Leave("Arguments", false) + } case *ast.Argument: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtAltElse: - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtAltElseIf: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtAltFor: - t.traverseArray("Init", nn.Init) - t.traverseArray("Cond", nn.Cond) - t.traverseArray("Loop", nn.Loop) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Init != nil { + t.visitor.Enter("Init", false) + for _, c := range nn.Init { + t.Traverse(c) + } + t.visitor.Leave("Init", false) + } + if nn.Cond != nil { + t.visitor.Enter("Cond", false) + for _, c := range nn.Cond { + t.Traverse(c) + } + t.visitor.Leave("Cond", false) + } + if nn.Loop != nil { + t.visitor.Enter("Loop", false) + for _, c := range nn.Loop { + t.Traverse(c) + } + t.visitor.Leave("Loop", false) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtAltForeach: - t.traverseSingle("Expr", nn.Expr) - t.traverseSingle("Key", nn.Key) - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } + if nn.Key != nil { + t.visitor.Enter("Key", true) + t.Traverse(nn.Key) + t.visitor.Leave("Key", true) + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtAltIf: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) - t.traverseArray("ElseIf", nn.ElseIf) - t.traverseSingle("Else", nn.Else) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } + if nn.ElseIf != nil { + t.visitor.Enter("ElseIf", false) + for _, c := range nn.ElseIf { + t.Traverse(c) + } + t.visitor.Leave("ElseIf", false) + } + if nn.Else != nil { + t.visitor.Enter("Else", true) + t.Traverse(nn.Else) + t.visitor.Leave("Else", true) + } case *ast.StmtAltSwitch: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("CaseList", nn.CaseList) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.CaseList != nil { + t.visitor.Enter("CaseList", true) + t.Traverse(nn.CaseList) + t.visitor.Leave("CaseList", true) + } case *ast.StmtAltWhile: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtBreak: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtCase: - t.traverseSingle("Cond", nn.Cond) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtCaseList: - t.traverseArray("Cases", nn.Cases) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cases != nil { + t.visitor.Enter("Cases", false) + for _, c := range nn.Cases { + t.Traverse(c) + } + t.visitor.Leave("Cases", false) + } case *ast.StmtCatch: - t.traverseArray("Types", nn.Types) - t.traverseSingle("Var", nn.Var) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Types != nil { + t.visitor.Enter("Types", false) + for _, c := range nn.Types { + t.Traverse(c) + } + t.visitor.Leave("Types", false) + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtClass: - t.traverseSingle("ClassName", nn.ClassName) - t.traverseArray("Modifiers", nn.Modifiers) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.ClassName != nil { + t.visitor.Enter("ClassName", true) + t.Traverse(nn.ClassName) + t.visitor.Leave("ClassName", true) + } + if nn.Modifiers != nil { + t.visitor.Enter("Modifiers", false) + for _, c := range nn.Modifiers { + t.Traverse(c) + } + t.visitor.Leave("Modifiers", false) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtClassConstList: - t.traverseArray("Modifiers", nn.Modifiers) - t.traverseArray("Consts", nn.Consts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Modifiers != nil { + t.visitor.Enter("Modifiers", false) + for _, c := range nn.Modifiers { + t.Traverse(c) + } + t.visitor.Leave("Modifiers", false) + } + if nn.Consts != nil { + t.visitor.Enter("Consts", false) + for _, c := range nn.Consts { + t.Traverse(c) + } + t.visitor.Leave("Consts", false) + } case *ast.StmtClassExtends: - t.traverseSingle("ClassName", nn.ClassName) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.ClassName != nil { + t.visitor.Enter("ClassName", true) + t.Traverse(nn.ClassName) + t.visitor.Leave("ClassName", true) + } case *ast.StmtClassImplements: - t.traverseArray("InterfaceNames", nn.InterfaceNames) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.InterfaceNames != nil { + t.visitor.Enter("InterfaceNames", false) + for _, c := range nn.InterfaceNames { + t.Traverse(c) + } + t.visitor.Leave("InterfaceNames", false) + } case *ast.StmtClassMethod: - t.traverseSingle("MethodName", nn.MethodName) - t.traverseArray("Modifiers", nn.Modifiers) - t.traverseArray("Params", nn.Params) - t.traverseSingle("ReturnType", nn.ReturnType) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.MethodName != nil { + t.visitor.Enter("MethodName", true) + t.Traverse(nn.MethodName) + t.visitor.Leave("MethodName", true) + } + if nn.Modifiers != nil { + t.visitor.Enter("Modifiers", false) + for _, c := range nn.Modifiers { + t.Traverse(c) + } + t.visitor.Leave("Modifiers", false) + } + if nn.Params != nil { + t.visitor.Enter("Params", false) + for _, c := range nn.Params { + t.Traverse(c) + } + t.visitor.Leave("Params", false) + } + if nn.ReturnType != nil { + t.visitor.Enter("ReturnType", true) + t.Traverse(nn.ReturnType) + t.visitor.Leave("ReturnType", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtConstList: - t.traverseArray("Consts", nn.Consts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Consts != nil { + t.visitor.Enter("Consts", false) + for _, c := range nn.Consts { + t.Traverse(c) + } + t.visitor.Leave("Consts", false) + } case *ast.StmtConstant: - t.traverseSingle("ConstantName", nn.ConstantName) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.ConstantName != nil { + t.visitor.Enter("ConstantName", true) + t.Traverse(nn.ConstantName) + t.visitor.Leave("ConstantName", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtContinue: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtDeclare: - t.traverseArray("Consts", nn.Consts) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Consts != nil { + t.visitor.Enter("Consts", false) + for _, c := range nn.Consts { + t.Traverse(c) + } + t.visitor.Leave("Consts", false) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtDefault: - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtDo: - t.traverseSingle("Stmt", nn.Stmt) - t.traverseSingle("Cond", nn.Cond) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } case *ast.StmtEcho: - t.traverseArray("Exprs", nn.Exprs) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Exprs != nil { + t.visitor.Enter("Exprs", false) + for _, c := range nn.Exprs { + t.Traverse(c) + } + t.visitor.Leave("Exprs", false) + } case *ast.StmtElse: - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtElseIf: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtExpression: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtFinally: - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtFor: - t.traverseArray("Init", nn.Init) - t.traverseArray("Cond", nn.Cond) - t.traverseArray("Loop", nn.Loop) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Init != nil { + t.visitor.Enter("Init", false) + for _, c := range nn.Init { + t.Traverse(c) + } + t.visitor.Leave("Init", false) + } + if nn.Cond != nil { + t.visitor.Enter("Cond", false) + for _, c := range nn.Cond { + t.Traverse(c) + } + t.visitor.Leave("Cond", false) + } + if nn.Loop != nil { + t.visitor.Enter("Loop", false) + for _, c := range nn.Loop { + t.Traverse(c) + } + t.visitor.Leave("Loop", false) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtForeach: - t.traverseSingle("Expr", nn.Expr) - t.traverseSingle("Key", nn.Key) - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } + if nn.Key != nil { + t.visitor.Enter("Key", true) + t.Traverse(nn.Key) + t.visitor.Leave("Key", true) + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.StmtFunction: - t.traverseSingle("FunctionName", nn.FunctionName) - t.traverseArray("Params", nn.Params) - t.traverseSingle("ReturnType", nn.ReturnType) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.FunctionName != nil { + t.visitor.Enter("FunctionName", true) + t.Traverse(nn.FunctionName) + t.visitor.Leave("FunctionName", true) + } + if nn.Params != nil { + t.visitor.Enter("Params", false) + for _, c := range nn.Params { + t.Traverse(c) + } + t.visitor.Leave("Params", false) + } + if nn.ReturnType != nil { + t.visitor.Enter("ReturnType", true) + t.Traverse(nn.ReturnType) + t.visitor.Leave("ReturnType", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtGlobal: - t.traverseArray("Vars", nn.Vars) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Vars != nil { + t.visitor.Enter("Vars", false) + for _, c := range nn.Vars { + t.Traverse(c) + } + t.visitor.Leave("Vars", false) + } case *ast.StmtGoto: - t.traverseSingle("Label", nn.Label) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Label != nil { + t.visitor.Enter("Label", true) + t.Traverse(nn.Label) + t.visitor.Leave("Label", true) + } case *ast.StmtGroupUse: - t.traverseSingle("UseType", nn.UseType) - t.traverseSingle("Prefix", nn.Prefix) - t.traverseArray("UseList", nn.UseList) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.UseType != nil { + t.visitor.Enter("UseType", true) + t.Traverse(nn.UseType) + t.visitor.Leave("UseType", true) + } + if nn.Prefix != nil { + t.visitor.Enter("Prefix", true) + t.Traverse(nn.Prefix) + t.visitor.Leave("Prefix", true) + } + if nn.UseList != nil { + t.visitor.Enter("UseList", false) + for _, c := range nn.UseList { + t.Traverse(c) + } + t.visitor.Leave("UseList", false) + } case *ast.StmtHaltCompiler: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.StmtIf: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) - t.traverseArray("ElseIf", nn.ElseIf) - t.traverseSingle("Else", nn.Else) + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } + if nn.ElseIf != nil { + t.visitor.Enter("ElseIf", false) + for _, c := range nn.ElseIf { + t.Traverse(c) + } + t.visitor.Leave("ElseIf", false) + } + if nn.Else != nil { + t.visitor.Enter("Else", true) + t.Traverse(nn.Else) + t.visitor.Leave("Else", true) + } case *ast.StmtInlineHtml: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.StmtInterface: - t.traverseSingle("InterfaceName", nn.InterfaceName) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.InterfaceName != nil { + t.visitor.Enter("InterfaceName", true) + t.Traverse(nn.InterfaceName) + t.visitor.Leave("InterfaceName", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtInterfaceExtends: - t.traverseArray("InterfaceNames", nn.InterfaceNames) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.InterfaceNames != nil { + t.visitor.Enter("InterfaceNames", false) + for _, c := range nn.InterfaceNames { + t.Traverse(c) + } + t.visitor.Leave("InterfaceNames", false) + } case *ast.StmtLabel: - t.traverseSingle("LabelName", nn.LabelName) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.LabelName != nil { + t.visitor.Enter("LabelName", true) + t.Traverse(nn.LabelName) + t.visitor.Leave("LabelName", true) + } case *ast.StmtNamespace: - t.traverseSingle("NamespaceName", nn.NamespaceName) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.NamespaceName != nil { + t.visitor.Enter("NamespaceName", true) + t.Traverse(nn.NamespaceName) + t.visitor.Leave("NamespaceName", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtNop: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.StmtProperty: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtPropertyList: - t.traverseArray("Modifiers", nn.Modifiers) - t.traverseSingle("Type", nn.Type) - t.traverseArray("Properties", nn.Properties) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Modifiers != nil { + t.visitor.Enter("Modifiers", false) + for _, c := range nn.Modifiers { + t.Traverse(c) + } + t.visitor.Leave("Modifiers", false) + } + if nn.Type != nil { + t.visitor.Enter("Type", true) + t.Traverse(nn.Type) + t.visitor.Leave("Type", true) + } + if nn.Properties != nil { + t.visitor.Enter("Properties", false) + for _, c := range nn.Properties { + t.Traverse(c) + } + t.visitor.Leave("Properties", false) + } case *ast.StmtReturn: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtStatic: - t.traverseArray("Vars", nn.Vars) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Vars != nil { + t.visitor.Enter("Vars", false) + for _, c := range nn.Vars { + t.Traverse(c) + } + t.visitor.Leave("Vars", false) + } case *ast.StmtStaticVar: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtStmtList: - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtSwitch: - t.traverseSingle("Cond", nn.Cond) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } case *ast.StmtThrow: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.StmtTrait: - t.traverseSingle("TraitName", nn.TraitName) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.TraitName != nil { + t.visitor.Enter("TraitName", true) + t.Traverse(nn.TraitName) + t.visitor.Leave("TraitName", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.StmtTraitAdaptationList: - t.traverseArray("Adaptations", nn.Adaptations) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Adaptations != nil { + t.visitor.Enter("Adaptations", false) + for _, c := range nn.Adaptations { + t.Traverse(c) + } + t.visitor.Leave("Adaptations", false) + } case *ast.StmtTraitMethodRef: - t.traverseSingle("Trait", nn.Trait) - t.traverseSingle("Method", nn.Method) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Trait != nil { + t.visitor.Enter("Trait", true) + t.Traverse(nn.Trait) + t.visitor.Leave("Trait", true) + } + if nn.Method != nil { + t.visitor.Enter("Method", true) + t.Traverse(nn.Method) + t.visitor.Leave("Method", true) + } case *ast.StmtTraitUse: - t.traverseArray("Traits", nn.Traits) - t.traverseSingle("TraitAdaptationList", nn.TraitAdaptationList) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Traits != nil { + t.visitor.Enter("Traits", false) + for _, c := range nn.Traits { + t.Traverse(c) + } + t.visitor.Leave("Traits", false) + } + if nn.TraitAdaptationList != nil { + t.visitor.Enter("TraitAdaptationList", true) + t.Traverse(nn.TraitAdaptationList) + t.visitor.Leave("TraitAdaptationList", true) + } case *ast.StmtTraitUseAlias: - t.traverseSingle("Ref", nn.Ref) - t.traverseSingle("Modifier", nn.Modifier) - t.traverseSingle("Alias", nn.Alias) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Ref != nil { + t.visitor.Enter("Ref", true) + t.Traverse(nn.Ref) + t.visitor.Leave("Ref", true) + } + if nn.Modifier != nil { + t.visitor.Enter("Modifier", true) + t.Traverse(nn.Modifier) + t.visitor.Leave("Modifier", true) + } + if nn.Alias != nil { + t.visitor.Enter("Alias", true) + t.Traverse(nn.Alias) + t.visitor.Leave("Alias", true) + } case *ast.StmtTraitUsePrecedence: - t.traverseSingle("Ref", nn.Ref) - t.traverseArray("Insteadof", nn.Insteadof) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Ref != nil { + t.visitor.Enter("Ref", true) + t.Traverse(nn.Ref) + t.visitor.Leave("Ref", true) + } + if nn.Insteadof != nil { + t.visitor.Enter("Insteadof", false) + for _, c := range nn.Insteadof { + t.Traverse(c) + } + t.visitor.Leave("Insteadof", false) + } case *ast.StmtTry: - t.traverseArray("Stmts", nn.Stmts) - t.traverseArray("Catches", nn.Catches) - t.traverseSingle("Finally", nn.Finally) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } + if nn.Catches != nil { + t.visitor.Enter("Catches", false) + for _, c := range nn.Catches { + t.Traverse(c) + } + t.visitor.Leave("Catches", false) + } + if nn.Finally != nil { + t.visitor.Enter("Finally", true) + t.Traverse(nn.Finally) + t.visitor.Leave("Finally", true) + } case *ast.StmtUnset: - t.traverseArray("Vars", nn.Vars) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Vars != nil { + t.visitor.Enter("Vars", false) + for _, c := range nn.Vars { + t.Traverse(c) + } + t.visitor.Leave("Vars", false) + } case *ast.StmtUse: - t.traverseSingle("UseType", nn.UseType) - t.traverseSingle("Use", nn.Use) - t.traverseSingle("Alias", nn.Alias) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.UseType != nil { + t.visitor.Enter("UseType", true) + t.Traverse(nn.UseType) + t.visitor.Leave("UseType", true) + } + if nn.Use != nil { + t.visitor.Enter("Use", true) + t.Traverse(nn.Use) + t.visitor.Leave("Use", true) + } + if nn.Alias != nil { + t.visitor.Enter("Alias", true) + t.Traverse(nn.Alias) + t.visitor.Leave("Alias", true) + } case *ast.StmtUseList: - t.traverseSingle("UseType", nn.UseType) - t.traverseArray("Uses", nn.Uses) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.UseType != nil { + t.visitor.Enter("UseType", true) + t.Traverse(nn.UseType) + t.visitor.Leave("UseType", true) + } + if nn.Uses != nil { + t.visitor.Enter("Uses", false) + for _, c := range nn.Uses { + t.Traverse(c) + } + t.visitor.Leave("Uses", false) + } case *ast.StmtWhile: - t.traverseSingle("Cond", nn.Cond) - t.traverseSingle("Stmt", nn.Stmt) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Cond != nil { + t.visitor.Enter("Cond", true) + t.Traverse(nn.Cond) + t.visitor.Leave("Cond", true) + } + if nn.Stmt != nil { + t.visitor.Enter("Stmt", true) + t.Traverse(nn.Stmt) + t.visitor.Leave("Stmt", true) + } case *ast.ExprArray: - t.traverseArray("Items", nn.Items) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Items != nil { + t.visitor.Enter("Items", false) + for _, c := range nn.Items { + t.Traverse(c) + } + t.visitor.Leave("Items", false) + } case *ast.ExprArrayDimFetch: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Dim", nn.Dim) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Dim != nil { + t.visitor.Enter("Dim", true) + t.Traverse(nn.Dim) + t.visitor.Leave("Dim", true) + } case *ast.ExprArrayItem: - t.traverseSingle("Key", nn.Key) - t.traverseSingle("Val", nn.Val) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Key != nil { + t.visitor.Enter("Key", true) + t.Traverse(nn.Key) + t.visitor.Leave("Key", true) + } + if nn.Val != nil { + t.visitor.Enter("Val", true) + t.Traverse(nn.Val) + t.visitor.Leave("Val", true) + } case *ast.ExprArrowFunction: - t.traverseArray("Params", nn.Params) - t.traverseSingle("ReturnType", nn.ReturnType) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Params != nil { + t.visitor.Enter("Params", false) + for _, c := range nn.Params { + t.Traverse(c) + } + t.visitor.Leave("Params", false) + } + if nn.ReturnType != nil { + t.visitor.Enter("ReturnType", true) + t.Traverse(nn.ReturnType) + t.visitor.Leave("ReturnType", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprBitwiseNot: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprBooleanNot: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprClassConstFetch: - t.traverseSingle("Class", nn.Class) - t.traverseSingle("ConstantName", nn.ConstantName) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Class != nil { + t.visitor.Enter("Class", true) + t.Traverse(nn.Class) + t.visitor.Leave("Class", true) + } + if nn.ConstantName != nil { + t.visitor.Enter("ConstantName", true) + t.Traverse(nn.ConstantName) + t.visitor.Leave("ConstantName", true) + } case *ast.ExprClone: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprClosure: - t.traverseArray("Params", nn.Params) - t.traverseSingle("ClosureUse", nn.ClosureUse) - t.traverseSingle("ReturnType", nn.ReturnType) - t.traverseArray("Stmts", nn.Stmts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Params != nil { + t.visitor.Enter("Params", false) + for _, c := range nn.Params { + t.Traverse(c) + } + t.visitor.Leave("Params", false) + } + if nn.ClosureUse != nil { + t.visitor.Enter("ClosureUse", true) + t.Traverse(nn.ClosureUse) + t.visitor.Leave("ClosureUse", true) + } + if nn.ReturnType != nil { + t.visitor.Enter("ReturnType", true) + t.Traverse(nn.ReturnType) + t.visitor.Leave("ReturnType", true) + } + if nn.Stmts != nil { + t.visitor.Enter("Stmts", false) + for _, c := range nn.Stmts { + t.Traverse(c) + } + t.visitor.Leave("Stmts", false) + } case *ast.ExprClosureUse: - t.traverseArray("Uses", nn.Uses) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Uses != nil { + t.visitor.Enter("Uses", false) + for _, c := range nn.Uses { + t.Traverse(c) + } + t.visitor.Leave("Uses", false) + } case *ast.ExprConstFetch: - t.traverseSingle("Const", nn.Const) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Const != nil { + t.visitor.Enter("Const", true) + t.Traverse(nn.Const) + t.visitor.Leave("Const", true) + } case *ast.ExprEmpty: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprErrorSuppress: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprEval: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprExit: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprFunctionCall: - t.traverseSingle("Function", nn.Function) - t.traverseSingle("ArgumentList", nn.ArgumentList) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Function != nil { + t.visitor.Enter("Function", true) + t.Traverse(nn.Function) + t.visitor.Leave("Function", true) + } + if nn.ArgumentList != nil { + t.visitor.Enter("ArgumentList", true) + t.Traverse(nn.ArgumentList) + t.visitor.Leave("ArgumentList", true) + } case *ast.ExprInclude: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprIncludeOnce: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprInstanceOf: - t.traverseSingle("Expr", nn.Expr) - t.traverseSingle("Class", nn.Class) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } + if nn.Class != nil { + t.visitor.Enter("Class", true) + t.Traverse(nn.Class) + t.visitor.Leave("Class", true) + } case *ast.ExprIsset: - t.traverseArray("Vars", nn.Vars) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Vars != nil { + t.visitor.Enter("Vars", false) + for _, c := range nn.Vars { + t.Traverse(c) + } + t.visitor.Leave("Vars", false) + } case *ast.ExprList: - t.traverseArray("Items", nn.Items) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Items != nil { + t.visitor.Enter("Items", false) + for _, c := range nn.Items { + t.Traverse(c) + } + t.visitor.Leave("Items", false) + } case *ast.ExprMethodCall: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Method", nn.Method) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Method != nil { + t.visitor.Enter("Method", true) + t.Traverse(nn.Method) + t.visitor.Leave("Method", true) + } case *ast.ExprNew: - t.traverseSingle("Class", nn.Class) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Class != nil { + t.visitor.Enter("Class", true) + t.Traverse(nn.Class) + t.visitor.Leave("Class", true) + } case *ast.ExprPostDec: - t.traverseSingle("Var", nn.Var) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ExprPostInc: - t.traverseSingle("Var", nn.Var) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ExprPreDec: - t.traverseSingle("Var", nn.Var) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ExprPreInc: - t.traverseSingle("Var", nn.Var) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ExprPrint: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprPropertyFetch: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Property", nn.Property) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Property != nil { + t.visitor.Enter("Property", true) + t.Traverse(nn.Property) + t.visitor.Leave("Property", true) + } case *ast.ExprReference: - t.traverseSingle("Var", nn.Var) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ExprRequire: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprRequireOnce: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprShellExec: - t.traverseArray("Parts", nn.Parts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } case *ast.ExprShortArray: - t.traverseArray("Items", nn.Items) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Items != nil { + t.visitor.Enter("Items", false) + for _, c := range nn.Items { + t.Traverse(c) + } + t.visitor.Leave("Items", false) + } case *ast.ExprShortList: - t.traverseArray("Items", nn.Items) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Items != nil { + t.visitor.Enter("Items", false) + for _, c := range nn.Items { + t.Traverse(c) + } + t.visitor.Leave("Items", false) + } case *ast.ExprStaticCall: - t.traverseSingle("Class", nn.Class) - t.traverseSingle("Call", nn.Call) - t.traverseSingle("ArgumentList", nn.ArgumentList) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Class != nil { + t.visitor.Enter("Class", true) + t.Traverse(nn.Class) + t.visitor.Leave("Class", true) + } + if nn.Call != nil { + t.visitor.Enter("Call", true) + t.Traverse(nn.Call) + t.visitor.Leave("Call", true) + } + if nn.ArgumentList != nil { + t.visitor.Enter("ArgumentList", true) + t.Traverse(nn.ArgumentList) + t.visitor.Leave("ArgumentList", true) + } case *ast.ExprStaticPropertyFetch: - t.traverseSingle("Class", nn.Class) - t.traverseSingle("Property", nn.Property) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Class != nil { + t.visitor.Enter("Class", true) + t.Traverse(nn.Class) + t.visitor.Leave("Class", true) + } + if nn.Property != nil { + t.visitor.Enter("Property", true) + t.Traverse(nn.Property) + t.visitor.Leave("Property", true) + } case *ast.ExprTernary: - t.traverseSingle("Condition", nn.Condition) - t.traverseSingle("IfTrue", nn.IfTrue) - t.traverseSingle("IfFalse", nn.IfFalse) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Condition != nil { + t.visitor.Enter("Condition", true) + t.Traverse(nn.Condition) + t.visitor.Leave("Condition", true) + } + if nn.IfTrue != nil { + t.visitor.Enter("IfTrue", true) + t.Traverse(nn.IfTrue) + t.visitor.Leave("IfTrue", true) + } + if nn.IfFalse != nil { + t.visitor.Enter("IfFalse", true) + t.Traverse(nn.IfFalse) + t.visitor.Leave("IfFalse", true) + } case *ast.ExprUnaryMinus: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprUnaryPlus: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprVariable: - t.traverseSingle("VarName", nn.VarName) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.VarName != nil { + t.visitor.Enter("VarName", true) + t.Traverse(nn.VarName) + t.visitor.Leave("VarName", true) + } case *ast.ExprYield: - t.traverseSingle("Key", nn.Key) - t.traverseSingle("Value", nn.Value) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Key != nil { + t.visitor.Enter("Key", true) + t.Traverse(nn.Key) + t.visitor.Leave("Key", true) + } + if nn.Value != nil { + t.visitor.Enter("Value", true) + t.Traverse(nn.Value) + t.visitor.Leave("Value", true) + } case *ast.ExprYieldFrom: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssign: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignReference: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignBitwiseAnd: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignBitwiseOr: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignBitwiseXor: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignCoalesce: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignConcat: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignDiv: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignMinus: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignMod: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignMul: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignPlus: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignPow: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignShiftLeft: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprAssignShiftRight: - t.traverseSingle("Var", nn.Var) - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprBinaryBitwiseAnd: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryBitwiseOr: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryBitwiseXor: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryBooleanAnd: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryBooleanOr: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryCoalesce: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryConcat: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryDiv: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryEqual: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryGreater: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryGreaterOrEqual: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryIdentical: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryLogicalAnd: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryLogicalOr: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryLogicalXor: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryMinus: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryMod: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryMul: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryNotEqual: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryNotIdentical: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryPlus: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryPow: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryShiftLeft: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinaryShiftRight: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinarySmaller: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinarySmallerOrEqual: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprBinarySpaceship: - t.traverseSingle("Left", nn.Left) - t.traverseSingle("Right", nn.Right) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Left != nil { + t.visitor.Enter("Left", true) + t.Traverse(nn.Left) + t.visitor.Leave("Left", true) + } + if nn.Right != nil { + t.visitor.Enter("Right", true) + t.Traverse(nn.Right) + t.visitor.Leave("Right", true) + } case *ast.ExprCastArray: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastBool: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastDouble: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastInt: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastObject: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastString: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ExprCastUnset: - t.traverseSingle("Expr", nn.Expr) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Expr != nil { + t.visitor.Enter("Expr", true) + t.Traverse(nn.Expr) + t.visitor.Leave("Expr", true) + } case *ast.ScalarDnumber: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.ScalarEncapsed: - t.traverseArray("Parts", nn.Parts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } case *ast.ScalarEncapsedStringPart: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.ScalarHeredoc: - t.traverseArray("Parts", nn.Parts) + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } case *ast.ScalarLnumber: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.ScalarMagicConstant: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } case *ast.ScalarString: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + default: + panic("unexpected type of node") } t.visitor.LeaveNode(n) } - -func (t *DFS) traverseSingle(key string, n ast.Vertex) { - if n == nil { - return - } - - t.visitor.Enter(key, true) - t.Traverse(n) - t.visitor.Leave(key, true) -} - -func (t *DFS) traverseArray(key string, nn []ast.Vertex) { - if nn == nil { - return - } - - t.visitor.Enter(key, false) - for _, c := range nn { - t.Traverse(c) - } - t.visitor.Leave(key, false) -} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index a000a59..9d4c316 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -117,7 +117,7 @@ func (v *Dump) Identifier(n *ast.Identifier) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Identifier{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -335,7 +335,7 @@ func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInlineHtml{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -953,7 +953,7 @@ func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarDnumber{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -966,7 +966,7 @@ func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsedStringPart{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -974,7 +974,7 @@ func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarHeredoc{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Label: %q,\n", n.Label)) } @@ -982,7 +982,7 @@ func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarLnumber{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -990,7 +990,7 @@ func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarMagicConstant{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } @@ -998,6 +998,29 @@ func (v *Dump) ScalarString(n *ast.ScalarString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarString{\n") - v.printIndentIfNotSingle(v.indent) + v.printIndent(v.indent) + v.print(fmt.Sprintf("Value: %q,\n", n.Value)) +} + +func (v *Dump) NameName(_ *ast.NameName) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.NameName{\n") +} + +func (v *Dump) NameFullyQualified(_ *ast.NameFullyQualified) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.NameFullyQualified{\n") +} + +func (v *Dump) NameRelative(_ *ast.NameRelative) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.NameRelative{\n") +} + +func (v *Dump) NameNamePart(n *ast.NameNamePart) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.NameNamePart{\n") + + v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) } diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index b1f5153..3d68a0d 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -16,7 +16,7 @@ func ExampleDump() { Var: &ast.ExprVariable{}, }, &ast.StmtInlineHtml{ - Value: "foo", + Value: []byte("foo"), }, }, } diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go new file mode 100644 index 0000000..f79378c --- /dev/null +++ b/pkg/ast/visitor/namespace_resolver.go @@ -0,0 +1,399 @@ +// Package visitor contains walker.visitor implementations +package visitor + +import ( + "errors" + "github.com/z7zmey/php-parser/pkg/ast" + "strings" +) + +// NamespaceResolver visitor +type NamespaceResolver struct { + Null + Namespace *Namespace + ResolvedNames map[ast.Vertex]string + + goDeep bool +} + +// NewNamespaceResolver NamespaceResolver type constructor +func NewNamespaceResolver() *NamespaceResolver { + return &NamespaceResolver{ + Namespace: NewNamespace(""), + ResolvedNames: map[ast.Vertex]string{}, + goDeep: true, + } +} + +func (nsr *NamespaceResolver) EnterNode(n ast.Vertex) bool { + n.Accept(nsr) + + if !nsr.goDeep { + nsr.goDeep = true + return false + } + + return true +} + +func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) { + if n.NamespaceName == nil { + nsr.Namespace = NewNamespace("") + } else { + NSParts := n.NamespaceName.(*ast.NameName).Parts + nsr.Namespace = NewNamespace(concatNameParts(NSParts)) + } +} + +func (nsr *NamespaceResolver) StmtUseList(n *ast.StmtUseList) { + useType := "" + if n.UseType != nil { + useType = string(n.UseType.(*ast.Identifier).Value) + } + + for _, nn := range n.Uses { + nsr.AddAlias(useType, nn, nil) + } + + nsr.goDeep = false +} + +func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { + useType := "" + if n.UseType != nil { + useType = string(n.UseType.(*ast.Identifier).Value) + } + + for _, nn := range n.UseList { + nsr.AddAlias(useType, nn, n.Prefix.(*ast.NameName).Parts) + } + + nsr.goDeep = false +} + +func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { + if n.Extends != nil { + nsr.ResolveName(n.Extends.ClassName, "") + } + + if n.Implements != nil { + for _, interfaceName := range n.Implements.InterfaceNames { + nsr.ResolveName(interfaceName, "") + } + } + + if n.ClassName != nil { + nsr.AddNamespacedName(n, string(n.ClassName.(*ast.Identifier).Value)) + } +} + +func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface) { + if n.Extends != nil { + for _, interfaceName := range n.Extends.InterfaceNames { + nsr.ResolveName(interfaceName, "") + } + } + + nsr.AddNamespacedName(n, string(n.InterfaceName.(*ast.Identifier).Value)) +} + +func (nsr *NamespaceResolver) StmtTrait(n *ast.StmtTrait) { + nsr.AddNamespacedName(n, string(n.TraitName.(*ast.Identifier).Value)) +} + +func (nsr *NamespaceResolver) StmtFunction(n *ast.StmtFunction) { + nsr.AddNamespacedName(n, string(n.FunctionName.(*ast.Identifier).Value)) + + for _, parameter := range n.Params { + nsr.ResolveType(parameter.(*ast.Parameter).Type) + } + + if n.ReturnType != nil { + nsr.ResolveType(n.ReturnType) + } +} + +func (nsr *NamespaceResolver) StmtClassMethod(n *ast.StmtClassMethod) { + for _, parameter := range n.Params { + nsr.ResolveType(parameter.(*ast.Parameter).Type) + } + + if n.ReturnType != nil { + nsr.ResolveType(n.ReturnType) + } +} + +func (nsr *NamespaceResolver) ExprClosure(n *ast.ExprClosure) { + for _, parameter := range n.Params { + nsr.ResolveType(parameter.(*ast.Parameter).Type) + } + + if n.ReturnType != nil { + nsr.ResolveType(n.ReturnType) + } +} + +func (nsr *NamespaceResolver) StmtConstList(n *ast.StmtConstList) { + for _, constant := range n.Consts { + nsr.AddNamespacedName(constant, string(constant.(*ast.StmtConstant).ConstantName.(*ast.Identifier).Value)) + } +} + +func (nsr *NamespaceResolver) ExprStaticCall(n *ast.ExprStaticCall) { + nsr.ResolveName(n.Class, "") +} + +func (nsr *NamespaceResolver) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { + nsr.ResolveName(n.Class, "") +} + +func (nsr *NamespaceResolver) ExprClassConstFetch(n *ast.ExprClassConstFetch) { + nsr.ResolveName(n.Class, "") +} + +func (nsr *NamespaceResolver) ExprNew(n *ast.ExprNew) { + nsr.ResolveName(n.Class, "") +} + +func (nsr *NamespaceResolver) ExprInstanceOf(n *ast.ExprInstanceOf) { + nsr.ResolveName(n.Class, "") +} + +func (nsr *NamespaceResolver) StmtCatch(n *ast.StmtCatch) { + for _, t := range n.Types { + nsr.ResolveName(t, "") + } +} + +func (nsr *NamespaceResolver) ExprFunctionCall(n *ast.ExprFunctionCall) { + nsr.ResolveName(n.Function, "function") +} + +func (nsr *NamespaceResolver) ExprConstFetch(n *ast.ExprConstFetch) { + nsr.ResolveName(n.Const, "const") +} + +func (nsr *NamespaceResolver) StmtTraitUse(n *ast.StmtTraitUse) { + for _, t := range n.Traits { + nsr.ResolveName(t, "") + } + + if adaptationList, ok := n.TraitAdaptationList.(*ast.StmtTraitAdaptationList); ok { + for _, a := range adaptationList.Adaptations { + switch aa := a.(type) { + case *ast.StmtTraitUsePrecedence: + refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait + if refTrait != nil { + nsr.ResolveName(refTrait, "") + } + for _, insteadOf := range aa.Insteadof { + nsr.ResolveName(insteadOf, "") + } + + case *ast.StmtTraitUseAlias: + refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait + if refTrait != nil { + nsr.ResolveName(refTrait, "") + } + } + } + } +} + +// LeaveNode is invoked after node process +func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex) { + switch nn := n.(type) { + case *ast.StmtNamespace: + if nn.Stmts != nil { + nsr.Namespace = NewNamespace("") + } + } +} + +// AddAlias adds a new alias +func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex) { + switch use := nn.(type) { + case *ast.StmtUse: + if use.UseType != nil { + useType = string(use.UseType.(*ast.Identifier).Value) + } + + useNameParts := use.Use.(*ast.NameName).Parts + var alias string + if use.Alias == nil { + alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) + } else { + alias = string(use.Alias.(*ast.Identifier).Value) + } + + nsr.Namespace.AddAlias(useType, concatNameParts(prefix, useNameParts), alias) + } +} + +// AddNamespacedName adds namespaced name by node +func (nsr *NamespaceResolver) AddNamespacedName(nn ast.Vertex, nodeName string) { + if nsr.Namespace.Namespace == "" { + nsr.ResolvedNames[nn] = nodeName + } else { + nsr.ResolvedNames[nn] = nsr.Namespace.Namespace + "\\" + nodeName + } +} + +// ResolveName adds a resolved fully qualified name by node +func (nsr *NamespaceResolver) ResolveName(nameNode ast.Vertex, aliasType string) { + resolved, err := nsr.Namespace.ResolveName(nameNode, aliasType) + if err == nil { + nsr.ResolvedNames[nameNode] = resolved + } +} + +// ResolveType adds a resolved fully qualified type name +func (nsr *NamespaceResolver) ResolveType(n ast.Vertex) { + switch nn := n.(type) { + case *ast.Nullable: + nsr.ResolveType(nn.Expr) + case *ast.NameName: + nsr.ResolveName(n, "") + case *ast.NameRelative: + nsr.ResolveName(n, "") + case *ast.NameFullyQualified: + nsr.ResolveName(n, "") + } +} + +// Namespace context +type Namespace struct { + Namespace string + Aliases map[string]map[string]string +} + +// NewNamespace constructor +func NewNamespace(NSName string) *Namespace { + return &Namespace{ + Namespace: NSName, + Aliases: map[string]map[string]string{ + "": {}, + "const": {}, + "function": {}, + }, + } +} + +// AddAlias adds a new alias +func (ns *Namespace) AddAlias(aliasType string, aliasName string, alias string) { + aliasType = strings.ToLower(aliasType) + + if aliasType == "const" { + ns.Aliases[aliasType][alias] = aliasName + } else { + ns.Aliases[aliasType][strings.ToLower(alias)] = aliasName + } +} + +// ResolveName returns a resolved fully qualified name +func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string, error) { + switch n := nameNode.(type) { + case *ast.NameFullyQualified: + // Fully qualifid name is already resolved + return concatNameParts(n.Parts), nil + + case *ast.NameRelative: + if ns.Namespace == "" { + return concatNameParts(n.Parts), nil + } + return ns.Namespace + "\\" + concatNameParts(n.Parts), nil + + case *ast.NameName: + if aliasType == "const" && len(n.Parts) == 1 { + part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value)) + if part == "true" || part == "false" || part == "null" { + return part, nil + } + } + + if aliasType == "" && len(n.Parts) == 1 { + part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value)) + + switch part { + case "self": + fallthrough + case "static": + fallthrough + case "parent": + fallthrough + case "int": + fallthrough + case "float": + fallthrough + case "bool": + fallthrough + case "string": + fallthrough + case "void": + fallthrough + case "iterable": + fallthrough + case "object": + return part, nil + } + } + + aliasName, err := ns.ResolveAlias(nameNode, aliasType) + if err != nil { + // resolve as relative name if alias not found + if ns.Namespace == "" { + return concatNameParts(n.Parts), nil + } + return ns.Namespace + "\\" + concatNameParts(n.Parts), nil + } + + if len(n.Parts) > 1 { + // if name qualified, replace first part by alias + return aliasName + "\\" + concatNameParts(n.Parts[1:]), nil + } + + return aliasName, nil + } + + return "", errors.New("must be instance of name.Names") +} + +// ResolveAlias returns alias or error if not found +func (ns *Namespace) ResolveAlias(nameNode ast.Vertex, aliasType string) (string, error) { + aliasType = strings.ToLower(aliasType) + nameParts := nameNode.(*ast.NameName).Parts + + firstPartStr := string(nameParts[0].(*ast.NameNamePart).Value) + + if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type + firstPartStr = strings.ToLower(firstPartStr) + aliasType = "" + } else { + if aliasType != "const" { // constants are case-sensitive + firstPartStr = strings.ToLower(firstPartStr) + } + } + + aliasName, ok := ns.Aliases[aliasType][firstPartStr] + if !ok { + return "", errors.New("Not found") + } + + return aliasName, nil +} + +func concatNameParts(parts ...[]ast.Vertex) string { + str := "" + + for _, p := range parts { + for _, n := range p { + if str == "" { + str = string(n.(*ast.NameNamePart).Value) + } else { + str = str + "\\" + string(n.(*ast.NameNamePart).Value) + } + } + } + + return str +} diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go new file mode 100644 index 0000000..61ed537 --- /dev/null +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -0,0 +1,986 @@ +package visitor_test + +import ( + "testing" + + "gotest.tools/assert" + + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/ast/traverser" + "github.com/z7zmey/php-parser/pkg/ast/visitor" +) + +func TestResolveStaticCall(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprStaticCall{ + Class: nameBC, + Call: &ast.Identifier{Value: []byte("foo")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveStaticPropertyFetch(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprStaticPropertyFetch{ + Class: nameBC, + Property: &ast.Identifier{Value: []byte("foo")}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveClassConstFetch(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprClassConstFetch{ + Class: nameBC, + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveNew(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprNew{ + Class: nameBC, + ArgumentList: &ast.ArgumentList{}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveInstanceOf(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprInstanceOf{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Class: nameBC, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveInstanceCatch(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + nameDE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}, &ast.NameNamePart{Value: []byte("E")}}} + nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + &ast.StmtUse{ + Use: nameDE, + Alias: &ast.Identifier{Value: []byte("F")}, + }, + }, + }, + &ast.StmtTry{ + Stmts: []ast.Vertex{}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Types: []ast.Vertex{ + nameBC, + nameF, + }, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameBC: "A\\B\\C", + nameF: "D\\E", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveFunctionCall(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + UseType: &ast.Identifier{Value: []byte("function")}, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprFunctionCall{ + Function: nameB, + ArgumentList: &ast.ArgumentList{}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameB: "A\\B", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveConstFetch(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + UseType: &ast.Identifier{Value: []byte("const")}, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.ExprConstFetch{ + Const: nameB, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameB: "A\\B", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveGroupUse(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("D")}}} + nameE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("E")}}} + nameC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}}} + nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtGroupUse{ + Prefix: nameAB, + UseList: []ast.Vertex{ + &ast.StmtUse{ + UseType: &ast.Identifier{Value: []byte("Function")}, + Use: nameF, + }, + &ast.StmtUse{ + UseType: &ast.Identifier{Value: []byte("const")}, + Use: nameC, + }, + }, + }, + &ast.StmtGroupUse{ + Prefix: nameBD, + UseType: &ast.Identifier{Value: []byte("Function")}, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Use: nameE, + }, + }, + }, + &ast.ExprConstFetch{ + Const: nameC, + }, + &ast.ExprFunctionCall{ + Function: nameF, + ArgumentList: &ast.ArgumentList{}, + }, + &ast.ExprFunctionCall{ + Function: nameE, + ArgumentList: &ast.ArgumentList{}, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameC: "A\\B\\C", + nameF: "A\\B\\F", + nameE: "B\\D\\E", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveTraitUse(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + nameD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}}} + + fullyQualifiedNameB := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + fullyQualifiedNameBC := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + relativeNameB := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + relativeNameBC := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAB, + }, + }, + }, + &ast.StmtTraitUse{ + Traits: []ast.Vertex{ + nameB, + relativeNameB, + }, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Ref: &ast.StmtTraitMethodRef{ + Trait: fullyQualifiedNameB, + Method: &ast.Identifier{Value: []byte("foo")}, + }, + Insteadof: []ast.Vertex{fullyQualifiedNameBC}, + }, + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: relativeNameBC, + Method: &ast.Identifier{Value: []byte("foo")}, + }, + Alias: &ast.Identifier{Value: []byte("bar")}, + }, + }, + }, + }, + &ast.StmtTraitUse{ + Traits: []ast.Vertex{ + nameD, + }, + }, + }, + } + + expected := map[ast.Vertex]string{ + nameB: "A\\B", + nameD: "D", + relativeNameB: "B", + fullyQualifiedNameB: "B", + fullyQualifiedNameBC: "B\\C", + relativeNameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveClassName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + class := &ast.StmtClass{ + ClassName: &ast.Identifier{Value: []byte("A")}, + Extends: &ast.StmtClassExtends{ + ClassName: nameAB, + }, + Implements: &ast.StmtClassImplements{ + InterfaceNames: []ast.Vertex{ + nameBC, + }, + }, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + class, + }, + } + + expected := map[ast.Vertex]string{ + class: "A", + nameAB: "A\\B", + nameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveInterfaceName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + interfaceNode := &ast.StmtInterface{ + InterfaceName: &ast.Identifier{Value: []byte("A")}, + Extends: &ast.StmtInterfaceExtends{ + InterfaceNames: []ast.Vertex{ + nameAB, + nameBC, + }, + }, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + interfaceNode, + }, + } + + expected := map[ast.Vertex]string{ + interfaceNode: "A", + nameAB: "A\\B", + nameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveTraitName(t *testing.T) { + traitNode := &ast.StmtTrait{ + TraitName: &ast.Identifier{Value: []byte("A")}, + Stmts: []ast.Vertex{}, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + traitNode, + }, + } + + expected := map[ast.Vertex]string{ + traitNode: "A", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveFunctionName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + functionNode := &ast.StmtFunction{ + ReturnsRef: false, + FunctionName: &ast.Identifier{Value: []byte("A")}, + Params: []ast.Vertex{ + &ast.Parameter{ + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + }, + }, + ReturnType: &ast.Nullable{Expr: nameBC}, + Stmts: []ast.Vertex{}, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + functionNode, + }, + } + + expected := map[ast.Vertex]string{ + functionNode: "A", + nameAB: "A\\B", + nameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveMethodName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + methodNode := &ast.StmtClassMethod{ + ReturnsRef: false, + MethodName: &ast.Identifier{Value: []byte("A")}, + Params: []ast.Vertex{ + &ast.Parameter{ + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + }, + }, + ReturnType: &ast.Nullable{Expr: nameBC}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{}, + }, + } + + expected := map[ast.Vertex]string{ + nameAB: "A\\B", + nameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(methodNode) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveClosureName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + + closureNode := &ast.ExprClosure{ + ReturnsRef: false, + Static: false, + Params: []ast.Vertex{ + &ast.Parameter{ + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + }, + }, + ClosureUse: nil, + ReturnType: &ast.Nullable{Expr: nameBC}, + Stmts: []ast.Vertex{}, + } + + expected := map[ast.Vertex]string{ + nameAB: "A\\B", + nameBC: "B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(closureNode) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveConstantsName(t *testing.T) { + nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + + constantB := &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, + } + constantC := &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: nameAB, + }, + &ast.StmtConstList{ + Consts: []ast.Vertex{ + constantB, + constantC, + }, + }, + }, + } + + expected := map[ast.Vertex]string{ + constantB: "A\\B\\B", + constantC: "A\\B\\C", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveNamespaces(t *testing.T) { + namespaceAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + namespaceCD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("D")}}} + + nameAC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("C")}}} + nameCF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("F")}}} + nameFG := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}, &ast.NameNamePart{Value: []byte("G")}}} + relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("E")}}} + + constantB := &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, + } + constantC := &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: namespaceAB, + }, + &ast.StmtConstList{ + Consts: []ast.Vertex{ + constantB, + constantC, + }, + }, + &ast.ExprStaticCall{ + Class: nameFG, + Call: &ast.Identifier{Value: []byte("foo")}, + ArgumentList: &ast.ArgumentList{}, + }, + &ast.StmtNamespace{ + Stmts: []ast.Vertex{}, + }, + &ast.StmtNamespace{ + NamespaceName: namespaceCD, + Stmts: []ast.Vertex{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: nameAC, + }, + }, + }, + &ast.ExprStaticCall{ + Class: relativeNameCE, + Call: &ast.Identifier{Value: []byte("foo")}, + ArgumentList: &ast.ArgumentList{}, + }, + &ast.ExprStaticCall{ + Class: nameCF, + Call: &ast.Identifier{Value: []byte("foo")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + }, + }, + } + + expected := map[ast.Vertex]string{ + constantB: "A\\B\\B", + constantC: "A\\B\\C", + nameFG: "A\\B\\F\\G", + relativeNameCE: "C\\D\\C\\E", + nameCF: "A\\C\\F", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestResolveStaticCallDinamicClassName(t *testing.T) { + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.ExprStaticCall{ + Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Call: &ast.Identifier{Value: []byte("foo")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + } + + expected := map[ast.Vertex]string{} + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestDoNotResolveReservedConstants(t *testing.T) { + namespaceName := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}} + + constantTrue := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("True")}, + }, + } + + constantFalse := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("False")}, + }, + } + + constantNull := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("NULL")}, + }, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: namespaceName, + }, + &ast.StmtExpression{ + Expr: &ast.ExprConstFetch{ + Const: constantTrue, + }, + }, + &ast.StmtExpression{ + Expr: &ast.ExprConstFetch{ + Const: constantFalse, + }, + }, + &ast.StmtExpression{ + Expr: &ast.ExprConstFetch{ + Const: constantNull, + }, + }, + }, + } + + expected := map[ast.Vertex]string{ + constantTrue: "true", + constantFalse: "false", + constantNull: "null", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestDoNotResolveReservedNames(t *testing.T) { + + nameInt := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("int")}, + }, + } + + nameFloat := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("float")}, + }, + } + + nameBool := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("bool")}, + }, + } + + nameString := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("string")}, + }, + } + + nameVoid := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("void")}, + }, + } + + nameIterable := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("iterable")}, + }, + } + + nameObject := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("object")}, + }, + } + + function := &ast.StmtFunction{ + FunctionName: &ast.Identifier{Value: []byte("bar")}, + Params: []ast.Vertex{ + &ast.Parameter{ + Type: nameInt, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Int")}, + }, + }, + &ast.Parameter{ + Type: nameFloat, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Float")}, + }, + }, + &ast.Parameter{ + Type: nameBool, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Bool")}, + }, + }, + &ast.Parameter{ + Type: nameString, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("String")}, + }, + }, + &ast.Parameter{ + Type: nameVoid, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Void")}, + }, + }, + &ast.Parameter{ + Type: nameIterable, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Iterable")}, + }, + }, + &ast.Parameter{ + Type: nameObject, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("Object")}, + }, + }, + }, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Foo")}, + }, + }, + }, + function, + }, + } + + expected := map[ast.Vertex]string{ + function: "Foo\\bar", + nameInt: "int", + nameFloat: "float", + nameBool: "bool", + nameString: "string", + nameVoid: "void", + nameIterable: "iterable", + nameObject: "object", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} + +func TestDoNotResolveReservedSpecialNames(t *testing.T) { + + nameSelf := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Self")}, + }, + } + + nameStatic := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Static")}, + }, + } + + nameParent := &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Parent")}, + }, + } + + cls := &ast.StmtClass{ + ClassName: &ast.Identifier{Value: []byte("Bar")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Expr: &ast.ExprStaticCall{ + Class: nameSelf, + Call: &ast.Identifier{Value: []byte("func")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + &ast.StmtExpression{ + Expr: &ast.ExprStaticCall{ + Class: nameStatic, + Call: &ast.Identifier{Value: []byte("func")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + &ast.StmtExpression{ + Expr: &ast.ExprStaticCall{ + Class: nameParent, + Call: &ast.Identifier{Value: []byte("func")}, + ArgumentList: &ast.ArgumentList{}, + }, + }, + }, + } + + stxTree := &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Foo")}, + }, + }, + }, + cls, + }, + } + + expected := map[ast.Vertex]string{ + cls: "Foo\\Bar", + nameSelf: "self", + nameStatic: "static", + nameParent: "parent", + } + + nsResolver := visitor.NewNamespaceResolver() + dfsTraverser := traverser.NewDFS(nsResolver) + dfsTraverser.Traverse(stxTree) + + assert.DeepEqual(t, expected, nsResolver.ResolvedNames) +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 41ab67b..bdcacbf 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -681,3 +681,19 @@ func (v *Null) ScalarMagicConstant(_ *ast.ScalarMagicConstant) { func (v *Null) ScalarString(_ *ast.ScalarString) { // do nothing } + +func (v *Null) NameName(_ *ast.NameName) { + // do nothing +} + +func (v *Null) NameFullyQualified(_ *ast.NameFullyQualified) { + // do nothing +} + +func (v *Null) NameRelative(_ *ast.NameRelative) { + // do nothing +} + +func (v *Null) NameNamePart(_ *ast.NameNamePart) { + // do nothing +} From 50f8a47119d13b79c8479f5a5b043a5f4bb1c489 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 14 May 2020 19:07:05 +0300 Subject: [PATCH 008/140] update tests --- internal/php5/parser_test.go | 23147 +++++++++++++++++ internal/php7/parser_test.go | 25883 ++++++++++++++++++++ node/expr/assign/n_assign.go | 66 - node/expr/assign/n_assign_ref.go | 66 - node/expr/assign/n_bitwise_and.go | 66 - node/expr/assign/n_bitwise_or.go | 66 - node/expr/assign/n_bitwise_xor.go | 66 - node/expr/assign/n_coalesce.go | 66 - node/expr/assign/n_concat.go | 66 - node/expr/assign/n_div.go | 66 - node/expr/assign/n_minus.go | 66 - node/expr/assign/n_mod.go | 66 - node/expr/assign/n_mul.go | 66 - node/expr/assign/n_plus.go | 66 - node/expr/assign/n_pow.go | 66 - node/expr/assign/n_shift_left.go | 66 - node/expr/assign/n_shift_right.go | 66 - node/expr/assign/t_assign_op_test.go | 1344 - node/expr/assign/t_freefloating_test.go | 84 - node/expr/assign/t_position_test.go | 18 - node/expr/assign/t_visitor_test.go | 190 - node/expr/binary/n_bitwise_and.go | 66 - node/expr/binary/n_bitwise_or.go | 66 - node/expr/binary/n_bitwise_xor.go | 66 - node/expr/binary/n_boolean_and.go | 66 - node/expr/binary/n_boolean_or.go | 66 - node/expr/binary/n_coalesce.go | 66 - node/expr/binary/n_concat.go | 66 - node/expr/binary/n_div.go | 66 - node/expr/binary/n_equal.go | 66 - node/expr/binary/n_greater.go | 66 - node/expr/binary/n_greater_or_equal.go | 66 - node/expr/binary/n_identical.go | 66 - node/expr/binary/n_logical_and.go | 66 - node/expr/binary/n_logical_or.go | 66 - node/expr/binary/n_logical_xor.go | 66 - node/expr/binary/n_minus.go | 66 - node/expr/binary/n_mod.go | 66 - node/expr/binary/n_mul.go | 66 - node/expr/binary/n_not_equal.go | 66 - node/expr/binary/n_not_identical.go | 66 - node/expr/binary/n_plus.go | 66 - node/expr/binary/n_pow.go | 66 - node/expr/binary/n_shift_left.go | 66 - node/expr/binary/n_shift_right.go | 66 - node/expr/binary/n_smaller.go | 66 - node/expr/binary/n_smaller_or_equal.go | 66 - node/expr/binary/n_spaceship.go | 66 - node/expr/binary/t_binary_op_test.go | 2030 -- node/expr/binary/t_freefloating_test.go | 117 - node/expr/binary/t_position_test.go | 18 - node/expr/binary/t_visitor_test.go | 285 - node/expr/cast/n_cast_array.go | 58 - node/expr/cast/n_cast_bool.go | 58 - node/expr/cast/n_cast_double.go | 58 - node/expr/cast/n_cast_int.go | 58 - node/expr/cast/n_cast_object.go | 58 - node/expr/cast/n_cast_string.go | 58 - node/expr/cast/n_cast_unset.go | 58 - node/expr/cast/t_cast_test.go | 653 - node/expr/cast/t_freefloating_test.go | 57 - node/expr/cast/t_position_test.go | 18 - node/expr/cast/t_visitor_test.go | 119 - node/expr/n_array.go | 62 - node/expr/n_array_dim_fetch.go | 66 - node/expr/n_array_item.go | 70 - node/expr/n_arrow_function.go | 88 - node/expr/n_bitwise_not.go | 58 - node/expr/n_boolean_not.go | 58 - node/expr/n_class_const_fetch.go | 66 - node/expr/n_clone.go | 58 - node/expr/n_closure.go | 100 - node/expr/n_closure_use.go | 62 - node/expr/n_const_fetch.go | 58 - node/expr/n_empty.go | 58 - node/expr/n_error_suppress.go | 58 - node/expr/n_eval.go | 58 - node/expr/n_exit.go | 61 - node/expr/n_function_call.go | 66 - node/expr/n_include.go | 58 - node/expr/n_include_once.go | 58 - node/expr/n_instance_of.go | 66 - node/expr/n_isset.go | 62 - node/expr/n_list.go | 62 - node/expr/n_method_call.go | 74 - node/expr/n_new.go | 66 - node/expr/n_post_dec.go | 58 - node/expr/n_post_inc.go | 58 - node/expr/n_pre_dec.go | 58 - node/expr/n_pre_inc.go | 58 - node/expr/n_print.go | 58 - node/expr/n_property_fetch.go | 66 - node/expr/n_reference.go | 58 - node/expr/n_require.go | 58 - node/expr/n_require_once.go | 58 - node/expr/n_shell_exec.go | 62 - node/expr/n_short_array.go | 62 - node/expr/n_short_list.go | 62 - node/expr/n_static_call.go | 74 - node/expr/n_static_property_fetch.go | 66 - node/expr/n_ternary.go | 74 - node/expr/n_unary_minus.go | 58 - node/expr/n_unary_plus.go | 58 - node/expr/n_variable.go | 63 - node/expr/n_yield.go | 66 - node/expr/n_yield_from.go | 58 - node/expr/t_array_dim_fetch_test.go | 166 - node/expr/t_array_test.go | 284 - node/expr/t_arrow_function_test.go | 144 - node/expr/t_bitwise_not_test.go | 73 - node/expr/t_boolean_not_test.go | 73 - node/expr/t_class_const_fetch_test.go | 145 - node/expr/t_clone_test.go | 131 - node/expr/t_closure_test.go | 427 - node/expr/t_const_fetch_test.go | 197 - node/expr/t_empty_test.go | 73 - node/expr/t_error_supress_test.go | 73 - node/expr/t_eval_test.go | 73 - node/expr/t_exit_test.go | 301 - node/expr/t_freefloating_test.go | 165 - node/expr/t_function_call_test.go | 462 - node/expr/t_inc_dec_test.go | 247 - node/expr/t_include_test.go | 247 - node/expr/t_instance_of_test.go | 248 - node/expr/t_isset_test.go | 152 - node/expr/t_list_test.go | 577 - node/expr/t_method_call_test.go | 90 - node/expr/t_new_test.go | 323 - node/expr/t_position_test.go | 18 - node/expr/t_print_test.go | 73 - node/expr/t_property_fetch_test.go | 82 - node/expr/t_reference_test.go | 117 - node/expr/t_shell_exec_test.go | 86 - node/expr/t_short_array_test.go | 220 - node/expr/t_short_list_test.go | 304 - node/expr/t_static_call_test.go | 416 - node/expr/t_static_property_fetch_test.go | 247 - node/expr/t_ternary_test.go | 450 - node/expr/t_unary_test.go | 131 - node/expr/t_variable_test.go | 123 - node/expr/t_visitor_test.go | 416 - node/expr/t_yield_test.go | 360 - node/n_argument.go | 64 - node/n_argument_list.go | 61 - node/n_identifier.go | 53 - node/n_nullable.go | 57 - node/n_parameter.go | 80 - node/n_root.go | 61 - node/name/n_fully_qualified.go | 67 - node/name/n_name.go | 67 - node/name/n_name_part.go | 53 - node/name/n_relative.go | 67 - node/name/names.go | 11 - node/name/t_freefloating_test.go | 48 - node/name/t_name_test.go | 235 - node/name/t_position_test.go | 18 - node/name/t_visitor_test.go | 89 - node/node.go | 16 - node/scalar/node_dnumber.go | 53 - node/scalar/node_encapsed.go | 62 - node/scalar/node_encapsed_string_part.go | 53 - node/scalar/node_heredoc.go | 66 - node/scalar/node_lnumber.go | 53 - node/scalar/node_magic_constant.go | 53 - node/scalar/node_string.go | 53 - node/scalar/t_encapsed_test.go | 662 - node/scalar/t_freefloating_test.go | 57 - node/scalar/t_heredoc_test.go | 336 - node/scalar/t_magic_constant_test.go | 57 - node/scalar/t_numbers_test.go | 308 - node/scalar/t_position_test.go | 18 - node/scalar/t_string_test.go | 228 - node/scalar/t_visitor_test.go | 104 - node/stmt/n_alt_else.go | 58 - node/stmt/n_alt_else_if.go | 66 - node/stmt/n_alt_for.go | 94 - node/stmt/n_alt_foreach.go | 82 - node/stmt/n_alt_if.go | 104 - node/stmt/n_alt_switch.go | 66 - node/stmt/n_alt_while.go | 66 - node/stmt/n_break.go | 58 - node/stmt/n_case.go | 70 - node/stmt/n_case_list.go | 62 - node/stmt/n_catch.go | 82 - node/stmt/n_class.go | 110 - node/stmt/n_class_const_list.go | 74 - node/stmt/n_class_extends.go | 58 - node/stmt/n_class_implements.go | 62 - node/stmt/n_class_method.go | 105 - node/stmt/n_const_list.go | 62 - node/stmt/n_constant.go | 70 - node/stmt/n_continue.go | 58 - node/stmt/n_declare.go | 74 - node/stmt/n_default.go | 62 - node/stmt/n_do.go | 66 - node/stmt/n_echo.go | 62 - node/stmt/n_else.go | 58 - node/stmt/n_else_if.go | 66 - node/stmt/n_expression.go | 58 - node/stmt/n_finally.go | 62 - node/stmt/n_for.go | 94 - node/stmt/n_foreach.go | 82 - node/stmt/n_function.go | 98 - node/stmt/n_global.go | 62 - node/stmt/n_goto.go | 58 - node/stmt/n_group_use.go | 84 - node/stmt/n_halt_compiler.go | 47 - node/stmt/n_if.go | 104 - node/stmt/n_inline_html.go | 53 - node/stmt/n_interface.go | 82 - node/stmt/n_interface_extends.go | 62 - node/stmt/n_label.go | 58 - node/stmt/n_namespace.go | 70 - node/stmt/n_nop.go | 47 - node/stmt/n_property.go | 70 - node/stmt/n_property_list.go | 82 - node/stmt/n_return.go | 58 - node/stmt/n_static.go | 62 - node/stmt/n_static_var.go | 66 - node/stmt/n_stmt_list.go | 62 - node/stmt/n_switch.go | 66 - node/stmt/n_throw.go | 58 - node/stmt/n_trait.go | 74 - node/stmt/n_trait_adaptation_list.go | 62 - node/stmt/n_trait_method_ref.go | 66 - node/stmt/n_trait_use.go | 70 - node/stmt/n_trait_use_alias.go | 74 - node/stmt/n_trait_use_precedence.go | 70 - node/stmt/n_try.go | 82 - node/stmt/n_unset.go | 62 - node/stmt/n_use.go | 80 - node/stmt/n_use_list.go | 70 - node/stmt/n_while.go | 66 - node/stmt/t_alt_if_test.go | 407 - node/stmt/t_class_const_list_test.go | 239 - node/stmt/t_class_method_test.go | 626 - node/stmt/t_class_test.go | 513 - node/stmt/t_const_list_test.go | 104 - node/stmt/t_continue_test.go | 213 - node/stmt/t_declare_test.go | 255 - node/stmt/t_do_test.go | 66 - node/stmt/t_echo_test.go | 130 - node/stmt/t_expression_test.go | 57 - node/stmt/t_for_test.go | 291 - node/stmt/t_foreach_test.go | 625 - node/stmt/t_freefloating_test.go | 216 - node/stmt/t_function_test.go | 383 - node/stmt/t_global_test.go | 204 - node/stmt/t_goto_label_test.go | 72 - node/stmt/t_halt_compiler_test.go | 46 - node/stmt/t_if_test.go | 545 - node/stmt/t_inline_html_test.go | 55 - node/stmt/t_interface_test.go | 224 - node/stmt/t_namespace_test.go | 154 - node/stmt/t_position_test.go | 18 - node/stmt/t_property_list_test.go | 487 - node/stmt/t_static_var_test.go | 263 - node/stmt/t_switch_case_default_test.go | 433 - node/stmt/t_throw_test.go | 64 - node/stmt/t_trait_test.go | 57 - node/stmt/t_trait_use_test.go | 822 - node/stmt/t_try_catch_finnaly_test.go | 640 - node/stmt/t_unset_test.go | 199 - node/stmt/t_use_test.go | 1385 -- node/stmt/t_visitor_test.go | 574 - node/stmt/t_while_break_test.go | 213 - node/t_freefloating_test.go | 53 - node/t_node_test.go | 2755 --- node/t_position_test.go | 18 - node/t_visitor_test.go | 113 - 270 files changed, 49030 insertions(+), 39496 deletions(-) create mode 100644 internal/php5/parser_test.go create mode 100644 internal/php7/parser_test.go delete mode 100644 node/expr/assign/n_assign.go delete mode 100644 node/expr/assign/n_assign_ref.go delete mode 100644 node/expr/assign/n_bitwise_and.go delete mode 100644 node/expr/assign/n_bitwise_or.go delete mode 100644 node/expr/assign/n_bitwise_xor.go delete mode 100644 node/expr/assign/n_coalesce.go delete mode 100644 node/expr/assign/n_concat.go delete mode 100644 node/expr/assign/n_div.go delete mode 100644 node/expr/assign/n_minus.go delete mode 100644 node/expr/assign/n_mod.go delete mode 100644 node/expr/assign/n_mul.go delete mode 100644 node/expr/assign/n_plus.go delete mode 100644 node/expr/assign/n_pow.go delete mode 100644 node/expr/assign/n_shift_left.go delete mode 100644 node/expr/assign/n_shift_right.go delete mode 100644 node/expr/assign/t_assign_op_test.go delete mode 100644 node/expr/assign/t_freefloating_test.go delete mode 100644 node/expr/assign/t_position_test.go delete mode 100644 node/expr/assign/t_visitor_test.go delete mode 100644 node/expr/binary/n_bitwise_and.go delete mode 100644 node/expr/binary/n_bitwise_or.go delete mode 100644 node/expr/binary/n_bitwise_xor.go delete mode 100644 node/expr/binary/n_boolean_and.go delete mode 100644 node/expr/binary/n_boolean_or.go delete mode 100644 node/expr/binary/n_coalesce.go delete mode 100644 node/expr/binary/n_concat.go delete mode 100644 node/expr/binary/n_div.go delete mode 100644 node/expr/binary/n_equal.go delete mode 100644 node/expr/binary/n_greater.go delete mode 100644 node/expr/binary/n_greater_or_equal.go delete mode 100644 node/expr/binary/n_identical.go delete mode 100644 node/expr/binary/n_logical_and.go delete mode 100644 node/expr/binary/n_logical_or.go delete mode 100644 node/expr/binary/n_logical_xor.go delete mode 100644 node/expr/binary/n_minus.go delete mode 100644 node/expr/binary/n_mod.go delete mode 100644 node/expr/binary/n_mul.go delete mode 100644 node/expr/binary/n_not_equal.go delete mode 100644 node/expr/binary/n_not_identical.go delete mode 100644 node/expr/binary/n_plus.go delete mode 100644 node/expr/binary/n_pow.go delete mode 100644 node/expr/binary/n_shift_left.go delete mode 100644 node/expr/binary/n_shift_right.go delete mode 100644 node/expr/binary/n_smaller.go delete mode 100644 node/expr/binary/n_smaller_or_equal.go delete mode 100644 node/expr/binary/n_spaceship.go delete mode 100644 node/expr/binary/t_binary_op_test.go delete mode 100644 node/expr/binary/t_freefloating_test.go delete mode 100644 node/expr/binary/t_position_test.go delete mode 100644 node/expr/binary/t_visitor_test.go delete mode 100644 node/expr/cast/n_cast_array.go delete mode 100644 node/expr/cast/n_cast_bool.go delete mode 100644 node/expr/cast/n_cast_double.go delete mode 100644 node/expr/cast/n_cast_int.go delete mode 100644 node/expr/cast/n_cast_object.go delete mode 100644 node/expr/cast/n_cast_string.go delete mode 100644 node/expr/cast/n_cast_unset.go delete mode 100644 node/expr/cast/t_cast_test.go delete mode 100644 node/expr/cast/t_freefloating_test.go delete mode 100644 node/expr/cast/t_position_test.go delete mode 100644 node/expr/cast/t_visitor_test.go delete mode 100644 node/expr/n_array.go delete mode 100644 node/expr/n_array_dim_fetch.go delete mode 100644 node/expr/n_array_item.go delete mode 100644 node/expr/n_arrow_function.go delete mode 100644 node/expr/n_bitwise_not.go delete mode 100644 node/expr/n_boolean_not.go delete mode 100644 node/expr/n_class_const_fetch.go delete mode 100644 node/expr/n_clone.go delete mode 100644 node/expr/n_closure.go delete mode 100644 node/expr/n_closure_use.go delete mode 100644 node/expr/n_const_fetch.go delete mode 100644 node/expr/n_empty.go delete mode 100644 node/expr/n_error_suppress.go delete mode 100644 node/expr/n_eval.go delete mode 100644 node/expr/n_exit.go delete mode 100644 node/expr/n_function_call.go delete mode 100644 node/expr/n_include.go delete mode 100644 node/expr/n_include_once.go delete mode 100644 node/expr/n_instance_of.go delete mode 100644 node/expr/n_isset.go delete mode 100644 node/expr/n_list.go delete mode 100644 node/expr/n_method_call.go delete mode 100644 node/expr/n_new.go delete mode 100644 node/expr/n_post_dec.go delete mode 100644 node/expr/n_post_inc.go delete mode 100644 node/expr/n_pre_dec.go delete mode 100644 node/expr/n_pre_inc.go delete mode 100644 node/expr/n_print.go delete mode 100644 node/expr/n_property_fetch.go delete mode 100644 node/expr/n_reference.go delete mode 100644 node/expr/n_require.go delete mode 100644 node/expr/n_require_once.go delete mode 100644 node/expr/n_shell_exec.go delete mode 100644 node/expr/n_short_array.go delete mode 100644 node/expr/n_short_list.go delete mode 100644 node/expr/n_static_call.go delete mode 100644 node/expr/n_static_property_fetch.go delete mode 100644 node/expr/n_ternary.go delete mode 100644 node/expr/n_unary_minus.go delete mode 100644 node/expr/n_unary_plus.go delete mode 100644 node/expr/n_variable.go delete mode 100644 node/expr/n_yield.go delete mode 100644 node/expr/n_yield_from.go delete mode 100644 node/expr/t_array_dim_fetch_test.go delete mode 100644 node/expr/t_array_test.go delete mode 100644 node/expr/t_arrow_function_test.go delete mode 100644 node/expr/t_bitwise_not_test.go delete mode 100644 node/expr/t_boolean_not_test.go delete mode 100644 node/expr/t_class_const_fetch_test.go delete mode 100644 node/expr/t_clone_test.go delete mode 100644 node/expr/t_closure_test.go delete mode 100644 node/expr/t_const_fetch_test.go delete mode 100644 node/expr/t_empty_test.go delete mode 100644 node/expr/t_error_supress_test.go delete mode 100644 node/expr/t_eval_test.go delete mode 100644 node/expr/t_exit_test.go delete mode 100644 node/expr/t_freefloating_test.go delete mode 100644 node/expr/t_function_call_test.go delete mode 100644 node/expr/t_inc_dec_test.go delete mode 100644 node/expr/t_include_test.go delete mode 100644 node/expr/t_instance_of_test.go delete mode 100644 node/expr/t_isset_test.go delete mode 100644 node/expr/t_list_test.go delete mode 100644 node/expr/t_method_call_test.go delete mode 100644 node/expr/t_new_test.go delete mode 100644 node/expr/t_position_test.go delete mode 100644 node/expr/t_print_test.go delete mode 100644 node/expr/t_property_fetch_test.go delete mode 100644 node/expr/t_reference_test.go delete mode 100644 node/expr/t_shell_exec_test.go delete mode 100644 node/expr/t_short_array_test.go delete mode 100644 node/expr/t_short_list_test.go delete mode 100644 node/expr/t_static_call_test.go delete mode 100644 node/expr/t_static_property_fetch_test.go delete mode 100644 node/expr/t_ternary_test.go delete mode 100644 node/expr/t_unary_test.go delete mode 100644 node/expr/t_variable_test.go delete mode 100644 node/expr/t_visitor_test.go delete mode 100644 node/expr/t_yield_test.go delete mode 100644 node/n_argument.go delete mode 100644 node/n_argument_list.go delete mode 100644 node/n_identifier.go delete mode 100644 node/n_nullable.go delete mode 100644 node/n_parameter.go delete mode 100644 node/n_root.go delete mode 100644 node/name/n_fully_qualified.go delete mode 100644 node/name/n_name.go delete mode 100644 node/name/n_name_part.go delete mode 100644 node/name/n_relative.go delete mode 100644 node/name/names.go delete mode 100644 node/name/t_freefloating_test.go delete mode 100644 node/name/t_name_test.go delete mode 100644 node/name/t_position_test.go delete mode 100644 node/name/t_visitor_test.go delete mode 100644 node/node.go delete mode 100644 node/scalar/node_dnumber.go delete mode 100644 node/scalar/node_encapsed.go delete mode 100644 node/scalar/node_encapsed_string_part.go delete mode 100644 node/scalar/node_heredoc.go delete mode 100644 node/scalar/node_lnumber.go delete mode 100644 node/scalar/node_magic_constant.go delete mode 100644 node/scalar/node_string.go delete mode 100644 node/scalar/t_encapsed_test.go delete mode 100644 node/scalar/t_freefloating_test.go delete mode 100644 node/scalar/t_heredoc_test.go delete mode 100644 node/scalar/t_magic_constant_test.go delete mode 100644 node/scalar/t_numbers_test.go delete mode 100644 node/scalar/t_position_test.go delete mode 100644 node/scalar/t_string_test.go delete mode 100644 node/scalar/t_visitor_test.go delete mode 100644 node/stmt/n_alt_else.go delete mode 100644 node/stmt/n_alt_else_if.go delete mode 100644 node/stmt/n_alt_for.go delete mode 100644 node/stmt/n_alt_foreach.go delete mode 100644 node/stmt/n_alt_if.go delete mode 100644 node/stmt/n_alt_switch.go delete mode 100644 node/stmt/n_alt_while.go delete mode 100644 node/stmt/n_break.go delete mode 100644 node/stmt/n_case.go delete mode 100644 node/stmt/n_case_list.go delete mode 100644 node/stmt/n_catch.go delete mode 100644 node/stmt/n_class.go delete mode 100644 node/stmt/n_class_const_list.go delete mode 100644 node/stmt/n_class_extends.go delete mode 100644 node/stmt/n_class_implements.go delete mode 100644 node/stmt/n_class_method.go delete mode 100644 node/stmt/n_const_list.go delete mode 100644 node/stmt/n_constant.go delete mode 100644 node/stmt/n_continue.go delete mode 100644 node/stmt/n_declare.go delete mode 100644 node/stmt/n_default.go delete mode 100644 node/stmt/n_do.go delete mode 100644 node/stmt/n_echo.go delete mode 100644 node/stmt/n_else.go delete mode 100644 node/stmt/n_else_if.go delete mode 100644 node/stmt/n_expression.go delete mode 100644 node/stmt/n_finally.go delete mode 100644 node/stmt/n_for.go delete mode 100644 node/stmt/n_foreach.go delete mode 100644 node/stmt/n_function.go delete mode 100644 node/stmt/n_global.go delete mode 100644 node/stmt/n_goto.go delete mode 100644 node/stmt/n_group_use.go delete mode 100644 node/stmt/n_halt_compiler.go delete mode 100644 node/stmt/n_if.go delete mode 100644 node/stmt/n_inline_html.go delete mode 100644 node/stmt/n_interface.go delete mode 100644 node/stmt/n_interface_extends.go delete mode 100644 node/stmt/n_label.go delete mode 100644 node/stmt/n_namespace.go delete mode 100644 node/stmt/n_nop.go delete mode 100644 node/stmt/n_property.go delete mode 100644 node/stmt/n_property_list.go delete mode 100644 node/stmt/n_return.go delete mode 100644 node/stmt/n_static.go delete mode 100644 node/stmt/n_static_var.go delete mode 100644 node/stmt/n_stmt_list.go delete mode 100644 node/stmt/n_switch.go delete mode 100644 node/stmt/n_throw.go delete mode 100644 node/stmt/n_trait.go delete mode 100644 node/stmt/n_trait_adaptation_list.go delete mode 100644 node/stmt/n_trait_method_ref.go delete mode 100644 node/stmt/n_trait_use.go delete mode 100644 node/stmt/n_trait_use_alias.go delete mode 100644 node/stmt/n_trait_use_precedence.go delete mode 100644 node/stmt/n_try.go delete mode 100644 node/stmt/n_unset.go delete mode 100644 node/stmt/n_use.go delete mode 100644 node/stmt/n_use_list.go delete mode 100644 node/stmt/n_while.go delete mode 100644 node/stmt/t_alt_if_test.go delete mode 100644 node/stmt/t_class_const_list_test.go delete mode 100644 node/stmt/t_class_method_test.go delete mode 100644 node/stmt/t_class_test.go delete mode 100644 node/stmt/t_const_list_test.go delete mode 100644 node/stmt/t_continue_test.go delete mode 100644 node/stmt/t_declare_test.go delete mode 100644 node/stmt/t_do_test.go delete mode 100644 node/stmt/t_echo_test.go delete mode 100644 node/stmt/t_expression_test.go delete mode 100644 node/stmt/t_for_test.go delete mode 100644 node/stmt/t_foreach_test.go delete mode 100644 node/stmt/t_freefloating_test.go delete mode 100644 node/stmt/t_function_test.go delete mode 100644 node/stmt/t_global_test.go delete mode 100644 node/stmt/t_goto_label_test.go delete mode 100644 node/stmt/t_halt_compiler_test.go delete mode 100644 node/stmt/t_if_test.go delete mode 100644 node/stmt/t_inline_html_test.go delete mode 100644 node/stmt/t_interface_test.go delete mode 100644 node/stmt/t_namespace_test.go delete mode 100644 node/stmt/t_position_test.go delete mode 100644 node/stmt/t_property_list_test.go delete mode 100644 node/stmt/t_static_var_test.go delete mode 100644 node/stmt/t_switch_case_default_test.go delete mode 100644 node/stmt/t_throw_test.go delete mode 100644 node/stmt/t_trait_test.go delete mode 100644 node/stmt/t_trait_use_test.go delete mode 100644 node/stmt/t_try_catch_finnaly_test.go delete mode 100644 node/stmt/t_unset_test.go delete mode 100644 node/stmt/t_use_test.go delete mode 100644 node/stmt/t_visitor_test.go delete mode 100644 node/stmt/t_while_break_test.go delete mode 100644 node/t_freefloating_test.go delete mode 100644 node/t_node_test.go delete mode 100644 node/t_position_test.go delete mode 100644 node/t_visitor_test.go diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go new file mode 100644 index 0000000..638d1df --- /dev/null +++ b/internal/php5/parser_test.go @@ -0,0 +1,23147 @@ +package php5_test + +import ( + "gotest.tools/assert" + "testing" + + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" +) + +func TestIdentifier(t *testing.T) { + src := `bar($a, ...$b); + foo::bar($a, ...$b); + $foo::bar($a, ...$b); + new foo($a, ...$b); + ` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 7, + StartPos: 6, + EndPos: 133, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 21, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 20, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 9, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 9, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 20, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 14, + EndPos: 19, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 19, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 19, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 40, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 39, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 28, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 28, + }, + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 39, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 33, + EndPos: 38, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 38, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 38, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 64, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 63, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 47, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 47, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 49, + EndPos: 52, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 63, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 57, + EndPos: 62, + }, + }, + IsReference: false, + Variadic: true, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 62, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 62, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 87, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 86, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 70, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 70, + }, + }, + Value: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 72, + EndPos: 75, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 86, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 80, + EndPos: 85, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 85, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 85, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 111, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 110, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 94, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 94, + }, + }, + Value: []byte("foo"), + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 96, + EndPos: 99, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 110, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 104, + EndPos: 109, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 109, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 109, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 133, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 132, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 121, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 121, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 132, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 126, + EndPos: 131, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 131, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 131, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestPhp5ParameterNode(t *testing.T) { + src := `bar()";` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 9, + }, + }, + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 18, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("()"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { + src := `bar()}";` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 9, + }, + }, + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 21, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 14, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 21, + }, + }, + }, + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestScalarHeredoc_HeredocSimpleLabel(t *testing.T) { + src := ` $v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_ExprWithKey(t *testing.T) { + src := ` $v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Items: []ast.Vertex{}, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_WithRef(t *testing.T) { + src := ` &$v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_WithList(t *testing.T) { + src := ` list($v)) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 32, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtFunction(t *testing.T) { + src := `
` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + }, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 17, + }, + }, + Value: []byte("
"), + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtInterface(t *testing.T) { + src := `1, &$b,);` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 20, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBitwiseNot(t *testing.T) { + src := `foo();` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("foo"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprNew(t *testing.T) { + src := `foo;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 10, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprReference_ForeachWithRef(t *testing.T) { + t.Helper() + src := ` &$v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprShellExec(t *testing.T) { + src := "1, &$b,];` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 15, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 8, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 8, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprStaticCall(t *testing.T) { + src := ` $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprYield_Expr(t *testing.T) { + src := ` 1;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +// expr assign + +func TestExprAssign_Assign(t *testing.T) { + src := `>= $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +// expr binary + +func TestExprBinary_BitwiseAnd(t *testing.T) { + src := `= $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_Greater(t *testing.T) { + src := ` $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 10, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_Identical(t *testing.T) { + src := `> $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php5parser := php5.NewParser([]byte(src), "5.6") + php5parser.Parse() + actual := php5parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_SmallerOrEqual(t *testing.T) { + src := `bar($a, ...$b); + foo::bar($a, ...$b); + $foo::bar($a, ...$b); + new foo($a, ...$b); + /** anonymous class */ + new class ($a, ...$b) {}; + ` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 9, + StartPos: 6, + EndPos: 186, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 21, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 20, + }, + }, + Function: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 9, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 6, + EndPos: 9, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 20, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 12, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 14, + EndPos: 19, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 19, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 17, + EndPos: 19, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 40, + }, + }, + Expr: &ast.ExprFunctionCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 39, + }, + }, + Function: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 28, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 24, + EndPos: 28, + }, + }, + Value: []byte("foo"), + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 28, + EndPos: 39, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 29, + EndPos: 31, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 33, + EndPos: 38, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 38, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 36, + EndPos: 38, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 64, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 63, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 47, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 43, + EndPos: 47, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 49, + EndPos: 52, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 63, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + IsReference: false, + Variadic: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 53, + EndPos: 55, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 57, + EndPos: 62, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 62, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 60, + EndPos: 62, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 87, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 86, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 70, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 67, + EndPos: 70, + }, + }, + Value: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 72, + EndPos: 75, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 86, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 76, + EndPos: 78, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 80, + EndPos: 85, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 85, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 83, + EndPos: 85, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 111, + }, + }, + Expr: &ast.ExprStaticCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 110, + }, + }, + Class: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 94, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 90, + EndPos: 94, + }, + }, + Value: []byte("foo"), + }, + }, + Call: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 96, + EndPos: 99, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 110, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 100, + EndPos: 102, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 104, + EndPos: 109, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 109, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 107, + EndPos: 109, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 133, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 114, + EndPos: 132, + }, + }, + Class: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 121, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 118, + EndPos: 121, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 132, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 122, + EndPos: 124, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 126, + EndPos: 131, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 131, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 129, + EndPos: 131, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + }, + }, + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 161, + EndPos: 186, + }, + }, + Expr: &ast.ExprNew{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 161, + EndPos: 185, + }, + }, + Class: &ast.StmtClass{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 165, + EndPos: 185, + }, + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 182, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 174, + }, + }, + Variadic: false, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 174, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 172, + EndPos: 174, + }, + }, + Value: []byte("a"), + }, + }, + }, + &ast.Argument{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 176, + EndPos: 181, + }, + }, + Variadic: true, + IsReference: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 179, + EndPos: 181, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 179, + EndPos: 181, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestPhp7ParameterNode(t *testing.T) { + src := `bar()";` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 9, + }, + }, + Value: []byte("test "), + }, + &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 18, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + Value: []byte("foo"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("()"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { + src := `bar()}";` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + }, + Expr: &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + }, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 9, + }, + }, + Value: []byte("test "), + }, + &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 21, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 14, + }, + }, + Value: []byte("foo"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("bar"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 21, + }, + }, + }, + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestScalarHeredoc_HeredocSimpleLabel(t *testing.T) { + src := ` $v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_ExprWithKey(t *testing.T) { + src := ` $v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Items: []ast.Vertex{}, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + }, + Value: []byte("v"), + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_WithRef(t *testing.T) { + src := ` &$v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtForeach_WithList(t *testing.T) { + src := ` list($v)) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 32, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Val: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Value: []byte("v"), + }, + }, + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtFunction(t *testing.T) { + src := `
` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + }, + &ast.StmtInlineHtml{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 17, + }, + }, + Value: []byte("
"), + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestStmtInterface(t *testing.T) { + src := `1, &$b,);` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + }, + Expr: &ast.ExprArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 20, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 13, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprArray_ItemUnpack(t *testing.T) { + src := ` $a;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 14, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 14, + }, + }, + Expr: &ast.ExprArrowFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + ReturnsRef: false, + Static: false, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprArrowFunction_ReturnType(t *testing.T) { + src := ` $a;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + }, + Expr: &ast.ExprArrowFunction{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + }, + Static: false, + ReturnsRef: true, + ReturnType: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("foo"), + }, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 22, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 22, + }, + }, + Value: []byte("a"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBitwiseNot(t *testing.T) { + src := `foo();` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Expr: &ast.ExprMethodCall{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("foo"), + }, + ArgumentList: &ast.ArgumentList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprNew(t *testing.T) { + src := `foo;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Expr: &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 10, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("foo"), + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprReference_ForeachWithRef(t *testing.T) { + t.Helper() + src := ` &$v) {}` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + }, + Value: []byte("a"), + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + }, + Value: []byte("k"), + }, + }, + Var: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + }, + Value: []byte("v"), + }, + }, + }, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + }, + Stmts: []ast.Vertex{}, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprShellExec(t *testing.T) { + src := "1, &$b,];` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Expr: &ast.ExprShortArray{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 15, + }, + }, + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 8, + }, + }, + Key: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 4, + EndPos: 5, + }, + }, + Value: []byte("1"), + }, + Val: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 8, + }, + }, + Value: []byte("1"), + }, + }, + &ast.ExprArrayItem{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + &ast.ExprArrayItem{}, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprShortList(t *testing.T) { + src := ` $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprYield_Expr(t *testing.T) { + src := ` 1;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + }, + Expr: &ast.ExprYield{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + }, + Key: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("a"), + }, + }, + Value: &ast.ScalarLnumber{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + }, + Value: []byte("1"), + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprYieldFrom(t *testing.T) { + src := `>= $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Expr: &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprAssign_Coalesce(t *testing.T) { + src := `= $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Expr: &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_Greater(t *testing.T) { + src := ` $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Expr: &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 10, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_Identical(t *testing.T) { + src := `> $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Expr: &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 11, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +func TestExprBinary_SmallerOrEqual(t *testing.T) { + src := ` $b;` + + expected := &ast.Root{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + }, + Expr: &ast.ExprBinarySpaceship{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 12, + }, + }, + Left: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + }, + Value: []byte("a"), + }, + }, + Right: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, + Value: []byte("b"), + }, + }, + }, + }, + }, + } + + php7parser := php7.NewParser([]byte(src), "7.4") + php7parser.Parse() + actual := php7parser.GetRootNode() + assert.DeepEqual(t, expected, actual) +} + +// expr cast + +func TestExprCast_Array(t *testing.T) { + src := `>= $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Expr: &assign.ShiftRight{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Expression: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestCoalesce(t *testing.T) { - src := `= $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Expr: &binary.GreaterOrEqual{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestGreater(t *testing.T) { - src := ` $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Expr: &binary.Greater{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestIdentical(t *testing.T) { - src := `> $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Expr: &binary.ShiftRight{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestSmallerOrEqual(t *testing.T) { - src := ` $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Expr: &binary.Spaceship{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Left: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Right: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/binary/t_freefloating_test.go b/node/expr/binary/t_freefloating_test.go deleted file mode 100644 index 7db5cf4..0000000 --- a/node/expr/binary/t_freefloating_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package binary_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr/binary" -) - -var expected freefloating.Collection = freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.WhiteSpaceType, - Value: " ", - Position: nil, - }, - { - StringType: freefloating.CommentType, - Value: "//comment\n", - Position: nil, - }, - }, -} - -var nodes = []node.Node{ - &binary.BitwiseAnd{ - FreeFloating: expected, - }, - &binary.BitwiseOr{ - FreeFloating: expected, - }, - &binary.BitwiseXor{ - FreeFloating: expected, - }, - &binary.BooleanAnd{ - FreeFloating: expected, - }, - &binary.BooleanOr{ - FreeFloating: expected, - }, - &binary.Coalesce{ - FreeFloating: expected, - }, - &binary.Concat{ - FreeFloating: expected, - }, - &binary.Div{ - FreeFloating: expected, - }, - &binary.Equal{ - FreeFloating: expected, - }, - &binary.GreaterOrEqual{ - FreeFloating: expected, - }, - &binary.Greater{ - FreeFloating: expected, - }, - &binary.Identical{ - FreeFloating: expected, - }, - &binary.LogicalAnd{ - FreeFloating: expected, - }, - &binary.LogicalOr{ - FreeFloating: expected, - }, - &binary.LogicalXor{ - FreeFloating: expected, - }, - &binary.Minus{ - FreeFloating: expected, - }, - &binary.Mod{ - FreeFloating: expected, - }, - &binary.Mul{ - FreeFloating: expected, - }, - &binary.NotEqual{ - FreeFloating: expected, - }, - &binary.NotIdentical{ - FreeFloating: expected, - }, - &binary.Plus{ - FreeFloating: expected, - }, - &binary.Pow{ - FreeFloating: expected, - }, - &binary.ShiftLeft{ - FreeFloating: expected, - }, - &binary.ShiftRight{ - FreeFloating: expected, - }, - &binary.SmallerOrEqual{ - FreeFloating: expected, - }, - &binary.Smaller{ - FreeFloating: expected, - }, - &binary.Spaceship{ - FreeFloating: expected, - }, -} - -func TestMeta(t *testing.T) { - for _, n := range nodes { - actual := *n.GetFreeFloating() - assert.DeepEqual(t, expected, actual) - } -} diff --git a/node/expr/binary/t_position_test.go b/node/expr/binary/t_position_test.go deleted file mode 100644 index 079e380..0000000 --- a/node/expr/binary/t_position_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package binary_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/position" -) - -func TestPosition(t *testing.T) { - expected := position.NewPosition(1, 1, 1, 1) - for _, n := range nodes { - n.SetPosition(expected) - actual := n.GetPosition() - assert.DeepEqual(t, expected, actual) - } -} diff --git a/node/expr/binary/t_visitor_test.go b/node/expr/binary/t_visitor_test.go deleted file mode 100644 index 7962e23..0000000 --- a/node/expr/binary/t_visitor_test.go +++ /dev/null @@ -1,285 +0,0 @@ -package binary_test - -import ( - "testing" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/walker" - "gotest.tools/assert" -) - -var nodesToTest = []struct { - node node.Node // node - expectedVisitedKeys []string // visited keys - expectedAttributes map[string]interface{} -}{ - { - &binary.BitwiseAnd{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.BitwiseOr{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.BitwiseXor{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.BooleanAnd{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.BooleanOr{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Coalesce{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Concat{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Div{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Equal{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.GreaterOrEqual{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Greater{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Identical{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.LogicalAnd{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.LogicalOr{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.LogicalXor{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Minus{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Mod{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Mul{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.NotEqual{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.NotIdentical{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Plus{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Pow{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.ShiftLeft{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.ShiftRight{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.SmallerOrEqual{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Smaller{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, - { - &binary.Spaceship{ - Left: &expr.Variable{}, - Right: &expr.Variable{}, - }, - []string{"Left", "Right"}, - nil, - }, -} - -type visitorMock struct { - visitChildren bool - visitedKeys []string -} - -func (v *visitorMock) EnterNode(n walker.Walkable) bool { return v.visitChildren } -func (v *visitorMock) LeaveNode(n walker.Walkable) {} -func (v *visitorMock) EnterChildNode(key string, w walker.Walkable) { - v.visitedKeys = append(v.visitedKeys, key) -} -func (v *visitorMock) LeaveChildNode(key string, w walker.Walkable) {} -func (v *visitorMock) EnterChildList(key string, w walker.Walkable) { - v.visitedKeys = append(v.visitedKeys, key) -} -func (v *visitorMock) LeaveChildList(key string, w walker.Walkable) {} - -func TestVisitorDisableChildren(t *testing.T) { - for _, tt := range nodesToTest { - v := &visitorMock{false, []string{}} - tt.node.Walk(v) - - expected := []string{} - actual := v.visitedKeys - - assert.DeepEqual(t, expected, actual) - } -} - -func TestVisitor(t *testing.T) { - for _, tt := range nodesToTest { - v := &visitorMock{true, []string{}} - tt.node.Walk(v) - - expected := tt.expectedVisitedKeys - actual := v.visitedKeys - - assert.DeepEqual(t, expected, actual) - } -} - -// test Attributes() - -func TestNameAttributes(t *testing.T) { - for _, tt := range nodesToTest { - expected := tt.expectedAttributes - actual := tt.node.Attributes() - - assert.DeepEqual(t, expected, actual) - } -} diff --git a/node/expr/cast/n_cast_array.go b/node/expr/cast/n_cast_array.go deleted file mode 100644 index f12458b..0000000 --- a/node/expr/cast/n_cast_array.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Array node -type Array struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewArray node constructor -func NewArray(Expr node.Node) *Array { - return &Array{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Array) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Array) GetPosition() *position.Position { - return n.Position -} - -func (n *Array) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Array) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Array) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_bool.go b/node/expr/cast/n_cast_bool.go deleted file mode 100644 index a794df8..0000000 --- a/node/expr/cast/n_cast_bool.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Bool node -type Bool struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewBool node constructor -func NewBool(Expr node.Node) *Bool { - return &Bool{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Bool) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Bool) GetPosition() *position.Position { - return n.Position -} - -func (n *Bool) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Bool) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Bool) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_double.go b/node/expr/cast/n_cast_double.go deleted file mode 100644 index 61dcc43..0000000 --- a/node/expr/cast/n_cast_double.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Double node -type Double struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewDouble node constructor -func NewDouble(Expr node.Node) *Double { - return &Double{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Double) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Double) GetPosition() *position.Position { - return n.Position -} - -func (n *Double) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Double) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Double) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_int.go b/node/expr/cast/n_cast_int.go deleted file mode 100644 index fc3f98d..0000000 --- a/node/expr/cast/n_cast_int.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Int node -type Int struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewInt node constructor -func NewInt(Expr node.Node) *Int { - return &Int{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Int) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Int) GetPosition() *position.Position { - return n.Position -} - -func (n *Int) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Int) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Int) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_object.go b/node/expr/cast/n_cast_object.go deleted file mode 100644 index ea67ce2..0000000 --- a/node/expr/cast/n_cast_object.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Object node -type Object struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewObject node constructor -func NewObject(Expr node.Node) *Object { - return &Object{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Object) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Object) GetPosition() *position.Position { - return n.Position -} - -func (n *Object) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Object) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Object) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_string.go b/node/expr/cast/n_cast_string.go deleted file mode 100644 index 68a09e2..0000000 --- a/node/expr/cast/n_cast_string.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// String node -type String struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewString node constructor -func NewString(Expr node.Node) *String { - return &String{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *String) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *String) GetPosition() *position.Position { - return n.Position -} - -func (n *String) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *String) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *String) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/n_cast_unset.go b/node/expr/cast/n_cast_unset.go deleted file mode 100644 index a792daa..0000000 --- a/node/expr/cast/n_cast_unset.go +++ /dev/null @@ -1,58 +0,0 @@ -package cast - -import ( - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/position" - "github.com/z7zmey/php-parser/walker" -) - -// Unset node -type Unset struct { - FreeFloating freefloating.Collection - Position *position.Position - Expr node.Node -} - -// NewUnset node constructor -func NewUnset(Expr node.Node) *Unset { - return &Unset{ - FreeFloating: nil, - Expr: Expr, - } -} - -// SetPosition sets node position -func (n *Unset) SetPosition(p *position.Position) { - n.Position = p -} - -// GetPosition returns node positions -func (n *Unset) GetPosition() *position.Position { - return n.Position -} - -func (n *Unset) GetFreeFloating() *freefloating.Collection { - return &n.FreeFloating -} - -// Attributes returns node attributes as map -func (n *Unset) Attributes() map[string]interface{} { - return nil -} - -// Walk traverses nodes -// Walk is invoked recursively until v.EnterNode returns true -func (n *Unset) Walk(v walker.Visitor) { - if v.EnterNode(n) == false { - return - } - - if n.Expr != nil { - v.EnterChildNode("Expr", n) - n.Expr.Walk(v) - v.LeaveChildNode("Expr", n) - } - - v.LeaveNode(n) -} diff --git a/node/expr/cast/t_cast_test.go b/node/expr/cast/t_cast_test.go deleted file mode 100644 index 0314800..0000000 --- a/node/expr/cast/t_cast_test.go +++ /dev/null @@ -1,653 +0,0 @@ -package cast_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/position" -) - -func TestArray(t *testing.T) { - src := `1, &$b,);` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 21, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 21, - }, - Expr: &expr.Array{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 20, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 13, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 10, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 13, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 18, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 18, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 18, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 18, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestArrayItemUnpack(t *testing.T) { - src := ` $a;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 14, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 14, - }, - Expr: &expr.ArrowFunction{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - ReturnsRef: false, - Static: false, - PhpDocComment: "", - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - Value: "a", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestArrowFunctionReturnType(t *testing.T) { - src := ` $a;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 23, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 23, - }, - Expr: &expr.ArrowFunction{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 22, - }, - Static: false, - PhpDocComment: "", - ReturnsRef: true, - ReturnType: &name.Name{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, - }, - Value: "foo", - }, - }, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 22, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 22, - }, - Value: "a", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/t_bitwise_not_test.go b/node/expr/t_bitwise_not_test.go deleted file mode 100644 index a5688b0..0000000 --- a/node/expr/t_bitwise_not_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package expr_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestBitwiseNot(t *testing.T) { - src := `foo();` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - Value: "foo", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/t_new_test.go b/node/expr/t_new_test.go deleted file mode 100644 index d0670f8..0000000 --- a/node/expr/t_new_test.go +++ /dev/null @@ -1,323 +0,0 @@ -package expr_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node/expr" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestNew(t *testing.T) { - src := `foo;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - Expr: &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - Value: "a", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - Value: "foo", - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/t_reference_test.go b/node/expr/t_reference_test.go deleted file mode 100644 index 8a9c38e..0000000 --- a/node/expr/t_reference_test.go +++ /dev/null @@ -1,117 +0,0 @@ -package expr_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestForeachWithRef(t *testing.T) { - t.Helper() - src := ` &$v) {}` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Stmts: []node.Node{ - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "k", - }, - }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 27, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - Value: "v", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - Stmts: []node.Node{}, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/t_shell_exec_test.go b/node/expr/t_shell_exec_test.go deleted file mode 100644 index 4932334..0000000 --- a/node/expr/t_shell_exec_test.go +++ /dev/null @@ -1,86 +0,0 @@ -package expr_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node/expr" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestShellExec(t *testing.T) { - src := "1, &$b,];` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 16, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 16, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 15, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 4, - EndPos: 8, - }, - Key: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 4, - EndPos: 5, - }, - Value: "1", - }, - Val: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 8, - }, - Value: "1", - }, - }, - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 13, - }, - Val: &expr.Reference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 13, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - Value: "b", - }, - }, - }, - }, - &expr.ArrayItem{}, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/expr/t_short_list_test.go b/node/expr/t_short_list_test.go deleted file mode 100644 index 76f0bbe..0000000 --- a/node/expr/t_short_list_test.go +++ /dev/null @@ -1,304 +0,0 @@ -package expr_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/position" -) - -func TestShortList(t *testing.T) { - src := ` $b;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 18, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 18, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - Value: "a", - }, - }, - Value: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 17, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 17, - }, - Value: "b", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestYieldExpr(t *testing.T) { - src := ` 1;` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, - Expr: &expr.Yield{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 16, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, - }, - Value: "a", - }, - }, - Value: &scalar.Lnumber{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 16, - }, - Value: "1", - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestYieldFrom(t *testing.T) { - src := `bar()";` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 22, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 22, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 21, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 4, - EndPos: 9, - }, - Value: "test ", - }, - &expr.PropertyFetch{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 18, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 13, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 13, - }, - Value: "foo", - }, - }, - Property: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 18, - }, - Value: "bar", - }, - }, - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "()", - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestDollarOpenCurlyBraces(t *testing.T) { - src := `bar()}";` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 24, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 24, - }, - Expr: &scalar.Encapsed{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 23, - }, - Parts: []node.Node{ - &scalar.EncapsedStringPart{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 4, - EndPos: 9, - }, - Value: "test ", - }, - &expr.MethodCall{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 21, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 14, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 14, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 21, - }, - }, - }, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/scalar/t_freefloating_test.go b/node/scalar/t_freefloating_test.go deleted file mode 100644 index c30e2ff..0000000 --- a/node/scalar/t_freefloating_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package scalar_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/scalar" -) - -var expected freefloating.Collection = freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.WhiteSpaceType, - Value: " ", - Position: nil, - }, - { - StringType: freefloating.CommentType, - Value: "//comment\n", - Position: nil, - }, - }, -} - -var nodes = []node.Node{ - &scalar.Dnumber{ - FreeFloating: expected, - }, - &scalar.EncapsedStringPart{ - FreeFloating: expected, - }, - &scalar.Encapsed{ - FreeFloating: expected, - }, - &scalar.Heredoc{ - FreeFloating: expected, - }, - &scalar.Lnumber{ - FreeFloating: expected, - }, - &scalar.MagicConstant{ - FreeFloating: expected, - }, - &scalar.String{ - FreeFloating: expected, - }, -} - -func TestMeta(t *testing.T) { - for _, n := range nodes { - actual := *n.GetFreeFloating() - assert.DeepEqual(t, expected, actual) - } -} diff --git a/node/scalar/t_heredoc_test.go b/node/scalar/t_heredoc_test.go deleted file mode 100644 index ae0ce1f..0000000 --- a/node/scalar/t_heredoc_test.go +++ /dev/null @@ -1,336 +0,0 @@ -package scalar_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestHeredocSimpleLabel(t *testing.T) { - src := ` $v) {}` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, - Stmts: []node.Node{ - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "k", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 26, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 26, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 30, - }, - Stmts: []node.Node{}, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestForeachExprWithKey(t *testing.T) { - src := ` $v) {}` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, - Stmts: []node.Node{ - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, - Expr: &expr.ShortArray{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - Items: []node.Node{}, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "k", - }, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 26, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 26, - }, - Value: "v", - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 30, - }, - Stmts: []node.Node{}, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestForeachWithRef(t *testing.T) { - src := ` &$v) {}` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Stmts: []node.Node{ - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "k", - }, - }, - Variable: &expr.Reference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 27, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - Value: "v", - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - Stmts: []node.Node{}, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestForeachWithList(t *testing.T) { - src := ` list($v)) {}` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 36, - }, - Stmts: []node.Node{ - &stmt.Foreach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 36, - }, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 14, - }, - Value: "a", - }, - }, - Key: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 20, - }, - Value: "k", - }, - }, - Variable: &expr.List{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 32, - }, - Items: []node.Node{ - &expr.ArrayItem{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - Val: &expr.Variable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - Value: "v", - }, - }, - }, - }, - }, - Stmt: &stmt.StmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 34, - EndPos: 36, - }, - Stmts: []node.Node{}, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/stmt/t_freefloating_test.go b/node/stmt/t_freefloating_test.go deleted file mode 100644 index 182c5d9..0000000 --- a/node/stmt/t_freefloating_test.go +++ /dev/null @@ -1,216 +0,0 @@ -package stmt_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" -) - -var expected freefloating.Collection = freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.WhiteSpaceType, - Value: " ", - Position: nil, - }, - { - StringType: freefloating.CommentType, - Value: "//comment\n", - Position: nil, - }, - }, -} - -var nodes = []node.Node{ - &stmt.AltElseIf{ - FreeFloating: expected, - }, - &stmt.AltElse{ - FreeFloating: expected, - }, - &stmt.AltFor{ - FreeFloating: expected, - }, - &stmt.AltForeach{ - FreeFloating: expected, - }, - &stmt.AltIf{ - FreeFloating: expected, - }, - &stmt.AltSwitch{ - FreeFloating: expected, - }, - &stmt.AltWhile{ - FreeFloating: expected, - }, - &stmt.Break{ - FreeFloating: expected, - }, - &stmt.CaseList{ - FreeFloating: expected, - }, - &stmt.Case{ - FreeFloating: expected, - }, - &stmt.Catch{ - FreeFloating: expected, - }, - &stmt.ClassConstList{ - FreeFloating: expected, - }, - &stmt.ClassExtends{ - FreeFloating: expected, - }, - &stmt.ClassImplements{ - FreeFloating: expected, - }, - &stmt.ClassMethod{ - FreeFloating: expected, - }, - &stmt.Class{ - FreeFloating: expected, - }, - &stmt.ConstList{ - FreeFloating: expected, - }, - &stmt.Constant{ - FreeFloating: expected, - }, - &stmt.Continue{ - FreeFloating: expected, - }, - &stmt.Declare{ - FreeFloating: expected, - }, - &stmt.Default{ - FreeFloating: expected, - }, - &stmt.Do{ - FreeFloating: expected, - }, - &stmt.Echo{ - FreeFloating: expected, - }, - &stmt.ElseIf{ - FreeFloating: expected, - }, - &stmt.Else{ - FreeFloating: expected, - }, - &stmt.Expression{ - FreeFloating: expected, - }, - &stmt.Finally{ - FreeFloating: expected, - }, - &stmt.For{ - FreeFloating: expected, - }, - &stmt.Foreach{ - FreeFloating: expected, - }, - &stmt.Function{ - FreeFloating: expected, - }, - &stmt.Global{ - FreeFloating: expected, - }, - &stmt.Goto{ - FreeFloating: expected, - }, - &stmt.GroupUse{ - FreeFloating: expected, - }, - &stmt.HaltCompiler{ - FreeFloating: expected, - }, - &stmt.If{ - FreeFloating: expected, - }, - &stmt.InlineHtml{ - FreeFloating: expected, - }, - &stmt.InterfaceExtends{ - FreeFloating: expected, - }, - &stmt.Interface{ - FreeFloating: expected, - }, - &stmt.Label{ - FreeFloating: expected, - }, - &stmt.Namespace{ - FreeFloating: expected, - }, - &stmt.Nop{ - FreeFloating: expected, - }, - &stmt.PropertyList{ - FreeFloating: expected, - }, - &stmt.Property{ - FreeFloating: expected, - }, - &stmt.Return{ - FreeFloating: expected, - }, - &stmt.StaticVar{ - FreeFloating: expected, - }, - &stmt.Static{ - FreeFloating: expected, - }, - &stmt.StmtList{ - FreeFloating: expected, - }, - &stmt.Switch{ - FreeFloating: expected, - }, - &stmt.Throw{ - FreeFloating: expected, - }, - &stmt.TraitAdaptationList{ - FreeFloating: expected, - }, - &stmt.TraitMethodRef{ - FreeFloating: expected, - }, - &stmt.TraitUseAlias{ - FreeFloating: expected, - }, - &stmt.TraitUsePrecedence{ - FreeFloating: expected, - }, - &stmt.TraitUse{ - FreeFloating: expected, - }, - &stmt.Trait{ - FreeFloating: expected, - }, - &stmt.Try{ - FreeFloating: expected, - }, - &stmt.Unset{ - FreeFloating: expected, - }, - &stmt.UseList{ - FreeFloating: expected, - }, - &stmt.Use{ - FreeFloating: expected, - }, - &stmt.While{ - FreeFloating: expected, - }, -} - -func TestMeta(t *testing.T) { - for _, n := range nodes { - actual := *n.GetFreeFloating() - assert.DeepEqual(t, expected, actual) - } -} diff --git a/node/stmt/t_function_test.go b/node/stmt/t_function_test.go deleted file mode 100644 index 4b8fbe3..0000000 --- a/node/stmt/t_function_test.go +++ /dev/null @@ -1,383 +0,0 @@ -package stmt_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestSimpleFunction(t *testing.T) { - src := `
` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, - Stmts: []node.Node{ - &stmt.Nop{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - }, - &stmt.InlineHtml{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 5, - EndPos: 17, - }, - Value: "
", - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual = php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} diff --git a/node/stmt/t_interface_test.go b/node/stmt/t_interface_test.go deleted file mode 100644 index 5b018ec..0000000 --- a/node/stmt/t_interface_test.go +++ /dev/null @@ -1,224 +0,0 @@ -package stmt_test - -import ( - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/position" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/php7" -) - -func TestInterface(t *testing.T) { - src := `bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - /** anonymous class */ - new class ($a, ...$b) {}; - ` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 9, - StartPos: 6, - EndPos: 186, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 21, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 20, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 19, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 19, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 19, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 40, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 28, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 28, - }, - Value: "foo", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 39, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 38, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 38, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 38, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 64, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 47, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 47, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 52, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 63, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - IsReference: false, - Variadic: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 62, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 87, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, - Value: "foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 75, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 86, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 85, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 111, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 94, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 94, - }, - Value: "foo", - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 99, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 110, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 109, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 133, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 132, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 131, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 186, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 185, - }, - Class: &stmt.Class{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 185, - }, - PhpDocComment: "/** anonymous class */", - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 171, - EndPos: 182, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 176, - EndPos: 181, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 181, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 181, - }, - Value: "b", - }, - }, - }, - }, - }, - Stmts: []node.Node{}, - }, - }, - }, - }, - } - - php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestPhp5ArgumentNode(t *testing.T) { - src := `bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - ` - - expected := &node.Root{ - Position: &position.Position{ - StartLine: 2, - EndLine: 7, - StartPos: 6, - EndPos: 133, - }, - Stmts: []node.Node{ - &stmt.Expression{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 21, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 20, - }, - Function: &name.Name{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 20, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 12, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 19, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 19, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 17, - EndPos: 19, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 40, - }, - Expr: &expr.FunctionCall{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 39, - }, - Function: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 28, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 28, - }, - Value: "foo", - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 39, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 29, - EndPos: 31, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 33, - EndPos: 38, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 38, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 36, - EndPos: 38, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 64, - }, - Expr: &expr.MethodCall{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 63, - }, - Variable: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 47, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 43, - EndPos: 47, - }, - Value: "foo", - }, - }, - Method: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 52, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 52, - EndPos: 63, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 62, - }, - IsReference: false, - Variadic: true, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 87, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 86, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, - Value: "foo", - }, - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 72, - EndPos: 75, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 75, - EndPos: 86, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 85, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 111, - }, - Expr: &expr.StaticCall{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 110, - }, - Class: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 94, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 90, - EndPos: 94, - }, - Value: "foo", - }, - }, - Call: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 99, - }, - Value: "bar", - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 99, - EndPos: 110, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 109, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - &stmt.Expression{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 133, - }, - Expr: &expr.New{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 114, - EndPos: 132, - }, - Class: &name.Name{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, - Parts: []node.Node{ - &name.NamePart{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, - Value: "foo", - }, - }, - }, - ArgumentList: &node.ArgumentList{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 121, - EndPos: 132, - }, - Arguments: []node.Node{ - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - Variadic: false, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - Value: "a", - }, - }, - }, - &node.Argument{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 131, - }, - Variadic: true, - IsReference: false, - Expr: &expr.Variable{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, - }, - VarName: &node.Identifier{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, - }, - Value: "b", - }, - }, - }, - }, - }, - }, - }, - }, - } - - php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.Parse() - actual := php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - -func TestPhp7ParameterNode(t *testing.T) { - src := ` Date: Sun, 17 May 2020 22:56:32 +0300 Subject: [PATCH 009/140] refactor printer --- cmd/php-parser/main.go | 2 +- internal/php5/parser.go | 24 +- internal/php5/php5.go | Bin 351465 -> 352441 bytes internal/php5/php5.y | 22 + internal/php7/parser.go | 21 +- internal/php7/parser_test.go | 60 +- internal/php7/php7.go | Bin 288574 -> 289200 bytes internal/php7/php7.y | 16 + internal/scanner/scanner.go | Bin 384834 -> 384850 bytes internal/scanner/scanner.rl | 1 + internal/scanner/token.go | 1 + pkg/ast/visitor/namespace_resolver.go | 4 +- pkg/ast/visitor/namespace_resolver_test.go | 62 +- {printer => pkg/printer}/pretty_printer.go | 1134 +++--- .../printer}/pretty_printer_test.go | 1855 +++++----- pkg/printer/printer.go | 3257 ++++++++++++++++ .../printer}/printer_parsed_php5_test.go | 12 +- .../printer}/printer_parsed_php7_test.go | 20 +- {printer => pkg/printer}/printer_test.go | 2415 ++++++------ pkg/token/position.go | 13 +- printer/printer.go | 3267 ----------------- 21 files changed, 6120 insertions(+), 6066 deletions(-) rename {printer => pkg/printer}/pretty_printer.go (54%) rename {printer => pkg/printer}/pretty_printer_test.go (55%) create mode 100644 pkg/printer/printer.go rename {printer => pkg/printer}/printer_parsed_php5_test.go (99%) rename {printer => pkg/printer}/printer_parsed_php7_test.go (98%) rename {printer => pkg/printer}/printer_test.go (54%) delete mode 100644 printer/printer.go diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 569dd30..33d03e0 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -13,8 +13,8 @@ import ( "github.com/pkg/profile" "github.com/yookoala/realpath" - "github.com/z7zmey/php-parser/pkg/parser" "github.com/z7zmey/php-parser/pkg/ast/visitor" + "github.com/z7zmey/php-parser/pkg/parser" ) var wg sync.WaitGroup diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 060be97..d4ec16d 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -2,6 +2,7 @@ package php5 import ( "bytes" + "fmt" "github.com/z7zmey/php-parser/internal/positionbuilder" "github.com/z7zmey/php-parser/internal/scanner" @@ -132,10 +133,25 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { return []token.Token{} } - tokens := make([]token.Token, len(t.Tokens)) - copy(tokens, t.Tokens) + return []token.Token{ + { + ID: token.ID(t.ID), + Value: t.Value, + }, + } +} - return tokens +func (l *Parser) addDollarToken(v ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + l.setFreeFloating(v, token.Dollar, []token.Token{ + { + ID: token.ID('$'), + Value: []byte("$"), + }, + }) } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { @@ -159,6 +175,8 @@ func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } vlen := len(semiColon[0].Value) + fmt.Printf("vlen: %q\n", string(semiColon[0].Value)) + tlen := 2 if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { tlen = 3 diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 0b7071c7ed8af7138587147591722e79b8bc60c7..b63ef14d9ac832ea4a8f75c6ef740c1df8969913 100644 GIT binary patch delta 8740 zcmb7Kd3=sn_W#`F$wnl$5RrutJMWu!S0W(^Y6-Q~o}fj?5?wTJjLTE+QX!(`5ha= znVS?dMAb1-=(|U+Fa+L9K`Y{q}>D`h?sN7IKi!r}C z7RIk|S{f#?;$0rDeyPFdGv?9sw>WvDd3VS$E1JIs(eNjphS$TYoZ5UR!?ht`0rxm* zVO?IveELrlg$186D>WiKd?w{I;IT9yh8J1>>bYVKu)tR7!!#h42Vc>r^|_mh8}TgW zGz!%Q(wzcvu#z|TFs;Amb5A$1_w z0N2Ket6^dA{D&!S9E3CHRk`7A8g-8m{#Oy8fIj(<$16uZo|&TWvRbK56ZjgT<51lO z|2=NqLmArXUwRYwC@&Y0YRDvB#JS6HBep2SmRceIUnaddjV$1q-0!H?MR%$!z(uro zs@z9-DWj%K?cp#+4?POyIvsY@X!aP-=BZ|9BPyNEV^zsx{A+Ex+Hn;qH97OD^>g@s z4rLo9ou0?D$T^rdsE$>;$vGb{>!%kwAwSs@aZj}T~z8bxnHzCIWYXFUZ9-a~~kFLOG z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y(OL12us`)g~1ol-;`rRDXh7x>7kt`kwWpxtAj>+NqLPN`_%t0a)b$55eYJscOc7^ z+(%}54jlzR;jvDR%E&@Z*TTuB>5qsA<7w>7S9B)U=|i#c__Mi{lWc1U4oU6lNMomv ziZ-AL+qk7OwtTbfVP-dXCUJl=xFjFVt2BF?DQe}+;{w(K*P0*15E_?=XJz>R6K>U{ zh~N)c?UEcc9Ra}M&i7DUTQHXisR5q-0?=t2*P&kttPO5!?{GL@lCsZ`;0x>7}{ zj5M2jI+YTU-~MpmrHVQcQI9bFH2X2xmg$YVjM-46_RMu+B^}Oj`omy?ZjW*z(s**6 z0%pa+(Jcd=r);@iU))X~?CfO*h^q~A-4JI4b74R7)G#Ivwm9aEU^@PFirbS<6u?wa zem8VKYi@*+JT_q!Q|U;a1anT`QK0pBLWukZC!9u)aZm)9szT>2Kp0-ReVoI;DFlg1 RcZ)EZUx-WmK3=*c{|9+$1-t+N diff --git a/internal/php5/php5.y b/internal/php5/php5.y index fc42063..082430d 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1431,6 +1431,7 @@ catch_statement: yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) @@ -1508,6 +1509,7 @@ additional_catch: yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) @@ -2309,6 +2311,7 @@ parameter: yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2354,6 +2357,7 @@ parameter: } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2556,6 +2560,7 @@ global_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2605,6 +2610,7 @@ static_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2623,6 +2629,7 @@ static_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) @@ -2641,6 +2648,7 @@ static_var_list: staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2658,6 +2666,7 @@ static_var_list: staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) @@ -3155,6 +3164,7 @@ class_variable_declaration: property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) @@ -3174,6 +3184,7 @@ class_variable_declaration: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) @@ -3192,6 +3203,7 @@ class_variable_declaration: property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3209,6 +3221,7 @@ class_variable_declaration: property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) @@ -4589,6 +4602,7 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4608,6 +4622,7 @@ lexical_var_list: yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4623,6 +4638,7 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4641,6 +4657,7 @@ lexical_var_list: // save comments yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6381,6 +6398,7 @@ compound_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6807,6 +6825,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6822,6 +6841,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) @@ -6841,6 +6861,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) @@ -6950,6 +6971,7 @@ encaps_var_offset: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index cb42f54..a960984 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -131,10 +131,25 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { return []token.Token{} } - tokens := make([]token.Token, len(t.Tokens)) - copy(tokens, t.Tokens) + return []token.Token{ + { + ID: token.ID(t.ID), + Value: t.Value, + }, + } +} - return tokens +func (l *Parser) addDollarToken(v ast.Vertex) { + if l.Lexer.GetWithFreeFloating() == false { + return + } + + l.setFreeFloating(v, token.Dollar, []token.Token{ + { + ID: token.ID('$'), + Value: []byte("$"), + }, + }) } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 25490fc..bceae9c 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -982,7 +982,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 51, }, }, - ReturnsRef: false, + ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -1183,7 +1183,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 117, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -1397,8 +1397,8 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 162, }, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ @@ -1577,8 +1577,8 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 214, }, }, - Static: true, - ReturnsRef: false, + Static: true, + ReturnsRef: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ @@ -4376,7 +4376,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { EndPos: 31, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -4454,7 +4454,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { EndPos: 45, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -4511,7 +4511,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { EndPos: 73, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -4602,7 +4602,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { EndPos: 52, }, }, - ReturnsRef: true, + ReturnsRef: true, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -4740,7 +4740,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { EndPos: 54, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -4854,7 +4854,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { EndPos: 51, }, }, - ReturnsRef: false, + ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -7300,7 +7300,7 @@ func TestStmtFunction(t *testing.T) { EndPos: 20, }, }, - ReturnsRef: false, + ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -7345,7 +7345,7 @@ func TestStmtFunction_Return(t *testing.T) { EndPos: 27, }, }, - ReturnsRef: false, + ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -7401,7 +7401,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 51, }, }, - ReturnsRef: false, + ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -7568,7 +7568,7 @@ func TestStmtFunction_Ref(t *testing.T) { EndPos: 30, }, }, - ReturnsRef: true, + ReturnsRef: true, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -7635,7 +7635,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { EndPos: 27, }, }, - ReturnsRef: true, + ReturnsRef: true, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ @@ -14535,8 +14535,8 @@ func TestExprArrowFunction(t *testing.T) { EndPos: 13, }, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -14600,8 +14600,8 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { EndPos: 22, }, }, - Static: false, - ReturnsRef: true, + Static: false, + ReturnsRef: true, ReturnType: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ @@ -15080,9 +15080,9 @@ func TestExprClosure(t *testing.T) { EndPos: 15, }, }, - ReturnsRef: false, - Static: false, - Stmts: []ast.Vertex{}, + ReturnsRef: false, + Static: false, + Stmts: []ast.Vertex{}, }, }, }, @@ -15125,8 +15125,8 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 36, }, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ @@ -15302,8 +15302,8 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 36, }, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ @@ -15479,8 +15479,8 @@ func TestExprClosure_ReturnType(t *testing.T) { EndPos: 22, }, }, - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, ReturnType: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 9a3f30acc70e4c89f744c945a1580e66496e91ed..0900ad3bc4f50b2d782f8519e24d3155b18efd06 100644 GIT binary patch delta 6082 zcmbtYdw7+_(SLUKO~QeMB!whRfaC-)AR;;UBnT2fl29lKBBFri0$3o(O$?}jky`rs z2_zU{Xcd}#3K-=Q1Y9l3#pP_dU7Lr`GoAU+3(;yR$RD znfcA^ZrvSSvp>3~WdfzSe;uBn!V`pJQ*7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}KNzS(_^cp=gC$U5w_ zc{V$&Gde&1iX<=qu>A~l$pC)cg@Ks!I-K<<`&n6I=ab=|ea_?)L?s0g6WrgPhab@l z{Zg0w54Zqk`YVpvmi3*^DUY2Z+b&2Z&c1*!VmL|W;snc5AbzVW)1bf4>cj)@$b~$A z5cO2kzLzHi=U)atnt@YQUj`iNJC8A_|5coY>S{-{IRJYL3e)Cg;Wy4PzJ3eGx)QZKrReYh>_+d<83*`+d_T5<70dV=dhXckAa zc#I={k%M?yww1zlFJX1uPZ%Hy^F%8~6N%=;IEvvnqb#qwc1x#&AI!M+rc6`~Ps#p5 z3pfxM1rtuEu?g4g8?Fd>_w`uopn*8qX}JAEVg*;%kXcp*6LMeD% z#lyX-qN|008=V?xhb9w=_SUw$wMqwARrjzWEIn4^;g4KZEgkGip!UeT7WSyAy)32i zFmTmxC-Ll3~ZjkC+(&O`~#z(AcQeP=rbazwo14qIv zTxo+}H#d&72Afa1Xk?~$sc`_xwr_|Pc$WA40M%R75@ipu;nEH diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 9f08fa4..cd147ff 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1368,6 +1368,7 @@ catch_list: yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Tokens) yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Tokens) yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Tokens) @@ -2172,6 +2173,8 @@ parameter: } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).addDollarToken(variable) + // normalize if $3 == nil { yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) @@ -2217,6 +2220,8 @@ parameter: yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).addDollarToken(variable) + // normalize if $3 == nil { yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) @@ -2456,6 +2461,7 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2472,6 +2478,7 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2981,6 +2988,7 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2997,6 +3005,7 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4297,6 +4306,7 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4314,6 +4324,7 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4943,6 +4954,7 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5352,6 +5364,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5367,6 +5380,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) @@ -5386,6 +5400,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments + yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) @@ -5521,6 +5536,7 @@ encaps_var_offset: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 3764cecebc814589dd6160b8a65a90d6e0ae1930..0d411e1ec8e4ad8d6a07dc73564650959747d838 100644 GIT binary patch delta 40 ucmX@KPyEt8@rD-07N!>F7M3lnQup~eOY*Z*^YlDj6l@iM%;}Q%Sv3JRaSjIn delta 24 gcmcb#PyEn6@rD-07N!>F7M3lnQun88-DlMR0DyT3SO5S3 diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index 5eec481..d9195f2 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -510,6 +510,7 @@ func (lex *Lexer) Lex(lval Lval) int { token.Tokens = lex.Tokens token.Value = lex.data[lex.ts:lex.te] + token.ID = tok lval.Token(token) diff --git a/internal/scanner/token.go b/internal/scanner/token.go index d45a12e..7c07126 100644 --- a/internal/scanner/token.go +++ b/internal/scanner/token.go @@ -6,6 +6,7 @@ import ( // Token value returned by lexer type Token struct { + ID TokenID Value []byte Tokens []token.Token StartLine int diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index f79378c..3029c5c 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -27,7 +27,7 @@ func NewNamespaceResolver() *NamespaceResolver { func (nsr *NamespaceResolver) EnterNode(n ast.Vertex) bool { n.Accept(nsr) - + if !nsr.goDeep { nsr.goDeep = true return false @@ -54,7 +54,7 @@ func (nsr *NamespaceResolver) StmtUseList(n *ast.StmtUseList) { for _, nn := range n.Uses { nsr.AddAlias(useType, nn, nil) } - + nsr.goDeep = false } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 61ed537..607aa9e 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -194,8 +194,8 @@ func TestResolveInstanceCatch(t *testing.T) { nameBC, nameF, }, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, - Stmts: []ast.Vertex{}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Stmts: []ast.Vertex{}, }, }, }, @@ -407,7 +407,7 @@ func TestResolveClassName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} class := &ast.StmtClass{ - ClassName: &ast.Identifier{Value: []byte("A")}, + ClassName: &ast.Identifier{Value: []byte("A")}, Extends: &ast.StmtClassExtends{ ClassName: nameAB, }, @@ -472,8 +472,8 @@ func TestResolveInterfaceName(t *testing.T) { func TestResolveTraitName(t *testing.T) { traitNode := &ast.StmtTrait{ - TraitName: &ast.Identifier{Value: []byte("A")}, - Stmts: []ast.Vertex{}, + TraitName: &ast.Identifier{Value: []byte("A")}, + Stmts: []ast.Vertex{}, } stxTree := &ast.StmtStmtList{ @@ -498,14 +498,14 @@ func TestResolveFunctionName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} functionNode := &ast.StmtFunction{ - ReturnsRef: false, - FunctionName: &ast.Identifier{Value: []byte("A")}, + ReturnsRef: false, + FunctionName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -536,14 +536,14 @@ func TestResolveMethodName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} methodNode := &ast.StmtClassMethod{ - ReturnsRef: false, - MethodName: &ast.Identifier{Value: []byte("A")}, + ReturnsRef: false, + MethodName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -569,14 +569,14 @@ func TestResolveClosureName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} closureNode := &ast.ExprClosure{ - ReturnsRef: false, - Static: false, + ReturnsRef: false, + Static: false, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + ByRef: false, + Variadic: false, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ClosureUse: nil, @@ -600,12 +600,12 @@ func TestResolveConstantsName(t *testing.T) { nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} constantB := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("B")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + ConstantName: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } constantC := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("C")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + ConstantName: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } stxTree := &ast.StmtStmtList{ @@ -644,12 +644,12 @@ func TestResolveNamespaces(t *testing.T) { relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("E")}}} constantB := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("B")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + ConstantName: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } constantC := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("C")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + ConstantName: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } stxTree := &ast.StmtStmtList{ diff --git a/printer/pretty_printer.go b/pkg/printer/pretty_printer.go similarity index 54% rename from printer/pretty_printer.go rename to pkg/printer/pretty_printer.go index 95de96f..37a1a71 100644 --- a/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -4,15 +4,7 @@ import ( "io" "strings" - "github.com/z7zmey/php-parser/node/stmt" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" + "github.com/z7zmey/php-parser/pkg/ast" ) type PrettyPrinter struct { @@ -30,11 +22,11 @@ func NewPrettyPrinter(w io.Writer, indentStr string) *PrettyPrinter { } } -func (p *PrettyPrinter) Print(n node.Node) { +func (p *PrettyPrinter) Print(n ast.Vertex) { p.printNode(n) } -func (p *PrettyPrinter) joinPrint(glue string, nn []node.Node) { +func (p *PrettyPrinter) joinPrint(glue string, nn []ast.Vertex) { for k, n := range nn { if k > 0 { io.WriteString(p.w, glue) @@ -44,7 +36,7 @@ func (p *PrettyPrinter) joinPrint(glue string, nn []node.Node) { } } -func (p *PrettyPrinter) printNodes(nn []node.Node) { +func (p *PrettyPrinter) printNodes(nn []ast.Vertex) { p.indentDepth++ l := len(nn) - 1 for k, n := range nn { @@ -63,367 +55,367 @@ func (p *PrettyPrinter) printIndent() { } } -func (p *PrettyPrinter) printNode(n node.Node) { +func (p *PrettyPrinter) printNode(n ast.Vertex) { switch n.(type) { // node - case *node.Root: + case *ast.Root: p.printNodeRoot(n) - case *node.Identifier: + case *ast.Identifier: p.printNodeIdentifier(n) - case *node.Parameter: + case *ast.Parameter: p.printNodeParameter(n) - case *node.Nullable: + case *ast.Nullable: p.printNodeNullable(n) - case *node.Argument: + case *ast.Argument: p.printNodeArgument(n) // name - case *name.NamePart: + case *ast.NameNamePart: p.printNameNamePart(n) - case *name.Name: + case *ast.NameName: p.printNameName(n) - case *name.FullyQualified: + case *ast.NameFullyQualified: p.printNameFullyQualified(n) - case *name.Relative: + case *ast.NameRelative: p.printNameRelative(n) // scalar - case *scalar.Lnumber: + case *ast.ScalarLnumber: p.printScalarLNumber(n) - case *scalar.Dnumber: + case *ast.ScalarDnumber: p.printScalarDNumber(n) - case *scalar.String: + case *ast.ScalarString: p.printScalarString(n) - case *scalar.EncapsedStringPart: + case *ast.ScalarEncapsedStringPart: p.printScalarEncapsedStringPart(n) - case *scalar.Encapsed: + case *ast.ScalarEncapsed: p.printScalarEncapsed(n) - case *scalar.Heredoc: + case *ast.ScalarHeredoc: p.printScalarHeredoc(n) - case *scalar.MagicConstant: + case *ast.ScalarMagicConstant: p.printScalarMagicConstant(n) // assign - case *assign.Assign: - p.printAssign(n) - case *assign.Reference: - p.printReference(n) - case *assign.BitwiseAnd: + case *ast.ExprAssign: + p.printAssignAssign(n) + case *ast.ExprAssignReference: + p.printAssignReference(n) + case *ast.ExprAssignBitwiseAnd: p.printAssignBitwiseAnd(n) - case *assign.BitwiseOr: + case *ast.ExprAssignBitwiseOr: p.printAssignBitwiseOr(n) - case *assign.BitwiseXor: + case *ast.ExprAssignBitwiseXor: p.printAssignBitwiseXor(n) - case *assign.Concat: + case *ast.ExprAssignConcat: p.printAssignConcat(n) - case *assign.Div: + case *ast.ExprAssignDiv: p.printAssignDiv(n) - case *assign.Minus: + case *ast.ExprAssignMinus: p.printAssignMinus(n) - case *assign.Mod: + case *ast.ExprAssignMod: p.printAssignMod(n) - case *assign.Mul: + case *ast.ExprAssignMul: p.printAssignMul(n) - case *assign.Plus: + case *ast.ExprAssignPlus: p.printAssignPlus(n) - case *assign.Pow: + case *ast.ExprAssignPow: p.printAssignPow(n) - case *assign.ShiftLeft: + case *ast.ExprAssignShiftLeft: p.printAssignShiftLeft(n) - case *assign.ShiftRight: + case *ast.ExprAssignShiftRight: p.printAssignShiftRight(n) // binary - case *binary.BitwiseAnd: + case *ast.ExprBinaryBitwiseAnd: p.printBinaryBitwiseAnd(n) - case *binary.BitwiseOr: + case *ast.ExprBinaryBitwiseOr: p.printBinaryBitwiseOr(n) - case *binary.BitwiseXor: + case *ast.ExprBinaryBitwiseXor: p.printBinaryBitwiseXor(n) - case *binary.BooleanAnd: + case *ast.ExprBinaryBooleanAnd: p.printBinaryBooleanAnd(n) - case *binary.BooleanOr: + case *ast.ExprBinaryBooleanOr: p.printBinaryBooleanOr(n) - case *binary.Coalesce: + case *ast.ExprBinaryCoalesce: p.printBinaryCoalesce(n) - case *binary.Concat: + case *ast.ExprBinaryConcat: p.printBinaryConcat(n) - case *binary.Div: + case *ast.ExprBinaryDiv: p.printBinaryDiv(n) - case *binary.Equal: + case *ast.ExprBinaryEqual: p.printBinaryEqual(n) - case *binary.GreaterOrEqual: + case *ast.ExprBinaryGreaterOrEqual: p.printBinaryGreaterOrEqual(n) - case *binary.Greater: + case *ast.ExprBinaryGreater: p.printBinaryGreater(n) - case *binary.Identical: + case *ast.ExprBinaryIdentical: p.printBinaryIdentical(n) - case *binary.LogicalAnd: + case *ast.ExprBinaryLogicalAnd: p.printBinaryLogicalAnd(n) - case *binary.LogicalOr: + case *ast.ExprBinaryLogicalOr: p.printBinaryLogicalOr(n) - case *binary.LogicalXor: + case *ast.ExprBinaryLogicalXor: p.printBinaryLogicalXor(n) - case *binary.Minus: + case *ast.ExprBinaryMinus: p.printBinaryMinus(n) - case *binary.Mod: + case *ast.ExprBinaryMod: p.printBinaryMod(n) - case *binary.Mul: + case *ast.ExprBinaryMul: p.printBinaryMul(n) - case *binary.NotEqual: + case *ast.ExprBinaryNotEqual: p.printBinaryNotEqual(n) - case *binary.NotIdentical: + case *ast.ExprBinaryNotIdentical: p.printBinaryNotIdentical(n) - case *binary.Plus: + case *ast.ExprBinaryPlus: p.printBinaryPlus(n) - case *binary.Pow: + case *ast.ExprBinaryPow: p.printBinaryPow(n) - case *binary.ShiftLeft: + case *ast.ExprBinaryShiftLeft: p.printBinaryShiftLeft(n) - case *binary.ShiftRight: + case *ast.ExprBinaryShiftRight: p.printBinaryShiftRight(n) - case *binary.SmallerOrEqual: + case *ast.ExprBinarySmallerOrEqual: p.printBinarySmallerOrEqual(n) - case *binary.Smaller: + case *ast.ExprBinarySmaller: p.printBinarySmaller(n) - case *binary.Spaceship: + case *ast.ExprBinarySpaceship: p.printBinarySpaceship(n) // cast - case *cast.Array: + case *ast.ExprCastArray: p.printArray(n) - case *cast.Bool: + case *ast.ExprCastBool: p.printBool(n) - case *cast.Double: + case *ast.ExprCastDouble: p.printDouble(n) - case *cast.Int: + case *ast.ExprCastInt: p.printInt(n) - case *cast.Object: + case *ast.ExprCastObject: p.printObject(n) - case *cast.String: + case *ast.ExprCastString: p.printString(n) - case *cast.Unset: + case *ast.ExprCastUnset: p.printUnset(n) // expr - case *expr.ArrayDimFetch: + case *ast.ExprArrayDimFetch: p.printExprArrayDimFetch(n) - case *expr.ArrayItem: + case *ast.ExprArrayItem: p.printExprArrayItem(n) - case *expr.Array: + case *ast.ExprArray: p.printExprArray(n) - case *expr.BitwiseNot: + case *ast.ExprBitwiseNot: p.printExprBitwiseNot(n) - case *expr.BooleanNot: + case *ast.ExprBooleanNot: p.printExprBooleanNot(n) - case *expr.ClassConstFetch: + case *ast.ExprClassConstFetch: p.printExprClassConstFetch(n) - case *expr.Clone: + case *ast.ExprClone: p.printExprClone(n) - case *expr.ClosureUse: + case *ast.ExprClosureUse: p.printExprClosureUse(n) - case *expr.Closure: + case *ast.ExprClosure: p.printExprClosure(n) - case *expr.ConstFetch: + case *ast.ExprConstFetch: p.printExprConstFetch(n) - case *expr.Empty: + case *ast.ExprEmpty: p.printExprEmpty(n) - case *expr.ErrorSuppress: + case *ast.ExprErrorSuppress: p.printExprErrorSuppress(n) - case *expr.Eval: + case *ast.ExprEval: p.printExprEval(n) - case *expr.Exit: + case *ast.ExprExit: p.printExprExit(n) - case *expr.FunctionCall: + case *ast.ExprFunctionCall: p.printExprFunctionCall(n) - case *expr.Include: + case *ast.ExprInclude: p.printExprInclude(n) - case *expr.IncludeOnce: + case *ast.ExprIncludeOnce: p.printExprIncludeOnce(n) - case *expr.InstanceOf: + case *ast.ExprInstanceOf: p.printExprInstanceOf(n) - case *expr.Isset: + case *ast.ExprIsset: p.printExprIsset(n) - case *expr.List: + case *ast.ExprList: p.printExprList(n) - case *expr.MethodCall: + case *ast.ExprMethodCall: p.printExprMethodCall(n) - case *expr.New: + case *ast.ExprNew: p.printExprNew(n) - case *expr.PostDec: + case *ast.ExprPostDec: p.printExprPostDec(n) - case *expr.PostInc: + case *ast.ExprPostInc: p.printExprPostInc(n) - case *expr.PreDec: + case *ast.ExprPreDec: p.printExprPreDec(n) - case *expr.PreInc: + case *ast.ExprPreInc: p.printExprPreInc(n) - case *expr.Print: + case *ast.ExprPrint: p.printExprPrint(n) - case *expr.PropertyFetch: + case *ast.ExprPropertyFetch: p.printExprPropertyFetch(n) - case *expr.Reference: + case *ast.ExprReference: p.printExprReference(n) - case *expr.Require: + case *ast.ExprRequire: p.printExprRequire(n) - case *expr.RequireOnce: + case *ast.ExprRequireOnce: p.printExprRequireOnce(n) - case *expr.ShellExec: + case *ast.ExprShellExec: p.printExprShellExec(n) - case *expr.ShortArray: + case *ast.ExprShortArray: p.printExprShortArray(n) - case *expr.ShortList: + case *ast.ExprShortList: p.printExprShortList(n) - case *expr.StaticCall: + case *ast.ExprStaticCall: p.printExprStaticCall(n) - case *expr.StaticPropertyFetch: + case *ast.ExprStaticPropertyFetch: p.printExprStaticPropertyFetch(n) - case *expr.Ternary: + case *ast.ExprTernary: p.printExprTernary(n) - case *expr.UnaryMinus: + case *ast.ExprUnaryMinus: p.printExprUnaryMinus(n) - case *expr.UnaryPlus: + case *ast.ExprUnaryPlus: p.printExprUnaryPlus(n) - case *expr.Variable: + case *ast.ExprVariable: p.printExprVariable(n) - case *expr.YieldFrom: + case *ast.ExprYieldFrom: p.printExprYieldFrom(n) - case *expr.Yield: + case *ast.ExprYield: p.printExprYield(n) // stmt - case *stmt.AltElseIf: + case *ast.StmtAltElseIf: p.printStmtAltElseIf(n) - case *stmt.AltElse: + case *ast.StmtAltElse: p.printStmtAltElse(n) - case *stmt.AltFor: + case *ast.StmtAltFor: p.printStmtAltFor(n) - case *stmt.AltForeach: + case *ast.StmtAltForeach: p.printStmtAltForeach(n) - case *stmt.AltIf: + case *ast.StmtAltIf: p.printStmtAltIf(n) - case *stmt.AltSwitch: + case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) - case *stmt.AltWhile: + case *ast.StmtAltWhile: p.printStmtAltWhile(n) - case *stmt.Break: + case *ast.StmtBreak: p.printStmtBreak(n) - case *stmt.Case: + case *ast.StmtCase: p.printStmtCase(n) - case *stmt.Catch: + case *ast.StmtCatch: p.printStmtCatch(n) - case *stmt.ClassMethod: + case *ast.StmtClassMethod: p.printStmtClassMethod(n) - case *stmt.Class: + case *ast.StmtClass: p.printStmtClass(n) - case *stmt.ClassConstList: + case *ast.StmtClassConstList: p.printStmtClassConstList(n) - case *stmt.Constant: + case *ast.StmtConstant: p.printStmtConstant(n) - case *stmt.Continue: + case *ast.StmtContinue: p.printStmtContinue(n) - case *stmt.Declare: + case *ast.StmtDeclare: p.printStmtDeclare(n) - case *stmt.Default: + case *ast.StmtDefault: p.printStmtDefault(n) - case *stmt.Do: + case *ast.StmtDo: p.printStmtDo(n) - case *stmt.Echo: + case *ast.StmtEcho: p.printStmtEcho(n) - case *stmt.ElseIf: + case *ast.StmtElseIf: p.printStmtElseif(n) - case *stmt.Else: + case *ast.StmtElse: p.printStmtElse(n) - case *stmt.Expression: + case *ast.StmtExpression: p.printStmtExpression(n) - case *stmt.Finally: + case *ast.StmtFinally: p.printStmtFinally(n) - case *stmt.For: + case *ast.StmtFor: p.printStmtFor(n) - case *stmt.Foreach: + case *ast.StmtForeach: p.printStmtForeach(n) - case *stmt.Function: + case *ast.StmtFunction: p.printStmtFunction(n) - case *stmt.Global: + case *ast.StmtGlobal: p.printStmtGlobal(n) - case *stmt.Goto: + case *ast.StmtGoto: p.printStmtGoto(n) - case *stmt.GroupUse: + case *ast.StmtGroupUse: p.printStmtGroupUse(n) - case *stmt.HaltCompiler: + case *ast.StmtHaltCompiler: p.printStmtHaltCompiler(n) - case *stmt.If: + case *ast.StmtIf: p.printStmtIf(n) - case *stmt.InlineHtml: + case *ast.StmtInlineHtml: p.printStmtInlineHTML(n) - case *stmt.Interface: + case *ast.StmtInterface: p.printStmtInterface(n) - case *stmt.Label: + case *ast.StmtLabel: p.printStmtLabel(n) - case *stmt.Namespace: + case *ast.StmtNamespace: p.printStmtNamespace(n) - case *stmt.Nop: + case *ast.StmtNop: p.printStmtNop(n) - case *stmt.PropertyList: + case *ast.StmtPropertyList: p.printStmtPropertyList(n) - case *stmt.Property: + case *ast.StmtProperty: p.printStmtProperty(n) - case *stmt.Return: + case *ast.StmtReturn: p.printStmtReturn(n) - case *stmt.StaticVar: + case *ast.StmtStaticVar: p.printStmtStaticVar(n) - case *stmt.Static: + case *ast.StmtStatic: p.printStmtStatic(n) - case *stmt.StmtList: + case *ast.StmtStmtList: p.printStmtStmtList(n) - case *stmt.Switch: + case *ast.StmtSwitch: p.printStmtSwitch(n) - case *stmt.Throw: + case *ast.StmtThrow: p.printStmtThrow(n) - case *stmt.TraitMethodRef: + case *ast.StmtTraitMethodRef: p.printStmtTraitMethodRef(n) - case *stmt.TraitUseAlias: + case *ast.StmtTraitUseAlias: p.printStmtTraitUseAlias(n) - case *stmt.TraitUsePrecedence: + case *ast.StmtTraitUsePrecedence: p.printStmtTraitUsePrecedence(n) - case *stmt.TraitUse: + case *ast.StmtTraitUse: p.printStmtTraitUse(n) - case *stmt.Trait: + case *ast.StmtTrait: p.printStmtTrait(n) - case *stmt.Try: + case *ast.StmtTry: p.printStmtTry(n) - case *stmt.Unset: + case *ast.StmtUnset: p.printStmtUnset(n) - case *stmt.UseList: + case *ast.StmtUseList: p.printStmtUseList(n) - case *stmt.Use: + case *ast.StmtUse: p.printStmtUse(n) - case *stmt.While: + case *ast.StmtWhile: p.printStmtWhile(n) } } // node -func (p *PrettyPrinter) printNodeRoot(n node.Node) { - v := n.(*node.Root) +func (p *PrettyPrinter) printNodeRoot(n ast.Vertex) { + v := n.(*ast.Root) if len(v.Stmts) > 0 { firstStmt := v.Stmts[0] v.Stmts = v.Stmts[1:] switch fs := firstStmt.(type) { - case *stmt.InlineHtml: - io.WriteString(p.w, fs.Value) + case *ast.StmtInlineHtml: + io.WriteString(p.w, string(fs.Value)) io.WriteString(p.w, " 0 { @@ -506,8 +498,8 @@ func (p *PrettyPrinter) printNameName(n node.Node) { } } -func (p *PrettyPrinter) printNameFullyQualified(n node.Node) { - nn := n.(*name.FullyQualified) +func (p *PrettyPrinter) printNameFullyQualified(n ast.Vertex) { + nn := n.(*ast.NameFullyQualified) for _, part := range nn.Parts { io.WriteString(p.w, "\\") @@ -515,8 +507,8 @@ func (p *PrettyPrinter) printNameFullyQualified(n node.Node) { } } -func (p *PrettyPrinter) printNameRelative(n node.Node) { - nn := n.(*name.Relative) +func (p *PrettyPrinter) printNameRelative(n ast.Vertex) { + nn := n.(*ast.NameRelative) io.WriteString(p.w, "namespace") for _, part := range nn.Parts { @@ -527,34 +519,34 @@ func (p *PrettyPrinter) printNameRelative(n node.Node) { // scalar -func (p *PrettyPrinter) printScalarLNumber(n node.Node) { - v := n.(*scalar.Lnumber).Value +func (p *PrettyPrinter) printScalarLNumber(n ast.Vertex) { + v := string(n.(*ast.ScalarLnumber).Value) io.WriteString(p.w, v) } -func (p *PrettyPrinter) printScalarDNumber(n node.Node) { - v := n.(*scalar.Dnumber).Value +func (p *PrettyPrinter) printScalarDNumber(n ast.Vertex) { + v := string(n.(*ast.ScalarDnumber).Value) io.WriteString(p.w, v) } -func (p *PrettyPrinter) printScalarString(n node.Node) { - v := n.(*scalar.String).Value +func (p *PrettyPrinter) printScalarString(n ast.Vertex) { + v := string(n.(*ast.ScalarString).Value) io.WriteString(p.w, v) } -func (p *PrettyPrinter) printScalarEncapsedStringPart(n node.Node) { - v := n.(*scalar.EncapsedStringPart).Value +func (p *PrettyPrinter) printScalarEncapsedStringPart(n ast.Vertex) { + v := string(n.(*ast.ScalarEncapsedStringPart).Value) io.WriteString(p.w, v) } -func (p *PrettyPrinter) printScalarEncapsed(n node.Node) { - nn := n.(*scalar.Encapsed) +func (p *PrettyPrinter) printScalarEncapsed(n ast.Vertex) { + nn := n.(*ast.ScalarEncapsed) io.WriteString(p.w, "\"") for _, part := range nn.Parts { switch part.(type) { - case *scalar.EncapsedStringPart: + case *ast.ScalarEncapsedStringPart: p.Print(part) default: io.WriteString(p.w, "{") @@ -566,14 +558,14 @@ func (p *PrettyPrinter) printScalarEncapsed(n node.Node) { io.WriteString(p.w, "\"") } -func (p *PrettyPrinter) printScalarHeredoc(n node.Node) { - nn := n.(*scalar.Heredoc) +func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) { + nn := n.(*ast.ScalarHeredoc) - io.WriteString(p.w, nn.Label) + io.WriteString(p.w, string(nn.Label)) for _, part := range nn.Parts { switch part.(type) { - case *scalar.EncapsedStringPart: + case *ast.ScalarEncapsedStringPart: p.Print(part) default: io.WriteString(p.w, "{") @@ -582,326 +574,326 @@ func (p *PrettyPrinter) printScalarHeredoc(n node.Node) { } } - io.WriteString(p.w, strings.Trim(nn.Label, "<\"'\n")) + io.WriteString(p.w, strings.Trim(string(nn.Label), "<\"'\n")) } -func (p *PrettyPrinter) printScalarMagicConstant(n node.Node) { - v := n.(*scalar.MagicConstant).Value +func (p *PrettyPrinter) printScalarMagicConstant(n ast.Vertex) { + v := string(n.(*ast.ScalarMagicConstant).Value) io.WriteString(p.w, v) } // Assign -func (p *PrettyPrinter) printAssign(n node.Node) { - nn := n.(*assign.Assign) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignAssign(n ast.Vertex) { + nn := n.(*ast.ExprAssign) + p.Print(nn.Var) io.WriteString(p.w, " = ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printReference(n node.Node) { - nn := n.(*assign.Reference) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignReference(n ast.Vertex) { + nn := n.(*ast.ExprAssignReference) + p.Print(nn.Var) io.WriteString(p.w, " =& ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignBitwiseAnd(n node.Node) { - nn := n.(*assign.BitwiseAnd) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignBitwiseAnd(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseAnd) + p.Print(nn.Var) io.WriteString(p.w, " &= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignBitwiseOr(n node.Node) { - nn := n.(*assign.BitwiseOr) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignBitwiseOr(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseOr) + p.Print(nn.Var) io.WriteString(p.w, " |= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignBitwiseXor(n node.Node) { - nn := n.(*assign.BitwiseXor) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignBitwiseXor(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseXor) + p.Print(nn.Var) io.WriteString(p.w, " ^= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignConcat(n node.Node) { - nn := n.(*assign.Concat) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignConcat(n ast.Vertex) { + nn := n.(*ast.ExprAssignConcat) + p.Print(nn.Var) io.WriteString(p.w, " .= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignDiv(n node.Node) { - nn := n.(*assign.Div) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignDiv(n ast.Vertex) { + nn := n.(*ast.ExprAssignDiv) + p.Print(nn.Var) io.WriteString(p.w, " /= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignMinus(n node.Node) { - nn := n.(*assign.Minus) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignMinus(n ast.Vertex) { + nn := n.(*ast.ExprAssignMinus) + p.Print(nn.Var) io.WriteString(p.w, " -= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignMod(n node.Node) { - nn := n.(*assign.Mod) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignMod(n ast.Vertex) { + nn := n.(*ast.ExprAssignMod) + p.Print(nn.Var) io.WriteString(p.w, " %= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignMul(n node.Node) { - nn := n.(*assign.Mul) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignMul(n ast.Vertex) { + nn := n.(*ast.ExprAssignMul) + p.Print(nn.Var) io.WriteString(p.w, " *= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignPlus(n node.Node) { - nn := n.(*assign.Plus) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignPlus(n ast.Vertex) { + nn := n.(*ast.ExprAssignPlus) + p.Print(nn.Var) io.WriteString(p.w, " += ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignPow(n node.Node) { - nn := n.(*assign.Pow) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignPow(n ast.Vertex) { + nn := n.(*ast.ExprAssignPow) + p.Print(nn.Var) io.WriteString(p.w, " **= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignShiftLeft(n node.Node) { - nn := n.(*assign.ShiftLeft) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignShiftLeft(n ast.Vertex) { + nn := n.(*ast.ExprAssignShiftLeft) + p.Print(nn.Var) io.WriteString(p.w, " <<= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } -func (p *PrettyPrinter) printAssignShiftRight(n node.Node) { - nn := n.(*assign.ShiftRight) - p.Print(nn.Variable) +func (p *PrettyPrinter) printAssignShiftRight(n ast.Vertex) { + nn := n.(*ast.ExprAssignShiftRight) + p.Print(nn.Var) io.WriteString(p.w, " >>= ") - p.Print(nn.Expression) + p.Print(nn.Expr) } // binary -func (p *PrettyPrinter) printBinaryBitwiseAnd(n node.Node) { - nn := n.(*binary.BitwiseAnd) +func (p *PrettyPrinter) printBinaryBitwiseAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseAnd) p.Print(nn.Left) io.WriteString(p.w, " & ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryBitwiseOr(n node.Node) { - nn := n.(*binary.BitwiseOr) +func (p *PrettyPrinter) printBinaryBitwiseOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseOr) p.Print(nn.Left) io.WriteString(p.w, " | ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryBitwiseXor(n node.Node) { - nn := n.(*binary.BitwiseXor) +func (p *PrettyPrinter) printBinaryBitwiseXor(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseXor) p.Print(nn.Left) io.WriteString(p.w, " ^ ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryBooleanAnd(n node.Node) { - nn := n.(*binary.BooleanAnd) +func (p *PrettyPrinter) printBinaryBooleanAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBooleanAnd) p.Print(nn.Left) io.WriteString(p.w, " && ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryBooleanOr(n node.Node) { - nn := n.(*binary.BooleanOr) +func (p *PrettyPrinter) printBinaryBooleanOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBooleanOr) p.Print(nn.Left) io.WriteString(p.w, " || ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryCoalesce(n node.Node) { - nn := n.(*binary.Coalesce) +func (p *PrettyPrinter) printBinaryCoalesce(n ast.Vertex) { + nn := n.(*ast.ExprBinaryCoalesce) p.Print(nn.Left) io.WriteString(p.w, " ?? ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryConcat(n node.Node) { - nn := n.(*binary.Concat) +func (p *PrettyPrinter) printBinaryConcat(n ast.Vertex) { + nn := n.(*ast.ExprBinaryConcat) p.Print(nn.Left) io.WriteString(p.w, " . ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryDiv(n node.Node) { - nn := n.(*binary.Div) +func (p *PrettyPrinter) printBinaryDiv(n ast.Vertex) { + nn := n.(*ast.ExprBinaryDiv) p.Print(nn.Left) io.WriteString(p.w, " / ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryEqual(n node.Node) { - nn := n.(*binary.Equal) +func (p *PrettyPrinter) printBinaryEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryEqual) p.Print(nn.Left) io.WriteString(p.w, " == ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryGreaterOrEqual(n node.Node) { - nn := n.(*binary.GreaterOrEqual) +func (p *PrettyPrinter) printBinaryGreaterOrEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryGreaterOrEqual) p.Print(nn.Left) io.WriteString(p.w, " >= ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryGreater(n node.Node) { - nn := n.(*binary.Greater) +func (p *PrettyPrinter) printBinaryGreater(n ast.Vertex) { + nn := n.(*ast.ExprBinaryGreater) p.Print(nn.Left) io.WriteString(p.w, " > ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryIdentical(n node.Node) { - nn := n.(*binary.Identical) +func (p *PrettyPrinter) printBinaryIdentical(n ast.Vertex) { + nn := n.(*ast.ExprBinaryIdentical) p.Print(nn.Left) io.WriteString(p.w, " === ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryLogicalAnd(n node.Node) { - nn := n.(*binary.LogicalAnd) +func (p *PrettyPrinter) printBinaryLogicalAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalAnd) p.Print(nn.Left) io.WriteString(p.w, " and ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryLogicalOr(n node.Node) { - nn := n.(*binary.LogicalOr) +func (p *PrettyPrinter) printBinaryLogicalOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalOr) p.Print(nn.Left) io.WriteString(p.w, " or ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryLogicalXor(n node.Node) { - nn := n.(*binary.LogicalXor) +func (p *PrettyPrinter) printBinaryLogicalXor(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalXor) p.Print(nn.Left) io.WriteString(p.w, " xor ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryMinus(n node.Node) { - nn := n.(*binary.Minus) +func (p *PrettyPrinter) printBinaryMinus(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMinus) p.Print(nn.Left) io.WriteString(p.w, " - ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryMod(n node.Node) { - nn := n.(*binary.Mod) +func (p *PrettyPrinter) printBinaryMod(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMod) p.Print(nn.Left) io.WriteString(p.w, " % ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryMul(n node.Node) { - nn := n.(*binary.Mul) +func (p *PrettyPrinter) printBinaryMul(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMul) p.Print(nn.Left) io.WriteString(p.w, " * ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryNotEqual(n node.Node) { - nn := n.(*binary.NotEqual) +func (p *PrettyPrinter) printBinaryNotEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryNotEqual) p.Print(nn.Left) io.WriteString(p.w, " != ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryNotIdentical(n node.Node) { - nn := n.(*binary.NotIdentical) +func (p *PrettyPrinter) printBinaryNotIdentical(n ast.Vertex) { + nn := n.(*ast.ExprBinaryNotIdentical) p.Print(nn.Left) io.WriteString(p.w, " !== ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryPlus(n node.Node) { - nn := n.(*binary.Plus) +func (p *PrettyPrinter) printBinaryPlus(n ast.Vertex) { + nn := n.(*ast.ExprBinaryPlus) p.Print(nn.Left) io.WriteString(p.w, " + ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryPow(n node.Node) { - nn := n.(*binary.Pow) +func (p *PrettyPrinter) printBinaryPow(n ast.Vertex) { + nn := n.(*ast.ExprBinaryPow) p.Print(nn.Left) io.WriteString(p.w, " ** ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryShiftLeft(n node.Node) { - nn := n.(*binary.ShiftLeft) +func (p *PrettyPrinter) printBinaryShiftLeft(n ast.Vertex) { + nn := n.(*ast.ExprBinaryShiftLeft) p.Print(nn.Left) io.WriteString(p.w, " << ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinaryShiftRight(n node.Node) { - nn := n.(*binary.ShiftRight) +func (p *PrettyPrinter) printBinaryShiftRight(n ast.Vertex) { + nn := n.(*ast.ExprBinaryShiftRight) p.Print(nn.Left) io.WriteString(p.w, " >> ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinarySmallerOrEqual(n node.Node) { - nn := n.(*binary.SmallerOrEqual) +func (p *PrettyPrinter) printBinarySmallerOrEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinarySmallerOrEqual) p.Print(nn.Left) io.WriteString(p.w, " <= ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinarySmaller(n node.Node) { - nn := n.(*binary.Smaller) +func (p *PrettyPrinter) printBinarySmaller(n ast.Vertex) { + nn := n.(*ast.ExprBinarySmaller) p.Print(nn.Left) io.WriteString(p.w, " < ") p.Print(nn.Right) } -func (p *PrettyPrinter) printBinarySpaceship(n node.Node) { - nn := n.(*binary.Spaceship) +func (p *PrettyPrinter) printBinarySpaceship(n ast.Vertex) { + nn := n.(*ast.ExprBinarySpaceship) p.Print(nn.Left) io.WriteString(p.w, " <=> ") @@ -910,50 +902,50 @@ func (p *PrettyPrinter) printBinarySpaceship(n node.Node) { // cast -func (p *PrettyPrinter) printArray(n node.Node) { - nn := n.(*cast.Array) +func (p *PrettyPrinter) printArray(n ast.Vertex) { + nn := n.(*ast.ExprCastArray) io.WriteString(p.w, "(array)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printBool(n node.Node) { - nn := n.(*cast.Bool) +func (p *PrettyPrinter) printBool(n ast.Vertex) { + nn := n.(*ast.ExprCastBool) io.WriteString(p.w, "(bool)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printDouble(n node.Node) { - nn := n.(*cast.Double) +func (p *PrettyPrinter) printDouble(n ast.Vertex) { + nn := n.(*ast.ExprCastDouble) io.WriteString(p.w, "(float)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printInt(n node.Node) { - nn := n.(*cast.Int) +func (p *PrettyPrinter) printInt(n ast.Vertex) { + nn := n.(*ast.ExprCastInt) io.WriteString(p.w, "(int)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printObject(n node.Node) { - nn := n.(*cast.Object) +func (p *PrettyPrinter) printObject(n ast.Vertex) { + nn := n.(*ast.ExprCastObject) io.WriteString(p.w, "(object)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printString(n node.Node) { - nn := n.(*cast.String) +func (p *PrettyPrinter) printString(n ast.Vertex) { + nn := n.(*ast.ExprCastString) io.WriteString(p.w, "(string)") p.Print(nn.Expr) } -func (p *PrettyPrinter) printUnset(n node.Node) { - nn := n.(*cast.Unset) +func (p *PrettyPrinter) printUnset(n ast.Vertex) { + nn := n.(*ast.ExprCastUnset) io.WriteString(p.w, "(unset)") p.Print(nn.Expr) @@ -961,16 +953,16 @@ func (p *PrettyPrinter) printUnset(n node.Node) { // expr -func (p *PrettyPrinter) printExprArrayDimFetch(n node.Node) { - nn := n.(*expr.ArrayDimFetch) - p.Print(nn.Variable) +func (p *PrettyPrinter) printExprArrayDimFetch(n ast.Vertex) { + nn := n.(*ast.ExprArrayDimFetch) + p.Print(nn.Var) io.WriteString(p.w, "[") p.Print(nn.Dim) io.WriteString(p.w, "]") } -func (p *PrettyPrinter) printExprArrayItem(n node.Node) { - nn := n.(*expr.ArrayItem) +func (p *PrettyPrinter) printExprArrayItem(n ast.Vertex) { + nn := n.(*ast.ExprArrayItem) if nn.Key != nil { p.Print(nn.Key) @@ -980,51 +972,51 @@ func (p *PrettyPrinter) printExprArrayItem(n node.Node) { p.Print(nn.Val) } -func (p *PrettyPrinter) printExprArray(n node.Node) { - nn := n.(*expr.Array) +func (p *PrettyPrinter) printExprArray(n ast.Vertex) { + nn := n.(*ast.ExprArray) io.WriteString(p.w, "array(") p.joinPrint(", ", nn.Items) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprBitwiseNot(n node.Node) { - nn := n.(*expr.BitwiseNot) +func (p *PrettyPrinter) printExprBitwiseNot(n ast.Vertex) { + nn := n.(*ast.ExprBitwiseNot) io.WriteString(p.w, "~") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprBooleanNot(n node.Node) { - nn := n.(*expr.BooleanNot) +func (p *PrettyPrinter) printExprBooleanNot(n ast.Vertex) { + nn := n.(*ast.ExprBooleanNot) io.WriteString(p.w, "!") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprClassConstFetch(n node.Node) { - nn := n.(*expr.ClassConstFetch) +func (p *PrettyPrinter) printExprClassConstFetch(n ast.Vertex) { + nn := n.(*ast.ExprClassConstFetch) p.Print(nn.Class) io.WriteString(p.w, "::") - io.WriteString(p.w, nn.ConstantName.(*node.Identifier).Value) + io.WriteString(p.w, string(nn.ConstantName.(*ast.Identifier).Value)) } -func (p *PrettyPrinter) printExprClone(n node.Node) { - nn := n.(*expr.Clone) +func (p *PrettyPrinter) printExprClone(n ast.Vertex) { + nn := n.(*ast.ExprClone) io.WriteString(p.w, "clone ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprClosureUse(n node.Node) { - nn := n.(*expr.ClosureUse) +func (p *PrettyPrinter) printExprClosureUse(n ast.Vertex) { + nn := n.(*ast.ExprClosureUse) io.WriteString(p.w, "use (") p.joinPrint(", ", nn.Uses) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprClosure(n node.Node) { - nn := n.(*expr.Closure) +func (p *PrettyPrinter) printExprClosure(n ast.Vertex) { + nn := n.(*ast.ExprClosure) if nn.Static { io.WriteString(p.w, "static ") @@ -1057,37 +1049,37 @@ func (p *PrettyPrinter) printExprClosure(n node.Node) { io.WriteString(p.w, "}") } -func (p *PrettyPrinter) printExprConstFetch(n node.Node) { - nn := n.(*expr.ConstFetch) +func (p *PrettyPrinter) printExprConstFetch(n ast.Vertex) { + nn := n.(*ast.ExprConstFetch) - p.Print(nn.Constant) + p.Print(nn.Const) } -func (p *PrettyPrinter) printExprEmpty(n node.Node) { - nn := n.(*expr.Empty) +func (p *PrettyPrinter) printExprEmpty(n ast.Vertex) { + nn := n.(*ast.ExprEmpty) io.WriteString(p.w, "empty(") p.Print(nn.Expr) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprErrorSuppress(n node.Node) { - nn := n.(*expr.ErrorSuppress) +func (p *PrettyPrinter) printExprErrorSuppress(n ast.Vertex) { + nn := n.(*ast.ExprErrorSuppress) io.WriteString(p.w, "@") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprEval(n node.Node) { - nn := n.(*expr.Eval) +func (p *PrettyPrinter) printExprEval(n ast.Vertex) { + nn := n.(*ast.ExprEval) io.WriteString(p.w, "eval(") p.Print(nn.Expr) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprExit(n node.Node) { - nn := n.(*expr.Exit) +func (p *PrettyPrinter) printExprExit(n ast.Vertex) { + nn := n.(*ast.ExprExit) if nn.Die { io.WriteString(p.w, "die(") @@ -1098,8 +1090,8 @@ func (p *PrettyPrinter) printExprExit(n node.Node) { io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprFunctionCall(n node.Node) { - nn := n.(*expr.FunctionCall) +func (p *PrettyPrinter) printExprFunctionCall(n ast.Vertex) { + nn := n.(*ast.ExprFunctionCall) p.Print(nn.Function) io.WriteString(p.w, "(") @@ -1107,48 +1099,48 @@ func (p *PrettyPrinter) printExprFunctionCall(n node.Node) { io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprInclude(n node.Node) { - nn := n.(*expr.Include) +func (p *PrettyPrinter) printExprInclude(n ast.Vertex) { + nn := n.(*ast.ExprInclude) io.WriteString(p.w, "include ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprIncludeOnce(n node.Node) { - nn := n.(*expr.IncludeOnce) +func (p *PrettyPrinter) printExprIncludeOnce(n ast.Vertex) { + nn := n.(*ast.ExprIncludeOnce) io.WriteString(p.w, "include_once ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprInstanceOf(n node.Node) { - nn := n.(*expr.InstanceOf) +func (p *PrettyPrinter) printExprInstanceOf(n ast.Vertex) { + nn := n.(*ast.ExprInstanceOf) p.Print(nn.Expr) io.WriteString(p.w, " instanceof ") p.Print(nn.Class) } -func (p *PrettyPrinter) printExprIsset(n node.Node) { - nn := n.(*expr.Isset) +func (p *PrettyPrinter) printExprIsset(n ast.Vertex) { + nn := n.(*ast.ExprIsset) io.WriteString(p.w, "isset(") - p.joinPrint(", ", nn.Variables) + p.joinPrint(", ", nn.Vars) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprList(n node.Node) { - nn := n.(*expr.List) +func (p *PrettyPrinter) printExprList(n ast.Vertex) { + nn := n.(*ast.ExprList) io.WriteString(p.w, "list(") p.joinPrint(", ", nn.Items) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprMethodCall(n node.Node) { - nn := n.(*expr.MethodCall) +func (p *PrettyPrinter) printExprMethodCall(n ast.Vertex) { + nn := n.(*ast.ExprMethodCall) - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, "->") p.Print(nn.Method) io.WriteString(p.w, "(") @@ -1156,8 +1148,8 @@ func (p *PrettyPrinter) printExprMethodCall(n node.Node) { io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprNew(n node.Node) { - nn := n.(*expr.New) +func (p *PrettyPrinter) printExprNew(n ast.Vertex) { + nn := n.(*ast.ExprNew) io.WriteString(p.w, "new ") p.Print(nn.Class) @@ -1169,78 +1161,78 @@ func (p *PrettyPrinter) printExprNew(n node.Node) { } } -func (p *PrettyPrinter) printExprPostDec(n node.Node) { - nn := n.(*expr.PostDec) +func (p *PrettyPrinter) printExprPostDec(n ast.Vertex) { + nn := n.(*ast.ExprPostDec) - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, "--") } -func (p *PrettyPrinter) printExprPostInc(n node.Node) { - nn := n.(*expr.PostInc) +func (p *PrettyPrinter) printExprPostInc(n ast.Vertex) { + nn := n.(*ast.ExprPostInc) - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, "++") } -func (p *PrettyPrinter) printExprPreDec(n node.Node) { - nn := n.(*expr.PreDec) +func (p *PrettyPrinter) printExprPreDec(n ast.Vertex) { + nn := n.(*ast.ExprPreDec) io.WriteString(p.w, "--") - p.Print(nn.Variable) + p.Print(nn.Var) } -func (p *PrettyPrinter) printExprPreInc(n node.Node) { - nn := n.(*expr.PreInc) +func (p *PrettyPrinter) printExprPreInc(n ast.Vertex) { + nn := n.(*ast.ExprPreInc) io.WriteString(p.w, "++") - p.Print(nn.Variable) + p.Print(nn.Var) } -func (p *PrettyPrinter) printExprPrint(n node.Node) { - nn := n.(*expr.Print) +func (p *PrettyPrinter) printExprPrint(n ast.Vertex) { + nn := n.(*ast.ExprPrint) io.WriteString(p.w, "print(") p.Print(nn.Expr) io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprPropertyFetch(n node.Node) { - nn := n.(*expr.PropertyFetch) +func (p *PrettyPrinter) printExprPropertyFetch(n ast.Vertex) { + nn := n.(*ast.ExprPropertyFetch) - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, "->") p.Print(nn.Property) } -func (p *PrettyPrinter) printExprReference(n node.Node) { - nn := n.(*expr.Reference) +func (p *PrettyPrinter) printExprReference(n ast.Vertex) { + nn := n.(*ast.ExprReference) io.WriteString(p.w, "&") - p.Print(nn.Variable) + p.Print(nn.Var) } -func (p *PrettyPrinter) printExprRequire(n node.Node) { - nn := n.(*expr.Require) +func (p *PrettyPrinter) printExprRequire(n ast.Vertex) { + nn := n.(*ast.ExprRequire) io.WriteString(p.w, "require ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprRequireOnce(n node.Node) { - nn := n.(*expr.RequireOnce) +func (p *PrettyPrinter) printExprRequireOnce(n ast.Vertex) { + nn := n.(*ast.ExprRequireOnce) io.WriteString(p.w, "require_once ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprShellExec(n node.Node) { - nn := n.(*expr.ShellExec) +func (p *PrettyPrinter) printExprShellExec(n ast.Vertex) { + nn := n.(*ast.ExprShellExec) io.WriteString(p.w, "`") for _, part := range nn.Parts { switch part.(type) { - case *scalar.EncapsedStringPart: + case *ast.ScalarEncapsedStringPart: p.Print(part) default: io.WriteString(p.w, "{") @@ -1251,24 +1243,24 @@ func (p *PrettyPrinter) printExprShellExec(n node.Node) { io.WriteString(p.w, "`") } -func (p *PrettyPrinter) printExprShortArray(n node.Node) { - nn := n.(*expr.ShortArray) +func (p *PrettyPrinter) printExprShortArray(n ast.Vertex) { + nn := n.(*ast.ExprShortArray) io.WriteString(p.w, "[") p.joinPrint(", ", nn.Items) io.WriteString(p.w, "]") } -func (p *PrettyPrinter) printExprShortList(n node.Node) { - nn := n.(*expr.ShortList) +func (p *PrettyPrinter) printExprShortList(n ast.Vertex) { + nn := n.(*ast.ExprShortList) io.WriteString(p.w, "[") p.joinPrint(", ", nn.Items) io.WriteString(p.w, "]") } -func (p *PrettyPrinter) printExprStaticCall(n node.Node) { - nn := n.(*expr.StaticCall) +func (p *PrettyPrinter) printExprStaticCall(n ast.Vertex) { + nn := n.(*ast.ExprStaticCall) p.Print(nn.Class) io.WriteString(p.w, "::") @@ -1278,16 +1270,16 @@ func (p *PrettyPrinter) printExprStaticCall(n node.Node) { io.WriteString(p.w, ")") } -func (p *PrettyPrinter) printExprStaticPropertyFetch(n node.Node) { - nn := n.(*expr.StaticPropertyFetch) +func (p *PrettyPrinter) printExprStaticPropertyFetch(n ast.Vertex) { + nn := n.(*ast.ExprStaticPropertyFetch) p.Print(nn.Class) io.WriteString(p.w, "::") p.Print(nn.Property) } -func (p *PrettyPrinter) printExprTernary(n node.Node) { - nn := n.(*expr.Ternary) +func (p *PrettyPrinter) printExprTernary(n ast.Vertex) { + nn := n.(*ast.ExprTernary) p.Print(nn.Condition) io.WriteString(p.w, " ?") @@ -1302,35 +1294,35 @@ func (p *PrettyPrinter) printExprTernary(n node.Node) { p.Print(nn.IfFalse) } -func (p *PrettyPrinter) printExprUnaryMinus(n node.Node) { - nn := n.(*expr.UnaryMinus) +func (p *PrettyPrinter) printExprUnaryMinus(n ast.Vertex) { + nn := n.(*ast.ExprUnaryMinus) io.WriteString(p.w, "-") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprUnaryPlus(n node.Node) { - nn := n.(*expr.UnaryPlus) +func (p *PrettyPrinter) printExprUnaryPlus(n ast.Vertex) { + nn := n.(*ast.ExprUnaryPlus) io.WriteString(p.w, "+") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprVariable(n node.Node) { - nn := n.(*expr.Variable) +func (p *PrettyPrinter) printExprVariable(n ast.Vertex) { + nn := n.(*ast.ExprVariable) io.WriteString(p.w, "$") p.Print(nn.VarName) } -func (p *PrettyPrinter) printExprYieldFrom(n node.Node) { - nn := n.(*expr.YieldFrom) +func (p *PrettyPrinter) printExprYieldFrom(n ast.Vertex) { + nn := n.(*ast.ExprYieldFrom) io.WriteString(p.w, "yield from ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printExprYield(n node.Node) { - nn := n.(*expr.Yield) +func (p *PrettyPrinter) printExprYield(n ast.Vertex) { + nn := n.(*ast.ExprYield) io.WriteString(p.w, "yield ") @@ -1344,32 +1336,32 @@ func (p *PrettyPrinter) printExprYield(n node.Node) { // smtm -func (p *PrettyPrinter) printStmtAltElseIf(n node.Node) { - nn := n.(*stmt.AltElseIf) +func (p *PrettyPrinter) printStmtAltElseIf(n ast.Vertex) { + nn := n.(*ast.StmtAltElseIf) io.WriteString(p.w, "elseif (") p.Print(nn.Cond) io.WriteString(p.w, ") :") - if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { + if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { io.WriteString(p.w, "\n") p.printNodes(s) } } -func (p *PrettyPrinter) printStmtAltElse(n node.Node) { - nn := n.(*stmt.AltElse) +func (p *PrettyPrinter) printStmtAltElse(n ast.Vertex) { + nn := n.(*ast.StmtAltElse) io.WriteString(p.w, "else :") - if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { + if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { io.WriteString(p.w, "\n") p.printNodes(s) } } -func (p *PrettyPrinter) printStmtAltFor(n node.Node) { - nn := n.(*stmt.AltFor) +func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { + nn := n.(*ast.StmtAltFor) io.WriteString(p.w, "for (") p.joinPrint(", ", nn.Init) @@ -1379,7 +1371,7 @@ func (p *PrettyPrinter) printStmtAltFor(n node.Node) { p.joinPrint(", ", nn.Loop) io.WriteString(p.w, ") :\n") - s := nn.Stmt.(*stmt.StmtList) + s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) io.WriteString(p.w, "\n") p.printIndent() @@ -1387,8 +1379,8 @@ func (p *PrettyPrinter) printStmtAltFor(n node.Node) { io.WriteString(p.w, "endfor;") } -func (p *PrettyPrinter) printStmtAltForeach(n node.Node) { - nn := n.(*stmt.AltForeach) +func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { + nn := n.(*ast.StmtAltForeach) io.WriteString(p.w, "foreach (") p.Print(nn.Expr) @@ -1399,11 +1391,11 @@ func (p *PrettyPrinter) printStmtAltForeach(n node.Node) { io.WriteString(p.w, " => ") } - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, ") :\n") - s := nn.Stmt.(*stmt.StmtList) + s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) io.WriteString(p.w, "\n") @@ -1411,14 +1403,14 @@ func (p *PrettyPrinter) printStmtAltForeach(n node.Node) { io.WriteString(p.w, "endforeach;") } -func (p *PrettyPrinter) printStmtAltIf(n node.Node) { - nn := n.(*stmt.AltIf) +func (p *PrettyPrinter) printStmtAltIf(n ast.Vertex) { + nn := n.(*ast.StmtAltIf) io.WriteString(p.w, "if (") p.Print(nn.Cond) io.WriteString(p.w, ") :\n") - s := nn.Stmt.(*stmt.StmtList) + s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) for _, elseif := range nn.ElseIf { @@ -1438,8 +1430,8 @@ func (p *PrettyPrinter) printStmtAltIf(n node.Node) { io.WriteString(p.w, "endif;") } -func (p *PrettyPrinter) printStmtAltSwitch(n node.Node) { - nn := n.(*stmt.AltSwitch) +func (p *PrettyPrinter) printStmtAltSwitch(n ast.Vertex) { + nn := n.(*ast.StmtAltSwitch) io.WriteString(p.w, "switch (") p.Print(nn.Cond) @@ -1453,14 +1445,14 @@ func (p *PrettyPrinter) printStmtAltSwitch(n node.Node) { io.WriteString(p.w, "endswitch;") } -func (p *PrettyPrinter) printStmtAltWhile(n node.Node) { - nn := n.(*stmt.AltWhile) +func (p *PrettyPrinter) printStmtAltWhile(n ast.Vertex) { + nn := n.(*ast.StmtAltWhile) io.WriteString(p.w, "while (") p.Print(nn.Cond) io.WriteString(p.w, ") :\n") - s := nn.Stmt.(*stmt.StmtList) + s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) io.WriteString(p.w, "\n") @@ -1468,8 +1460,8 @@ func (p *PrettyPrinter) printStmtAltWhile(n node.Node) { io.WriteString(p.w, "endwhile;") } -func (p *PrettyPrinter) printStmtBreak(n node.Node) { - nn := n.(*stmt.Break) +func (p *PrettyPrinter) printStmtBreak(n ast.Vertex) { + nn := n.(*ast.StmtBreak) io.WriteString(p.w, "break") if nn.Expr != nil { @@ -1480,8 +1472,8 @@ func (p *PrettyPrinter) printStmtBreak(n node.Node) { io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtCase(n node.Node) { - nn := n.(*stmt.Case) +func (p *PrettyPrinter) printStmtCase(n ast.Vertex) { + nn := n.(*ast.StmtCase) io.WriteString(p.w, "case ") p.Print(nn.Cond) @@ -1493,13 +1485,13 @@ func (p *PrettyPrinter) printStmtCase(n node.Node) { } } -func (p *PrettyPrinter) printStmtCatch(n node.Node) { - nn := n.(*stmt.Catch) +func (p *PrettyPrinter) printStmtCatch(n ast.Vertex) { + nn := n.(*ast.StmtCatch) io.WriteString(p.w, "catch (") p.joinPrint(" | ", nn.Types) io.WriteString(p.w, " ") - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, ") {\n") p.printNodes(nn.Stmts) io.WriteString(p.w, "\n") @@ -1507,8 +1499,8 @@ func (p *PrettyPrinter) printStmtCatch(n node.Node) { io.WriteString(p.w, "}") } -func (p *PrettyPrinter) printStmtClassMethod(n node.Node) { - nn := n.(*stmt.ClassMethod) +func (p *PrettyPrinter) printStmtClassMethod(n ast.Vertex) { + nn := n.(*ast.StmtClassMethod) if nn.Modifiers != nil { p.joinPrint(" ", nn.Modifiers) @@ -1531,7 +1523,7 @@ func (p *PrettyPrinter) printStmtClassMethod(n node.Node) { } switch s := nn.Stmt.(type) { - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, "\n") p.printIndent() io.WriteString(p.w, "{\n") @@ -1544,8 +1536,8 @@ func (p *PrettyPrinter) printStmtClassMethod(n node.Node) { } } -func (p *PrettyPrinter) printStmtClass(n node.Node) { - nn := n.(*stmt.Class) +func (p *PrettyPrinter) printStmtClass(n ast.Vertex) { + nn := n.(*ast.StmtClass) if nn.Modifiers != nil { p.joinPrint(" ", nn.Modifiers) @@ -1583,8 +1575,8 @@ func (p *PrettyPrinter) printStmtClass(n node.Node) { io.WriteString(p.w, "}") } -func (p *PrettyPrinter) printStmtClassConstList(n node.Node) { - nn := n.(*stmt.ClassConstList) +func (p *PrettyPrinter) printStmtClassConstList(n ast.Vertex) { + nn := n.(*ast.StmtClassConstList) if nn.Modifiers != nil { p.joinPrint(" ", nn.Modifiers) @@ -1597,16 +1589,16 @@ func (p *PrettyPrinter) printStmtClassConstList(n node.Node) { io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtConstant(n node.Node) { - nn := n.(*stmt.Constant) +func (p *PrettyPrinter) printStmtConstant(n ast.Vertex) { + nn := n.(*ast.StmtConstant) p.Print(nn.ConstantName) io.WriteString(p.w, " = ") p.Print(nn.Expr) } -func (p *PrettyPrinter) printStmtContinue(n node.Node) { - nn := n.(*stmt.Continue) +func (p *PrettyPrinter) printStmtContinue(n ast.Vertex) { + nn := n.(*ast.StmtContinue) io.WriteString(p.w, "continue") if nn.Expr != nil { @@ -1617,18 +1609,18 @@ func (p *PrettyPrinter) printStmtContinue(n node.Node) { io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtDeclare(n node.Node) { - nn := n.(*stmt.Declare) +func (p *PrettyPrinter) printStmtDeclare(n ast.Vertex) { + nn := n.(*ast.StmtDeclare) io.WriteString(p.w, "declare(") p.joinPrint(", ", nn.Consts) io.WriteString(p.w, ")") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1640,8 +1632,8 @@ func (p *PrettyPrinter) printStmtDeclare(n node.Node) { } } -func (p *PrettyPrinter) printStmtDefault(n node.Node) { - nn := n.(*stmt.Default) +func (p *PrettyPrinter) printStmtDefault(n ast.Vertex) { + nn := n.(*ast.StmtDefault) io.WriteString(p.w, "default:") if len(nn.Stmts) > 0 { @@ -1650,12 +1642,12 @@ func (p *PrettyPrinter) printStmtDefault(n node.Node) { } } -func (p *PrettyPrinter) printStmtDo(n node.Node) { - nn := n.(*stmt.Do) +func (p *PrettyPrinter) printStmtDo(n ast.Vertex) { + nn := n.(*ast.StmtDo) io.WriteString(p.w, "do") switch s := nn.Stmt.(type) { - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) io.WriteString(p.w, " ") @@ -1674,25 +1666,25 @@ func (p *PrettyPrinter) printStmtDo(n node.Node) { io.WriteString(p.w, ");") } -func (p *PrettyPrinter) printStmtEcho(n node.Node) { - nn := n.(*stmt.Echo) +func (p *PrettyPrinter) printStmtEcho(n ast.Vertex) { + nn := n.(*ast.StmtEcho) io.WriteString(p.w, "echo ") p.joinPrint(", ", nn.Exprs) io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtElseif(n node.Node) { - nn := n.(*stmt.ElseIf) +func (p *PrettyPrinter) printStmtElseif(n ast.Vertex) { + nn := n.(*ast.StmtElseIf) io.WriteString(p.w, "elseif (") p.Print(nn.Cond) io.WriteString(p.w, ")") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1704,16 +1696,16 @@ func (p *PrettyPrinter) printStmtElseif(n node.Node) { } } -func (p *PrettyPrinter) printStmtElse(n node.Node) { - nn := n.(*stmt.Else) +func (p *PrettyPrinter) printStmtElse(n ast.Vertex) { + nn := n.(*ast.StmtElse) io.WriteString(p.w, "else") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1725,16 +1717,16 @@ func (p *PrettyPrinter) printStmtElse(n node.Node) { } } -func (p *PrettyPrinter) printStmtExpression(n node.Node) { - nn := n.(*stmt.Expression) +func (p *PrettyPrinter) printStmtExpression(n ast.Vertex) { + nn := n.(*ast.StmtExpression) p.Print(nn.Expr) io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtFinally(n node.Node) { - nn := n.(*stmt.Finally) +func (p *PrettyPrinter) printStmtFinally(n ast.Vertex) { + nn := n.(*ast.StmtFinally) io.WriteString(p.w, "finally {\n") p.printNodes(nn.Stmts) @@ -1743,8 +1735,8 @@ func (p *PrettyPrinter) printStmtFinally(n node.Node) { io.WriteString(p.w, "}") } -func (p *PrettyPrinter) printStmtFor(n node.Node) { - nn := n.(*stmt.For) +func (p *PrettyPrinter) printStmtFor(n ast.Vertex) { + nn := n.(*ast.StmtFor) io.WriteString(p.w, "for (") p.joinPrint(", ", nn.Init) @@ -1755,10 +1747,10 @@ func (p *PrettyPrinter) printStmtFor(n node.Node) { io.WriteString(p.w, ")") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1770,8 +1762,8 @@ func (p *PrettyPrinter) printStmtFor(n node.Node) { } } -func (p *PrettyPrinter) printStmtForeach(n node.Node) { - nn := n.(*stmt.Foreach) +func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { + nn := n.(*ast.StmtForeach) io.WriteString(p.w, "foreach (") p.Print(nn.Expr) @@ -1782,14 +1774,14 @@ func (p *PrettyPrinter) printStmtForeach(n node.Node) { io.WriteString(p.w, " => ") } - p.Print(nn.Variable) + p.Print(nn.Var) io.WriteString(p.w, ")") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1801,8 +1793,8 @@ func (p *PrettyPrinter) printStmtForeach(n node.Node) { } } -func (p *PrettyPrinter) printStmtFunction(n node.Node) { - nn := n.(*stmt.Function) +func (p *PrettyPrinter) printStmtFunction(n ast.Vertex) { + nn := n.(*ast.StmtFunction) io.WriteString(p.w, "function ") @@ -1828,24 +1820,24 @@ func (p *PrettyPrinter) printStmtFunction(n node.Node) { io.WriteString(p.w, "}") } -func (p *PrettyPrinter) printStmtGlobal(n node.Node) { - nn := n.(*stmt.Global) +func (p *PrettyPrinter) printStmtGlobal(n ast.Vertex) { + nn := n.(*ast.StmtGlobal) io.WriteString(p.w, "global ") p.joinPrint(", ", nn.Vars) io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtGoto(n node.Node) { - nn := n.(*stmt.Goto) +func (p *PrettyPrinter) printStmtGoto(n ast.Vertex) { + nn := n.(*ast.StmtGoto) io.WriteString(p.w, "goto ") p.Print(nn.Label) io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtGroupUse(n node.Node) { - nn := n.(*stmt.GroupUse) +func (p *PrettyPrinter) printStmtGroupUse(n ast.Vertex) { + nn := n.(*ast.StmtGroupUse) io.WriteString(p.w, "use ") @@ -1860,22 +1852,22 @@ func (p *PrettyPrinter) printStmtGroupUse(n node.Node) { io.WriteString(p.w, "};") } -func (p *PrettyPrinter) printStmtHaltCompiler(n node.Node) { +func (p *PrettyPrinter) printStmtHaltCompiler(n ast.Vertex) { io.WriteString(p.w, "__halt_compiler();") } -func (p *PrettyPrinter) printStmtIf(n node.Node) { - nn := n.(*stmt.If) +func (p *PrettyPrinter) printStmtIf(n ast.Vertex) { + nn := n.(*ast.StmtIf) io.WriteString(p.w, "if (") p.Print(nn.Cond) io.WriteString(p.w, ")") switch s := nn.Stmt.(type) { - case *stmt.Nop: + case *ast.StmtNop: p.Print(s) break - case *stmt.StmtList: + case *ast.StmtStmtList: io.WriteString(p.w, " ") p.Print(s) default: @@ -1900,16 +1892,16 @@ func (p *PrettyPrinter) printStmtIf(n node.Node) { } } -func (p *PrettyPrinter) printStmtInlineHTML(n node.Node) { - nn := n.(*stmt.InlineHtml) +func (p *PrettyPrinter) printStmtInlineHTML(n ast.Vertex) { + nn := n.(*ast.StmtInlineHtml) io.WriteString(p.w, "?>") - io.WriteString(p.w, nn.Value) + io.WriteString(p.w, string(nn.Value)) io.WriteString(p.w, "HTML"}, - &stmt.Expression{ - Expr: &scalar.Heredoc{ - Label: "<<<\"LBL\"\n", - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello world\n"}, + p.Print(&ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtInlineHtml{Value: []byte("

HTML
")}, + &ast.StmtExpression{ + Expr: &ast.ScalarHeredoc{ + Label: []byte("<<<\"LBL\"\n"), + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{Value: []byte("hello world\n")}, }, }, }, @@ -114,7 +107,7 @@ func TestPrintIdentifier(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&node.Identifier{Value: "test"}) + p.Print(&ast.Identifier{Value: []byte("test")}) if o.String() != `test` { t.Errorf("TestPrintIdentifier is failed\n") @@ -125,12 +118,12 @@ func TestPrintParameter(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&node.Parameter{ + p.Print(&ast.Parameter{ ByRef: false, Variadic: true, - VariableType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - DefaultValue: &scalar.String{Value: "'default'"}, + Type: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + DefaultValue: &ast.ScalarString{Value: []byte("'default'")}, }) expected := "\\Foo ...$var = 'default'" @@ -145,13 +138,13 @@ func TestPrintNullable(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&node.Nullable{ - Expr: &node.Parameter{ + p.Print(&ast.Nullable{ + Expr: &ast.Parameter{ ByRef: false, Variadic: true, - VariableType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - DefaultValue: &scalar.String{Value: "'default'"}, + Type: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + DefaultValue: &ast.ScalarString{Value: []byte("'default'")}, }, }) @@ -167,10 +160,10 @@ func TestPrintArgument(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&node.Argument{ + p.Print(&ast.Argument{ IsReference: false, Variadic: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := "...$var" @@ -184,10 +177,10 @@ func TestPrintArgumentByRef(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&node.Argument{ + p.Print(&ast.Argument{ IsReference: true, Variadic: false, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := "&$var" @@ -204,8 +197,8 @@ func TestPrintNameNamePart(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&name.NamePart{ - Value: "foo", + p.Print(&ast.NameNamePart{ + Value: []byte("foo"), }) expected := "foo" @@ -220,13 +213,13 @@ func TestPrintNameName(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&name.Name{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -243,13 +236,13 @@ func TestPrintNameFullyQualified(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameFullyQualified{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -266,13 +259,13 @@ func TestPrintNameRelative(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&name.Relative{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameRelative{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -291,7 +284,7 @@ func TestPrintScalarLNumber(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.Lnumber{Value: "1"}) + p.Print(&ast.ScalarLnumber{Value: []byte("1")}) if o.String() != `1` { t.Errorf("TestPrintScalarLNumber is failed\n") @@ -302,7 +295,7 @@ func TestPrintScalarDNumber(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.Dnumber{Value: ".1"}) + p.Print(&ast.ScalarDnumber{Value: []byte(".1")}) if o.String() != `.1` { t.Errorf("TestPrintScalarDNumber is failed\n") @@ -313,7 +306,7 @@ func TestPrintScalarString(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.String{Value: "'hello world'"}) + p.Print(&ast.ScalarString{Value: []byte("'hello world'")}) expected := `'hello world'` actual := o.String() @@ -327,7 +320,7 @@ func TestPrintScalarEncapsedStringPart(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.EncapsedStringPart{Value: "hello world"}) + p.Print(&ast.ScalarEncapsedStringPart{Value: []byte("hello world")}) if o.String() != `hello world` { t.Errorf("TestPrintScalarEncapsedStringPart is failed\n") @@ -338,11 +331,11 @@ func TestPrintScalarEncapsed(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - &scalar.EncapsedStringPart{Value: " world"}, + p.Print(&ast.ScalarEncapsed{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + &ast.ScalarEncapsedStringPart{Value: []byte(" world")}, }, }) @@ -355,12 +348,12 @@ func TestPrintScalarHeredoc(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&scalar.Heredoc{ - Label: "<<>= $b` @@ -652,9 +645,9 @@ func TestPrintBinaryBitwiseAnd(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.BitwiseAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryBitwiseAnd{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a & $b` @@ -669,9 +662,9 @@ func TestPrintBinaryBitwiseOr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.BitwiseOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryBitwiseOr{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a | $b` @@ -686,9 +679,9 @@ func TestPrintBinaryBitwiseXor(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.BitwiseXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryBitwiseXor{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a ^ $b` @@ -703,9 +696,9 @@ func TestPrintBinaryBooleanAnd(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.BooleanAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryBooleanAnd{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a && $b` @@ -720,9 +713,9 @@ func TestPrintBinaryBooleanOr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.BooleanOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryBooleanOr{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a || $b` @@ -737,9 +730,9 @@ func TestPrintBinaryCoalesce(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Coalesce{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryCoalesce{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a ?? $b` @@ -754,9 +747,9 @@ func TestPrintBinaryConcat(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Concat{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryConcat{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a . $b` @@ -771,9 +764,9 @@ func TestPrintBinaryDiv(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Div{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryDiv{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a / $b` @@ -788,9 +781,9 @@ func TestPrintBinaryEqual(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Equal{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryEqual{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a == $b` @@ -805,9 +798,9 @@ func TestPrintBinaryGreaterOrEqual(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.GreaterOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryGreaterOrEqual{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a >= $b` @@ -822,9 +815,9 @@ func TestPrintBinaryGreater(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Greater{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryGreater{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a > $b` @@ -839,9 +832,9 @@ func TestPrintBinaryIdentical(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Identical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryIdentical{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a === $b` @@ -856,9 +849,9 @@ func TestPrintBinaryLogicalAnd(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.LogicalAnd{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryLogicalAnd{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a and $b` @@ -873,9 +866,9 @@ func TestPrintBinaryLogicalOr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.LogicalOr{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryLogicalOr{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a or $b` @@ -890,9 +883,9 @@ func TestPrintBinaryLogicalXor(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.LogicalXor{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryLogicalXor{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a xor $b` @@ -907,9 +900,9 @@ func TestPrintBinaryMinus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Minus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryMinus{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a - $b` @@ -924,9 +917,9 @@ func TestPrintBinaryMod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Mod{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryMod{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a % $b` @@ -941,9 +934,9 @@ func TestPrintBinaryMul(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Mul{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryMul{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a * $b` @@ -958,9 +951,9 @@ func TestPrintBinaryNotEqual(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.NotEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryNotEqual{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a != $b` @@ -975,9 +968,9 @@ func TestPrintBinaryNotIdentical(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.NotIdentical{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryNotIdentical{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a !== $b` @@ -992,9 +985,9 @@ func TestPrintBinaryPlus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Plus{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryPlus{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a + $b` @@ -1009,9 +1002,9 @@ func TestPrintBinaryPow(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Pow{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryPow{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a ** $b` @@ -1026,9 +1019,9 @@ func TestPrintBinaryShiftLeft(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.ShiftLeft{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryShiftLeft{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a << $b` @@ -1043,9 +1036,9 @@ func TestPrintBinaryShiftRight(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.ShiftRight{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinaryShiftRight{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a >> $b` @@ -1060,9 +1053,9 @@ func TestPrintBinarySmallerOrEqual(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.SmallerOrEqual{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinarySmallerOrEqual{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a <= $b` @@ -1077,9 +1070,9 @@ func TestPrintBinarySmaller(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Smaller{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinarySmaller{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a < $b` @@ -1094,9 +1087,9 @@ func TestPrintBinarySpaceship(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&binary.Spaceship{ - Left: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Right: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprBinarySpaceship{ + Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a <=> $b` @@ -1113,8 +1106,8 @@ func TestPrintArray(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Array{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastArray{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(array)$var` @@ -1129,8 +1122,8 @@ func TestPrintBool(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Bool{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastBool{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(bool)$var` @@ -1145,8 +1138,8 @@ func TestPrintDouble(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Double{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastDouble{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(float)$var` @@ -1161,8 +1154,8 @@ func TestPrintInt(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Int{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastInt{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(int)$var` @@ -1177,8 +1170,8 @@ func TestPrintObject(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Object{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastObject{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(object)$var` @@ -1193,8 +1186,8 @@ func TestPrintString(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.String{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastString{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(string)$var` @@ -1209,8 +1202,8 @@ func TestPrintUnset(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&cast.Unset{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprCastUnset{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `(unset)$var` @@ -1227,9 +1220,9 @@ func TestPrintExprArrayDimFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ArrayDimFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Dim: &scalar.Lnumber{Value: "1"}, + p.Print(&ast.ExprArrayDimFetch{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Dim: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := `$var[1]` @@ -1244,9 +1237,9 @@ func TestPrintExprArrayItemWithKey(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ArrayItem{ - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + p.Print(&ast.ExprArrayItem{ + Key: &ast.ScalarString{Value: []byte("'Hello'")}, + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, }) expected := `'Hello' => $world` @@ -1261,8 +1254,8 @@ func TestPrintExprArrayItem(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ArrayItem{ - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "world"}}}, + p.Print(&ast.ExprArrayItem{ + Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}}, }) expected := `&$world` @@ -1277,18 +1270,18 @@ func TestPrintExprArray(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Array{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + p.Print(&ast.ExprArray{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Key: &ast.ScalarString{Value: []byte("'Hello'")}, + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + &ast.ExprArrayItem{ + Key: &ast.ScalarLnumber{Value: []byte("2")}, + Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, }, - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }, }, }) @@ -1305,8 +1298,8 @@ func TestPrintExprBitwiseNot(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.BitwiseNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprBitwiseNot{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `~$var` @@ -1321,8 +1314,8 @@ func TestPrintExprBooleanNot(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.BooleanNot{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprBooleanNot{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `!$var` @@ -1337,9 +1330,9 @@ func TestPrintExprClassConstFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ClassConstFetch{ - Class: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - ConstantName: &node.Identifier{Value: "CONST"}, + p.Print(&ast.ExprClassConstFetch{ + Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + ConstantName: &ast.Identifier{Value: []byte("CONST")}, }) expected := `$var::CONST` @@ -1354,8 +1347,8 @@ func TestPrintExprClone(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Clone{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprClone{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `clone $var` @@ -1370,10 +1363,10 @@ func TestPrintExprClosureUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ClosureUse{ - Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + p.Print(&ast.ExprClosureUse{ + Uses: []ast.Vertex{ + &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("bar")}}, }, }) @@ -1389,27 +1382,27 @@ func TestPrintExprClosure(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &expr.Closure{ + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.ExprClosure{ Static: true, ReturnsRef: true, - Params: []node.Node{ - &node.Parameter{ + Params: []ast.Vertex{ + &ast.Parameter{ ByRef: true, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }, }, - ClosureUse: &expr.ClosureUse{ - Uses: []node.Node{ - &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + ClosureUse: &ast.ExprClosureUse{ + Uses: []ast.Vertex{ + &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, - ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + ReturnType: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }, }, @@ -1431,8 +1424,8 @@ func TestPrintExprConstFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ConstFetch{ - Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}, + p.Print(&ast.ExprConstFetch{ + Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}, }) expected := "null" @@ -1447,7 +1440,7 @@ func TestPrintEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Empty{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprEmpty{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `empty($var)` actual := o.String() @@ -1461,7 +1454,7 @@ func TestPrettyPrinterrorSuppress(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ErrorSuppress{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprErrorSuppress{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `@$var` actual := o.String() @@ -1475,7 +1468,7 @@ func TestPrintEval(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Eval{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprEval{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `eval($var)` actual := o.String() @@ -1489,7 +1482,7 @@ func TestPrintExit(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Exit{Die: false, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprExit{Die: false, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `exit($var)` actual := o.String() @@ -1503,7 +1496,7 @@ func TestPrintDie(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Exit{Die: true, Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprExit{Die: true, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `die($var)` actual := o.String() @@ -1517,20 +1510,20 @@ func TestPrintFunctionCall(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.FunctionCall{ - Function: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ + p.Print(&ast.ExprFunctionCall{ + Function: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ IsReference: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &node.Argument{ + &ast.Argument{ Variadic: true, - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, }, }, @@ -1548,7 +1541,7 @@ func TestPrintInclude(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Include{Expr: &scalar.String{Value: "'path'"}}) + p.Print(&ast.ExprInclude{Expr: &ast.ScalarString{Value: []byte("'path'")}}) expected := `include 'path'` actual := o.String() @@ -1562,7 +1555,7 @@ func TestPrintIncludeOnce(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.IncludeOnce{Expr: &scalar.String{Value: "'path'"}}) + p.Print(&ast.ExprIncludeOnce{Expr: &ast.ScalarString{Value: []byte("'path'")}}) expected := `include_once 'path'` actual := o.String() @@ -1576,9 +1569,9 @@ func TestPrintInstanceOf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.InstanceOf{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + p.Print(&ast.ExprInstanceOf{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, }) expected := `$var instanceof Foo` @@ -1593,10 +1586,10 @@ func TestPrintIsset(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Isset{ - Variables: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprIsset{ + Vars: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }) @@ -1612,19 +1605,19 @@ func TestPrintList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.ExprList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, }, }, @@ -1644,16 +1637,16 @@ func TestPrintMethodCall(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.MethodCall{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Method: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.ExprMethodCall{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Method: &ast.Identifier{Value: []byte("bar")}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, }, @@ -1671,15 +1664,15 @@ func TestPrintNew(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.New{ - Class: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.ExprNew{ + Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, }, @@ -1697,8 +1690,8 @@ func TestPrintPostDec(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.PostDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprPostDec{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `$var--` @@ -1713,8 +1706,8 @@ func TestPrintPostInc(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.PostInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprPostInc{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `$var++` @@ -1729,8 +1722,8 @@ func TestPrintPreDec(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.PreDec{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprPreDec{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `--$var` @@ -1745,8 +1738,8 @@ func TestPrintPreInc(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.PreInc{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprPreInc{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `++$var` @@ -1761,7 +1754,7 @@ func TestPrintPrint(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Print{Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprPrint{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `print($var)` actual := o.String() @@ -1775,9 +1768,9 @@ func TestPrintPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.PropertyFetch{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, - Property: &node.Identifier{Value: "bar"}, + p.Print(&ast.ExprPropertyFetch{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Property: &ast.Identifier{Value: []byte("bar")}, }) expected := `$foo->bar` @@ -1792,8 +1785,8 @@ func TestPrintExprReference(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Reference{ - Variable: &expr.Variable{VarName: &node.Identifier{Value: "foo"}}, + p.Print(&ast.ExprReference{ + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }) expected := `&$foo` @@ -1808,7 +1801,7 @@ func TestPrintRequire(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Require{Expr: &scalar.String{Value: "'path'"}}) + p.Print(&ast.ExprRequire{Expr: &ast.ScalarString{Value: []byte("'path'")}}) expected := `require 'path'` actual := o.String() @@ -1822,7 +1815,7 @@ func TestPrintRequireOnce(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.RequireOnce{Expr: &scalar.String{Value: "'path'"}}) + p.Print(&ast.ExprRequireOnce{Expr: &ast.ScalarString{Value: []byte("'path'")}}) expected := `require_once 'path'` actual := o.String() @@ -1836,11 +1829,11 @@ func TestPrintShellExec(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ShellExec{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{VarName: &node.Identifier{Value: "world"}}, - &scalar.EncapsedStringPart{Value: "!"}, + p.Print(&ast.ExprShellExec{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, + &ast.ScalarEncapsedStringPart{Value: []byte("!")}, }, }) @@ -1856,18 +1849,18 @@ func TestPrintExprShortArray(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{VarName: &node.Identifier{Value: "world"}}, + p.Print(&ast.ExprShortArray{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Key: &ast.ScalarString{Value: []byte("'Hello'")}, + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}, + &ast.ExprArrayItem{ + Key: &ast.ScalarLnumber{Value: []byte("2")}, + Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, }, - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }, }, }) @@ -1884,19 +1877,19 @@ func TestPrintShortList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.ShortList{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.ExprShortList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - &expr.ArrayItem{ - Val: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, }, }, @@ -1916,16 +1909,16 @@ func TestPrintStaticCall(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.StaticCall{ - Class: &node.Identifier{Value: "Foo"}, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.ExprStaticCall{ + Class: &ast.Identifier{Value: []byte("Foo")}, + Call: &ast.Identifier{Value: []byte("bar")}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, }, @@ -1943,9 +1936,9 @@ func TestPrintStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.StaticPropertyFetch{ - Class: &node.Identifier{Value: "Foo"}, - Property: &expr.Variable{VarName: &node.Identifier{Value: "bar"}}, + p.Print(&ast.ExprStaticPropertyFetch{ + Class: &ast.Identifier{Value: []byte("Foo")}, + Property: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("bar")}}, }) expected := `Foo::$bar` @@ -1960,9 +1953,9 @@ func TestPrintTernary(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.ExprTernary{ + Condition: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + IfFalse: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }) expected := `$a ?: $b` @@ -1977,10 +1970,10 @@ func TestPrintTernaryFull(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Ternary{ - Condition: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - IfTrue: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - IfFalse: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + p.Print(&ast.ExprTernary{ + Condition: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + IfTrue: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, + IfFalse: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }) expected := `$a ? $b : $c` @@ -1995,8 +1988,8 @@ func TestPrintUnaryMinus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.UnaryMinus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprUnaryMinus{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `-$var` @@ -2011,8 +2004,8 @@ func TestPrintUnaryPlus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.UnaryPlus{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprUnaryPlus{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `+$var` @@ -2027,7 +2020,7 @@ func TestPrintVariable(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Variable{VarName: &expr.Variable{VarName: &node.Identifier{Value: "var"}}}) + p.Print(&ast.ExprVariable{VarName: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) expected := `$$var` actual := o.String() @@ -2041,8 +2034,8 @@ func TestPrintYieldFrom(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.YieldFrom{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprYieldFrom{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `yield from $var` @@ -2057,8 +2050,8 @@ func TestPrintYield(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Yield{ - Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprYield{ + Value: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `yield $var` @@ -2073,9 +2066,9 @@ func TestPrintYieldFull(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&expr.Yield{ - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Value: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + p.Print(&ast.ExprYield{ + Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, + Value: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }) expected := `yield $k => $var` @@ -2092,11 +2085,11 @@ func TestPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + p.Print(&ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }) @@ -2114,9 +2107,9 @@ func TestPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{}, + p.Print(&ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{}, }) expected := `elseif ($a) :` @@ -2131,10 +2124,10 @@ func TestPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.AltElse{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + p.Print(&ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }) @@ -2152,8 +2145,8 @@ func TestPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.AltElse{ - Stmt: &stmt.StmtList{}, + p.Print(&ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{}, }) expected := `else :` @@ -2168,21 +2161,21 @@ func TestPrintAltFor(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltFor{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtAltFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Cond: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Loop: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, }, }, }, @@ -2205,15 +2198,15 @@ func TestPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltForeach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "key"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "val"}}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtAltForeach{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("key")}}, + Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("val")}}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, }, }, }, @@ -2236,33 +2229,33 @@ func TestPrintAltIf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtAltIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, }, }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }, - &stmt.AltElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{}, + &ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, + Stmt: &ast.StmtStmtList{}, }, }, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + Else: &ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }, @@ -2291,22 +2284,22 @@ func TestPrintStmtAltSwitch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltSwitch{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtAltSwitch{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + CaseList: &ast.StmtCaseList{ + Cases: []ast.Vertex{ + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'a'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'b'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }, @@ -2334,13 +2327,13 @@ func TestPrintAltWhile(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.AltWhile{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtAltWhile{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, }, @@ -2363,8 +2356,8 @@ func TestPrintStmtBreak(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Break{ - Expr: &scalar.Lnumber{Value: "1"}, + p.Print(&ast.StmtBreak{ + Expr: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := "break 1;" @@ -2379,10 +2372,10 @@ func TestPrintStmtCase(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Case{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + p.Print(&ast.StmtCase{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }) @@ -2399,9 +2392,9 @@ func TestPrintStmtCaseEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Case{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmts: []node.Node{}, + p.Print(&ast.StmtCase{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmts: []ast.Vertex{}, }) expected := "case $a:" @@ -2416,16 +2409,16 @@ func TestPrintStmtCatch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, - &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtCatch{ + Types: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, + &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, }, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }, }, @@ -2447,26 +2440,26 @@ func TestPrintStmtClassMethod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + p.Print(&ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, ReturnsRef: true, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ ByRef: true, - VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, - &node.Parameter{ + &ast.Parameter{ Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, - ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }, }) @@ -2485,24 +2478,24 @@ func TestPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + p.Print(&ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, ReturnsRef: true, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ ByRef: true, - VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, - &node.Parameter{ + &ast.Parameter{ Variadic: true, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, - ReturnType: &name.Name{Parts: []node.Node{&name.NamePart{Value: "void"}}}, - Stmt: &stmt.Nop{}, + ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, + Stmt: &ast.StmtNop{}, }) expected := `public function &foo(?int &$a = null, ...$b): void;` @@ -2517,27 +2510,27 @@ func TestPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ClassName: &node.Identifier{Value: "Foo"}, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtClass{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, + ClassName: &ast.Identifier{Value: []byte("Foo")}, + Extends: &ast.StmtClassExtends{ + ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Implements: &ast.StmtClassImplements{ + InterfaceNames: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -2563,36 +2556,36 @@ func TestPrintStmtAnonymousClass(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtClass{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - &node.Argument{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + &ast.Argument{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, }, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + Extends: &ast.StmtClassExtends{ + ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Implements: &ast.StmtClassImplements{ + InterfaceNames: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -2618,16 +2611,16 @@ func TestPrintStmtClassConstList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'a'"}, + p.Print(&ast.StmtClassConstList{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'a'")}, }, - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.String{Value: "'b'"}, + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("BAR")}, + Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, }) @@ -2644,9 +2637,9 @@ func TestPrintStmtConstant(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'BAR'"}, + p.Print(&ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'BAR'")}, }) expected := "FOO = 'BAR'" @@ -2661,8 +2654,8 @@ func TestPrintStmtContinue(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Continue{ - Expr: &scalar.Lnumber{Value: "1"}, + p.Print(&ast.StmtContinue{ + Expr: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := `continue 1;` @@ -2677,18 +2670,18 @@ func TestPrintStmtDeclareStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }, @@ -2711,16 +2704,16 @@ func TestPrintStmtDeclareExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }, }, }) @@ -2740,14 +2733,14 @@ func TestPrintStmtDeclareNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `declare(FOO = 'bar');` @@ -2762,9 +2755,9 @@ func TestPrintStmtDefalut(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Default{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + p.Print(&ast.StmtDefault{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }) @@ -2781,8 +2774,8 @@ func TestPrintStmtDefalutEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Default{ - Stmts: []node.Node{}, + p.Print(&ast.StmtDefault{ + Stmts: []ast.Vertex{}, }) expected := `default:` @@ -2797,12 +2790,12 @@ func TestPrintStmtDo_Expression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtDo{ + Cond: &ast.ScalarLnumber{Value: []byte("1")}, + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, }, }, @@ -2824,13 +2817,13 @@ func TestPrintStmtDo_StmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtDo{ + Cond: &ast.ScalarLnumber{Value: []byte("1")}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, }, }, @@ -2853,10 +2846,10 @@ func TestPrintStmtEcho(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Echo{ - Exprs: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }) @@ -2872,11 +2865,11 @@ func TestPrintStmtElseIfStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -2895,9 +2888,9 @@ func TestPrintStmtElseIfExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }) expected := `elseif ($a) @@ -2913,9 +2906,9 @@ func TestPrintStmtElseIfNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.Nop{}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtNop{}, }) expected := `elseif ($a);` @@ -2930,10 +2923,10 @@ func TestPrintStmtElseStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Else{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -2952,8 +2945,8 @@ func TestPrintStmtElseExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Else{ - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }) expected := `else @@ -2969,8 +2962,8 @@ func TestPrintStmtElseNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Else{ - Stmt: &stmt.Nop{}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtNop{}, }) expected := `else;` @@ -2985,7 +2978,7 @@ func TestPrintExpression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Expression{Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}}) + p.Print(&ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}) expected := `$a;` actual := o.String() @@ -2999,11 +2992,11 @@ func TestPrintStmtFinally(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Finally{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtFinally{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }, @@ -3025,24 +3018,24 @@ func TestPrintStmtForStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.For{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + Cond: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}, }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + Loop: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("f")}}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }, @@ -3065,19 +3058,19 @@ func TestPrintStmtForExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.For{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Cond: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Loop: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }, }, }) @@ -3097,17 +3090,17 @@ func TestPrintStmtForNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.For{ - Init: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, + p.Print(&ast.StmtFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, - Cond: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + Cond: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - Loop: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "c"}}, + Loop: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `for ($a; $b; $c);` @@ -3122,14 +3115,14 @@ func TestPrintStmtForeachStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }, @@ -3152,13 +3145,13 @@ func TestPrintStmtForeachExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtForeach{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("v")}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }, }, }) @@ -3178,11 +3171,11 @@ func TestPrintStmtForeachNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Foreach{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Key: &expr.Variable{VarName: &node.Identifier{Value: "k"}}, - Variable: &expr.Reference{Variable: &expr.Variable{VarName: &node.Identifier{Value: "v"}}}, - Stmt: &stmt.Nop{}, + p.Print(&ast.StmtForeach{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, + Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("v")}}}, + Stmt: &ast.StmtNop{}, }) expected := `foreach ($a as $k => &$v);` @@ -3197,21 +3190,21 @@ func TestPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.Function{ + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtFunction{ ReturnsRef: true, - FunctionName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ + FunctionName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ ByRef: true, Variadic: false, - Variable: &expr.Variable{VarName: &node.Identifier{Value: "var"}}, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, }, }, - ReturnType: &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.Nop{}, + ReturnType: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }, @@ -3233,10 +3226,10 @@ func TestPrintStmtGlobal(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Global{ - Vars: []node.Node{ - &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.StmtGlobal{ + Vars: []ast.Vertex{ + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }) @@ -3252,8 +3245,8 @@ func TestPrintStmtGoto(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Goto{ - Label: &node.Identifier{Value: "FOO"}, + p.Print(&ast.StmtGoto{ + Label: &ast.Identifier{Value: []byte("FOO")}, }) expected := `goto FOO;` @@ -3268,16 +3261,16 @@ func TestPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.GroupUse{ - UseType: &node.Identifier{Value: "function"}, - Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - UseList: []node.Node{ - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - Alias: &node.Identifier{Value: "Baz"}, + p.Print(&ast.StmtGroupUse{ + UseType: &ast.Identifier{Value: []byte("function")}, + Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Alias: &ast.Identifier{Value: []byte("Baz")}, }, - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, }) @@ -3294,7 +3287,7 @@ func TestPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.HaltCompiler{}) + p.Print(&ast.StmtHaltCompiler{}) expected := `__halt_compiler();` actual := o.String() @@ -3308,32 +3301,32 @@ func TestPrintIfExpression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "c"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "d"}}, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}, }, }, }, }, - &stmt.ElseIf{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "e"}}, - Stmt: &stmt.Nop{}, + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, + Stmt: &ast.StmtNop{}, }, }, - Else: &stmt.Else{ - Stmt: &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "f"}}, + Else: &ast.StmtElse{ + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("f")}}, }, }, }, @@ -3361,14 +3354,14 @@ func TestPrintIfStmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.Namespace{ - Stmts: []node.Node{ - &stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.Variable{VarName: &node.Identifier{Value: "b"}}, + p.Print(&ast.StmtNamespace{ + Stmts: []ast.Vertex{ + &ast.StmtIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, }, }, }, @@ -3392,9 +3385,9 @@ func TestPrintIfNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.If{ - Cond: &expr.Variable{VarName: &node.Identifier{Value: "a"}}, - Stmt: &stmt.Nop{}, + p.Print(&ast.StmtIf{ + Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Stmt: &ast.StmtNop{}, }) expected := `if ($a);` @@ -3409,8 +3402,8 @@ func TestPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&stmt.InlineHtml{ - Value: "test", + p.Print(&ast.StmtInlineHtml{ + Value: []byte("test"), }) expected := `?>test 0 { + io.WriteString(p.w, glue) + } + + p.Print(n) + } +} + +func (p *Printer) printNodes(nn []ast.Vertex) { + for _, n := range nn { + p.Print(n) + } +} + +func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { + if n == nil { + return + } + + for _, m := range n.GetNode().Tokens[pos] { + io.WriteString(p.w, string(m.Value)) + } +} + +func (p *Printer) printNode(n ast.Vertex) { + switch n.(type) { + + // node + + case *ast.Root: + p.printNodeRoot(n) + case *ast.Identifier: + p.printNodeIdentifier(n) + case *ast.Parameter: + p.printNodeParameter(n) + case *ast.Nullable: + p.printNodeNullable(n) + case *ast.Argument: + p.printNodeArgument(n) + + // name + + case *ast.NameNamePart: + p.printNameNamePart(n) + case *ast.NameName: + p.printNameName(n) + case *ast.NameFullyQualified: + p.printNameFullyQualified(n) + case *ast.NameRelative: + p.printNameRelative(n) + + // scalar + + case *ast.ScalarLnumber: + p.printScalarLNumber(n) + case *ast.ScalarDnumber: + p.printScalarDNumber(n) + case *ast.ScalarString: + p.printScalarString(n) + case *ast.ScalarEncapsedStringPart: + p.printScalarEncapsedStringPart(n) + case *ast.ScalarEncapsed: + p.printScalarEncapsed(n) + case *ast.ScalarHeredoc: + p.printScalarHeredoc(n) + case *ast.ScalarMagicConstant: + p.printScalarMagicConstant(n) + + // assign + + case *ast.ExprAssign: + p.printAssign(n) + case *ast.ExprAssignReference: + p.printAssignReference(n) + case *ast.ExprAssignBitwiseAnd: + p.printAssignBitwiseAnd(n) + case *ast.ExprAssignBitwiseOr: + p.printAssignBitwiseOr(n) + case *ast.ExprAssignBitwiseXor: + p.printAssignBitwiseXor(n) + case *ast.ExprAssignCoalesce: + p.printAssignCoalesce(n) + case *ast.ExprAssignConcat: + p.printAssignConcat(n) + case *ast.ExprAssignDiv: + p.printAssignDiv(n) + case *ast.ExprAssignMinus: + p.printAssignMinus(n) + case *ast.ExprAssignMod: + p.printAssignMod(n) + case *ast.ExprAssignMul: + p.printAssignMul(n) + case *ast.ExprAssignPlus: + p.printAssignPlus(n) + case *ast.ExprAssignPow: + p.printAssignPow(n) + case *ast.ExprAssignShiftLeft: + p.printAssignShiftLeft(n) + case *ast.ExprAssignShiftRight: + p.printAssignShiftRight(n) + + // binary + + case *ast.ExprBinaryBitwiseAnd: + p.printBinaryBitwiseAnd(n) + case *ast.ExprBinaryBitwiseOr: + p.printBinaryBitwiseOr(n) + case *ast.ExprBinaryBitwiseXor: + p.printBinaryBitwiseXor(n) + case *ast.ExprBinaryBooleanAnd: + p.printBinaryBooleanAnd(n) + case *ast.ExprBinaryBooleanOr: + p.printBinaryBooleanOr(n) + case *ast.ExprBinaryCoalesce: + p.printBinaryCoalesce(n) + case *ast.ExprBinaryConcat: + p.printBinaryConcat(n) + case *ast.ExprBinaryDiv: + p.printBinaryDiv(n) + case *ast.ExprBinaryEqual: + p.printBinaryEqual(n) + case *ast.ExprBinaryGreaterOrEqual: + p.printBinaryGreaterOrEqual(n) + case *ast.ExprBinaryGreater: + p.printBinaryGreater(n) + case *ast.ExprBinaryIdentical: + p.printBinaryIdentical(n) + case *ast.ExprBinaryLogicalAnd: + p.printBinaryLogicalAnd(n) + case *ast.ExprBinaryLogicalOr: + p.printBinaryLogicalOr(n) + case *ast.ExprBinaryLogicalXor: + p.printBinaryLogicalXor(n) + case *ast.ExprBinaryMinus: + p.printBinaryMinus(n) + case *ast.ExprBinaryMod: + p.printBinaryMod(n) + case *ast.ExprBinaryMul: + p.printBinaryMul(n) + case *ast.ExprBinaryNotEqual: + p.printBinaryNotEqual(n) + case *ast.ExprBinaryNotIdentical: + p.printBinaryNotIdentical(n) + case *ast.ExprBinaryPlus: + p.printBinaryPlus(n) + case *ast.ExprBinaryPow: + p.printBinaryPow(n) + case *ast.ExprBinaryShiftLeft: + p.printBinaryShiftLeft(n) + case *ast.ExprBinaryShiftRight: + p.printBinaryShiftRight(n) + case *ast.ExprBinarySmallerOrEqual: + p.printBinarySmallerOrEqual(n) + case *ast.ExprBinarySmaller: + p.printBinarySmaller(n) + case *ast.ExprBinarySpaceship: + p.printBinarySpaceship(n) + + // cast + + case *ast.ExprCastArray: + p.printArray(n) + case *ast.ExprCastBool: + p.printBool(n) + case *ast.ExprCastDouble: + p.printDouble(n) + case *ast.ExprCastInt: + p.printInt(n) + case *ast.ExprCastObject: + p.printObject(n) + case *ast.ExprCastString: + p.printString(n) + case *ast.ExprCastUnset: + p.printUnset(n) + + // expr + + case *ast.ExprArrayDimFetch: + p.printExprArrayDimFetch(n) + case *ast.ExprArrayItem: + p.printExprArrayItem(n) + case *ast.ExprArray: + p.printExprArray(n) + case *ast.ExprArrowFunction: + p.printExprArrowFunction(n) + case *ast.ExprBitwiseNot: + p.printExprBitwiseNot(n) + case *ast.ExprBooleanNot: + p.printExprBooleanNot(n) + case *ast.ExprClassConstFetch: + p.printExprClassConstFetch(n) + case *ast.ExprClone: + p.printExprClone(n) + case *ast.ExprClosureUse: + p.printExprClosureUse(n) + case *ast.ExprClosure: + p.printExprClosure(n) + case *ast.ExprConstFetch: + p.printExprConstFetch(n) + case *ast.ExprEmpty: + p.printExprEmpty(n) + case *ast.ExprErrorSuppress: + p.printExprErrorSuppress(n) + case *ast.ExprEval: + p.printExprEval(n) + case *ast.ExprExit: + p.printExprExit(n) + case *ast.ExprFunctionCall: + p.printExprFunctionCall(n) + case *ast.ExprInclude: + p.printExprInclude(n) + case *ast.ExprIncludeOnce: + p.printExprIncludeOnce(n) + case *ast.ExprInstanceOf: + p.printExprInstanceOf(n) + case *ast.ExprIsset: + p.printExprIsset(n) + case *ast.ExprList: + p.printExprList(n) + case *ast.ExprMethodCall: + p.printExprMethodCall(n) + case *ast.ExprNew: + p.printExprNew(n) + case *ast.ExprPostDec: + p.printExprPostDec(n) + case *ast.ExprPostInc: + p.printExprPostInc(n) + case *ast.ExprPreDec: + p.printExprPreDec(n) + case *ast.ExprPreInc: + p.printExprPreInc(n) + case *ast.ExprPrint: + p.printExprPrint(n) + case *ast.ExprPropertyFetch: + p.printExprPropertyFetch(n) + case *ast.ExprReference: + p.printExprReference(n) + case *ast.ExprRequire: + p.printExprRequire(n) + case *ast.ExprRequireOnce: + p.printExprRequireOnce(n) + case *ast.ExprShellExec: + p.printExprShellExec(n) + case *ast.ExprShortArray: + p.printExprShortArray(n) + case *ast.ExprShortList: + p.printExprShortList(n) + case *ast.ExprStaticCall: + p.printExprStaticCall(n) + case *ast.ExprStaticPropertyFetch: + p.printExprStaticPropertyFetch(n) + case *ast.ExprTernary: + p.printExprTernary(n) + case *ast.ExprUnaryMinus: + p.printExprUnaryMinus(n) + case *ast.ExprUnaryPlus: + p.printExprUnaryPlus(n) + case *ast.ExprVariable: + p.printExprVariable(n) + case *ast.ExprYieldFrom: + p.printExprYieldFrom(n) + case *ast.ExprYield: + p.printExprYield(n) + + // stmt + + case *ast.StmtAltElseIf: + p.printStmtAltElseIf(n) + case *ast.StmtAltElse: + p.printStmtAltElse(n) + case *ast.StmtAltFor: + p.printStmtAltFor(n) + case *ast.StmtAltForeach: + p.printStmtAltForeach(n) + case *ast.StmtAltIf: + p.printStmtAltIf(n) + case *ast.StmtAltSwitch: + p.printStmtAltSwitch(n) + case *ast.StmtAltWhile: + p.printStmtAltWhile(n) + case *ast.StmtBreak: + p.printStmtBreak(n) + case *ast.StmtCase: + p.printStmtCase(n) + case *ast.StmtCatch: + p.printStmtCatch(n) + case *ast.StmtClassMethod: + p.printStmtClassMethod(n) + case *ast.StmtClass: + p.printStmtClass(n) + case *ast.StmtClassConstList: + p.printStmtClassConstList(n) + case *ast.StmtConstList: + p.printStmtConstList(n) + case *ast.StmtConstant: + p.printStmtConstant(n) + case *ast.StmtContinue: + p.printStmtContinue(n) + case *ast.StmtDeclare: + p.printStmtDeclare(n) + case *ast.StmtDefault: + p.printStmtDefault(n) + case *ast.StmtDo: + p.printStmtDo(n) + case *ast.StmtEcho: + p.printStmtEcho(n) + case *ast.StmtElseIf: + p.printStmtElseif(n) + case *ast.StmtElse: + p.printStmtElse(n) + case *ast.StmtExpression: + p.printStmtExpression(n) + case *ast.StmtFinally: + p.printStmtFinally(n) + case *ast.StmtFor: + p.printStmtFor(n) + case *ast.StmtForeach: + p.printStmtForeach(n) + case *ast.StmtFunction: + p.printStmtFunction(n) + case *ast.StmtGlobal: + p.printStmtGlobal(n) + case *ast.StmtGoto: + p.printStmtGoto(n) + case *ast.StmtGroupUse: + p.printStmtGroupUse(n) + case *ast.StmtHaltCompiler: + p.printStmtHaltCompiler(n) + case *ast.StmtIf: + p.printStmtIf(n) + case *ast.StmtInlineHtml: + p.printStmtInlineHTML(n) + case *ast.StmtInterface: + p.printStmtInterface(n) + case *ast.StmtLabel: + p.printStmtLabel(n) + case *ast.StmtNamespace: + p.printStmtNamespace(n) + case *ast.StmtNop: + p.printStmtNop(n) + case *ast.StmtPropertyList: + p.printStmtPropertyList(n) + case *ast.StmtProperty: + p.printStmtProperty(n) + case *ast.StmtReturn: + p.printStmtReturn(n) + case *ast.StmtStaticVar: + p.printStmtStaticVar(n) + case *ast.StmtStatic: + p.printStmtStatic(n) + case *ast.StmtStmtList: + p.printStmtStmtList(n) + case *ast.StmtSwitch: + p.printStmtSwitch(n) + case *ast.StmtThrow: + p.printStmtThrow(n) + case *ast.StmtTraitAdaptationList: + p.printStmtTraitAdaptationList(n) + case *ast.StmtTraitMethodRef: + p.printStmtTraitMethodRef(n) + case *ast.StmtTraitUseAlias: + p.printStmtTraitUseAlias(n) + case *ast.StmtTraitUsePrecedence: + p.printStmtTraitUsePrecedence(n) + case *ast.StmtTraitUse: + p.printStmtTraitUse(n) + case *ast.StmtTrait: + p.printStmtTrait(n) + case *ast.StmtTry: + p.printStmtTry(n) + case *ast.StmtUnset: + p.printStmtUnset(n) + case *ast.StmtUseList: + p.printStmtUseList(n) + case *ast.StmtUse: + p.printStmtUse(n) + case *ast.StmtWhile: + p.printStmtWhile(n) + } +} + +// node + +func (p *Printer) printNodeRoot(n ast.Vertex) { + nn := n.(*ast.Root) + p.SetState(HtmlState) + p.printFreeFloating(nn, token.Start) + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNodeIdentifier(n ast.Vertex) { + nn := n.(*ast.Identifier) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNodeParameter(n ast.Vertex) { + nn := n.(*ast.Parameter) + p.printFreeFloating(nn, token.Start) + + if nn.Type != nil { + p.Print(nn.Type) + } + p.printFreeFloating(nn, token.OptionalType) + + if nn.ByRef { + io.WriteString(p.w, "&") + } + p.printFreeFloating(nn, token.Ampersand) + + if nn.Variadic { + io.WriteString(p.w, "...") + } + p.printFreeFloating(nn, token.Variadic) + + p.Print(nn.Var) + + if nn.DefaultValue != nil { + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "=") + p.Print(nn.DefaultValue) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNodeNullable(n ast.Vertex) { + nn := n.(*ast.Nullable) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "?") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNodeArgument(n ast.Vertex) { + nn := n.(*ast.Argument) + p.printFreeFloating(nn, token.Start) + + if nn.IsReference { + io.WriteString(p.w, "&") + } + p.printFreeFloating(nn, token.Ampersand) + + if nn.Variadic { + io.WriteString(p.w, "...") + } + p.printFreeFloating(nn, token.Variadic) + + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +// name + +func (p *Printer) printNameNamePart(n ast.Vertex) { + nn := n.(*ast.NameNamePart) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, string(nn.Value)) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNameName(n ast.Vertex) { + nn := n.(*ast.NameName) + p.printFreeFloating(nn, token.Start) + + p.joinPrint("\\", nn.Parts) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNameFullyQualified(n ast.Vertex) { + nn := n.(*ast.NameFullyQualified) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "\\") + p.joinPrint("\\", nn.Parts) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNameRelative(n ast.Vertex) { + nn := n.(*ast.NameRelative) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "namespace") + p.printFreeFloating(nn, token.Namespace) + + for _, part := range nn.Parts { + io.WriteString(p.w, "\\") + p.Print(part) + } + + p.printFreeFloating(nn, token.End) +} + +// scalar + +func (p *Printer) printScalarLNumber(n ast.Vertex) { + nn := n.(*ast.ScalarLnumber) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarDNumber(n ast.Vertex) { + nn := n.(*ast.ScalarDnumber) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarString(n ast.Vertex) { + nn := n.(*ast.ScalarString) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarEncapsedStringPart(n ast.Vertex) { + nn := n.(*ast.ScalarEncapsedStringPart) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarEncapsed(n ast.Vertex) { + nn := n.(*ast.ScalarEncapsed) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "\"") + for _, part := range nn.Parts { + switch part.(type) { + case *ast.ExprArrayDimFetch: + s := part.GetNode().Tokens[token.Start] + if len(s) > 0 && string(s[0].Value) == "${" { + p.printExprArrayDimFetchWithoutLeadingDollar(part) + } else { + p.Print(part) + } + case *ast.ExprVariable: + s := part.GetNode().Tokens[token.Start] + if len(s) > 0 && string(s[0].Value) == "${" { + p.printExprVariableWithoutLeadingDollar(part) + } else { + p.Print(part) + } + default: + p.Print(part) + } + } + io.WriteString(p.w, "\"") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarHeredoc(n ast.Vertex) { + nn := n.(*ast.ScalarHeredoc) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, string(nn.Label)) + + for _, part := range nn.Parts { + switch part.(type) { + case *ast.ExprArrayDimFetch: + s := part.GetNode().Tokens[token.Start] + if len(s) > 0 && string(s[0].Value) == "${" { + p.printExprArrayDimFetchWithoutLeadingDollar(part) + } else { + p.Print(part) + } + case *ast.ExprVariable: + s := part.GetNode().Tokens[token.Start] + if len(s) > 0 && string(s[0].Value) == "${" { + p.printExprVariableWithoutLeadingDollar(part) + } else { + p.Print(part) + } + default: + p.Print(part) + } + } + + io.WriteString(p.w, strings.Trim(string(nn.Label), "<\"'\n")) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printScalarMagicConstant(n ast.Vertex) { + nn := n.(*ast.ScalarMagicConstant) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) +} + +// Assign + +func (p *Printer) printAssign(n ast.Vertex) { + nn := n.(*ast.ExprAssign) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignReference(n ast.Vertex) { + nn := n.(*ast.ExprAssignReference) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "=") + p.printFreeFloating(nn, token.Equal) + io.WriteString(p.w, "&") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignBitwiseAnd(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseAnd) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "&") + io.WriteString(p.w, "=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignBitwiseOr(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseOr) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "|=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignBitwiseXor(n ast.Vertex) { + nn := n.(*ast.ExprAssignBitwiseXor) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "^=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignCoalesce(n ast.Vertex) { + nn := n.(*ast.ExprAssignCoalesce) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "??=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignConcat(n ast.Vertex) { + nn := n.(*ast.ExprAssignConcat) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, ".=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignDiv(n ast.Vertex) { + nn := n.(*ast.ExprAssignDiv) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "/=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignMinus(n ast.Vertex) { + nn := n.(*ast.ExprAssignMinus) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "-=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignMod(n ast.Vertex) { + nn := n.(*ast.ExprAssignMod) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "%=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignMul(n ast.Vertex) { + nn := n.(*ast.ExprAssignMul) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "*=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignPlus(n ast.Vertex) { + nn := n.(*ast.ExprAssignPlus) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "+=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignPow(n ast.Vertex) { + nn := n.(*ast.ExprAssignPow) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "**=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignShiftLeft(n ast.Vertex) { + nn := n.(*ast.ExprAssignShiftLeft) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "<<=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printAssignShiftRight(n ast.Vertex) { + nn := n.(*ast.ExprAssignShiftRight) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, ">>=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +// binary + +func (p *Printer) printBinaryBitwiseAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseAnd) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "&") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryBitwiseOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseOr) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "|") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryBitwiseXor(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBitwiseXor) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "^") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryBooleanAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBooleanAnd) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "&&") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryBooleanOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryBooleanOr) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "||") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryCoalesce(n ast.Vertex) { + nn := n.(*ast.ExprBinaryCoalesce) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "??") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryConcat(n ast.Vertex) { + nn := n.(*ast.ExprBinaryConcat) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ".") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryDiv(n ast.Vertex) { + nn := n.(*ast.ExprBinaryDiv) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "/") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryEqual) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "==") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryGreaterOrEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryGreaterOrEqual) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ">=") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryGreater(n ast.Vertex) { + nn := n.(*ast.ExprBinaryGreater) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ">") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryIdentical(n ast.Vertex) { + nn := n.(*ast.ExprBinaryIdentical) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "===") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryLogicalAnd(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalAnd) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "and") + if nn.Right.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryLogicalOr(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalOr) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "or") + if nn.Right.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryLogicalXor(n ast.Vertex) { + nn := n.(*ast.ExprBinaryLogicalXor) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "xor") + if nn.Right.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryMinus(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMinus) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "-") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryMod(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMod) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "%") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryMul(n ast.Vertex) { + nn := n.(*ast.ExprBinaryMul) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "*") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryNotEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinaryNotEqual) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + p.printFreeFloating(nn, token.Equal) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "!=") + } + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryNotIdentical(n ast.Vertex) { + nn := n.(*ast.ExprBinaryNotIdentical) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "!==") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryPlus(n ast.Vertex) { + nn := n.(*ast.ExprBinaryPlus) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "+") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryPow(n ast.Vertex) { + nn := n.(*ast.ExprBinaryPow) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "**") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryShiftLeft(n ast.Vertex) { + nn := n.(*ast.ExprBinaryShiftLeft) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "<<") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinaryShiftRight(n ast.Vertex) { + nn := n.(*ast.ExprBinaryShiftRight) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ">>") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinarySmallerOrEqual(n ast.Vertex) { + nn := n.(*ast.ExprBinarySmallerOrEqual) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "<=") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinarySmaller(n ast.Vertex) { + nn := n.(*ast.ExprBinarySmaller) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "<") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBinarySpaceship(n ast.Vertex) { + nn := n.(*ast.ExprBinarySpaceship) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Left) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "<=>") + p.Print(nn.Right) + + p.printFreeFloating(nn, token.End) +} + +// cast + +func (p *Printer) printArray(n ast.Vertex) { + nn := n.(*ast.ExprCastArray) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(array)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printBool(n ast.Vertex) { + nn := n.(*ast.ExprCastBool) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(boolean)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printDouble(n ast.Vertex) { + nn := n.(*ast.ExprCastDouble) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(float)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printInt(n ast.Vertex) { + nn := n.(*ast.ExprCastInt) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(integer)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printObject(n ast.Vertex) { + nn := n.(*ast.ExprCastObject) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(object)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printString(n ast.Vertex) { + nn := n.(*ast.ExprCastString) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(string)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printUnset(n ast.Vertex) { + nn := n.(*ast.ExprCastUnset) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Cast) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "(unset)") + } + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +// expr + +func (p *Printer) printExprArrayDimFetch(n ast.Vertex) { + nn := n.(*ast.ExprArrayDimFetch) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "[") + } + p.Print(nn.Dim) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "]") + } + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprArrayDimFetchWithoutLeadingDollar(n ast.Vertex) { + nn := n.(*ast.ExprArrayDimFetch) + p.printFreeFloating(nn, token.Start) + p.printExprVariableWithoutLeadingDollar(nn.Var) + p.printFreeFloating(nn, token.Var) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "[") + } + p.Print(nn.Dim) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "]") + } + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprArrayItem(n ast.Vertex) { + nn := n.(*ast.ExprArrayItem) + p.printFreeFloating(nn, token.Start) + + if nn.Unpack { + io.WriteString(p.w, "...") + } + + if nn.Key != nil { + p.Print(nn.Key) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "=>") + } + + p.Print(nn.Val) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprArray(n ast.Vertex) { + nn := n.(*ast.ExprArray) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "array") + p.printFreeFloating(nn, token.Array) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Items) + p.printFreeFloating(nn, token.ArrayPairList) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprArrowFunction(n ast.Vertex) { + nn := n.(*ast.ExprArrowFunction) + p.printFreeFloating(nn, token.Start) + + if nn.Static { + io.WriteString(p.w, "static") + } + p.printFreeFloating(nn, token.Static) + if nn.Static && n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, "fn") + p.printFreeFloating(nn, token.Function) + + if nn.ReturnsRef { + io.WriteString(p.w, "&") + } + p.printFreeFloating(nn, token.Ampersand) + + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Params) + p.printFreeFloating(nn, token.ParameterList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Params) + + if nn.ReturnType != nil { + io.WriteString(p.w, ":") + p.Print(nn.ReturnType) + } + p.printFreeFloating(nn, token.ReturnType) + + io.WriteString(p.w, "=>") + + p.printNode(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprBitwiseNot(n ast.Vertex) { + nn := n.(*ast.ExprBitwiseNot) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "~") + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprBooleanNot(n ast.Vertex) { + nn := n.(*ast.ExprBooleanNot) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "!") + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprClassConstFetch(n ast.Vertex) { + nn := n.(*ast.ExprClassConstFetch) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Class) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "::") + p.Print(nn.ConstantName) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprClone(n ast.Vertex) { + nn := n.(*ast.ExprClone) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "clone") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprClosureUse(n ast.Vertex) { + nn := n.(*ast.ExprClosureUse) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "use") + p.printFreeFloating(nn, token.Use) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Uses) + p.printFreeFloating(nn, token.LexicalVarList) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprClosure(n ast.Vertex) { + nn := n.(*ast.ExprClosure) + p.printFreeFloating(nn, token.Start) + + if nn.Static { + io.WriteString(p.w, "static") + } + p.printFreeFloating(nn, token.Static) + if nn.Static && n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, "function") + p.printFreeFloating(nn, token.Function) + + if nn.ReturnsRef { + io.WriteString(p.w, "&") + } + p.printFreeFloating(nn, token.Ampersand) + + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Params) + p.printFreeFloating(nn, token.ParameterList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Params) + + if nn.ClosureUse != nil { + p.Print(nn.ClosureUse) + } + p.printFreeFloating(nn, token.LexicalVars) + + if nn.ReturnType != nil { + io.WriteString(p.w, ":") + p.Print(nn.ReturnType) + } + p.printFreeFloating(nn, token.ReturnType) + + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprConstFetch(n ast.Vertex) { + nn := n.(*ast.ExprConstFetch) + p.printFreeFloating(nn, token.Start) + p.Print(nn.Const) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprEmpty(n ast.Vertex) { + nn := n.(*ast.ExprEmpty) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "empty") + p.printFreeFloating(nn, token.Empty) + io.WriteString(p.w, "(") + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprErrorSuppress(n ast.Vertex) { + nn := n.(*ast.ExprErrorSuppress) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "@") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprEval(n ast.Vertex) { + nn := n.(*ast.ExprEval) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "eval") + p.printFreeFloating(nn, token.Eval) + io.WriteString(p.w, "(") + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprExit(n ast.Vertex) { + nn := n.(*ast.ExprExit) + p.printFreeFloating(nn, token.Start) + + if nn.Die { + io.WriteString(p.w, "die") + } else { + io.WriteString(p.w, "exit") + } + p.printFreeFloating(nn, token.Exit) + + if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() && nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprFunctionCall(n ast.Vertex) { + nn := n.(*ast.ExprFunctionCall) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Function) + + p.printFreeFloating(nn.ArgumentList, token.Start) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printFreeFloating(nn.ArgumentList, token.ArgumentList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, token.End) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprInclude(n ast.Vertex) { + nn := n.(*ast.ExprInclude) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "include") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprIncludeOnce(n ast.Vertex) { + nn := n.(*ast.ExprIncludeOnce) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "include_once") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprInstanceOf(n ast.Vertex) { + nn := n.(*ast.ExprInstanceOf) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, "instanceof") + + if nn.Class.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Class) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprIsset(n ast.Vertex) { + nn := n.(*ast.ExprIsset) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "isset") + p.printFreeFloating(nn, token.Isset) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Vars) + p.printFreeFloating(nn, token.VarList) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprList(n ast.Vertex) { + nn := n.(*ast.ExprList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "list") + p.printFreeFloating(nn, token.List) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Items) + p.printFreeFloating(nn, token.ArrayPairList) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprMethodCall(n ast.Vertex) { + nn := n.(*ast.ExprMethodCall) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "->") + p.Print(nn.Method) + + p.printFreeFloating(nn.ArgumentList, token.Start) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printFreeFloating(nn.ArgumentList, token.ArgumentList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, token.End) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprNew(n ast.Vertex) { + nn := n.(*ast.ExprNew) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "new") + if nn.Class.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Class) + + if nn.ArgumentList != nil { + p.printFreeFloating(nn.ArgumentList, token.Start) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printFreeFloating(nn.ArgumentList, token.ArgumentList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, token.End) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPostDec(n ast.Vertex) { + nn := n.(*ast.ExprPostDec) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "--") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPostInc(n ast.Vertex) { + nn := n.(*ast.ExprPostInc) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "++") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPreDec(n ast.Vertex) { + nn := n.(*ast.ExprPreDec) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "--") + p.Print(nn.Var) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPreInc(n ast.Vertex) { + nn := n.(*ast.ExprPreInc) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "++") + p.Print(nn.Var) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPrint(n ast.Vertex) { + nn := n.(*ast.ExprPrint) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "print") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprPropertyFetch(n ast.Vertex) { + nn := n.(*ast.ExprPropertyFetch) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "->") + p.Print(nn.Property) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprReference(n ast.Vertex) { + nn := n.(*ast.ExprReference) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "&") + p.Print(nn.Var) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprRequire(n ast.Vertex) { + nn := n.(*ast.ExprRequire) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "require") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprRequireOnce(n ast.Vertex) { + nn := n.(*ast.ExprRequireOnce) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "require_once") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprShellExec(n ast.Vertex) { + nn := n.(*ast.ExprShellExec) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "`") + p.joinPrint("", nn.Parts) + io.WriteString(p.w, "`") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprShortArray(n ast.Vertex) { + nn := n.(*ast.ExprShortArray) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "[") + p.joinPrint(",", nn.Items) + p.printFreeFloating(nn, token.ArrayPairList) + io.WriteString(p.w, "]") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprShortList(n ast.Vertex) { + nn := n.(*ast.ExprShortList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "[") + p.joinPrint(",", nn.Items) + p.printFreeFloating(nn, token.ArrayPairList) + io.WriteString(p.w, "]") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprStaticCall(n ast.Vertex) { + nn := n.(*ast.ExprStaticCall) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Class) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "::") + p.Print(nn.Call) + + p.printFreeFloating(nn.ArgumentList, token.Start) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printFreeFloating(nn.ArgumentList, token.ArgumentList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, token.End) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprStaticPropertyFetch(n ast.Vertex) { + nn := n.(*ast.ExprStaticPropertyFetch) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Class) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "::") + p.Print(nn.Property) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprTernary(n ast.Vertex) { + nn := n.(*ast.ExprTernary) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Condition) + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, "?") + + if nn.IfTrue != nil { + p.Print(nn.IfTrue) + } + p.printFreeFloating(nn, token.True) + + io.WriteString(p.w, ":") + p.Print(nn.IfFalse) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprUnaryMinus(n ast.Vertex) { + nn := n.(*ast.ExprUnaryMinus) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "-") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprUnaryPlus(n ast.Vertex) { + nn := n.(*ast.ExprUnaryPlus) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "+") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprVariable(n ast.Vertex) { + nn := n.(*ast.ExprVariable) + p.printFreeFloating(nn, token.Start) + + p.printFreeFloating(nn, token.Dollar) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "$") + } + + p.Print(nn.VarName) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprVariableWithoutLeadingDollar(n ast.Vertex) { + nn := n.(*ast.ExprVariable) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.VarName) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprYieldFrom(n ast.Vertex) { + nn := n.(*ast.ExprYieldFrom) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "yield from") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printExprYield(n ast.Vertex) { + nn := n.(*ast.ExprYield) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "yield") + + if nn.Key != nil { + if nn.Key.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Key) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, "=>") + } else { + if nn.Value.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.Value) + + p.printFreeFloating(nn, token.End) +} + +// smtm + +func (p *Printer) printStmtAltElseIf(n ast.Vertex) { + nn := n.(*ast.StmtAltElseIf) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "elseif") + p.printFreeFloating(nn, token.ElseIf) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { + p.printNodes(s) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltElse(n ast.Vertex) { + nn := n.(*ast.StmtAltElse) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "else") + p.printFreeFloating(nn, token.Else) + io.WriteString(p.w, ":") + + if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { + p.printNodes(s) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltFor(n ast.Vertex) { + nn := n.(*ast.StmtAltFor) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "for") + p.printFreeFloating(nn, token.For) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Init) + p.printFreeFloating(nn, token.InitExpr) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Cond) + p.printFreeFloating(nn, token.CondExpr) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Loop) + p.printFreeFloating(nn, token.IncExpr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + p.printFreeFloating(nn, token.Stmts) + + io.WriteString(p.w, "endfor") + p.printFreeFloating(nn, token.AltEnd) + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltForeach(n ast.Vertex) { + nn := n.(*ast.StmtAltForeach) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "foreach") + p.printFreeFloating(nn, token.Foreach) + io.WriteString(p.w, "(") + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "as") + + if nn.Key != nil { + if nn.Key.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Key) + p.printFreeFloating(nn, token.Key) + io.WriteString(p.w, "=>") + } else { + if nn.Var.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + + io.WriteString(p.w, ":") + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + p.printFreeFloating(nn, token.Stmts) + + io.WriteString(p.w, "endforeach") + p.printFreeFloating(nn, token.AltEnd) + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltIf(n ast.Vertex) { + nn := n.(*ast.StmtAltIf) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "if") + p.printFreeFloating(nn, token.If) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + + for _, elseif := range nn.ElseIf { + p.Print(elseif) + } + + if nn.Else != nil { + p.Print(nn.Else) + } + + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "endif") + p.printFreeFloating(nn, token.AltEnd) + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltSwitch(n ast.Vertex) { + nn := n.(*ast.StmtAltSwitch) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "switch") + p.printFreeFloating(nn, token.Switch) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + p.printFreeFloating(nn.CaseList, token.Start) + p.printFreeFloating(nn.CaseList, token.CaseListStart) + p.printNodes(nn.CaseList.Cases) + p.printFreeFloating(nn.CaseList, token.CaseListEnd) + p.printFreeFloating(nn.CaseList, token.End) + + io.WriteString(p.w, "endswitch") + p.printFreeFloating(nn, token.AltEnd) + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtAltWhile(n ast.Vertex) { + nn := n.(*ast.StmtAltWhile) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "while") + p.printFreeFloating(nn, token.While) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + p.printFreeFloating(nn, token.Stmts) + + io.WriteString(p.w, "endwhile") + p.printFreeFloating(nn, token.AltEnd) + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtBreak(n ast.Vertex) { + nn := n.(*ast.StmtBreak) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "break") + if nn.Expr != nil { + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + } + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtCase(n ast.Vertex) { + nn := n.(*ast.StmtCase) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "case") + if nn.Cond.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + p.printFreeFloating(nn, token.CaseSeparator) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ":") + } + + if len(nn.Stmts) > 0 { + p.printNodes(nn.Stmts) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtCatch(n ast.Vertex) { + nn := n.(*ast.StmtCatch) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "catch") + p.printFreeFloating(nn, token.Catch) + io.WriteString(p.w, "(") + p.joinPrint("|", nn.Types) + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtClassMethod(n ast.Vertex) { + nn := n.(*ast.StmtClassMethod) + p.printFreeFloating(nn, token.Start) + + if nn.Modifiers != nil { + for k, m := range nn.Modifiers { + if k > 0 && m.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + p.printFreeFloating(nn, token.ModifierList) + io.WriteString(p.w, "function") + p.printFreeFloating(nn, token.Function) + + if nn.ReturnsRef { + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "&") + p.printFreeFloating(nn, token.Ampersand) + } else { + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.MethodName) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Params) + p.printFreeFloating(nn, token.ParameterList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Params) + + if nn.ReturnType != nil { + io.WriteString(p.w, ":") + p.Print(nn.ReturnType) + } + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtClass(n ast.Vertex) { + nn := n.(*ast.StmtClass) + p.printFreeFloating(nn, token.Start) + + if nn.Modifiers != nil { + for k, m := range nn.Modifiers { + if k > 0 && m.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + p.printFreeFloating(nn, token.ModifierList) + io.WriteString(p.w, "class") + p.printFreeFloating(nn, token.Class) + + if nn.ClassName != nil { + if nn.ClassName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.ClassName) + } + + if nn.ArgumentList != nil { + p.printFreeFloating(nn.ArgumentList, token.Start) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.ArgumentList.Arguments) + p.printFreeFloating(nn.ArgumentList, token.ArgumentList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn.ArgumentList, token.End) + } + + if nn.Extends != nil { + p.printFreeFloating(nn.Extends, token.Start) + if nn.Extends.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "extends") + if nn.Extends.ClassName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Extends.ClassName) + } + + if nn.Implements != nil { + p.printFreeFloating(nn.Implements, token.Start) + if nn.Implements.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "implements") + if nn.Implements.InterfaceNames[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Implements.InterfaceNames) + } + + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtClassConstList(n ast.Vertex) { + nn := n.(*ast.StmtClassConstList) + p.printFreeFloating(nn, token.Start) + + if nn.Modifiers != nil { + for k, m := range nn.Modifiers { + if k > 0 && m.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + p.printFreeFloating(nn, token.ModifierList) + io.WriteString(p.w, "const") + + if nn.Consts[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Consts) + p.printFreeFloating(nn, token.ConstList) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtConstList(n ast.Vertex) { + nn := n.(*ast.StmtConstList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "const") + + if nn.Consts[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Consts) + p.printFreeFloating(nn, token.Stmts) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtConstant(n ast.Vertex) { + nn := n.(*ast.StmtConstant) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.ConstantName) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "=") + p.Print(nn.Expr) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtContinue(n ast.Vertex) { + nn := n.(*ast.StmtContinue) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "continue") + + if nn.Expr != nil { + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + } + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtDeclare(n ast.Vertex) { + nn := n.(*ast.StmtDeclare) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "declare") + p.printFreeFloating(nn, token.Declare) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Consts) + p.printFreeFloating(nn, token.ConstList) + io.WriteString(p.w, ")") + + if nn.Alt { + p.printFreeFloating(nn, token.Cond) + io.WriteString(p.w, ":") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + p.printFreeFloating(nn, token.Stmts) + + io.WriteString(p.w, "enddeclare") + p.printFreeFloating(nn, token.AltEnd) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + } else { + p.Print(nn.Stmt) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtDefault(n ast.Vertex) { + nn := n.(*ast.StmtDefault) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "default") + p.printFreeFloating(nn, token.Default) + p.printFreeFloating(nn, token.CaseSeparator) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ":") + } + + if len(nn.Stmts) > 0 { + p.printNodes(nn.Stmts) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtDo(n ast.Vertex) { + nn := n.(*ast.StmtDo) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "do") + + if _, ok := nn.Stmt.(*ast.StmtStmtList); !ok { + if nn.Stmt.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.Stmt) + p.printFreeFloating(nn, token.Stmts) + + io.WriteString(p.w, "while") + p.printFreeFloating(nn, token.While) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Cond) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtEcho(n ast.Vertex) { + nn := n.(*ast.StmtEcho) + + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "echo") + } + if nn.Exprs[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + p.printFreeFloating(nn, token.Start) + p.printFreeFloating(nn, token.Echo) + + p.joinPrint(",", nn.Exprs) + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtElseif(n ast.Vertex) { + nn := n.(*ast.StmtElseIf) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "elseif") + p.printFreeFloating(nn, token.ElseIf) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtElse(n ast.Vertex) { + nn := n.(*ast.StmtElse) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "else") + + if _, ok := nn.Stmt.(*ast.StmtStmtList); !ok { + if nn.Stmt.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtExpression(n ast.Vertex) { + nn := n.(*ast.StmtExpression) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtFinally(n ast.Vertex) { + nn := n.(*ast.StmtFinally) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "finally") + p.printFreeFloating(nn, token.Finally) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtFor(n ast.Vertex) { + nn := n.(*ast.StmtFor) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "for") + p.printFreeFloating(nn, token.For) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Init) + p.printFreeFloating(nn, token.InitExpr) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Cond) + p.printFreeFloating(nn, token.CondExpr) + io.WriteString(p.w, ";") + p.joinPrint(",", nn.Loop) + p.printFreeFloating(nn, token.IncExpr) + io.WriteString(p.w, ")") + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtForeach(n ast.Vertex) { + nn := n.(*ast.StmtForeach) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "foreach") + p.printFreeFloating(nn, token.Foreach) + io.WriteString(p.w, "(") + + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, "as") + + if nn.Key != nil { + if nn.Key.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Key) + p.printFreeFloating(nn, token.Key) + io.WriteString(p.w, "=>") + } else { + if nn.Var.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + p.Print(nn.Var) + p.printFreeFloating(nn, token.Var) + + io.WriteString(p.w, ")") + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtFunction(n ast.Vertex) { + nn := n.(*ast.StmtFunction) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "function") + p.printFreeFloating(nn, token.Function) + + if nn.ReturnsRef { + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "&") + } else { + if nn.FunctionName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.Print(nn.FunctionName) + p.printFreeFloating(nn, token.Name) + + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Params) + p.printFreeFloating(nn, token.ParamList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.Params) + + if nn.ReturnType != nil { + io.WriteString(p.w, ":") + p.Print(nn.ReturnType) + } + p.printFreeFloating(nn, token.ReturnType) + + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtGlobal(n ast.Vertex) { + nn := n.(*ast.StmtGlobal) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "global") + p.joinPrint(",", nn.Vars) + p.printFreeFloating(nn, token.VarList) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtGoto(n ast.Vertex) { + nn := n.(*ast.StmtGoto) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "goto") + if nn.Label.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Label) + p.printFreeFloating(nn, token.Label) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtGroupUse(n ast.Vertex) { + nn := n.(*ast.StmtGroupUse) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "use") + p.printFreeFloating(nn, token.Use) + + if nn.UseType != nil { + if nn.UseType.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.UseType) + } + + if nn.Prefix.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Prefix) + io.WriteString(p.w, "\\") + p.printFreeFloating(nn, token.Slash) + + io.WriteString(p.w, "{") + p.joinPrint(",", nn.UseList) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + p.printFreeFloating(nn, token.UseDeclarationList) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtHaltCompiler(n ast.Vertex) { + nn := n.(*ast.StmtHaltCompiler) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "__halt_compiler") + p.printFreeFloating(nn, token.HaltCompiller) + io.WriteString(p.w, "(") + p.printFreeFloating(nn, token.OpenParenthesisToken) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.CloseParenthesisToken) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtIf(n ast.Vertex) { + nn := n.(*ast.StmtIf) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "if") + p.printFreeFloating(n, token.If) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(n, token.Expr) + io.WriteString(p.w, ")") + + p.Print(nn.Stmt) + + if nn.ElseIf != nil { + p.printNodes(nn.ElseIf) + } + + if nn.Else != nil { + p.Print(nn.Else) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtInlineHTML(n ast.Vertex) { + nn := n.(*ast.StmtInlineHtml) + p.printFreeFloating(nn, token.Start) + + if p.s == PhpState && nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, "?>") + } + p.SetState(HtmlState) + + io.WriteString(p.w, string(nn.Value)) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtInterface(n ast.Vertex) { + nn := n.(*ast.StmtInterface) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "interface") + + if nn.InterfaceName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + p.Print(nn.InterfaceName) + + if nn.Extends != nil { + p.printFreeFloating(nn.Extends, token.Start) + if nn.Extends.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "extends") + if nn.Extends.InterfaceNames[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Extends.InterfaceNames) + } + + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtLabel(n ast.Vertex) { + nn := n.(*ast.StmtLabel) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.LabelName) + p.printFreeFloating(nn, token.Label) + + io.WriteString(p.w, ":") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtNamespace(n ast.Vertex) { + nn := n.(*ast.StmtNamespace) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "namespace") + + if nn.NamespaceName != nil { + if nn.NamespaceName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.NamespaceName) + } + + if nn.Stmts != nil { + p.printFreeFloating(nn, token.Namespace) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + } else { + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtNop(n ast.Vertex) { + p.printFreeFloating(n, token.Start) + p.printFreeFloating(n, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + p.printFreeFloating(n, token.End) +} + +func (p *Printer) printStmtPropertyList(n ast.Vertex) { + nn := n.(*ast.StmtPropertyList) + p.printFreeFloating(nn, token.Start) + + for k, m := range nn.Modifiers { + if k > 0 && m.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(m) + } + + if nn.Type != nil && nn.Type.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + p.Print(nn.Type) + + if nn.Properties[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + p.joinPrint(",", nn.Properties) + p.printFreeFloating(n, token.PropertyList) + + p.printFreeFloating(n, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtProperty(n ast.Vertex) { + nn := n.(*ast.StmtProperty) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + + if nn.Expr != nil { + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "=") + p.Print(nn.Expr) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtReturn(n ast.Vertex) { + nn := n.(*ast.StmtReturn) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "return") + if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtStaticVar(n ast.Vertex) { + nn := n.(*ast.StmtStaticVar) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Var) + + if nn.Expr != nil { + p.printFreeFloating(nn, token.Var) + io.WriteString(p.w, "=") + p.Print(nn.Expr) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtStatic(n ast.Vertex) { + nn := n.(*ast.StmtStatic) + p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "static") + + p.joinPrint(",", nn.Vars) + p.printFreeFloating(nn, token.VarList) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtStmtList(n ast.Vertex) { + nn := n.(*ast.StmtStmtList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtSwitch(n ast.Vertex) { + nn := n.(*ast.StmtSwitch) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "switch") + p.printFreeFloating(nn, token.Switch) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + + p.printFreeFloating(nn.CaseList, token.Start) + io.WriteString(p.w, "{") + p.printFreeFloating(nn.CaseList, token.CaseListStart) + p.printNodes(nn.CaseList.Cases) + p.printFreeFloating(nn.CaseList, token.CaseListEnd) + io.WriteString(p.w, "}") + p.printFreeFloating(nn.CaseList, token.End) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtThrow(n ast.Vertex) { + nn := n.(*ast.StmtThrow) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "throw") + if nn.Expr.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Expr) + p.printFreeFloating(nn, token.Expr) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTraitAdaptationList(n ast.Vertex) { + nn := n.(*ast.StmtTraitAdaptationList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "{") + p.printNodes(nn.Adaptations) + p.printFreeFloating(nn, token.AdaptationList) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTraitMethodRef(n ast.Vertex) { + nn := n.(*ast.StmtTraitMethodRef) + p.printFreeFloating(nn, token.Start) + + if nn.Trait != nil { + p.Print(nn.Trait) + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "::") + } + + p.Print(nn.Method) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTraitUseAlias(n ast.Vertex) { + nn := n.(*ast.StmtTraitUseAlias) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Ref) + p.printFreeFloating(nn, token.Ref) + + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "as") + + if nn.Modifier != nil { + if nn.Modifier.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Modifier) + } + + if nn.Alias != nil { + if nn.Alias.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Alias) + } + p.printFreeFloating(nn, token.Alias) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTraitUsePrecedence(n ast.Vertex) { + nn := n.(*ast.StmtTraitUsePrecedence) + p.printFreeFloating(nn, token.Start) + + p.Print(nn.Ref) + p.printFreeFloating(nn, token.Ref) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + + io.WriteString(p.w, "insteadof") + if nn.Insteadof[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Insteadof) + p.printFreeFloating(nn, token.NameList) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTraitUse(n ast.Vertex) { + nn := n.(*ast.StmtTraitUse) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "use") + if nn.Traits[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Traits) + + p.Print(nn.TraitAdaptationList) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTrait(n ast.Vertex) { + nn := n.(*ast.StmtTrait) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "trait") + if nn.TraitName.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.TraitName) + + p.printFreeFloating(nn, token.Name) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtTry(n ast.Vertex) { + nn := n.(*ast.StmtTry) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "try") + p.printFreeFloating(nn, token.Try) + io.WriteString(p.w, "{") + p.printNodes(nn.Stmts) + p.printFreeFloating(nn, token.Stmts) + io.WriteString(p.w, "}") + + if nn.Catches != nil { + p.printNodes(nn.Catches) + } + + if nn.Finally != nil { + p.Print(nn.Finally) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtUnset(n ast.Vertex) { + nn := n.(*ast.StmtUnset) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "unset") + p.printFreeFloating(nn, token.Unset) + io.WriteString(p.w, "(") + p.joinPrint(",", nn.Vars) + p.printFreeFloating(nn, token.VarList) + io.WriteString(p.w, ")") + p.printFreeFloating(nn, token.CloseParenthesisToken) + + p.printFreeFloating(nn, token.SemiColon) + if n.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtUseList(n ast.Vertex) { + nn := n.(*ast.StmtUseList) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "use") + + if nn.UseType != nil { + if nn.UseType.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.UseType) + } + + if nn.Uses[0].GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.joinPrint(",", nn.Uses) + p.printFreeFloating(nn, token.UseDeclarationList) + + p.printFreeFloating(nn, token.SemiColon) + if nn.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, ";") + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtUse(n ast.Vertex) { + nn := n.(*ast.StmtUse) + p.printFreeFloating(nn, token.Start) + + if nn.UseType != nil { + p.Print(nn.UseType) + if nn.UseType.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + } + + p.printFreeFloating(nn, token.Slash) + + p.Print(nn.Use) + + if nn.Alias != nil { + if nn.Alias.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + io.WriteString(p.w, "as") + if nn.Alias.GetNode().Tokens.IsEmpty() { + io.WriteString(p.w, " ") + } + p.Print(nn.Alias) + } + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printStmtWhile(n ast.Vertex) { + nn := n.(*ast.StmtWhile) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "while") + p.printFreeFloating(nn, token.While) + io.WriteString(p.w, "(") + p.Print(nn.Cond) + p.printFreeFloating(nn, token.Expr) + io.WriteString(p.w, ")") + + p.Print(nn.Stmt) + + p.printFreeFloating(nn, token.End) +} diff --git a/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go similarity index 99% rename from printer/printer_parsed_php5_test.go rename to pkg/printer/printer_parsed_php5_test.go index 660987a..14868ac 100644 --- a/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -2,22 +2,22 @@ package printer_test import ( "bytes" + "github.com/z7zmey/php-parser/pkg/ast" "testing" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/php5" - "github.com/z7zmey/php-parser/printer" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/pkg/printer" ) -func parsePhp5(src string) node.Node { +func parsePhp5(src string) ast.Vertex { php5parser := php5.NewParser([]byte(src), "5.6") - php5parser.WithFreeFloating() + php5parser.WithTokens() php5parser.Parse() return php5parser.GetRootNode() } -func printPhp5(n node.Node) string { +func printPhp5(n ast.Vertex) string { o := bytes.NewBufferString("") p := printer.NewPrinter(o) diff --git a/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go similarity index 98% rename from printer/printer_parsed_php7_test.go rename to pkg/printer/printer_parsed_php7_test.go index d50dc59..971219f 100644 --- a/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -2,14 +2,12 @@ package printer_test import ( "bytes" + "github.com/z7zmey/php-parser/pkg/ast" "os" "testing" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/php7" - "github.com/z7zmey/php-parser/printer" + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/pkg/printer" ) func ExamplePrinter() { @@ -30,15 +28,15 @@ abstract class Bar extends Baz // parse php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.WithFreeFloating() + php7parser.WithTokens() php7parser.Parse() rootNode := php7parser.GetRootNode() // change namespace - parts := &rootNode.(*node.Root).Stmts[0].(*stmt.Namespace).NamespaceName.(*name.Name).Parts - *parts = append(*parts, &name.NamePart{Value: "Quuz"}) + parts := &rootNode.(*ast.Root).Stmts[0].(*ast.StmtNamespace).NamespaceName.(*ast.NameName).Parts + *parts = append(*parts, &ast.NameNamePart{Value: []byte("Quuz")}) // print @@ -60,15 +58,15 @@ abstract class Bar extends Baz // } } -func parse(src string) node.Node { +func parse(src string) ast.Vertex { php7parser := php7.NewParser([]byte(src), "7.4") - php7parser.WithFreeFloating() + php7parser.WithTokens() php7parser.Parse() return php7parser.GetRootNode() } -func print(n node.Node) string { +func print(n ast.Vertex) string { o := bytes.NewBufferString("") p := printer.NewPrinter(o) diff --git a/printer/printer_test.go b/pkg/printer/printer_test.go similarity index 54% rename from printer/printer_test.go rename to pkg/printer/printer_test.go index 331de66..a2df1a1 100644 --- a/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -2,56 +2,49 @@ package printer_test import ( "bytes" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" "testing" - "github.com/z7zmey/php-parser/freefloating" - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" - "github.com/z7zmey/php-parser/node/stmt" - "github.com/z7zmey/php-parser/printer" + "github.com/z7zmey/php-parser/pkg/printer" ) func TestPrinterPrintFile(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Root{ - Stmts: []node.Node{ - &stmt.Namespace{ - NamespaceName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Foo"}, + p.Print(&ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtNamespace{ + NamespaceName: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Foo")}, }, }, }, - &stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ClassName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Bar"}, + &ast.StmtClass{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, + ClassName: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Bar")}, }, }, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{ - Parts: []node.Node{ - &name.NamePart{Value: "Baz"}, + Extends: &ast.StmtClassExtends{ + ClassName: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Baz")}, }, }, }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - MethodName: &node.Identifier{Value: "greet"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Echo{ - Exprs: []node.Node{ - &scalar.String{Value: "'Hello world'"}, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + MethodName: &ast.Identifier{Value: []byte("greet")}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ScalarString{Value: []byte("'Hello world'")}, }, }, }, @@ -74,37 +67,41 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Root{ - Stmts: []node.Node{ - &stmt.InlineHtml{Value: "
HTML
"}, - &stmt.Expression{ - Expr: &expr.Variable{ - FreeFloating: freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: "$", + p.Print(&ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtInlineHtml{Value: []byte("
HTML
")}, + &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Tokens: token.Collection{ + token.Start: []token.Token{ + { + ID: token.ID('$'), + Value: []byte("$"), + }, }, }, }, - VarName: &node.Identifier{ - Value: "a", + VarName: &ast.Identifier{ + Value: []byte("a"), }, }, }, - &stmt.InlineHtml{Value: "
HTML
"}, - &stmt.Expression{ - Expr: &expr.Variable{ - FreeFloating: freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: "$", + &ast.StmtInlineHtml{Value: []byte("
HTML
")}, + &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + Node: ast.Node{ + Tokens: token.Collection{ + token.Start: []token.Token{ + { + ID: token.ID('$'), + Value: []byte("$"), + }, }, }, }, - VarName: &node.Identifier{ - Value: "a", + VarName: &ast.Identifier{ + Value: []byte("a"), }, }, }, @@ -125,8 +122,8 @@ func TestPrinterPrintIdentifier(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - n := &node.Identifier{ - Value: "test", + n := &ast.Identifier{ + Value: []byte("test"), } p.Print(n) @@ -142,21 +139,21 @@ func TestPrinterPrintParameter(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Parameter{ + p.Print(&ast.Parameter{ ByRef: false, Variadic: true, - VariableType: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + Type: &ast.NameFullyQualified{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, }, }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, - DefaultValue: &scalar.String{ - Value: "'default'", + DefaultValue: &ast.ScalarString{ + Value: []byte("'default'"), }, }) @@ -172,24 +169,24 @@ func TestPrinterPrintNullable(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Nullable{ - Expr: &node.Parameter{ + p.Print(&ast.Nullable{ + Expr: &ast.Parameter{ ByRef: true, Variadic: false, - VariableType: &name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + Type: &ast.NameFullyQualified{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, }, }, - Variable: &expr.Variable{ - VarName: &node.Identifier{ - Value: "var", + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("var"), }, }, - DefaultValue: &scalar.String{ - Value: "'default'", + DefaultValue: &ast.ScalarString{ + Value: []byte("'default'"), }, }, }) @@ -206,12 +203,12 @@ func TestPrinterPrintArgument(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Argument{ + p.Print(&ast.Argument{ IsReference: false, Variadic: true, - Expr: &expr.Variable{ - VarName: &node.Identifier{ - Value: "var", + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("var"), }, }, }) @@ -227,12 +224,12 @@ func TestPrinterPrintArgumentByRef(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Argument{ + p.Print(&ast.Argument{ IsReference: true, Variadic: false, - Expr: &expr.Variable{ - VarName: &node.Identifier{ - Value: "var", + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("var"), }, }, }) @@ -251,8 +248,8 @@ func TestPrinterPrintNameNamePart(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&name.NamePart{ - Value: "foo", + p.Print(&ast.NameNamePart{ + Value: []byte("foo"), }) expected := "foo" @@ -267,13 +264,13 @@ func TestPrinterPrintNameName(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&name.Name{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -290,13 +287,13 @@ func TestPrinterPrintNameFullyQualified(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&name.FullyQualified{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameFullyQualified{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -313,13 +310,13 @@ func TestPrinterPrintNameRelative(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&name.Relative{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + p.Print(&ast.NameRelative{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, - &name.NamePart{ - Value: "Bar", + &ast.NameNamePart{ + Value: []byte("Bar"), }, }, }) @@ -338,8 +335,8 @@ func TestPrinterPrintScalarLNumber(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.Lnumber{ - Value: "1", + p.Print(&ast.ScalarLnumber{ + Value: []byte("1"), }) expected := "1" @@ -354,8 +351,8 @@ func TestPrinterPrintScalarDNumber(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.Dnumber{ - Value: ".1", + p.Print(&ast.ScalarDnumber{ + Value: []byte(".1"), }) expected := ".1" @@ -370,8 +367,8 @@ func TestPrinterPrintScalarString(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.String{ - Value: "'hello world'", + p.Print(&ast.ScalarString{ + Value: []byte("'hello world'"), }) expected := `'hello world'` @@ -386,8 +383,8 @@ func TestPrinterPrintScalarEncapsedStringPart(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.EncapsedStringPart{ - Value: "hello world", + p.Print(&ast.ScalarEncapsedStringPart{ + Value: []byte("hello world"), }) expected := `hello world` @@ -402,13 +399,13 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.Encapsed{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ScalarEncapsed{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, - &scalar.EncapsedStringPart{Value: " world"}, + &ast.ScalarEncapsedStringPart{Value: []byte(" world")}, }, }) @@ -424,14 +421,14 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&scalar.Heredoc{ - Label: "<<bar` @@ -2221,9 +2218,9 @@ func TestPrinterPrintExprReference(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Reference{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "foo"}, + p.Print(&ast.ExprReference{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("foo")}, }, }) @@ -2239,8 +2236,8 @@ func TestPrinterPrintRequire(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Require{ - Expr: &scalar.String{Value: "'path'"}, + p.Print(&ast.ExprRequire{ + Expr: &ast.ScalarString{Value: []byte("'path'")}, }) expected := `require 'path'` @@ -2255,8 +2252,8 @@ func TestPrinterPrintRequireOnce(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.RequireOnce{ - Expr: &scalar.String{Value: "'path'"}, + p.Print(&ast.ExprRequireOnce{ + Expr: &ast.ScalarString{Value: []byte("'path'")}, }) expected := `require_once 'path'` @@ -2271,13 +2268,13 @@ func TestPrinterPrintShellExec(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.ShellExec{ - Parts: []node.Node{ - &scalar.EncapsedStringPart{Value: "hello "}, - &expr.Variable{ - VarName: &node.Identifier{Value: "world"}, + p.Print(&ast.ExprShellExec{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("world")}, }, - &scalar.EncapsedStringPart{Value: "!"}, + &ast.ScalarEncapsedStringPart{Value: []byte("!")}, }, }) @@ -2293,23 +2290,23 @@ func TestPrinterPrintExprShortArray(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.ShortArray{ - Items: []node.Node{ - &expr.ArrayItem{ - Key: &scalar.String{Value: "'Hello'"}, - Val: &expr.Variable{ - VarName: &node.Identifier{Value: "world"}, + p.Print(&ast.ExprShortArray{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Key: &ast.ScalarString{Value: []byte("'Hello'")}, + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("world")}, }, }, - &expr.ArrayItem{ - Key: &scalar.Lnumber{Value: "2"}, - Val: &expr.Reference{Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + &ast.ExprArrayItem{ + Key: &ast.ScalarLnumber{Value: []byte("2")}, + Val: &ast.ExprReference{Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }}, }, - &expr.ArrayItem{ - Val: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }, }, @@ -2327,24 +2324,24 @@ func TestPrinterPrintShortList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.ShortList{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.ExprShortList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, - &expr.ArrayItem{ - Val: &expr.List{ - Items: []node.Node{ - &expr.ArrayItem{ - Val: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprArrayItem{ + Val: &ast.ExprList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, - &expr.ArrayItem{ - Val: &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, }, }, @@ -2365,19 +2362,19 @@ func TestPrinterPrintStaticCall(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.StaticCall{ - Class: &node.Identifier{Value: "Foo"}, - Call: &node.Identifier{Value: "bar"}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.ExprStaticCall{ + Class: &ast.Identifier{Value: []byte("Foo")}, + Call: &ast.Identifier{Value: []byte("bar")}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, - &node.Argument{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -2396,10 +2393,10 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.StaticPropertyFetch{ - Class: &node.Identifier{Value: "Foo"}, - Property: &expr.Variable{ - VarName: &node.Identifier{Value: "bar"}, + p.Print(&ast.ExprStaticPropertyFetch{ + Class: &ast.Identifier{Value: []byte("Foo")}, + Property: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("bar")}, }, }) @@ -2415,12 +2412,12 @@ func TestPrinterPrintTernary(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Ternary{ - Condition: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.ExprTernary{ + Condition: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - IfFalse: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + IfFalse: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }) @@ -2436,15 +2433,15 @@ func TestPrinterPrintTernaryFull(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Ternary{ - Condition: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.ExprTernary{ + Condition: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - IfTrue: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + IfTrue: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, - IfFalse: &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + IfFalse: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, }) @@ -2460,9 +2457,9 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.UnaryMinus{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ExprUnaryMinus{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2478,9 +2475,9 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.UnaryPlus{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ExprUnaryPlus{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2496,9 +2493,9 @@ func TestPrinterPrintVariable(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Variable{ - VarName: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ExprVariable{ + VarName: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2514,9 +2511,9 @@ func TestPrinterPrintYieldFrom(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.YieldFrom{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ExprYieldFrom{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2532,9 +2529,9 @@ func TestPrinterPrintYield(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Yield{ - Value: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.ExprYield{ + Value: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2550,12 +2547,12 @@ func TestPrinterPrintYieldFull(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&expr.Yield{ - Key: &expr.Variable{ - VarName: &node.Identifier{Value: "k"}, + p.Print(&ast.ExprYield{ + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("k")}, }, - Value: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + Value: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -2573,14 +2570,14 @@ func TestPrinterPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -2598,11 +2595,11 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{}, + Stmt: &ast.StmtStmtList{}, }) expected := `elseif($a):` @@ -2617,11 +2614,11 @@ func TestPrinterPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltElse{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + p.Print(&ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -2639,8 +2636,8 @@ func TestPrinterPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltElse{ - Stmt: &stmt.StmtList{}, + p.Print(&ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{}, }) expected := `else:` @@ -2655,26 +2652,26 @@ func TestPrinterPrintAltFor(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltFor{ - Init: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtAltFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, - Cond: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Cond: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, - Loop: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + Loop: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "d"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("d")}, }}, }, }, @@ -2692,20 +2689,20 @@ func TestPrinterPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltForeach{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.StmtAltForeach{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, - Key: &expr.Variable{ - VarName: &node.Identifier{Value: "key"}, + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("key")}, }, - Variable: &expr.Reference{Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "val"}, + Var: &ast.ExprReference{Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("val")}, }}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "d"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("d")}, }}, }, }, @@ -2723,42 +2720,42 @@ func TestPrinterPrintAltIf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtAltIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "d"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("d")}, }}, }, }, - ElseIf: []node.Node{ - &stmt.AltElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + ElseIf: []ast.Vertex{ + &ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, }, - &stmt.AltElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + &ast.StmtAltElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, - Stmt: &stmt.StmtList{}, + Stmt: &ast.StmtStmtList{}, }, }, - Else: &stmt.AltElse{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Else: &ast.StmtAltElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -2777,25 +2774,25 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltSwitch{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.StmtAltSwitch{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + CaseList: &ast.StmtCaseList{ + Cases: []ast.Vertex{ + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'a'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'b'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -2815,14 +2812,14 @@ func TestPrinterPrintAltWhile(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.AltWhile{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtAltWhile{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -2840,9 +2837,9 @@ func TestPrinterPrintStmtBreak(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Break{ - Expr: &scalar.Lnumber{ - Value: "1", + p.Print(&ast.StmtBreak{ + Expr: &ast.ScalarLnumber{ + Value: []byte("1"), }, }) @@ -2858,13 +2855,13 @@ func TestPrinterPrintStmtCase(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Case{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtCase{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }) @@ -2881,11 +2878,11 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Case{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtCase{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmts: []node.Node{}, + Stmts: []ast.Vertex{}, }) expected := "case $a:" @@ -2900,17 +2897,17 @@ func TestPrinterPrintStmtCatch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Catch{ - Types: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, - &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, + p.Print(&ast.StmtCatch{ + Types: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, + &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("e")}, }, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }) @@ -2927,33 +2924,33 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, + p.Print(&ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, ReturnsRef: true, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: true, - VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ + ByRef: true, + Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, - &node.Parameter{ + &ast.Parameter{ Variadic: true, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, - ReturnType: &name.Name{ - Parts: []node.Node{&name.NamePart{Value: "void"}}, + ReturnType: &ast.NameName{ + Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, @@ -2971,33 +2968,33 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ClassMethod{ - Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + p.Print(&ast.StmtClassMethod{ + Modifiers: []ast.Vertex{ + &ast.Identifier{Value: []byte("public")}, + &ast.Identifier{Value: []byte("static")}, }, ReturnsRef: true, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ - ByRef: true, - VariableType: &node.Nullable{Expr: &name.Name{Parts: []node.Node{&name.NamePart{Value: "int"}}}}, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ + ByRef: true, + Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - DefaultValue: &expr.ConstFetch{Constant: &name.Name{Parts: []node.Node{&name.NamePart{Value: "null"}}}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, - &node.Parameter{ + &ast.Parameter{ Variadic: true, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, - ReturnType: &name.Name{ - Parts: []node.Node{&name.NamePart{Value: "void"}}, + ReturnType: &ast.NameName{ + Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `public static function &foo(?int&$a=null,...$b):void;` @@ -3012,28 +3009,28 @@ func TestPrinterPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ClassName: &node.Identifier{Value: "Foo"}, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + p.Print(&ast.StmtClass{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, + ClassName: &ast.Identifier{Value: []byte("Foo")}, + Extends: &ast.StmtClassExtends{ + ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Implements: &ast.StmtClassImplements{ + InterfaceNames: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Modifiers: []ast.Vertex{ + &ast.Identifier{Value: []byte("public")}, + &ast.Identifier{Value: []byte("static")}, }, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -3052,38 +3049,38 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Class{ - Modifiers: []node.Node{&node.Identifier{Value: "abstract"}}, - ArgumentList: &node.ArgumentList{ - Arguments: []node.Node{ - &node.Argument{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtClass{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, + ArgumentList: &ast.ArgumentList{ + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, - &node.Argument{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, }, - Extends: &stmt.ClassExtends{ - ClassName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + Extends: &ast.StmtClassExtends{ + ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Implements: &stmt.ClassImplements{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + Implements: &ast.StmtClassImplements{ + InterfaceNames: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, - Stmts: []node.Node{ - &stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + Stmts: []ast.Vertex{ + &ast.StmtClassConstList{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -3102,16 +3099,16 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ClassConstList{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'a'"}, + p.Print(&ast.StmtClassConstList{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'a'")}, }, - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.String{Value: "'b'"}, + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("BAR")}, + Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, }) @@ -3128,15 +3125,15 @@ func TestPrinterPrintStmtConstList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ConstList{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'a'"}, + p.Print(&ast.StmtConstList{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'a'")}, }, - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "BAR"}, - Expr: &scalar.String{Value: "'b'"}, + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("BAR")}, + Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, }) @@ -3153,9 +3150,9 @@ func TestPrinterPrintStmtConstant(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'BAR'"}, + p.Print(&ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'BAR'")}, }) expected := "FOO='BAR'" @@ -3170,9 +3167,9 @@ func TestPrinterPrintStmtContinue(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Continue{ - Expr: &scalar.Lnumber{ - Value: "1", + p.Print(&ast.StmtContinue{ + Expr: &ast.ScalarLnumber{ + Value: []byte("1"), }, }) @@ -3188,16 +3185,16 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -3214,14 +3211,14 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }) expected := `declare(FOO='bar')'bar';` @@ -3236,14 +3233,14 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Declare{ - Consts: []node.Node{ - &stmt.Constant{ - ConstantName: &node.Identifier{Value: "FOO"}, - Expr: &scalar.String{Value: "'bar'"}, + p.Print(&ast.StmtDeclare{ + Consts: []ast.Vertex{ + &ast.StmtConstant{ + ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `declare(FOO='bar');` @@ -3258,10 +3255,10 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Default{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtDefault{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }) @@ -3278,8 +3275,8 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Default{ - Stmts: []node.Node{}, + p.Print(&ast.StmtDefault{ + Stmts: []ast.Vertex{}, }) expected := `default:` @@ -3294,11 +3291,11 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtDo{ + Cond: &ast.ScalarLnumber{Value: []byte("1")}, + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, }) @@ -3315,12 +3312,12 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Do{ - Cond: &scalar.Lnumber{Value: "1"}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtDo{ + Cond: &ast.ScalarLnumber{Value: []byte("1")}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, @@ -3338,15 +3335,15 @@ func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Root{ - Stmts: []node.Node{ - &stmt.Echo{ - Exprs: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -3365,13 +3362,13 @@ func TestPrinterPrintStmtEchoPhpState(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Echo{ - Exprs: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }) @@ -3388,13 +3385,13 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -3411,11 +3408,11 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }) expected := `elseif($a)'bar';` @@ -3430,11 +3427,11 @@ func TestPrinterPrintStmtElseIfNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.ElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `elseif($a);` @@ -3449,10 +3446,10 @@ func TestPrinterPrintStmtElseStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Else{ - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -3469,8 +3466,8 @@ func TestPrinterPrintStmtElseExpr(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Else{ - Stmt: &stmt.Expression{Expr: &scalar.String{Value: "'bar'"}}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, }) expected := `else 'bar';` @@ -3485,8 +3482,8 @@ func TestPrinterPrintStmtElseNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Else{ - Stmt: &stmt.Nop{}, + p.Print(&ast.StmtElse{ + Stmt: &ast.StmtNop{}, }) expected := `else ;` @@ -3501,9 +3498,9 @@ func TestPrinterPrintExpression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }) @@ -3519,9 +3516,9 @@ func TestPrinterPrintStmtFinally(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Finally{ - Stmts: []node.Node{ - &stmt.Nop{}, + p.Print(&ast.StmtFinally{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }) @@ -3537,34 +3534,34 @@ func TestPrinterPrintStmtFor(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.For{ - Init: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtFor{ + Init: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, - Cond: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + Cond: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "d"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("d")}, }, }, - Loop: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Loop: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("e")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "f"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("f")}, }, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -3581,19 +3578,19 @@ func TestPrinterPrintStmtForeach(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Foreach{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtForeach{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Key: &expr.Variable{ - VarName: &node.Identifier{Value: "k"}, + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("k")}, }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "v"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("v")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Nop{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -3610,23 +3607,23 @@ func TestPrinterPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Function{ + p.Print(&ast.StmtFunction{ ReturnsRef: true, - FunctionName: &node.Identifier{Value: "foo"}, - Params: []node.Node{ - &node.Parameter{ + FunctionName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{ + &ast.Parameter{ ByRef: true, Variadic: false, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }, }, - ReturnType: &name.FullyQualified{ - Parts: []node.Node{&name.NamePart{Value: "Foo"}}, + ReturnType: &ast.NameFullyQualified{ + Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}, }, - Stmts: []node.Node{ - &stmt.Nop{}, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }) @@ -3642,13 +3639,13 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Global{ - Vars: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtGlobal{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }) @@ -3665,8 +3662,8 @@ func TestPrinterPrintStmtGoto(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Goto{ - Label: &node.Identifier{Value: "FOO"}, + p.Print(&ast.StmtGoto{ + Label: &ast.Identifier{Value: []byte("FOO")}, }) expected := `goto FOO;` @@ -3681,16 +3678,16 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.GroupUse{ - UseType: &node.Identifier{Value: "function"}, - Prefix: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - UseList: []node.Node{ - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - Alias: &node.Identifier{Value: "Baz"}, + p.Print(&ast.StmtGroupUse{ + UseType: &ast.Identifier{Value: []byte("function")}, + Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + UseList: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Alias: &ast.Identifier{Value: []byte("Baz")}, }, - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Quuz"}}}, + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, }, }) @@ -3707,7 +3704,7 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.HaltCompiler{}) + p.Print(&ast.StmtHaltCompiler{}) expected := `__halt_compiler();` actual := o.String() @@ -3721,41 +3718,41 @@ func TestPrinterPrintIfExpression(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.If{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, - ElseIf: []node.Node{ - &stmt.ElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "d"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("d")}, }, }, }, }, }, - &stmt.ElseIf{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("e")}, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }, }, - Else: &stmt.Else{ - Stmt: &stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "f"}, + Else: &ast.StmtElse{ + Stmt: &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("f")}, }, }, }, @@ -3773,15 +3770,15 @@ func TestPrinterPrintIfStmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.If{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -3800,11 +3797,11 @@ func TestPrinterPrintIfNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.If{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.Nop{}, + Stmt: &ast.StmtNop{}, }) expected := `if($a);` @@ -3819,10 +3816,10 @@ func TestPrinterPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&node.Root{ - Stmts: []node.Node{ - &stmt.InlineHtml{ - Value: "test", + p.Print(&ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtInlineHtml{ + Value: []byte("test"), }, }, }) @@ -3839,23 +3836,23 @@ func TestPrinterPrintInterface(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Interface{ - InterfaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Extends: &stmt.InterfaceExtends{ - InterfaceNames: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + p.Print(&ast.StmtInterface{ + InterfaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Extends: &ast.StmtInterfaceExtends{ + InterfaceNames: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, }, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, @@ -3875,8 +3872,8 @@ func TestPrinterPrintLabel(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Label{ - LabelName: &node.Identifier{Value: "FOO"}, + p.Print(&ast.StmtLabel{ + LabelName: &ast.Identifier{Value: []byte("FOO")}, }) expected := `FOO:` @@ -3891,8 +3888,8 @@ func TestPrinterPrintNamespace(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Namespace{ - NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, + p.Print(&ast.StmtNamespace{ + NamespaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, }) expected := `namespace Foo;` @@ -3907,11 +3904,11 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Namespace{ - NamespaceName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtNamespace{ + NamespaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }) @@ -3928,7 +3925,7 @@ func TestPrinterPrintNop(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Nop{}) + p.Print(&ast.StmtNop{}) expected := `;` actual := o.String() @@ -3942,28 +3939,28 @@ func TestPrinterPrintPropertyList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.PropertyList{ - Modifiers: []node.Node{ - &node.Identifier{Value: "public"}, - &node.Identifier{Value: "static"}, + p.Print(&ast.StmtPropertyList{ + Modifiers: []ast.Vertex{ + &ast.Identifier{Value: []byte("public")}, + &ast.Identifier{Value: []byte("static")}, }, - Type: &name.Name{ - Parts: []node.Node{ - &name.NamePart{ - Value: "Foo", + Type: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("Foo"), }, }, }, - Properties: []node.Node{ - &stmt.Property{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Properties: []ast.Vertex{ + &ast.StmtProperty{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Expr: &scalar.String{Value: "'a'"}, + Expr: &ast.ScalarString{Value: []byte("'a'")}, }, - &stmt.Property{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtProperty{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -3981,19 +3978,21 @@ func TestPrinterPrintProperty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Property{ - Variable: &expr.Variable{ - FreeFloating: freefloating.Collection{ - freefloating.Start: []freefloating.String{ - { - StringType: freefloating.TokenType, - Value: "$", + p.Print(&ast.StmtProperty{ + Var: &ast.ExprVariable{ + Node: ast.Node{ + Tokens: token.Collection{ + token.Start: []token.Token{ + { + ID: token.ID('$'), + Value: []byte("$"), + }, }, }, }, - VarName: &node.Identifier{Value: "a"}, + VarName: &ast.Identifier{Value: []byte("a")}, }, - Expr: &scalar.Lnumber{Value: "1"}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := `$a=1` @@ -4008,8 +4007,8 @@ func TestPrinterPrintReturn(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Return{ - Expr: &scalar.Lnumber{Value: "1"}, + p.Print(&ast.StmtReturn{ + Expr: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := `return 1;` @@ -4024,11 +4023,11 @@ func TestPrinterPrintStaticVar(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.StaticVar{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtStaticVar{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Expr: &scalar.Lnumber{Value: "1"}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, }) expected := `$a=1` @@ -4043,16 +4042,16 @@ func TestPrinterPrintStatic(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Static{ - Vars: []node.Node{ - &stmt.StaticVar{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtStatic{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, }, - &stmt.StaticVar{ - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtStaticVar{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -4070,13 +4069,13 @@ func TestPrinterPrintStmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }) @@ -4093,20 +4092,20 @@ func TestPrinterPrintStmtListNested(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, - &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, - &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "c"}, + &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("c")}, }}, }, }, @@ -4127,25 +4126,25 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Switch{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.StmtSwitch{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, - CaseList: &stmt.CaseList{ - Cases: []node.Node{ - &stmt.Case{ - Cond: &scalar.String{Value: "'a'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + CaseList: &ast.StmtCaseList{ + Cases: []ast.Vertex{ + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'a'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, - &stmt.Case{ - Cond: &scalar.String{Value: "'b'"}, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.StmtCase{ + Cond: &ast.ScalarString{Value: []byte("'b'")}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, @@ -4165,9 +4164,9 @@ func TestPrinterPrintStmtThrow(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Throw{ - Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "var"}, + p.Print(&ast.StmtThrow{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("var")}, }, }) @@ -4183,14 +4182,14 @@ func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitAdaptationList{ - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTraitAdaptationList{ + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }, - Alias: &node.Identifier{Value: "b"}, + Alias: &ast.Identifier{Value: []byte("b")}, }, }, }) @@ -4207,8 +4206,8 @@ func TestPrinterPrintStmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitMethodRef{ - Method: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTraitMethodRef{ + Method: &ast.Identifier{Value: []byte("a")}, }) expected := `a` @@ -4223,9 +4222,9 @@ func TestPrinterPrintStmtTraitMethodRefFull(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }) expected := `Foo::a` @@ -4240,13 +4239,13 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }, - Modifier: &node.Identifier{Value: "public"}, - Alias: &node.Identifier{Value: "b"}, + Modifier: &ast.Identifier{Value: []byte("public")}, + Alias: &ast.Identifier{Value: []byte("b")}, }) expected := `Foo::a as public b;` @@ -4261,14 +4260,14 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitUsePrecedence{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTraitUsePrecedence{ + Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }, - Insteadof: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + Insteadof: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, }) @@ -4284,12 +4283,12 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitUse{ - Traits: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + p.Print(&ast.StmtTraitUse{ + Traits: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - TraitAdaptationList: &stmt.Nop{}, + TraitAdaptationList: &ast.StmtNop{}, }) expected := `use Foo,Bar;` @@ -4304,19 +4303,19 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.TraitUse{ - Traits: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Bar"}}}, + p.Print(&ast.StmtTraitUse{ + Traits: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - TraitAdaptationList: &stmt.TraitAdaptationList{ - Adaptations: []node.Node{ - &stmt.TraitUseAlias{ - Ref: &stmt.TraitMethodRef{ - Trait: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Method: &node.Identifier{Value: "a"}, + TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }, - Alias: &node.Identifier{Value: "b"}, + Alias: &ast.Identifier{Value: []byte("b")}, }, }, }, @@ -4334,17 +4333,17 @@ func TestPrinterPrintTrait(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Trait{ - TraitName: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Stmts: []node.Node{ - &stmt.ClassMethod{ - Modifiers: []node.Node{&node.Identifier{Value: "public"}}, - MethodName: &node.Identifier{Value: "foo"}, - Params: []node.Node{}, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTrait{ + TraitName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Stmts: []ast.Vertex{ + &ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + MethodName: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, @@ -4364,31 +4363,31 @@ func TestPrinterPrintStmtTry(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Try{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtTry{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, - Catches: []node.Node{ - &stmt.Catch{ - Types: []node.Node{ - &name.Name{Parts: []node.Node{&name.NamePart{Value: "Exception"}}}, - &name.FullyQualified{Parts: []node.Node{&name.NamePart{Value: "RuntimeException"}}}, + Catches: []ast.Vertex{ + &ast.StmtCatch{ + Types: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, + &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, }, - Variable: &expr.Variable{ - VarName: &node.Identifier{Value: "e"}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("e")}, }, - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }}, }, }, }, - Finally: &stmt.Finally{ - Stmts: []node.Node{ - &stmt.Nop{}, + Finally: &ast.StmtFinally{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, }, }, }) @@ -4405,13 +4404,13 @@ func TestPrinterPrintStmtUnset(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Unset{ - Vars: []node.Node{ - &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtUnset{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - &expr.Variable{ - VarName: &node.Identifier{Value: "b"}, + &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("b")}, }, }, }) @@ -4428,15 +4427,15 @@ func TestPrinterPrintStmtUseList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.UseList{ - UseType: &node.Identifier{Value: "function"}, - Uses: []node.Node{ - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Alias: &node.Identifier{Value: "Bar"}, + p.Print(&ast.StmtUseList{ + UseType: &ast.Identifier{Value: []byte("function")}, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, }, - &stmt.Use{ - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Baz"}}}, + &ast.StmtUse{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, }, }) @@ -4453,10 +4452,10 @@ func TestPrinterPrintUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.Use{ - UseType: &node.Identifier{Value: "function"}, - Use: &name.Name{Parts: []node.Node{&name.NamePart{Value: "Foo"}}}, - Alias: &node.Identifier{Value: "Bar"}, + p.Print(&ast.StmtUse{ + UseType: &ast.Identifier{Value: []byte("function")}, + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, }) expected := `function Foo as Bar` @@ -4471,14 +4470,14 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&stmt.While{ - Cond: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + p.Print(&ast.StmtWhile{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }, - Stmt: &stmt.StmtList{ - Stmts: []node.Node{ - &stmt.Expression{Expr: &expr.Variable{ - VarName: &node.Identifier{Value: "a"}, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtExpression{Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("a")}, }}, }, }, diff --git a/pkg/token/position.go b/pkg/token/position.go index 209ed9d..7032e5a 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -2,8 +2,6 @@ package token type Position int -type Collection map[Position][]Token - //go:generate stringer -type=Position -output ./position_string.go const ( Start Position = iota @@ -86,3 +84,14 @@ const ( OpenParenthesisToken CloseParenthesisToken ) + +type Collection map[Position][]Token + +func (c Collection) IsEmpty() bool { + for _, v := range c { + if len(v) > 0 { + return false + } + } + return true +} diff --git a/printer/printer.go b/printer/printer.go deleted file mode 100644 index 06ad2ae..0000000 --- a/printer/printer.go +++ /dev/null @@ -1,3267 +0,0 @@ -package printer - -import ( - "io" - "strings" - - "github.com/z7zmey/php-parser/freefloating" - - "github.com/z7zmey/php-parser/node/stmt" - - "github.com/z7zmey/php-parser/node" - "github.com/z7zmey/php-parser/node/expr" - "github.com/z7zmey/php-parser/node/expr/assign" - "github.com/z7zmey/php-parser/node/expr/binary" - "github.com/z7zmey/php-parser/node/expr/cast" - "github.com/z7zmey/php-parser/node/name" - "github.com/z7zmey/php-parser/node/scalar" -) - -type printerState int - -const ( - PhpState printerState = iota - HtmlState -) - -type Printer struct { - w io.Writer - s printerState -} - -// NewPrinter - Constructor for Printer -func NewPrinter(w io.Writer) *Printer { - return &Printer{ - w: w, - } -} - -func (p *Printer) SetState(s printerState) { - p.s = s -} - -func (p *Printer) Print(n node.Node) { - _, isRoot := n.(*node.Root) - _, isInlineHtml := n.(*stmt.InlineHtml) - if p.s == HtmlState && !isInlineHtml && !isRoot { - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " 0 { - io.WriteString(p.w, glue) - } - - p.Print(n) - } -} - -func (p *Printer) printNodes(nn []node.Node) { - for _, n := range nn { - p.Print(n) - } -} - -func (p *Printer) printFreeFloating(n node.Node, pos freefloating.Position) { - if n == nil { - return - } - - for _, m := range (*n.GetFreeFloating())[pos] { - io.WriteString(p.w, m.Value) - } -} - -func (p *Printer) printNode(n node.Node) { - switch n.(type) { - - // node - - case *node.Root: - p.printNodeRoot(n) - case *node.Identifier: - p.printNodeIdentifier(n) - case *node.Parameter: - p.printNodeParameter(n) - case *node.Nullable: - p.printNodeNullable(n) - case *node.Argument: - p.printNodeArgument(n) - - // name - - case *name.NamePart: - p.printNameNamePart(n) - case *name.Name: - p.printNameName(n) - case *name.FullyQualified: - p.printNameFullyQualified(n) - case *name.Relative: - p.printNameRelative(n) - - // scalar - - case *scalar.Lnumber: - p.printScalarLNumber(n) - case *scalar.Dnumber: - p.printScalarDNumber(n) - case *scalar.String: - p.printScalarString(n) - case *scalar.EncapsedStringPart: - p.printScalarEncapsedStringPart(n) - case *scalar.Encapsed: - p.printScalarEncapsed(n) - case *scalar.Heredoc: - p.printScalarHeredoc(n) - case *scalar.MagicConstant: - p.printScalarMagicConstant(n) - - // assign - - case *assign.Assign: - p.printAssign(n) - case *assign.Reference: - p.printAssignReference(n) - case *assign.BitwiseAnd: - p.printAssignBitwiseAnd(n) - case *assign.BitwiseOr: - p.printAssignBitwiseOr(n) - case *assign.BitwiseXor: - p.printAssignBitwiseXor(n) - case *assign.Coalesce: - p.printAssignCoalesce(n) - case *assign.Concat: - p.printAssignConcat(n) - case *assign.Div: - p.printAssignDiv(n) - case *assign.Minus: - p.printAssignMinus(n) - case *assign.Mod: - p.printAssignMod(n) - case *assign.Mul: - p.printAssignMul(n) - case *assign.Plus: - p.printAssignPlus(n) - case *assign.Pow: - p.printAssignPow(n) - case *assign.ShiftLeft: - p.printAssignShiftLeft(n) - case *assign.ShiftRight: - p.printAssignShiftRight(n) - - // binary - - case *binary.BitwiseAnd: - p.printBinaryBitwiseAnd(n) - case *binary.BitwiseOr: - p.printBinaryBitwiseOr(n) - case *binary.BitwiseXor: - p.printBinaryBitwiseXor(n) - case *binary.BooleanAnd: - p.printBinaryBooleanAnd(n) - case *binary.BooleanOr: - p.printBinaryBooleanOr(n) - case *binary.Coalesce: - p.printBinaryCoalesce(n) - case *binary.Concat: - p.printBinaryConcat(n) - case *binary.Div: - p.printBinaryDiv(n) - case *binary.Equal: - p.printBinaryEqual(n) - case *binary.GreaterOrEqual: - p.printBinaryGreaterOrEqual(n) - case *binary.Greater: - p.printBinaryGreater(n) - case *binary.Identical: - p.printBinaryIdentical(n) - case *binary.LogicalAnd: - p.printBinaryLogicalAnd(n) - case *binary.LogicalOr: - p.printBinaryLogicalOr(n) - case *binary.LogicalXor: - p.printBinaryLogicalXor(n) - case *binary.Minus: - p.printBinaryMinus(n) - case *binary.Mod: - p.printBinaryMod(n) - case *binary.Mul: - p.printBinaryMul(n) - case *binary.NotEqual: - p.printBinaryNotEqual(n) - case *binary.NotIdentical: - p.printBinaryNotIdentical(n) - case *binary.Plus: - p.printBinaryPlus(n) - case *binary.Pow: - p.printBinaryPow(n) - case *binary.ShiftLeft: - p.printBinaryShiftLeft(n) - case *binary.ShiftRight: - p.printBinaryShiftRight(n) - case *binary.SmallerOrEqual: - p.printBinarySmallerOrEqual(n) - case *binary.Smaller: - p.printBinarySmaller(n) - case *binary.Spaceship: - p.printBinarySpaceship(n) - - // cast - - case *cast.Array: - p.printArray(n) - case *cast.Bool: - p.printBool(n) - case *cast.Double: - p.printDouble(n) - case *cast.Int: - p.printInt(n) - case *cast.Object: - p.printObject(n) - case *cast.String: - p.printString(n) - case *cast.Unset: - p.printUnset(n) - - // expr - - case *expr.ArrayDimFetch: - p.printExprArrayDimFetch(n) - case *expr.ArrayItem: - p.printExprArrayItem(n) - case *expr.Array: - p.printExprArray(n) - case *expr.ArrowFunction: - p.printExprArrowFunction(n) - case *expr.BitwiseNot: - p.printExprBitwiseNot(n) - case *expr.BooleanNot: - p.printExprBooleanNot(n) - case *expr.ClassConstFetch: - p.printExprClassConstFetch(n) - case *expr.Clone: - p.printExprClone(n) - case *expr.ClosureUse: - p.printExprClosureUse(n) - case *expr.Closure: - p.printExprClosure(n) - case *expr.ConstFetch: - p.printExprConstFetch(n) - case *expr.Empty: - p.printExprEmpty(n) - case *expr.ErrorSuppress: - p.printExprErrorSuppress(n) - case *expr.Eval: - p.printExprEval(n) - case *expr.Exit: - p.printExprExit(n) - case *expr.FunctionCall: - p.printExprFunctionCall(n) - case *expr.Include: - p.printExprInclude(n) - case *expr.IncludeOnce: - p.printExprIncludeOnce(n) - case *expr.InstanceOf: - p.printExprInstanceOf(n) - case *expr.Isset: - p.printExprIsset(n) - case *expr.List: - p.printExprList(n) - case *expr.MethodCall: - p.printExprMethodCall(n) - case *expr.New: - p.printExprNew(n) - case *expr.PostDec: - p.printExprPostDec(n) - case *expr.PostInc: - p.printExprPostInc(n) - case *expr.PreDec: - p.printExprPreDec(n) - case *expr.PreInc: - p.printExprPreInc(n) - case *expr.Print: - p.printExprPrint(n) - case *expr.PropertyFetch: - p.printExprPropertyFetch(n) - case *expr.Reference: - p.printExprReference(n) - case *expr.Require: - p.printExprRequire(n) - case *expr.RequireOnce: - p.printExprRequireOnce(n) - case *expr.ShellExec: - p.printExprShellExec(n) - case *expr.ShortArray: - p.printExprShortArray(n) - case *expr.ShortList: - p.printExprShortList(n) - case *expr.StaticCall: - p.printExprStaticCall(n) - case *expr.StaticPropertyFetch: - p.printExprStaticPropertyFetch(n) - case *expr.Ternary: - p.printExprTernary(n) - case *expr.UnaryMinus: - p.printExprUnaryMinus(n) - case *expr.UnaryPlus: - p.printExprUnaryPlus(n) - case *expr.Variable: - p.printExprVariable(n) - case *expr.YieldFrom: - p.printExprYieldFrom(n) - case *expr.Yield: - p.printExprYield(n) - - // stmt - - case *stmt.AltElseIf: - p.printStmtAltElseIf(n) - case *stmt.AltElse: - p.printStmtAltElse(n) - case *stmt.AltFor: - p.printStmtAltFor(n) - case *stmt.AltForeach: - p.printStmtAltForeach(n) - case *stmt.AltIf: - p.printStmtAltIf(n) - case *stmt.AltSwitch: - p.printStmtAltSwitch(n) - case *stmt.AltWhile: - p.printStmtAltWhile(n) - case *stmt.Break: - p.printStmtBreak(n) - case *stmt.Case: - p.printStmtCase(n) - case *stmt.Catch: - p.printStmtCatch(n) - case *stmt.ClassMethod: - p.printStmtClassMethod(n) - case *stmt.Class: - p.printStmtClass(n) - case *stmt.ClassConstList: - p.printStmtClassConstList(n) - case *stmt.ConstList: - p.printStmtConstList(n) - case *stmt.Constant: - p.printStmtConstant(n) - case *stmt.Continue: - p.printStmtContinue(n) - case *stmt.Declare: - p.printStmtDeclare(n) - case *stmt.Default: - p.printStmtDefault(n) - case *stmt.Do: - p.printStmtDo(n) - case *stmt.Echo: - p.printStmtEcho(n) - case *stmt.ElseIf: - p.printStmtElseif(n) - case *stmt.Else: - p.printStmtElse(n) - case *stmt.Expression: - p.printStmtExpression(n) - case *stmt.Finally: - p.printStmtFinally(n) - case *stmt.For: - p.printStmtFor(n) - case *stmt.Foreach: - p.printStmtForeach(n) - case *stmt.Function: - p.printStmtFunction(n) - case *stmt.Global: - p.printStmtGlobal(n) - case *stmt.Goto: - p.printStmtGoto(n) - case *stmt.GroupUse: - p.printStmtGroupUse(n) - case *stmt.HaltCompiler: - p.printStmtHaltCompiler(n) - case *stmt.If: - p.printStmtIf(n) - case *stmt.InlineHtml: - p.printStmtInlineHTML(n) - case *stmt.Interface: - p.printStmtInterface(n) - case *stmt.Label: - p.printStmtLabel(n) - case *stmt.Namespace: - p.printStmtNamespace(n) - case *stmt.Nop: - p.printStmtNop(n) - case *stmt.PropertyList: - p.printStmtPropertyList(n) - case *stmt.Property: - p.printStmtProperty(n) - case *stmt.Return: - p.printStmtReturn(n) - case *stmt.StaticVar: - p.printStmtStaticVar(n) - case *stmt.Static: - p.printStmtStatic(n) - case *stmt.StmtList: - p.printStmtStmtList(n) - case *stmt.Switch: - p.printStmtSwitch(n) - case *stmt.Throw: - p.printStmtThrow(n) - case *stmt.TraitAdaptationList: - p.printStmtTraitAdaptationList(n) - case *stmt.TraitMethodRef: - p.printStmtTraitMethodRef(n) - case *stmt.TraitUseAlias: - p.printStmtTraitUseAlias(n) - case *stmt.TraitUsePrecedence: - p.printStmtTraitUsePrecedence(n) - case *stmt.TraitUse: - p.printStmtTraitUse(n) - case *stmt.Trait: - p.printStmtTrait(n) - case *stmt.Try: - p.printStmtTry(n) - case *stmt.Unset: - p.printStmtUnset(n) - case *stmt.UseList: - p.printStmtUseList(n) - case *stmt.Use: - p.printStmtUse(n) - case *stmt.While: - p.printStmtWhile(n) - } -} - -// node - -func (p *Printer) printNodeRoot(n node.Node) { - nn := n.(*node.Root) - p.SetState(HtmlState) - p.printFreeFloating(nn, freefloating.Start) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNodeIdentifier(n node.Node) { - nn := n.(*node.Identifier) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNodeParameter(n node.Node) { - nn := n.(*node.Parameter) - p.printFreeFloating(nn, freefloating.Start) - - if nn.VariableType != nil { - p.Print(nn.VariableType) - } - p.printFreeFloating(nn, freefloating.OptionalType) - - if nn.ByRef { - io.WriteString(p.w, "&") - } - p.printFreeFloating(nn, freefloating.Ampersand) - - if nn.Variadic { - io.WriteString(p.w, "...") - } - p.printFreeFloating(nn, freefloating.Variadic) - - p.Print(nn.Variable) - - if nn.DefaultValue != nil { - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "=") - p.Print(nn.DefaultValue) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNodeNullable(n node.Node) { - nn := n.(*node.Nullable) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "?") - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNodeArgument(n node.Node) { - nn := n.(*node.Argument) - p.printFreeFloating(nn, freefloating.Start) - - if nn.IsReference { - io.WriteString(p.w, "&") - } - p.printFreeFloating(nn, freefloating.Ampersand) - - if nn.Variadic { - io.WriteString(p.w, "...") - } - p.printFreeFloating(nn, freefloating.Variadic) - - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -// name - -func (p *Printer) printNameNamePart(n node.Node) { - nn := n.(*name.NamePart) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, nn.Value) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNameName(n node.Node) { - nn := n.(*name.Name) - p.printFreeFloating(nn, freefloating.Start) - - p.joinPrint("\\", nn.Parts) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNameFullyQualified(n node.Node) { - nn := n.(*name.FullyQualified) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "\\") - p.joinPrint("\\", nn.Parts) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printNameRelative(n node.Node) { - nn := n.(*name.Relative) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "namespace") - p.printFreeFloating(nn, freefloating.Namespace) - - for _, part := range nn.Parts { - io.WriteString(p.w, "\\") - p.Print(part) - } - - p.printFreeFloating(nn, freefloating.End) -} - -// scalar - -func (p *Printer) printScalarLNumber(n node.Node) { - nn := n.(*scalar.Lnumber) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarDNumber(n node.Node) { - nn := n.(*scalar.Dnumber) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarString(n node.Node) { - nn := n.(*scalar.String) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarEncapsedStringPart(n node.Node) { - nn := n.(*scalar.EncapsedStringPart) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarEncapsed(n node.Node) { - nn := n.(*scalar.Encapsed) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "\"") - for _, part := range nn.Parts { - switch part.(type) { - case *expr.ArrayDimFetch: - s := (*part.GetFreeFloating())[freefloating.Start] - if len(s) > 0 && s[0].Value == "${" { - p.printExprArrayDimFetchWithoutLeadingDollar(part) - } else { - p.Print(part) - } - case *expr.Variable: - s := (*part.GetFreeFloating())[freefloating.Start] - if len(s) > 0 && s[0].Value == "${" { - p.printExprVariableWithoutLeadingDollar(part) - } else { - p.Print(part) - } - default: - p.Print(part) - } - } - io.WriteString(p.w, "\"") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarHeredoc(n node.Node) { - nn := n.(*scalar.Heredoc) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, nn.Label) - - for _, part := range nn.Parts { - switch part.(type) { - case *expr.ArrayDimFetch: - s := (*part.GetFreeFloating())[freefloating.Start] - if len(s) > 0 && s[0].Value == "${" { - p.printExprArrayDimFetchWithoutLeadingDollar(part) - } else { - p.Print(part) - } - case *expr.Variable: - s := (*part.GetFreeFloating())[freefloating.Start] - if len(s) > 0 && s[0].Value == "${" { - p.printExprVariableWithoutLeadingDollar(part) - } else { - p.Print(part) - } - default: - p.Print(part) - } - } - - io.WriteString(p.w, strings.Trim(nn.Label, "<\"'\n")) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printScalarMagicConstant(n node.Node) { - nn := n.(*scalar.MagicConstant) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, nn.Value) - p.printFreeFloating(nn, freefloating.End) -} - -// Assign - -func (p *Printer) printAssign(n node.Node) { - nn := n.(*assign.Assign) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignReference(n node.Node) { - nn := n.(*assign.Reference) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "=") - p.printFreeFloating(nn, freefloating.Equal) - io.WriteString(p.w, "&") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignBitwiseAnd(n node.Node) { - nn := n.(*assign.BitwiseAnd) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "&") - io.WriteString(p.w, "=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignBitwiseOr(n node.Node) { - nn := n.(*assign.BitwiseOr) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "|=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignBitwiseXor(n node.Node) { - nn := n.(*assign.BitwiseXor) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "^=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignCoalesce(n node.Node) { - nn := n.(*assign.Coalesce) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "??=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignConcat(n node.Node) { - nn := n.(*assign.Concat) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, ".=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignDiv(n node.Node) { - nn := n.(*assign.Div) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "/=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignMinus(n node.Node) { - nn := n.(*assign.Minus) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "-=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignMod(n node.Node) { - nn := n.(*assign.Mod) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "%=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignMul(n node.Node) { - nn := n.(*assign.Mul) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "*=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignPlus(n node.Node) { - nn := n.(*assign.Plus) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "+=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignPow(n node.Node) { - nn := n.(*assign.Pow) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "**=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignShiftLeft(n node.Node) { - nn := n.(*assign.ShiftLeft) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "<<=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printAssignShiftRight(n node.Node) { - nn := n.(*assign.ShiftRight) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, ">>=") - p.Print(nn.Expression) - - p.printFreeFloating(nn, freefloating.End) -} - -// binary - -func (p *Printer) printBinaryBitwiseAnd(n node.Node) { - nn := n.(*binary.BitwiseAnd) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "&") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryBitwiseOr(n node.Node) { - nn := n.(*binary.BitwiseOr) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "|") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryBitwiseXor(n node.Node) { - nn := n.(*binary.BitwiseXor) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "^") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryBooleanAnd(n node.Node) { - nn := n.(*binary.BooleanAnd) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "&&") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryBooleanOr(n node.Node) { - nn := n.(*binary.BooleanOr) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "||") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryCoalesce(n node.Node) { - nn := n.(*binary.Coalesce) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "??") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryConcat(n node.Node) { - nn := n.(*binary.Concat) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ".") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryDiv(n node.Node) { - nn := n.(*binary.Div) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "/") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryEqual(n node.Node) { - nn := n.(*binary.Equal) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "==") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryGreaterOrEqual(n node.Node) { - nn := n.(*binary.GreaterOrEqual) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ">=") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryGreater(n node.Node) { - nn := n.(*binary.Greater) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ">") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryIdentical(n node.Node) { - nn := n.(*binary.Identical) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "===") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryLogicalAnd(n node.Node) { - nn := n.(*binary.LogicalAnd) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "and") - if nn.Right.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryLogicalOr(n node.Node) { - nn := n.(*binary.LogicalOr) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "or") - if nn.Right.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryLogicalXor(n node.Node) { - nn := n.(*binary.LogicalXor) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "xor") - if nn.Right.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryMinus(n node.Node) { - nn := n.(*binary.Minus) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "-") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryMod(n node.Node) { - nn := n.(*binary.Mod) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "%") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryMul(n node.Node) { - nn := n.(*binary.Mul) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "*") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryNotEqual(n node.Node) { - nn := n.(*binary.NotEqual) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - p.printFreeFloating(nn, freefloating.Equal) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "!=") - } - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryNotIdentical(n node.Node) { - nn := n.(*binary.NotIdentical) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "!==") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryPlus(n node.Node) { - nn := n.(*binary.Plus) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "+") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryPow(n node.Node) { - nn := n.(*binary.Pow) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "**") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryShiftLeft(n node.Node) { - nn := n.(*binary.ShiftLeft) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "<<") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinaryShiftRight(n node.Node) { - nn := n.(*binary.ShiftRight) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ">>") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinarySmallerOrEqual(n node.Node) { - nn := n.(*binary.SmallerOrEqual) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "<=") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinarySmaller(n node.Node) { - nn := n.(*binary.Smaller) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "<") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBinarySpaceship(n node.Node) { - nn := n.(*binary.Spaceship) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "<=>") - p.Print(nn.Right) - - p.printFreeFloating(nn, freefloating.End) -} - -// cast - -func (p *Printer) printArray(n node.Node) { - nn := n.(*cast.Array) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(array)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printBool(n node.Node) { - nn := n.(*cast.Bool) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(boolean)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printDouble(n node.Node) { - nn := n.(*cast.Double) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(float)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printInt(n node.Node) { - nn := n.(*cast.Int) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(integer)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printObject(n node.Node) { - nn := n.(*cast.Object) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(object)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printString(n node.Node) { - nn := n.(*cast.String) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(string)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printUnset(n node.Node) { - nn := n.(*cast.Unset) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Cast) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "(unset)") - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -// expr - -func (p *Printer) printExprArrayDimFetch(n node.Node) { - nn := n.(*expr.ArrayDimFetch) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "[") - } - p.Print(nn.Dim) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "]") - } - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprArrayDimFetchWithoutLeadingDollar(n node.Node) { - nn := n.(*expr.ArrayDimFetch) - p.printFreeFloating(nn, freefloating.Start) - p.printExprVariableWithoutLeadingDollar(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "[") - } - p.Print(nn.Dim) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "]") - } - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprArrayItem(n node.Node) { - nn := n.(*expr.ArrayItem) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Unpack { - io.WriteString(p.w, "...") - } - - if nn.Key != nil { - p.Print(nn.Key) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "=>") - } - - p.Print(nn.Val) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprArray(n node.Node) { - nn := n.(*expr.Array) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "array") - p.printFreeFloating(nn, freefloating.Array) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, freefloating.ArrayPairList) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprArrowFunction(n node.Node) { - nn := n.(*expr.ArrowFunction) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Static { - io.WriteString(p.w, "static") - } - p.printFreeFloating(nn, freefloating.Static) - if nn.Static && n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, "fn") - p.printFreeFloating(nn, freefloating.Function) - - if nn.ReturnsRef { - io.WriteString(p.w, "&") - } - p.printFreeFloating(nn, freefloating.Ampersand) - - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, freefloating.ParameterList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Params) - - if nn.ReturnType != nil { - io.WriteString(p.w, ":") - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, freefloating.ReturnType) - - io.WriteString(p.w, "=>") - - p.printNode(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprBitwiseNot(n node.Node) { - nn := n.(*expr.BitwiseNot) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "~") - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprBooleanNot(n node.Node) { - nn := n.(*expr.BooleanNot) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "!") - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprClassConstFetch(n node.Node) { - nn := n.(*expr.ClassConstFetch) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "::") - p.Print(nn.ConstantName) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprClone(n node.Node) { - nn := n.(*expr.Clone) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "clone") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprClosureUse(n node.Node) { - nn := n.(*expr.ClosureUse) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "use") - p.printFreeFloating(nn, freefloating.Use) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Uses) - p.printFreeFloating(nn, freefloating.LexicalVarList) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprClosure(n node.Node) { - nn := n.(*expr.Closure) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Static { - io.WriteString(p.w, "static") - } - p.printFreeFloating(nn, freefloating.Static) - if nn.Static && n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, "function") - p.printFreeFloating(nn, freefloating.Function) - - if nn.ReturnsRef { - io.WriteString(p.w, "&") - } - p.printFreeFloating(nn, freefloating.Ampersand) - - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, freefloating.ParameterList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Params) - - if nn.ClosureUse != nil { - p.Print(nn.ClosureUse) - } - p.printFreeFloating(nn, freefloating.LexicalVars) - - if nn.ReturnType != nil { - io.WriteString(p.w, ":") - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, freefloating.ReturnType) - - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprConstFetch(n node.Node) { - nn := n.(*expr.ConstFetch) - p.printFreeFloating(nn, freefloating.Start) - p.Print(nn.Constant) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprEmpty(n node.Node) { - nn := n.(*expr.Empty) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "empty") - p.printFreeFloating(nn, freefloating.Empty) - io.WriteString(p.w, "(") - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprErrorSuppress(n node.Node) { - nn := n.(*expr.ErrorSuppress) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "@") - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprEval(n node.Node) { - nn := n.(*expr.Eval) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "eval") - p.printFreeFloating(nn, freefloating.Eval) - io.WriteString(p.w, "(") - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprExit(n node.Node) { - nn := n.(*expr.Exit) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Die { - io.WriteString(p.w, "die") - } else { - io.WriteString(p.w, "exit") - } - p.printFreeFloating(nn, freefloating.Exit) - - if nn.Expr != nil && nn.Expr.GetFreeFloating().IsEmpty() && nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprFunctionCall(n node.Node) { - nn := n.(*expr.FunctionCall) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Function) - - p.printFreeFloating(nn.ArgumentList, freefloating.Start) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, freefloating.End) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprInclude(n node.Node) { - nn := n.(*expr.Include) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "include") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprIncludeOnce(n node.Node) { - nn := n.(*expr.IncludeOnce) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "include_once") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprInstanceOf(n node.Node) { - nn := n.(*expr.InstanceOf) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, "instanceof") - - if nn.Class.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Class) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprIsset(n node.Node) { - nn := n.(*expr.Isset) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "isset") - p.printFreeFloating(nn, freefloating.Isset) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Variables) - p.printFreeFloating(nn, freefloating.VarList) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprList(n node.Node) { - nn := n.(*expr.List) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "list") - p.printFreeFloating(nn, freefloating.List) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, freefloating.ArrayPairList) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprMethodCall(n node.Node) { - nn := n.(*expr.MethodCall) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "->") - p.Print(nn.Method) - - p.printFreeFloating(nn.ArgumentList, freefloating.Start) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, freefloating.End) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprNew(n node.Node) { - nn := n.(*expr.New) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "new") - if nn.Class.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Class) - - if nn.ArgumentList != nil { - p.printFreeFloating(nn.ArgumentList, freefloating.Start) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, freefloating.End) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPostDec(n node.Node) { - nn := n.(*expr.PostDec) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "--") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPostInc(n node.Node) { - nn := n.(*expr.PostInc) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "++") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPreDec(n node.Node) { - nn := n.(*expr.PreDec) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "--") - p.Print(nn.Variable) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPreInc(n node.Node) { - nn := n.(*expr.PreInc) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "++") - p.Print(nn.Variable) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPrint(n node.Node) { - nn := n.(*expr.Print) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "print") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprPropertyFetch(n node.Node) { - nn := n.(*expr.PropertyFetch) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "->") - p.Print(nn.Property) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprReference(n node.Node) { - nn := n.(*expr.Reference) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "&") - p.Print(nn.Variable) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprRequire(n node.Node) { - nn := n.(*expr.Require) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "require") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprRequireOnce(n node.Node) { - nn := n.(*expr.RequireOnce) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "require_once") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprShellExec(n node.Node) { - nn := n.(*expr.ShellExec) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "`") - p.joinPrint("", nn.Parts) - io.WriteString(p.w, "`") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprShortArray(n node.Node) { - nn := n.(*expr.ShortArray) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "[") - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, freefloating.ArrayPairList) - io.WriteString(p.w, "]") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprShortList(n node.Node) { - nn := n.(*expr.ShortList) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "[") - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, freefloating.ArrayPairList) - io.WriteString(p.w, "]") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprStaticCall(n node.Node) { - nn := n.(*expr.StaticCall) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "::") - p.Print(nn.Call) - - p.printFreeFloating(nn.ArgumentList, freefloating.Start) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, freefloating.End) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprStaticPropertyFetch(n node.Node) { - nn := n.(*expr.StaticPropertyFetch) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "::") - p.Print(nn.Property) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprTernary(n node.Node) { - nn := n.(*expr.Ternary) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Condition) - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, "?") - - if nn.IfTrue != nil { - p.Print(nn.IfTrue) - } - p.printFreeFloating(nn, freefloating.True) - - io.WriteString(p.w, ":") - p.Print(nn.IfFalse) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprUnaryMinus(n node.Node) { - nn := n.(*expr.UnaryMinus) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "-") - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprUnaryPlus(n node.Node) { - nn := n.(*expr.UnaryPlus) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "+") - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprVariable(n node.Node) { - nn := n.(*expr.Variable) - p.printFreeFloating(nn, freefloating.Start) - - p.printFreeFloating(nn, freefloating.Dollar) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "$") - } - - p.Print(nn.VarName) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprVariableWithoutLeadingDollar(n node.Node) { - nn := n.(*expr.Variable) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.VarName) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprYieldFrom(n node.Node) { - nn := n.(*expr.YieldFrom) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "yield from") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printExprYield(n node.Node) { - nn := n.(*expr.Yield) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "yield") - - if nn.Key != nil { - if nn.Key.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Key) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, "=>") - } else { - if nn.Value.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.Value) - - p.printFreeFloating(nn, freefloating.End) -} - -// smtm - -func (p *Printer) printStmtAltElseIf(n node.Node) { - nn := n.(*stmt.AltElseIf) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "elseif") - p.printFreeFloating(nn, freefloating.ElseIf) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { - p.printNodes(s) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltElse(n node.Node) { - nn := n.(*stmt.AltElse) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "else") - p.printFreeFloating(nn, freefloating.Else) - io.WriteString(p.w, ":") - - if s := nn.Stmt.(*stmt.StmtList).Stmts; len(s) > 0 { - p.printNodes(s) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltFor(n node.Node) { - nn := n.(*stmt.AltFor) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "for") - p.printFreeFloating(nn, freefloating.For) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Init) - p.printFreeFloating(nn, freefloating.InitExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Cond) - p.printFreeFloating(nn, freefloating.CondExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Loop) - p.printFreeFloating(nn, freefloating.IncExpr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*stmt.StmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - - io.WriteString(p.w, "endfor") - p.printFreeFloating(nn, freefloating.AltEnd) - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltForeach(n node.Node) { - nn := n.(*stmt.AltForeach) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "foreach") - p.printFreeFloating(nn, freefloating.Foreach) - io.WriteString(p.w, "(") - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "as") - - if nn.Key != nil { - if nn.Key.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Key) - p.printFreeFloating(nn, freefloating.Key) - io.WriteString(p.w, "=>") - } else { - if nn.Variable.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - - io.WriteString(p.w, ":") - s := nn.Stmt.(*stmt.StmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - - io.WriteString(p.w, "endforeach") - p.printFreeFloating(nn, freefloating.AltEnd) - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltIf(n node.Node) { - nn := n.(*stmt.AltIf) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "if") - p.printFreeFloating(nn, freefloating.If) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*stmt.StmtList) - p.printNodes(s.Stmts) - - for _, elseif := range nn.ElseIf { - p.Print(elseif) - } - - if nn.Else != nil { - p.Print(nn.Else) - } - - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "endif") - p.printFreeFloating(nn, freefloating.AltEnd) - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltSwitch(n node.Node) { - nn := n.(*stmt.AltSwitch) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "switch") - p.printFreeFloating(nn, freefloating.Switch) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - p.printFreeFloating(nn.CaseList, freefloating.Start) - p.printFreeFloating(nn.CaseList, freefloating.CaseListStart) - p.printNodes(nn.CaseList.Cases) - p.printFreeFloating(nn.CaseList, freefloating.CaseListEnd) - p.printFreeFloating(nn.CaseList, freefloating.End) - - io.WriteString(p.w, "endswitch") - p.printFreeFloating(nn, freefloating.AltEnd) - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtAltWhile(n node.Node) { - nn := n.(*stmt.AltWhile) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "while") - p.printFreeFloating(nn, freefloating.While) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*stmt.StmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - - io.WriteString(p.w, "endwhile") - p.printFreeFloating(nn, freefloating.AltEnd) - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtBreak(n node.Node) { - nn := n.(*stmt.Break) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "break") - if nn.Expr != nil { - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - } - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtCase(n node.Node) { - nn := n.(*stmt.Case) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "case") - if nn.Cond.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - p.printFreeFloating(nn, freefloating.CaseSeparator) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ":") - } - - if len(nn.Stmts) > 0 { - p.printNodes(nn.Stmts) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtCatch(n node.Node) { - nn := n.(*stmt.Catch) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "catch") - p.printFreeFloating(nn, freefloating.Catch) - io.WriteString(p.w, "(") - p.joinPrint("|", nn.Types) - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtClassMethod(n node.Node) { - nn := n.(*stmt.ClassMethod) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(m) - } - - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - p.printFreeFloating(nn, freefloating.ModifierList) - io.WriteString(p.w, "function") - p.printFreeFloating(nn, freefloating.Function) - - if nn.ReturnsRef { - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "&") - p.printFreeFloating(nn, freefloating.Ampersand) - } else { - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.MethodName) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, freefloating.ParameterList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Params) - - if nn.ReturnType != nil { - io.WriteString(p.w, ":") - p.Print(nn.ReturnType) - } - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtClass(n node.Node) { - nn := n.(*stmt.Class) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(m) - } - - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - p.printFreeFloating(nn, freefloating.ModifierList) - io.WriteString(p.w, "class") - p.printFreeFloating(nn, freefloating.Class) - - if nn.ClassName != nil { - if nn.ClassName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.ClassName) - } - - if nn.ArgumentList != nil { - p.printFreeFloating(nn.ArgumentList, freefloating.Start) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, freefloating.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, freefloating.End) - } - - if nn.Extends != nil { - p.printFreeFloating(nn.Extends, freefloating.Start) - if nn.Extends.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "extends") - if nn.Extends.ClassName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Extends.ClassName) - } - - if nn.Implements != nil { - p.printFreeFloating(nn.Implements, freefloating.Start) - if nn.Implements.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "implements") - if nn.Implements.InterfaceNames[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Implements.InterfaceNames) - } - - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtClassConstList(n node.Node) { - nn := n.(*stmt.ClassConstList) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(m) - } - - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - p.printFreeFloating(nn, freefloating.ModifierList) - io.WriteString(p.w, "const") - - if nn.Consts[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Consts) - p.printFreeFloating(nn, freefloating.ConstList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtConstList(n node.Node) { - nn := n.(*stmt.ConstList) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "const") - - if nn.Consts[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Consts) - p.printFreeFloating(nn, freefloating.Stmts) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtConstant(n node.Node) { - nn := n.(*stmt.Constant) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.ConstantName) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "=") - p.Print(nn.Expr) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtContinue(n node.Node) { - nn := n.(*stmt.Continue) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "continue") - - if nn.Expr != nil { - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - } - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtDeclare(n node.Node) { - nn := n.(*stmt.Declare) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "declare") - p.printFreeFloating(nn, freefloating.Declare) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Consts) - p.printFreeFloating(nn, freefloating.ConstList) - io.WriteString(p.w, ")") - - if nn.Alt { - p.printFreeFloating(nn, freefloating.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*stmt.StmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - - io.WriteString(p.w, "enddeclare") - p.printFreeFloating(nn, freefloating.AltEnd) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - } else { - p.Print(nn.Stmt) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtDefault(n node.Node) { - nn := n.(*stmt.Default) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "default") - p.printFreeFloating(nn, freefloating.Default) - p.printFreeFloating(nn, freefloating.CaseSeparator) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ":") - } - - if len(nn.Stmts) > 0 { - p.printNodes(nn.Stmts) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtDo(n node.Node) { - nn := n.(*stmt.Do) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "do") - - if _, ok := nn.Stmt.(*stmt.StmtList); !ok { - if nn.Stmt.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.Stmt) - p.printFreeFloating(nn, freefloating.Stmts) - - io.WriteString(p.w, "while") - p.printFreeFloating(nn, freefloating.While) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Cond) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtEcho(n node.Node) { - nn := n.(*stmt.Echo) - - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "echo") - } - if nn.Exprs[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - p.printFreeFloating(nn, freefloating.Start) - p.printFreeFloating(nn, freefloating.Echo) - - p.joinPrint(",", nn.Exprs) - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtElseif(n node.Node) { - nn := n.(*stmt.ElseIf) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "elseif") - p.printFreeFloating(nn, freefloating.ElseIf) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtElse(n node.Node) { - nn := n.(*stmt.Else) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "else") - - if _, ok := nn.Stmt.(*stmt.StmtList); !ok { - if nn.Stmt.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtExpression(n node.Node) { - nn := n.(*stmt.Expression) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtFinally(n node.Node) { - nn := n.(*stmt.Finally) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "finally") - p.printFreeFloating(nn, freefloating.Finally) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtFor(n node.Node) { - nn := n.(*stmt.For) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "for") - p.printFreeFloating(nn, freefloating.For) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Init) - p.printFreeFloating(nn, freefloating.InitExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Cond) - p.printFreeFloating(nn, freefloating.CondExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Loop) - p.printFreeFloating(nn, freefloating.IncExpr) - io.WriteString(p.w, ")") - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtForeach(n node.Node) { - nn := n.(*stmt.Foreach) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "foreach") - p.printFreeFloating(nn, freefloating.Foreach) - io.WriteString(p.w, "(") - - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, "as") - - if nn.Key != nil { - if nn.Key.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Key) - p.printFreeFloating(nn, freefloating.Key) - io.WriteString(p.w, "=>") - } else { - if nn.Variable.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - p.Print(nn.Variable) - p.printFreeFloating(nn, freefloating.Var) - - io.WriteString(p.w, ")") - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtFunction(n node.Node) { - nn := n.(*stmt.Function) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "function") - p.printFreeFloating(nn, freefloating.Function) - - if nn.ReturnsRef { - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "&") - } else { - if nn.FunctionName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.FunctionName) - p.printFreeFloating(nn, freefloating.Name) - - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, freefloating.ParamList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.Params) - - if nn.ReturnType != nil { - io.WriteString(p.w, ":") - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, freefloating.ReturnType) - - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtGlobal(n node.Node) { - nn := n.(*stmt.Global) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "global") - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, freefloating.VarList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtGoto(n node.Node) { - nn := n.(*stmt.Goto) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "goto") - if nn.Label.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Label) - p.printFreeFloating(nn, freefloating.Label) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtGroupUse(n node.Node) { - nn := n.(*stmt.GroupUse) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "use") - p.printFreeFloating(nn, freefloating.Use) - - if nn.UseType != nil { - if nn.UseType.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.UseType) - } - - if nn.Prefix.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Prefix) - io.WriteString(p.w, "\\") - p.printFreeFloating(nn, freefloating.Slash) - - io.WriteString(p.w, "{") - p.joinPrint(",", nn.UseList) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - p.printFreeFloating(nn, freefloating.UseDeclarationList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtHaltCompiler(n node.Node) { - nn := n.(*stmt.HaltCompiler) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "__halt_compiler") - p.printFreeFloating(nn, freefloating.HaltCompiller) - io.WriteString(p.w, "(") - p.printFreeFloating(nn, freefloating.OpenParenthesisToken) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.CloseParenthesisToken) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtIf(n node.Node) { - nn := n.(*stmt.If) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "if") - p.printFreeFloating(n, freefloating.If) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(n, freefloating.Expr) - io.WriteString(p.w, ")") - - p.Print(nn.Stmt) - - if nn.ElseIf != nil { - p.printNodes(nn.ElseIf) - } - - if nn.Else != nil { - p.Print(nn.Else) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtInlineHTML(n node.Node) { - nn := n.(*stmt.InlineHtml) - p.printFreeFloating(nn, freefloating.Start) - - if p.s == PhpState && nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, "?>") - } - p.SetState(HtmlState) - - io.WriteString(p.w, nn.Value) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtInterface(n node.Node) { - nn := n.(*stmt.Interface) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "interface") - - if nn.InterfaceName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - p.Print(nn.InterfaceName) - - if nn.Extends != nil { - p.printFreeFloating(nn.Extends, freefloating.Start) - if nn.Extends.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "extends") - if nn.Extends.InterfaceNames[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Extends.InterfaceNames) - } - - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtLabel(n node.Node) { - nn := n.(*stmt.Label) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.LabelName) - p.printFreeFloating(nn, freefloating.Label) - - io.WriteString(p.w, ":") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtNamespace(n node.Node) { - nn := n.(*stmt.Namespace) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "namespace") - - if nn.NamespaceName != nil { - if nn.NamespaceName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.NamespaceName) - } - - if nn.Stmts != nil { - p.printFreeFloating(nn, freefloating.Namespace) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - } else { - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtNop(n node.Node) { - p.printFreeFloating(n, freefloating.Start) - p.printFreeFloating(n, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - p.printFreeFloating(n, freefloating.End) -} - -func (p *Printer) printStmtPropertyList(n node.Node) { - nn := n.(*stmt.PropertyList) - p.printFreeFloating(nn, freefloating.Start) - - for k, m := range nn.Modifiers { - if k > 0 && m.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(m) - } - - if nn.Type != nil && nn.Type.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - p.Print(nn.Type) - - if nn.Properties[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - p.joinPrint(",", nn.Properties) - p.printFreeFloating(n, freefloating.PropertyList) - - p.printFreeFloating(n, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtProperty(n node.Node) { - nn := n.(*stmt.Property) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - - if nn.Expr != nil { - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "=") - p.Print(nn.Expr) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtReturn(n node.Node) { - nn := n.(*stmt.Return) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "return") - if nn.Expr != nil && nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtStaticVar(n node.Node) { - nn := n.(*stmt.StaticVar) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Variable) - - if nn.Expr != nil { - p.printFreeFloating(nn, freefloating.Var) - io.WriteString(p.w, "=") - p.Print(nn.Expr) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtStatic(n node.Node) { - nn := n.(*stmt.Static) - p.printFreeFloating(nn, freefloating.Start) - io.WriteString(p.w, "static") - - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, freefloating.VarList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtStmtList(n node.Node) { - nn := n.(*stmt.StmtList) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtSwitch(n node.Node) { - nn := n.(*stmt.Switch) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "switch") - p.printFreeFloating(nn, freefloating.Switch) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - - p.printFreeFloating(nn.CaseList, freefloating.Start) - io.WriteString(p.w, "{") - p.printFreeFloating(nn.CaseList, freefloating.CaseListStart) - p.printNodes(nn.CaseList.Cases) - p.printFreeFloating(nn.CaseList, freefloating.CaseListEnd) - io.WriteString(p.w, "}") - p.printFreeFloating(nn.CaseList, freefloating.End) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtThrow(n node.Node) { - nn := n.(*stmt.Throw) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "throw") - if nn.Expr.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - p.printFreeFloating(nn, freefloating.Expr) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTraitAdaptationList(n node.Node) { - nn := n.(*stmt.TraitAdaptationList) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "{") - p.printNodes(nn.Adaptations) - p.printFreeFloating(nn, freefloating.AdaptationList) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTraitMethodRef(n node.Node) { - nn := n.(*stmt.TraitMethodRef) - p.printFreeFloating(nn, freefloating.Start) - - if nn.Trait != nil { - p.Print(nn.Trait) - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "::") - } - - p.Print(nn.Method) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTraitUseAlias(n node.Node) { - nn := n.(*stmt.TraitUseAlias) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Ref) - p.printFreeFloating(nn, freefloating.Ref) - - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "as") - - if nn.Modifier != nil { - if nn.Modifier.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Modifier) - } - - if nn.Alias != nil { - if nn.Alias.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Alias) - } - p.printFreeFloating(nn, freefloating.Alias) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTraitUsePrecedence(n node.Node) { - nn := n.(*stmt.TraitUsePrecedence) - p.printFreeFloating(nn, freefloating.Start) - - p.Print(nn.Ref) - p.printFreeFloating(nn, freefloating.Ref) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, "insteadof") - if nn.Insteadof[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Insteadof) - p.printFreeFloating(nn, freefloating.NameList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTraitUse(n node.Node) { - nn := n.(*stmt.TraitUse) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "use") - if nn.Traits[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Traits) - - p.Print(nn.TraitAdaptationList) - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTrait(n node.Node) { - nn := n.(*stmt.Trait) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "trait") - if nn.TraitName.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.TraitName) - - p.printFreeFloating(nn, freefloating.Name) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtTry(n node.Node) { - nn := n.(*stmt.Try) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "try") - p.printFreeFloating(nn, freefloating.Try) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, freefloating.Stmts) - io.WriteString(p.w, "}") - - if nn.Catches != nil { - p.printNodes(nn.Catches) - } - - if nn.Finally != nil { - p.Print(nn.Finally) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtUnset(n node.Node) { - nn := n.(*stmt.Unset) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "unset") - p.printFreeFloating(nn, freefloating.Unset) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, freefloating.VarList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, freefloating.CloseParenthesisToken) - - p.printFreeFloating(nn, freefloating.SemiColon) - if n.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtUseList(n node.Node) { - nn := n.(*stmt.UseList) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "use") - - if nn.UseType != nil { - if nn.UseType.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.UseType) - } - - if nn.Uses[0].GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Uses) - p.printFreeFloating(nn, freefloating.UseDeclarationList) - - p.printFreeFloating(nn, freefloating.SemiColon) - if nn.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtUse(n node.Node) { - nn := n.(*stmt.Use) - p.printFreeFloating(nn, freefloating.Start) - - if nn.UseType != nil { - p.Print(nn.UseType) - if nn.UseType.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.printFreeFloating(nn, freefloating.Slash) - - p.Print(nn.Use) - - if nn.Alias != nil { - if nn.Alias.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "as") - if nn.Alias.GetFreeFloating().IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Alias) - } - - p.printFreeFloating(nn, freefloating.End) -} - -func (p *Printer) printStmtWhile(n node.Node) { - nn := n.(*stmt.While) - p.printFreeFloating(nn, freefloating.Start) - - io.WriteString(p.w, "while") - p.printFreeFloating(nn, freefloating.While) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, freefloating.Expr) - io.WriteString(p.w, ")") - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, freefloating.End) -} From f4c15f4671c72f2901501f69c8293271a09e733d Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 17 May 2020 23:13:14 +0300 Subject: [PATCH 010/140] [refactoring] fix tests --- go.mod | 1 - go.sum | 16 ----------- pkg/ast/traverser/dfs.go | 61 ++++++++++++++++++++++++++++++++++++++++ pkg/errors/error_test.go | 4 +-- 4 files changed, 63 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 6b90c8b..79bd6f0 100644 --- a/go.mod +++ b/go.mod @@ -7,6 +7,5 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.4.0 github.com/yookoala/realpath v1.0.0 - golang.org/x/tools v0.0.0-20200308013534-11ec41452d41 // indirect gotest.tools v2.2.0+incompatible ) diff --git a/go.sum b/go.sum index 6f9717a..082e37f 100644 --- a/go.sum +++ b/go.sum @@ -6,22 +6,6 @@ github.com/pkg/profile v1.4.0 h1:uCmaf4vVbWAOZz36k1hrQD7ijGRzLwaME8Am/7a4jZI= github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE= github.com/yookoala/realpath v1.0.0 h1:7OA9pj4FZd+oZDsyvXWQvjn5oBdcHRTV44PpdMSuImQ= github.com/yookoala/realpath v1.0.0/go.mod h1:gJJMA9wuX7AcqLy1+ffPatSCySA1FQ2S8Ya9AIoYBpE= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200308013534-11ec41452d41 h1:9Di9iYgOt9ThCipBxChBVhgNipDoE5mxO84rQV7D0FE= -golang.org/x/tools v0.0.0-20200308013534-11ec41452d41/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 4618bc9..2bba30c 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -70,6 +70,12 @@ func (t *DFS) Traverse(n ast.Vertex) { return } case *ast.ArgumentList: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } if nn.Arguments != nil { t.visitor.Enter("Arguments", false) for _, c := range nn.Arguments { @@ -732,6 +738,12 @@ func (t *DFS) Traverse(n ast.Vertex) { return } case *ast.StmtIf: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } if nn.Cond != nil { t.visitor.Enter("Cond", true) t.Traverse(nn.Cond) @@ -2645,6 +2657,55 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } + case *ast.NameName: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } + case *ast.NameFullyQualified: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } + case *ast.NameRelative: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Parts != nil { + t.visitor.Enter("Parts", false) + for _, c := range nn.Parts { + t.Traverse(c) + } + t.visitor.Leave("Parts", false) + } + case *ast.NameNamePart: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } default: panic("unexpected type of node") } diff --git a/pkg/errors/error_test.go b/pkg/errors/error_test.go index 439157e..3fcac4c 100644 --- a/pkg/errors/error_test.go +++ b/pkg/errors/error_test.go @@ -5,8 +5,8 @@ import ( "gotest.tools/assert" - "github.com/z7zmey/php-parser/errors" - "github.com/z7zmey/php-parser/position" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" ) func TestConstructor(t *testing.T) { From e98607f5d08bd7b0b89c18da1cd5c38093f19ffe Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 17 May 2020 23:50:23 +0300 Subject: [PATCH 011/140] [refactoring] use position.Position to store token position --- internal/php5/parser.go | 10 +- internal/php5/php5.go | Bin 352441 -> 353481 bytes internal/php7/parser.go | 10 +- internal/positionbuilder/position_builder.go | 44 ++--- .../positionbuilder/position_builder_test.go | 156 ++++++++++-------- internal/scanner/lexer.go | 8 +- internal/scanner/token.go | 12 +- 7 files changed, 126 insertions(+), 114 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index d4ec16d..e3b2dc9 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -8,7 +8,6 @@ import ( "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" - "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" ) @@ -45,14 +44,9 @@ func (l *Parser) Lex(lval *yySymType) int { } func (l *Parser) Error(msg string) { - pos := &position.Position{ - StartLine: l.currentToken.StartLine, - EndLine: l.currentToken.EndLine, - StartPos: l.currentToken.StartPos, - EndPos: l.currentToken.EndPos, - } + var pos = l.currentToken.Position - l.Lexer.AddError(errors.NewError(msg, pos)) + l.Lexer.AddError(errors.NewError(msg, &pos)) } func (l *Parser) WithTokens() { diff --git a/internal/php5/php5.go b/internal/php5/php5.go index b63ef14d9ac832ea4a8f75c6ef740c1df8969913..c822f382c48cfe6e2733cae244a389469472bf4d 100644 GIT binary patch delta 7013 zcmY+Jd0bY-8pl7g923P2HxNAs1Qdld#9T1VjcZAoucnksE_f}M>QY@4abKs7?EEHjs=T(VFT&F-9M&N(yJfAD*L&-2VP&#dRXdyX_baiZa@ zU8qMh?B~aOG(#MT|1j|%lQ*(ZAyCc@Y_jVi=mT34VDYR_bikANq%hP5JDSOgB2cCW zV_TplHuzc+iv_fl3c#V3Qn7>cNs*`?_DAZd~>$a#3P)sf{c}hDp3fcmyY>(0v zWp_jim1WN^I#qN-)s&@w4-^LZj}D(>*lvl|x>!fWNGe)tcM{-qD$4R8ZK?*X(iHG7)6nx?a27jLldjA}E1?$9 z?uT;_QuN6@RAso~`H6J2vzkXMv(R109{loFqV-^zRV;coCL2A0=746bN6nRXFdvPF z7C?*Nh*A_?+>9nEO4^1}6;LKQhq{n?E$cX2mXu_p*4^)Z^~H#(DjxI z!G69arzt1}x6x+1Qv%w!-7wkOO7yWE7lvf$JrwTc&9d*yxnfH!;eiHKI&As_^>ZVz z1`p9N4?cLPDSv1RPp(3>yc~G;U#K0-CrIKZ!IM7j=~+3*5qlNsm{SS|*jM}NmYKRW}c$b@(BagW%5R5|z{{ho@~LK;BZ(;O;X zD3Y2mUAAlkZ!!Zv0z;tovv74t5op*Pyu~9HF<+(y($)D+T0kup;0!wm7qnS5o0^X0 zeg;W&Sd6u+M9oYb;a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[PATCH 012/140] [refactoring] rename struct field scanner.Token.Hidden --- internal/php5/parser.go | 12 +- internal/php5/php5.go | Bin 353481 -> 353481 bytes internal/php5/php5.y | 1194 +++++++++++++++--------------- internal/php7/parser.go | 12 +- internal/php7/php7.go | Bin 289200 -> 289200 bytes internal/php7/php7.y | 1012 ++++++++++++------------- internal/scanner/lexer.go | 32 +- internal/scanner/scanner.go | Bin 384850 -> 384855 bytes internal/scanner/scanner.rl | 6 +- internal/scanner/scanner_test.go | 88 +-- internal/scanner/token.go | 2 +- 11 files changed, 1179 insertions(+), 1179 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index e3b2dc9..8ceb195 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -50,7 +50,7 @@ func (l *Parser) Error(msg string) { } func (l *Parser) WithTokens() { - l.Lexer.SetWithTokens(true) + l.Lexer.SetWithHiddenTokens(true) } // Parse the php7 Parser entrypoint @@ -93,7 +93,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -106,7 +106,7 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { } func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -123,7 +123,7 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return []token.Token{} } @@ -136,7 +136,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } func (l *Parser) addDollarToken(v ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -149,7 +149,7 @@ func (l *Parser) addDollarToken(v ast.Vertex) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } diff --git a/internal/php5/php5.go b/internal/php5/php5.go index c822f382c48cfe6e2733cae244a389469472bf4d..a087602c1c796d9be2c5162e8bb4bb707e8d53b3 100644 GIT binary patch delta 11384 zcmbtad3;Y-7XRGkMbeQbs%PiU*jm1o>E-MraeF_G_3>mwMpsI1~%RF5(~u#aX(r zye6mxl_)P$Eh1=7>p}HK~Ovg1zIf~abDPvh!Qkl>>lKWL&+$Mt!ReoV)-T< ziuR%UP*j`NhU_HNUB2)FXPL)tv_uVSgf1>3q3~~_%%9Z&`&ech^qg9xclmV^rD+g6 z2NRK6@*i+IJJ=S@)_5TQK@_hs39}}*L#>oq9w_yqrW)px6gP{P@x@QOGZw$U_H{sy z>*feg#{LuafUi=~PtIn&{t>slRT{c#Ni#f9mW`s^Tk2c4GXp6*yih&_s zqPJad_L_V|VQn6d^na26$!@hfXklCexS{1x<_3bPED*@ske4$lGylwlb#?3CMq^B7r= zChM3g}1OdVL2u%<<5qK>In*qd*l89K1Cu=%XpmfK@aGqg|1@yCR1ZVxtk zhY^~~OVB;ArXzLvXg;HF=~}$i;#TiM)0C!U7`Pkds|{p)&u_?tCo1C~_M-iYK{xI4 zenTbv>s=J7L~#oms3*Hl#zIkRvv`UK`>_O_RT1EY$Wo1w2Sh0fs^zcl39#fn9aU-dQzwn{QmGURaquacuEbRx;LXcXJtf!!IcJR8%M+XCe1B81{&Sv<@B=Z#D-ZZWCCNG}L|cG`7}w8I8I=tJv6 z@gCHi`MyV!%&5mdqV@qQ?4H5{p=>j*3q`*uA+NuQ<6+Ta-qB^kuTM9iM&z^PceN~6oem9O1$t@D2_F(*iaikZn6x#yLuMh z*rv1ob#SIE7=m)KEyd$=h`73Iz{2B63ZXbSzs*I5~3IW9!B(i z8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bpbLdjEyJWWwxd?84{^?^QM`ce697 ztFFc2FYje-v`=`2N>#1Lq8q;{W*7B6Yv@ue zJ;uhOB3!tt$r$M^yZoN(VLH4 zMc>oS48Ay@9LhtdFBi|U?URQ(WYJ`B9@z55n{Tx1z+Umd9@XP4(G34UHI`G zFGs8rWe_q-IPJVQ`pCgjO)iwx){x>({+Sb=E=vsNdA*v<_)8~GDk*xWqy3xi_{&K zJCAq9d5Ss^ITN|5_4QjOPkuj{n@55A;_Q=Q&zq@8g*3#~hT$R8`6(Sk*<~iLhr`b5 z3PgX&PFW6kuS&82r`Rb;jik+`oGpsTH!qFHqS#V`C2TvmVIk=mu+9? z?;B?OHV7%?Q}h&o_;{f+Vc8<(wXAWn-k1OBnw!oY)O1Nmc` zS9ZH8B~7+F#?KnNzg11yB}|&^aDs=S?MhQsn#?_Y`@GMb& zsO>H{T;ieFJg+4B|G2_mGg0{MmdwlF@h^<0_WJJok((x}_cTfMsyc_fs#Z}q@xOTu z@!SR8#ovssagFykgie7Db}KqVhF#~+8wT6rXE%5(&I#(Ds{1-{My^|y#qL5Cfw9H2k zn|5HhwHZZVqPG^Ew%msMtz08#BacT|Q`|^wLu;ZNxzyM)HNRqq5)-~0^pdliSh0A# ztJvrVnp-tdO&imnJ`$|GGZY`FQq z#V$%U6AJvFBtV+(v&=IGuEi-mEc}S80RMlFXwN}sciQjQc`)5F{~BboY|XGty`q3r zS(fRg&Cjy%8(kn*Qe{fEWqJ+365QLG=Zs{kEbn7srR@Lz({uf-Q@C!<(i0eR9 0 { yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } @@ -938,16 +938,16 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -967,7 +967,7 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } @@ -985,15 +985,15 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) if len($4.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) } if len($4.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1017,11 +1017,11 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1042,7 +1042,7 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } @@ -1060,8 +1060,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1074,8 +1074,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1088,8 +1088,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1102,8 +1102,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1116,8 +1116,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1130,8 +1130,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1144,8 +1144,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1159,7 +1159,7 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1172,8 +1172,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1186,8 +1186,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1200,9 +1200,9 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1215,7 +1215,7 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1228,7 +1228,7 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1241,10 +1241,10 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1279,13 +1279,13 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) if $6 != nil { yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1319,13 +1319,13 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) if $6 != nil { yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1338,9 +1338,9 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1352,7 +1352,7 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1369,9 +1369,9 @@ unticked_statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1383,8 +1383,8 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1399,9 +1399,9 @@ unticked_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1428,13 +1428,13 @@ catch_statement: catchNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Hidden) + yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Hidden) + yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1455,9 +1455,9 @@ finally_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1506,13 +1506,13 @@ additional_catch: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1530,7 +1530,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1596,17 +1596,17 @@ unticked_function_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) } else { - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Params, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Params, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1635,9 +1635,9 @@ unticked_class_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1651,10 +1651,10 @@ unticked_class_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1670,7 +1670,7 @@ class_entry_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1684,8 +1684,8 @@ class_entry_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1697,7 +1697,7 @@ class_entry_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1711,8 +1711,8 @@ class_entry_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1733,7 +1733,7 @@ extends_from: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1761,7 +1761,7 @@ interface_extends_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1782,7 +1782,7 @@ implements_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1800,7 +1800,7 @@ interface_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1818,7 +1818,7 @@ foreach_optional_arg: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Key, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Key, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1839,7 +1839,7 @@ foreach_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1851,9 +1851,9 @@ foreach_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1879,9 +1879,9 @@ for_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1908,9 +1908,9 @@ foreach_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1938,9 +1938,9 @@ declare_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1960,8 +1960,8 @@ declare_list: constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1976,9 +1976,9 @@ declare_list: constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1996,8 +1996,8 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2011,9 +2011,9 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2027,9 +2027,9 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2045,10 +2045,10 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2072,8 +2072,8 @@ case_list: _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Hidden) yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2087,8 +2087,8 @@ case_list: _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Hidden) yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2128,9 +2128,9 @@ while_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2155,7 +2155,7 @@ elseif_list: _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } @@ -2186,14 +2186,14 @@ new_elseif_list: _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2215,7 +2215,7 @@ else_single: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2239,8 +2239,8 @@ new_else_single: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Else, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Else, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2274,7 +2274,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2305,12 +2305,12 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) yylex.(*Parser).addDollarToken(variable) // normalize @@ -2350,13 +2350,13 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) yylex.(*Parser).addDollarToken(variable) // normalize @@ -2390,7 +2390,7 @@ optional_class_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2402,7 +2402,7 @@ optional_class_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2424,8 +2424,8 @@ function_call_parameter_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2437,8 +2437,8 @@ function_call_parameter_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2452,8 +2452,8 @@ function_call_parameter_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2472,7 +2472,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2511,7 +2511,7 @@ function_call_parameter: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2523,7 +2523,7 @@ function_call_parameter: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2535,7 +2535,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2559,7 +2559,7 @@ global_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2572,7 +2572,7 @@ global_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2585,10 +2585,10 @@ global_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2609,9 +2609,9 @@ static_var_list: staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2628,10 +2628,10 @@ static_var_list: staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2649,7 +2649,7 @@ static_var_list: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2667,8 +2667,8 @@ static_var_list: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2701,7 +2701,7 @@ class_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2714,7 +2714,7 @@ class_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2741,18 +2741,18 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2767,7 +2767,7 @@ trait_use_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2785,7 +2785,7 @@ trait_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2799,7 +2799,7 @@ trait_adaptations: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2811,8 +2811,8 @@ trait_adaptations: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2854,7 +2854,7 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2864,7 +2864,7 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2881,7 +2881,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2899,7 +2899,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2916,7 +2916,7 @@ trait_method_reference: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2940,8 +2940,8 @@ trait_method_reference_fully_qualified: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2959,8 +2959,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2973,7 +2973,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3003,7 +3003,7 @@ method_body: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3016,8 +3016,8 @@ method_body: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3039,7 +3039,7 @@ variable_modifiers: modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3084,7 +3084,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3096,7 +3096,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3108,7 +3108,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3120,7 +3120,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3132,7 +3132,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3144,7 +3144,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3165,8 +3165,8 @@ class_variable_declaration: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3183,10 +3183,10 @@ class_variable_declaration: property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(property, token.Var, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3204,7 +3204,7 @@ class_variable_declaration: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3222,8 +3222,8 @@ class_variable_declaration: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(property, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3245,9 +3245,9 @@ class_constant_declaration: $1.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3263,9 +3263,9 @@ class_constant_declaration: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3277,7 +3277,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3311,7 +3311,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3348,8 +3348,8 @@ chaining_dereference: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3362,8 +3362,8 @@ chaining_dereference: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3418,7 +3418,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3435,10 +3435,10 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3451,7 +3451,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3464,8 +3464,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3490,9 +3490,9 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) - yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) + yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3504,7 +3504,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3516,7 +3516,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3529,7 +3529,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3542,7 +3542,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3555,7 +3555,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3568,7 +3568,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3581,7 +3581,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3594,7 +3594,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3607,7 +3607,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3620,7 +3620,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3633,7 +3633,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3646,7 +3646,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3659,7 +3659,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3672,7 +3672,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3684,7 +3684,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3697,7 +3697,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3709,7 +3709,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3722,7 +3722,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3735,7 +3735,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3748,7 +3748,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3761,7 +3761,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3774,7 +3774,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3787,7 +3787,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3800,7 +3800,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3813,7 +3813,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3826,7 +3826,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3839,7 +3839,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3852,7 +3852,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3865,7 +3865,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3878,7 +3878,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3891,7 +3891,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3904,7 +3904,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3917,7 +3917,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3930,7 +3930,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3942,7 +3942,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3954,7 +3954,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3966,7 +3966,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3978,7 +3978,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3991,7 +3991,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4004,7 +4004,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4017,7 +4017,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4030,7 +4030,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4044,7 +4044,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4057,7 +4057,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4070,7 +4070,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4083,7 +4083,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4096,7 +4096,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4120,8 +4120,8 @@ expr_without_variable: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) for _, n := range($4) { switch nn := n.(type) { @@ -4156,8 +4156,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4170,8 +4170,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4189,7 +4189,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4202,7 +4202,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4215,7 +4215,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4228,7 +4228,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4241,7 +4241,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4254,7 +4254,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4267,7 +4267,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4289,7 +4289,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4301,7 +4301,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4331,7 +4331,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4343,7 +4343,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4355,7 +4355,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4367,16 +4367,16 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Hidden) // normalize if $6 == nil { @@ -4393,17 +4393,17 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Static, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Static, $2.Hidden) if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Hidden) // normalize if $7 == nil { @@ -4423,7 +4423,7 @@ yield_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4435,7 +4435,7 @@ yield_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4447,8 +4447,8 @@ yield_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4460,8 +4460,8 @@ yield_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4477,8 +4477,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4491,8 +4491,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4506,9 +4506,9 @@ combined_scalar_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4521,8 +4521,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4537,9 +4537,9 @@ combined_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4551,8 +4551,8 @@ combined_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4580,9 +4580,9 @@ lexical_vars: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4600,8 +4600,8 @@ lexical_var_list: variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4619,9 +4619,9 @@ lexical_var_list: reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4637,7 +4637,7 @@ lexical_var_list: variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4655,8 +4655,8 @@ lexical_var_list: reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4688,8 +4688,8 @@ function_call: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4703,7 +4703,7 @@ function_call: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4716,7 +4716,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4729,7 +4729,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4742,7 +4742,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4755,7 +4755,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4782,7 +4782,7 @@ class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4806,8 +4806,8 @@ class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4819,7 +4819,7 @@ class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4846,8 +4846,8 @@ fully_qualified_class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4859,7 +4859,7 @@ fully_qualified_class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4886,7 +4886,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Hidden) for _, n := range($3) { switch nn := n.(type) { @@ -4953,7 +4953,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4974,8 +4974,8 @@ exit_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5047,7 +5047,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5059,7 +5059,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5071,7 +5071,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5083,7 +5083,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5095,7 +5095,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5107,7 +5107,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5119,7 +5119,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5131,7 +5131,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5143,7 +5143,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5155,7 +5155,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5169,7 +5169,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5181,7 +5181,7 @@ common_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5199,8 +5199,8 @@ static_class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5252,8 +5252,8 @@ static_scalar_value: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5267,7 +5267,7 @@ static_scalar_value: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5279,9 +5279,9 @@ static_scalar_value: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5293,8 +5293,8 @@ static_scalar_value: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5312,7 +5312,7 @@ static_scalar_value: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5334,8 +5334,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5348,7 +5348,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5361,7 +5361,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5374,7 +5374,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5387,7 +5387,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5400,7 +5400,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5413,7 +5413,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5425,7 +5425,7 @@ static_operation: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5437,7 +5437,7 @@ static_operation: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5450,7 +5450,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5463,7 +5463,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5476,7 +5476,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5489,7 +5489,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5502,7 +5502,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5515,7 +5515,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5528,7 +5528,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5541,7 +5541,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5554,7 +5554,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5567,7 +5567,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5580,7 +5580,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5593,7 +5593,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5606,7 +5606,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5619,7 +5619,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5632,7 +5632,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5646,7 +5646,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5659,7 +5659,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5672,7 +5672,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5685,7 +5685,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5698,8 +5698,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5712,8 +5712,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5725,7 +5725,7 @@ static_operation: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5737,7 +5737,7 @@ static_operation: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5746,8 +5746,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5784,8 +5784,8 @@ general_constant: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5799,7 +5799,7 @@ general_constant: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5816,7 +5816,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5846,7 +5846,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5858,7 +5858,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5870,7 +5870,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5889,7 +5889,7 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5917,9 +5917,9 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5932,7 +5932,7 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5947,7 +5947,7 @@ non_empty_static_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5993,8 +5993,8 @@ parenthesis_expr: if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6009,8 +6009,8 @@ parenthesis_expr: if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6056,7 +6056,7 @@ variable: } // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Hidden) for _, n := range($3) { switch nn := n.(type) { @@ -6139,7 +6139,7 @@ variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6155,8 +6155,8 @@ array_method_dereference: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6169,8 +6169,8 @@ array_method_dereference: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6240,7 +6240,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6253,7 +6253,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6278,8 +6278,8 @@ array_function_dereference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6292,8 +6292,8 @@ array_function_dereference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6358,8 +6358,8 @@ reference_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6372,8 +6372,8 @@ reference_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6397,7 +6397,7 @@ compound_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6410,10 +6410,10 @@ compound_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6464,8 +6464,8 @@ object_dim_list: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6478,8 +6478,8 @@ object_dim_list: fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6504,7 +6504,7 @@ variable_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6516,8 +6516,8 @@ variable_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6533,7 +6533,7 @@ simple_indirect_reference: n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6551,7 +6551,7 @@ simple_indirect_reference: n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(n, token.Start, $2.Hidden) yylex.(*Parser).setFreeFloating(n, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6568,7 +6568,7 @@ assignment_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6608,9 +6608,9 @@ assignment_list_element: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(listNode) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6640,7 +6640,7 @@ array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6657,9 +6657,9 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6672,7 +6672,7 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6687,7 +6687,7 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6715,10 +6715,10 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6733,8 +6733,8 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6750,8 +6750,8 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6766,7 +6766,7 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6788,7 +6788,7 @@ encaps_list: encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6807,7 +6807,7 @@ encaps_list: encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6824,7 +6824,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6842,8 +6842,8 @@ encaps_var: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6862,8 +6862,8 @@ encaps_var: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6878,7 +6878,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6895,7 +6895,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6912,9 +6912,9 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Tokens, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($6.Tokens, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Hidden, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($6.Hidden, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6924,7 +6924,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6939,7 +6939,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6956,7 +6956,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6970,7 +6970,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6986,9 +6986,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7000,9 +7000,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7014,9 +7014,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7028,7 +7028,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7040,7 +7040,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7052,9 +7052,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7066,7 +7066,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7078,7 +7078,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7096,7 +7096,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7129,8 +7129,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7145,8 +7145,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7164,8 +7164,8 @@ static_class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7183,8 +7183,8 @@ class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 918c795..b2f106b 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -48,7 +48,7 @@ func (l *Parser) Error(msg string) { } func (l *Parser) WithTokens() { - l.Lexer.SetWithTokens(true) + l.Lexer.SetWithHiddenTokens(true) } // Parse the php7 Parser entrypoint @@ -91,7 +91,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -104,7 +104,7 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { } func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -121,7 +121,7 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return []token.Token{} } @@ -134,7 +134,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } func (l *Parser) addDollarToken(v ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } @@ -147,7 +147,7 @@ func (l *Parser) addDollarToken(v ast.Vertex) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.Lexer.GetWithFreeFloating() == false { + if l.Lexer.GetWithHiddenTokens() == false { return } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 0900ad3bc4f50b2d782f8519e24d3155b18efd06..b26e86405145207dc3a1d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@1RrGwFut-wPPPOwLCieKrlBgg(IsE98<@!2H`Em2f1Y(ksyhn{x%=vd zwyHV;X~)I>ayfSIZTRxt>#+k9d%k7*!(;8TT*}TAiT|?f7I!nDR|UJSVrAA#f++Z& zUB!9^WcM`|gr3P_)XS-#81##!Z-GMfzRlwJ!k&hUm%T|nc*YIp!&8%p2Y=N^dKcJ2 z-yk7KmDkxZl@jSfSAN>p=q*xi+PCgVA!+qp4b0m58~fUB`h`DO5gJ;%_ri}EcO67F@iz49vnj)OHZtz=kWLY;{S5sY3A5)nx%=5aG&3@= ze8Ik@EsZF9ZUX|1ZYU%3=i>Px20kLfq+20|zBK?c$7L+AM?U*uV-H3iXyhHmm#<5g z&lA>Pd#It-_UD)COAXv%s?I4@5}@ye_QoVP_PTCBW-VU`GxSF_pel|qUO*~9Mm%QR zvATc#lhF?2ReM31>u-igiZ)7d0yrBQYv5}q=zBNT(7!m5oY0RM+%wro5MAPpHE5k< zY;1z@BvR|K@qyH(HV^&IY92aO@5q6)tsHK`yO%R>UYetSa}ifU9v2<@82U{JNrf~< ze~SXE8>Sk4(K0|*r5PWhJ%B7qH*D|iRr`dH$F9CX%9up*TTdHks{9t)l6$4f?^^Dk zTjdi|3NKl&KkLDc;rv)D1`RgKupFWD&UwbbRu)<>>t}JWwe?U#w~T;P3^Vi(bpY9s mX}n_Roi^OS53V)yhL3Ra{yNghdt{V>hcN89{P<|&{C@!Q9Aj|+ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index cd147ff..7515ba9 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -299,7 +299,7 @@ start: // save position yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -366,7 +366,7 @@ namespace_name: namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -379,8 +379,8 @@ namespace_name: namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -407,8 +407,8 @@ name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -420,7 +420,7 @@ name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -472,10 +472,10 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -490,9 +490,9 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -507,10 +507,10 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -522,9 +522,9 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -536,8 +536,8 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -551,8 +551,8 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -565,8 +565,8 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -579,8 +579,8 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -593,8 +593,8 @@ top_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -610,7 +610,7 @@ use_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -622,7 +622,7 @@ use_type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -640,12 +640,12 @@ group_use_declaration: // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Hidden) if $5 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -660,14 +660,14 @@ group_use_declaration: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Hidden) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Hidden) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -686,12 +686,12 @@ mixed_group_use_declaration: // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Slash, $3.Hidden) if $5 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($5.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($5), $6.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -706,14 +706,14 @@ mixed_group_use_declaration: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Use, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Use, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Slash, $4.Hidden) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.Stmts, append($6.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($6), $7.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -737,7 +737,7 @@ inline_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -755,7 +755,7 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -773,7 +773,7 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -829,8 +829,8 @@ unprefixed_use_declaration: // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -851,10 +851,10 @@ use_declaration: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Slash, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -867,7 +867,7 @@ const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -947,10 +947,10 @@ inner_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.HaltCompiller, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.OpenParenthesisToken, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -965,8 +965,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -997,9 +997,9 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.While, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.While, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1011,11 +1011,11 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.While, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.While, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $7.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($7)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1039,11 +1039,11 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1064,9 +1064,9 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Switch, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Switch, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1078,8 +1078,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1092,8 +1092,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1106,8 +1106,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1120,8 +1120,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1134,8 +1134,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1148,9 +1148,9 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1163,7 +1163,7 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1176,7 +1176,7 @@ statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1189,14 +1189,14 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Hidden) if $4 != nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1218,10 +1218,10 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $6.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1245,11 +1245,11 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Key, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1262,9 +1262,9 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1276,7 +1276,7 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1292,9 +1292,9 @@ statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1306,8 +1306,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1322,9 +1322,9 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1339,8 +1339,8 @@ statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1365,13 +1365,13 @@ catch_list: catch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9) // save comments - yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Tokens) + yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Hidden) + yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Hidden) + yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1388,7 +1388,7 @@ catch_name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1409,9 +1409,9 @@ finally_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1429,7 +1429,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1456,20 +1456,20 @@ function_declaration_statement: // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) } else { - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Hidden) if $8 != nil { yylex.(*Parser).setFreeFloating($$, token.Params, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) } - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Hidden) // normalize if $8 == nil { @@ -1514,10 +1514,10 @@ class_declaration_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1531,10 +1531,10 @@ class_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1564,7 +1564,7 @@ class_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1576,7 +1576,7 @@ class_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1593,10 +1593,10 @@ trait_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1613,10 +1613,10 @@ interface_declaration_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1637,7 +1637,7 @@ extends_from: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1658,7 +1658,7 @@ interface_extends_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1679,7 +1679,7 @@ implements_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1700,7 +1700,7 @@ foreach_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1712,9 +1712,9 @@ foreach_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1726,8 +1726,8 @@ foreach_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save commentsc - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1753,9 +1753,9 @@ for_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1782,9 +1782,9 @@ foreach_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1811,9 +1811,9 @@ declare_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1831,8 +1831,8 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1846,9 +1846,9 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1862,9 +1862,9 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1880,10 +1880,10 @@ switch_case_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1906,8 +1906,8 @@ case_list: _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_case, token.Expr, append($4.Tokens)) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_case, token.Expr, append($4.Hidden)) yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1921,8 +1921,8 @@ case_list: _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Hidden) yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1960,9 +1960,9 @@ while_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1978,9 +1978,9 @@ if_stmt_without_else: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1996,9 +1996,9 @@ if_stmt_without_else: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2023,7 +2023,7 @@ if_stmt: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2040,10 +2040,10 @@ alt_if_stmt_without_else: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.If, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2060,10 +2060,10 @@ alt_if_stmt_without_else: _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $6.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2078,8 +2078,8 @@ alt_if_stmt: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $3.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2098,10 +2098,10 @@ alt_if_stmt: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_else, token.Else, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $6.Tokens) + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_else, token.Else, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $6.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($6)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2135,7 +2135,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2166,12 +2166,12 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) yylex.(*Parser).addDollarToken(variable) @@ -2212,13 +2212,13 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) yylex.(*Parser).addDollarToken(variable) @@ -2267,7 +2267,7 @@ type_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2282,7 +2282,7 @@ type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2294,7 +2294,7 @@ type: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2318,7 +2318,7 @@ return_type: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Colon, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Colon, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2333,8 +2333,8 @@ argument_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2346,11 +2346,11 @@ argument_list: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, append($3.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, append($3.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($3), $4.Hidden...)...)) } else { - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $4.Hidden) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2369,7 +2369,7 @@ non_empty_argument_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2396,7 +2396,7 @@ argument: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2408,7 +2408,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2435,7 +2435,7 @@ static_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2460,7 +2460,7 @@ static_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2477,9 +2477,9 @@ static_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2510,7 +2510,7 @@ class_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2525,11 +2525,11 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2542,7 +2542,7 @@ class_statement: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2562,18 +2562,18 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Hidden) if $9 != nil { yylex.(*Parser).setFreeFloating($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) } @@ -2594,7 +2594,7 @@ name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2608,7 +2608,7 @@ trait_adaptations: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -2621,8 +2621,8 @@ trait_adaptations: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2633,8 +2633,8 @@ trait_adaptations: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2661,7 +2661,7 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2671,7 +2671,7 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2688,7 +2688,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2706,8 +2706,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2722,8 +2722,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2738,8 +2738,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2752,7 +2752,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2769,7 +2769,7 @@ trait_method_reference: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2793,8 +2793,8 @@ absolute_trait_method_reference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2809,7 +2809,7 @@ method_body: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2822,8 +2822,8 @@ method_body: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2845,7 +2845,7 @@ variable_modifiers: modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2890,7 +2890,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2902,7 +2902,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2914,7 +2914,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2926,7 +2926,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2938,7 +2938,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2950,7 +2950,7 @@ member_modifier: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2962,7 +2962,7 @@ property_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2987,7 +2987,7 @@ property: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3004,9 +3004,9 @@ property: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3018,7 +3018,7 @@ class_const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3041,8 +3041,8 @@ class_const_decl: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3059,8 +3059,8 @@ const_decl: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3072,7 +3072,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3114,7 +3114,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3139,9 +3139,9 @@ anonymous_class: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3159,7 +3159,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3171,7 +3171,7 @@ new_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3188,10 +3188,10 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3205,9 +3205,9 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3220,7 +3220,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3233,8 +3233,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3246,7 +3246,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3259,7 +3259,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3272,7 +3272,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3285,7 +3285,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3298,7 +3298,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3311,7 +3311,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3324,7 +3324,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3337,7 +3337,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3350,7 +3350,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3363,7 +3363,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3376,7 +3376,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3389,7 +3389,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3402,7 +3402,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3415,7 +3415,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3428,7 +3428,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3440,7 +3440,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3453,7 +3453,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3465,7 +3465,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3478,7 +3478,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3491,7 +3491,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3504,7 +3504,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3517,7 +3517,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3530,7 +3530,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3543,7 +3543,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3556,7 +3556,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3569,7 +3569,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3582,7 +3582,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3595,7 +3595,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3608,7 +3608,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3621,7 +3621,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3634,7 +3634,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3647,7 +3647,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3660,7 +3660,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3673,7 +3673,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3686,7 +3686,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3698,7 +3698,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3710,7 +3710,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3722,7 +3722,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,7 +3734,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3747,7 +3747,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3760,7 +3760,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3773,7 +3773,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3786,7 +3786,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3800,7 +3800,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3813,7 +3813,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3826,7 +3826,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3839,7 +3839,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3852,7 +3852,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3865,7 +3865,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3874,8 +3874,8 @@ expr_without_variable: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3894,8 +3894,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3908,8 +3908,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3922,7 +3922,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3940,7 +3940,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3953,7 +3953,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3966,7 +3966,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3979,7 +3979,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -3992,7 +3992,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4005,7 +4005,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4018,7 +4018,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4046,7 +4046,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4058,7 +4058,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4076,7 +4076,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4088,7 +4088,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4100,7 +4100,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4112,7 +4112,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4124,8 +4124,8 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4137,7 +4137,7 @@ expr_without_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4163,7 +4163,7 @@ expr_without_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens); + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden); yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4178,19 +4178,19 @@ inline_function: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Hidden) if $8 != nil { yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) } - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Hidden) // normalize if $8 == nil { @@ -4210,18 +4210,18 @@ inline_function: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) }; - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Hidden) if $6 != nil { yylex.(*Parser).setFreeFloating($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) }; - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Hidden) // normalize if $6 == nil { @@ -4268,9 +4268,9 @@ lexical_vars: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4282,7 +4282,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4305,7 +4305,7 @@ lexical_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4322,8 +4322,8 @@ lexical_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4352,7 +4352,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4365,7 +4365,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4392,7 +4392,7 @@ class_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4434,8 +4434,8 @@ exit_expr: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Tokens, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4490,9 +4490,9 @@ dereferencable_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4504,8 +4504,8 @@ dereferencable_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4517,7 +4517,7 @@ dereferencable_scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4532,7 +4532,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4544,7 +4544,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4556,7 +4556,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4568,7 +4568,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4580,7 +4580,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4592,7 +4592,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4604,7 +4604,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4616,7 +4616,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4628,7 +4628,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4640,7 +4640,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4654,7 +4654,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4666,7 +4666,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4678,7 +4678,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4690,7 +4690,7 @@ scalar: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4732,8 +4732,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4748,8 +4748,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4806,8 +4806,8 @@ dereferencable: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4831,8 +4831,8 @@ callable_expr: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4860,8 +4860,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4874,8 +4874,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4888,8 +4888,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4902,7 +4902,7 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4936,7 +4936,7 @@ variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4953,7 +4953,7 @@ simple_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4966,10 +4966,10 @@ simple_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4981,7 +4981,7 @@ simple_variable: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4998,7 +4998,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5011,7 +5011,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5033,8 +5033,8 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5047,8 +5047,8 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5061,7 +5061,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5074,7 +5074,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5087,7 +5087,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5102,7 +5102,7 @@ member_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5111,8 +5111,8 @@ member_name: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5133,7 +5133,7 @@ property_name: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5142,8 +5142,8 @@ property_name: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5189,7 +5189,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5215,7 +5215,7 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5242,8 +5242,8 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5257,7 +5257,7 @@ array_pair: reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5269,7 +5269,7 @@ array_pair: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5285,10 +5285,10 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5303,9 +5303,9 @@ array_pair: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5327,7 +5327,7 @@ encaps_list: encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5346,7 +5346,7 @@ encaps_list: encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5363,7 +5363,7 @@ encaps_var: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5381,8 +5381,8 @@ encaps_var: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Tokens, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Tokens, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5401,8 +5401,8 @@ encaps_var: // save comments yylex.(*Parser).addDollarToken(variable) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5417,7 +5417,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5434,7 +5434,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5451,9 +5451,9 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Tokens, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($6.Tokens, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Hidden, yylex.(*Parser).GetFreeFloatingToken($5)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($6.Hidden, yylex.(*Parser).GetFreeFloatingToken($6)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5463,7 +5463,7 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Tokens, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5478,7 +5478,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5495,7 +5495,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5521,7 +5521,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5535,7 +5535,7 @@ encaps_var_offset: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5551,12 +5551,12 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Hidden) if $4 == nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Hidden) } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Tokens...)...)) + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Hidden...)...)) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5569,9 +5569,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5583,7 +5583,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5595,7 +5595,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5607,9 +5607,9 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5621,7 +5621,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5633,7 +5633,7 @@ internal_functions_in_yacc: $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5651,7 +5651,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 9dad9d0..2a24948 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -16,8 +16,8 @@ type Scanner interface { GetPhpDocComment() string SetPhpDocComment(string) GetErrors() []*errors.Error - GetWithFreeFloating() bool - SetWithTokens(bool) + GetWithHiddenTokens() bool + SetWithHiddenTokens(bool) AddError(e *errors.Error) SetErrors(e []*errors.Error) } @@ -35,14 +35,14 @@ type Lexer struct { top int heredocLabel []byte - TokenPool *TokenPool - Tokens []token.Token - WithTokens bool - PhpDocComment string - lastToken *Token - Errors []*errors.Error - NewLines NewLines - PHPVersion string + TokenPool *TokenPool + HiddenTokens []token.Token + WithHiddenTokens bool + PhpDocComment string + lastToken *Token + Errors []*errors.Error + NewLines NewLines + PHPVersion string } func (l *Lexer) ReturnTokenToPool(t *Token) { @@ -61,12 +61,12 @@ func (l *Lexer) GetErrors() []*errors.Error { return l.Errors } -func (l *Lexer) GetWithFreeFloating() bool { - return l.WithTokens +func (l *Lexer) GetWithHiddenTokens() bool { + return l.WithHiddenTokens } -func (l *Lexer) SetWithTokens(b bool) { - l.WithTokens = b +func (l *Lexer) SetWithHiddenTokens(b bool) { + l.WithHiddenTokens = b } func (l *Lexer) AddError(e *errors.Error) { @@ -85,11 +85,11 @@ func (lex *Lexer) setTokenPosition(token *Token) { } func (lex *Lexer) addToken(id TokenID, ps, pe int) { - if !lex.WithTokens { + if !lex.WithHiddenTokens { return } - lex.Tokens = append(lex.Tokens, token.Token{ + lex.HiddenTokens = append(lex.HiddenTokens, token.Token{ ID: token.ID(id), Value: lex.data[ps:pe], }) diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 0d411e1ec8e4ad8d6a07dc73564650959747d838..b1cf6d357285c1e1260ae109c2ebb4338a5edf21 100644 GIT binary patch delta 87 zcmcb#PyG5m@eOjUY#x~@DXDpr bar ( '' ) ;` lexer := NewLexer([]byte(src)) - lexer.WithTokens = true + lexer.WithHiddenTokens = true lv := &lval{} expected := []token.Token{ @@ -1433,7 +1433,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual := lv.Tkn.Tokens + actual := lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1443,7 +1443,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1453,7 +1453,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1463,7 +1463,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1473,7 +1473,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1483,7 +1483,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1493,7 +1493,7 @@ func TestMethodCallTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1502,7 +1502,7 @@ func TestYieldFromTokens(t *testing.T) { yield from $a` lexer := NewLexer([]byte(src)) - lexer.WithTokens = true + lexer.WithHiddenTokens = true lv := &lval{} expected := []token.Token{ @@ -1516,7 +1516,7 @@ func TestYieldFromTokens(t *testing.T) { }, } lexer.Lex(lv) - actual := lv.Tkn.Tokens + actual := lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1526,7 +1526,7 @@ func TestYieldFromTokens(t *testing.T) { }, } lexer.Lex(lv) - actual = lv.Tkn.Tokens + actual = lv.Tkn.Hidden assert.DeepEqual(t, expected, actual) } diff --git a/internal/scanner/token.go b/internal/scanner/token.go index 793958c..b46b340 100644 --- a/internal/scanner/token.go +++ b/internal/scanner/token.go @@ -9,6 +9,6 @@ import ( type Token struct { ID TokenID Value []byte - Tokens []token.Token + Hidden []token.Token Position position.Position } From 8a50bd254aee4e3e12e2d1cf07d7de4d4aefd070 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 00:23:02 +0300 Subject: [PATCH 013/140] [refactoring] remove scanner.Lexer.PhpDocComment --- internal/php7/php7.go | Bin 289200 -> 288939 bytes internal/php7/php7.y | 9 --------- internal/scanner/lexer.go | 11 ----------- internal/scanner/scanner.go | Bin 384855 -> 384773 bytes internal/scanner/scanner.rl | 3 +-- 5 files changed, 1 insertion(+), 22 deletions(-) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index b26e86405145207dc3a1d4f2fb16940de9374be1..ff4af9bee78e4ed3a7cbc4d5294e27f6a990fac8 100644 GIT binary patch delta 7819 zcmaJ`d32RUvOiV*B_WZ7ge3tJvJe8IfHyZcxi_GI3IUWw1VlDTL{v6eRDuJt$UH%0 zQy}GrBo3gUU>L+kKtV@AK_vl11O?Q2C<6$L;>PxV-QWFg;yIr8M{=sGyQ{0Kezkmk zEB7V6R-IJ&4Q)6>sg1e7zoG8c>z|Ja=KEV``a_F9cr%lNi%T{Rd}ia+4VyRqua6aCRETmGar9#a{ZwVO?FLH6k1&NX*O1G{rd(BP+4MFyG z@sC8PyBd4Ey%DNM6OXqeLUp>@<86*mfmDyTE<#me$mx$|6)^y2qOv zp_~klH!VW_7NI6)Vs?)K;;9IAUzW!^7NG_;^L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kX_p+9Y4cTN5rLCCbI$ z4^Un7*&Q-Vpc{cuT=%itCZw*lTjWZBtqYorbKB*8f%AtC*u;>=&^c0f`%r3gQMNiK?3ZZrV6`?H z)Bh}}5ViS~tl$<0aPX!F@t+U-82kPKSlyV)sqkG6%K5NYzTS64eoQ>)2o9Hri|G;B z!d!8KSNWjC0sY27o7?U9LwGQ4)^3c z$$##88Bya?$$HnV&Uxdy@M}v;?YUMWlV7F@+@f2nuBI!qdBRB5ka`th52GNoPc^&SsxK)wU&p7bE@-Yj z45AwzWMnkomacFsfHHblhKe)Zv`tD-(L_EFM@@BHNA$B7aJm%WBcAt68E8*2S$~5&FQI0k&ezcmw_jnZ0<1v9>q|bWPR;0P#VW|W0Px+YT z^J>(LVr=6!^CqPM^C`y^Az$ zUk1G9x);q={}3%S26rl)5{{eB*B9Xs^}W?=+^<9x1+tBkf3h~op@N$XfIj{LJ!pVh zPQYre{$`*$kL$*NscMnt=4tEFs-ddCNieo-#oncEb6TKVMyMwGsp0B1)8N|ZGL=q) zT_ method_modifiers variable_modifiers %type non_empty_member_modifiers name_list class_modifiers -%type backup_doc_comment - %% ///////////////////////////////////////////////////////////////////////// @@ -4234,12 +4231,6 @@ inline_function: backup_doc_comment: /* empty */ - { - $$ = yylex.(*Parser).Lexer.GetPhpDocComment() - yylex.(*Parser).Lexer.SetPhpDocComment("") - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - } ; returns_ref: diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 2a24948..8a68d86 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -13,8 +13,6 @@ import ( type Scanner interface { Lex(lval Lval) int ReturnTokenToPool(t *Token) - GetPhpDocComment() string - SetPhpDocComment(string) GetErrors() []*errors.Error GetWithHiddenTokens() bool SetWithHiddenTokens(bool) @@ -38,7 +36,6 @@ type Lexer struct { TokenPool *TokenPool HiddenTokens []token.Token WithHiddenTokens bool - PhpDocComment string lastToken *Token Errors []*errors.Error NewLines NewLines @@ -49,14 +46,6 @@ func (l *Lexer) ReturnTokenToPool(t *Token) { l.TokenPool.Put(t) } -func (l *Lexer) GetPhpDocComment() string { - return l.PhpDocComment -} - -func (l *Lexer) SetPhpDocComment(s string) { - l.PhpDocComment = s -} - func (l *Lexer) GetErrors() []*errors.Error { return l.Errors } diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index b1cf6d357285c1e1260ae109c2ebb4338a5edf21..185e7a9ed2c49c059ce57c538f422814fad73d2f 100644 GIT binary patch delta 2951 zcmZ`*c~F(t6`%8c=PJk^2s|Q&HK;7g<2`uqi7~We+~S5}m1v{2wGr!vT4O*|NE4H3 z8;D=vpkOdf(`aYh=GD2ADr-ee?4Ti0XAHq*YGV;Ki)KnFUA{pS`N?~|G@-rd+Wdayxk`Y5wewJ61@dtxUuDU zs`tj}MxbBVM1;}Y(EwRS*zs8J&X0S6O--QvO&DlgJyU8agkH|HIPz?vvE=M5W6ilp z`pY_uG8VQE_BNlZH4Tj*+g&W(cHRkDRV^^wyWspsno)fw!nk;Aj5Gyb7G(lvP^Y)Dh|e0Cqf{V#=>~He;DKg zxCe?Piwp#Z3`>Hk0^I7Ggt9yxyaF;U-5FW%oNRNzJaw6ggE=RFDyt!xc1?pI`JD$+ zHHzB;C|~rzj!|SUz+~xJ3Vs@6DXY*NRJ#G9005%}nUCNkx?HNZb-KYN(0Tnj@%1t^(3K@co2tmC+VtN*4UvS&Rk zR;EnjN{3h{M>cGLzbQy2fVvX!YFs}iQM?I$rD+Z`vk)1x^rJ(0 zxaI*?#VkxyhtiCUE@1?1@~1`Da4_AOg?ThB4-S{}Q&BkBTwAswMcxx=x zgYc)SQ6j|n`BoQwn2#-5c3<%~&cU_%y$WSwsN7V5??WF)7S6|Is%FgI@GZc0tZIfC zbh@4uU5jx9H-gM7#6YCw&*Q6{qTA17gY}7}j-^=2rJxjgkQ2h+7M*-WSZ2I^B8gUa zV>VrDL>qmz2Io@xIuot!e%}J<^|e?}Th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p1-%XKX7J(Wy)b3V!lXUsZ|yY5zT(PG8^W ze$)CBcNTdc9aP!bg~s&&tJQ%_s;uOzz{)X{*QxBOaX&;oCl0F9s)42Q3&K}f*|hC} z$THsywCO&^{D~XP%!fE(+pA(dwLQQI=EFd34W$YY4PEWHOcRctT*@jUW8;zl`JJ!G z=30~){$h{D{PQKc422=PzP!YOT$f+v2G)uqQpi6CkoDw;W56VLT1HfmlX3r~rI@i-h7p7-g9!vm!~ znxQEcI4wNyCo-PMMA2+s zw?M;1FD46b%1&Ywo@cVJ0=ASkC5Z@&quk-l(ZJy*u%@n`DHN9?Qq`GXCd5X~DdHH1 z?94^tVH^;Bs~V@>B`=Q>OU<_<53&*R?R0TL{Xr+6 r6;IK>pAl18W$YMEv-z=6#Is_p6_u&;y`>)|uRkYt5VNxWOHukiG0jkj diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index 3379bef..d8efac1 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -336,7 +336,6 @@ func (lex *Lexer) Lex(lval Lval) int { } if isDocComment { - lex.PhpDocComment = string(lex.data[lex.ts:lex.te]) lex.addToken(T_DOC_COMMENT, lex.ts, lex.te) } else { lex.addToken(T_COMMENT, lex.ts, lex.te) @@ -352,7 +351,7 @@ func (lex *Lexer) Lex(lval Lval) int { }; "{" => { lex.setTokenPosition(token); tok = TokenID(int('{')); lex.call(ftargs, fentry(php)); goto _out; }; - "}" => { lex.setTokenPosition(token); tok = TokenID(int('}')); lex.ret(1); lex.PhpDocComment = ""; goto _out;}; + "}" => { lex.setTokenPosition(token); tok = TokenID(int('}')); lex.ret(1); goto _out;}; "$" varname => { lex.setTokenPosition(token); tok = T_VARIABLE; fbreak; }; varname => { lex.setTokenPosition(token); tok = T_STRING; fbreak; }; From 3bee91c972c8088131afe25dcc58bb8d492a0a15 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 01:01:35 +0300 Subject: [PATCH 014/140] [refactoring] remove scanner.Lval interface --- internal/php5/parser.go | 11 +- internal/php7/parser.go | 9 +- internal/scanner/lexer.go | 7 +- internal/scanner/scanner.go | Bin 384773 -> 384744 bytes internal/scanner/scanner.rl | 6 +- internal/scanner/scanner_test.go | 265 +++++++++++++------------------ 6 files changed, 129 insertions(+), 169 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 8ceb195..fe68521 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -36,11 +36,14 @@ func NewParser(src []byte, v string) *Parser { } } -// Lex proxy to lexer Lex +// Lex proxy to scanner Lex func (l *Parser) Lex(lval *yySymType) int { - t := l.Lexer.Lex(lval) - l.currentToken = lval.token - return t + t := l.Lexer.Lex() + + l.currentToken = t + lval.token = t + + return int(t.ID) } func (l *Parser) Error(msg string) { diff --git a/internal/php7/parser.go b/internal/php7/parser.go index b2f106b..b2a0cf6 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -36,9 +36,12 @@ func NewParser(src []byte, v string) *Parser { } func (l *Parser) Lex(lval *yySymType) int { - t := l.Lexer.Lex(lval) - l.currentToken = lval.token - return t + t := l.Lexer.Lex() + + l.currentToken = t + lval.token = t + + return int(t.ID) } func (l *Parser) Error(msg string) { diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 8a68d86..d367291 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -11,7 +11,7 @@ import ( ) type Scanner interface { - Lex(lval Lval) int + Lex() *Token ReturnTokenToPool(t *Token) GetErrors() []*errors.Error GetWithHiddenTokens() bool @@ -20,11 +20,6 @@ type Scanner interface { SetErrors(e []*errors.Error) } -// Lval parsers yySymType must implement this interface -type Lval interface { - Token(tkn *Token) -} - type Lexer struct { data []byte p, pe, cs int diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 185e7a9ed2c49c059ce57c538f422814fad73d2f..95db2b2208248f3035172eed40ec71fb126387fa 100644 GIT binary patch delta 59 zcmZqOC;nou_y!JE4owBEko@e_yk;@hb}?2)AZ7w$W*}zSF2>4w@+N;#YDsBPo @@ -361,16 +353,15 @@ func TestTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -390,13 +381,12 @@ func TestShebang(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} - token := lexer.Lex(lv) - assert.Equal(t, token, int(T_DNUMBER)) + tkn := lexer.Lex() + assert.Equal(t, tkn.ID, T_DNUMBER) - for _, tt := range lv.Tkn.Hidden { + for _, tt := range tkn.Hidden { actual = append(actual, string(tt.Value)) } @@ -411,14 +401,13 @@ func TestShebangHtml(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - token := lexer.Lex(lv) - assert.Equal(t, token, int(T_INLINE_HTML)) - assert.Equal(t, string(lv.Tkn.Hidden[0].Value), "#!/usr/bin/env php\n") + tkn := lexer.Lex() + assert.Equal(t, tkn.ID, T_INLINE_HTML) + assert.Equal(t, string(tkn.Hidden[0].Value), "#!/usr/bin/env php\n") - token = lexer.Lex(lv) - assert.Equal(t, token, int(T_DNUMBER)) + tkn = lexer.Lex() + assert.Equal(t, tkn.ID, T_DNUMBER) } func TestNumberTokens(t *testing.T) { @@ -462,16 +451,15 @@ func TestNumberTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -520,16 +508,15 @@ func TestConstantStrings(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -567,16 +554,15 @@ func TestSingleQuoteStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src)) - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -656,16 +642,15 @@ func TestTeplateStringTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -742,16 +727,15 @@ func TestBackquoteStringTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -837,16 +821,15 @@ CAT; lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -911,16 +894,15 @@ CAT lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -951,16 +933,15 @@ CAT; lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -983,16 +964,15 @@ func TestHereDocTokens73(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -1015,16 +995,15 @@ CAT;` lexer := NewLexer([]byte(src)) lexer.PHPVersion = "7.2" lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -1048,16 +1027,15 @@ func TestInlineHtmlNopTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} actual := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actual = append(actual, TokenID(token).String()) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -1083,18 +1061,17 @@ func TestStringTokensAfterVariable(t *testing.T) { } lexer := NewLexer([]byte(src)) - lv := &lval{} actual := []string{} actualTokens := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actualTokens = append(actualTokens, string(lv.Tkn.Value)) - actual = append(actual, TokenID(token).String()) + actualTokens = append(actualTokens, string(tkn.Value)) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -1117,18 +1094,17 @@ func TestSlashAfterVariable(t *testing.T) { } lexer := NewLexer([]byte(src)) - lv := &lval{} actual := []string{} actualTokens := []string{} for { - token := lexer.Lex(lv) - if token == 0 { + tkn := lexer.Lex() + if tkn.ID == 0 { break } - actualTokens = append(actualTokens, string(lv.Tkn.Value)) - actual = append(actual, TokenID(token).String()) + actualTokens = append(actualTokens, string(tkn.Value)) + actual = append(actual, tkn.ID.String()) } assert.DeepEqual(t, expected, actual) @@ -1156,9 +1132,8 @@ func TestCommentEnd(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + lexer.Lex() actual := lexer.HiddenTokens @@ -1186,11 +1161,10 @@ func TestCommentNewLine(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1216,11 +1190,10 @@ func TestCommentNewLine1(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1246,11 +1219,10 @@ func TestCommentNewLine2(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1277,11 +1249,10 @@ func TestCommentWithPhpEndTag(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1308,11 +1279,10 @@ func TestInlineComment(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1339,9 +1309,8 @@ func TestInlineComment2(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + lexer.Lex() actual := lexer.HiddenTokens @@ -1374,9 +1343,8 @@ func TestEmptyInlineComment(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + lexer.Lex() actual := lexer.HiddenTokens @@ -1405,11 +1373,10 @@ func TestEmptyInlineComment2(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} - lexer.Lex(lv) + tkn := lexer.Lex() - actual := lv.Tkn.Hidden + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1420,7 +1387,6 @@ func TestMethodCallTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} expected := []token.Token{ { @@ -1432,8 +1398,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte("\n\t"), }, } - lexer.Lex(lv) - actual := lv.Tkn.Hidden + tkn := lexer.Lex() + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1442,8 +1408,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1452,8 +1418,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1462,8 +1428,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1472,8 +1438,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1482,8 +1448,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1492,8 +1458,8 @@ func TestMethodCallTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1503,7 +1469,6 @@ func TestYieldFromTokens(t *testing.T) { lexer := NewLexer([]byte(src)) lexer.WithHiddenTokens = true - lv := &lval{} expected := []token.Token{ { @@ -1515,8 +1480,8 @@ func TestYieldFromTokens(t *testing.T) { Value: []byte("\n\t"), }, } - lexer.Lex(lv) - actual := lv.Tkn.Hidden + tkn := lexer.Lex() + actual := tkn.Hidden assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1525,8 +1490,8 @@ func TestYieldFromTokens(t *testing.T) { Value: []byte(" "), }, } - lexer.Lex(lv) - actual = lv.Tkn.Hidden + tkn = lexer.Lex() + actual = tkn.Hidden assert.DeepEqual(t, expected, actual) } @@ -1534,51 +1499,48 @@ func TestVarNameByteChars(t *testing.T) { src := " Date: Mon, 18 May 2020 01:03:20 +0300 Subject: [PATCH 015/140] [refactoring] remove unused scanner.Lexer.lastToken field --- internal/scanner/lexer.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index d367291..5c8dfad 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -31,7 +31,6 @@ type Lexer struct { TokenPool *TokenPool HiddenTokens []token.Token WithHiddenTokens bool - lastToken *Token Errors []*errors.Error NewLines NewLines PHPVersion string From 291dc7e884a152956e8ae2f72a6ded50a8a74f07 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 20:07:17 +0300 Subject: [PATCH 016/140] [refactoring] move errors from scanner to parser --- internal/php5/parser.go | 30 +++++++------ internal/php7/parser.go | 30 +++++++------ internal/scanner/lexer.go | 45 +++++++++++-------- internal/scanner/scanner.go | Bin 384744 -> 384574 bytes internal/scanner/scanner.rl | 15 ++----- internal/scanner/scanner_test.go | 75 ++++++++++++++++++------------- 6 files changed, 105 insertions(+), 90 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index fe68521..1315a54 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -21,19 +21,21 @@ type Parser struct { currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex + errors []*errors.Error } // NewParser creates and returns new Parser func NewParser(src []byte, v string) *Parser { - lexer := scanner.NewLexer(src) + parser := &Parser{} + + lexer := scanner.NewLexer(src, func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }) lexer.PHPVersion = v - return &Parser{ - lexer, - nil, - nil, - nil, - } + parser.Lexer = lexer + + return parser } // Lex proxy to scanner Lex @@ -49,7 +51,12 @@ func (l *Parser) Lex(lval *yySymType) int { func (l *Parser) Error(msg string) { var pos = l.currentToken.Position - l.Lexer.AddError(errors.NewError(msg, &pos)) + l.errors = append(l.errors, errors.NewError(msg, &pos)) +} + +// GetErrors returns errors list +func (l *Parser) GetErrors() []*errors.Error { + return l.errors } func (l *Parser) WithTokens() { @@ -59,7 +66,7 @@ func (l *Parser) WithTokens() { // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init - l.Lexer.SetErrors(nil) + l.errors = nil l.rootNode = nil l.positionBuilder = &positionbuilder.PositionBuilder{} @@ -73,11 +80,6 @@ func (l *Parser) GetRootNode() ast.Vertex { return l.rootNode } -// GetErrors returns errors list -func (l *Parser) GetErrors() []*errors.Error { - return l.Lexer.GetErrors() -} - // helpers func lastNode(nn []ast.Vertex) ast.Vertex { diff --git a/internal/php7/parser.go b/internal/php7/parser.go index b2a0cf6..72dab68 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -20,19 +20,21 @@ type Parser struct { currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex + errors []*errors.Error } // NewParser creates and returns new Parser func NewParser(src []byte, v string) *Parser { - lexer := scanner.NewLexer(src) + parser := &Parser{} + + lexer := scanner.NewLexer(src, func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }) lexer.PHPVersion = v - return &Parser{ - lexer, - nil, - nil, - nil, - } + parser.Lexer = lexer + + return parser } func (l *Parser) Lex(lval *yySymType) int { @@ -47,7 +49,12 @@ func (l *Parser) Lex(lval *yySymType) int { func (l *Parser) Error(msg string) { var pos = l.currentToken.Position - l.Lexer.AddError(errors.NewError(msg, &pos)) + l.errors = append(l.errors, errors.NewError(msg, &pos)) +} + +// GetErrors returns errors list +func (l *Parser) GetErrors() []*errors.Error { + return l.errors } func (l *Parser) WithTokens() { @@ -57,7 +64,7 @@ func (l *Parser) WithTokens() { // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init - l.Lexer.SetErrors(nil) + l.errors = nil l.rootNode = nil l.positionBuilder = &positionbuilder.PositionBuilder{} @@ -71,11 +78,6 @@ func (l *Parser) GetRootNode() ast.Vertex { return l.rootNode } -// GetErrors returns errors list -func (l *Parser) GetErrors() []*errors.Error { - return l.Lexer.GetErrors() -} - // helpers func lastNode(nn []ast.Vertex) ast.Vertex { diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 5c8dfad..60aaec9 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -13,15 +13,14 @@ import ( type Scanner interface { Lex() *Token ReturnTokenToPool(t *Token) - GetErrors() []*errors.Error GetWithHiddenTokens() bool SetWithHiddenTokens(bool) - AddError(e *errors.Error) - SetErrors(e []*errors.Error) } type Lexer struct { - data []byte + data []byte + errHandlerFunc func(*errors.Error) + p, pe, cs int ts, te, act int stack []int @@ -31,17 +30,29 @@ type Lexer struct { TokenPool *TokenPool HiddenTokens []token.Token WithHiddenTokens bool - Errors []*errors.Error NewLines NewLines PHPVersion string } -func (l *Lexer) ReturnTokenToPool(t *Token) { - l.TokenPool.Put(t) +func NewLexer(data []byte, errHandlerFunc func(*errors.Error)) *Lexer { + lex := &Lexer{ + data: data, + errHandlerFunc: errHandlerFunc, + + pe: len(data), + stack: make([]int, 0), + + TokenPool: &TokenPool{}, + NewLines: NewLines{make([]int, 0, 128)}, + } + + initLexer(lex) + + return lex } -func (l *Lexer) GetErrors() []*errors.Error { - return l.Errors +func (l *Lexer) ReturnTokenToPool(t *Token) { + l.TokenPool.Put(t) } func (l *Lexer) GetWithHiddenTokens() bool { @@ -52,14 +63,6 @@ func (l *Lexer) SetWithHiddenTokens(b bool) { l.WithHiddenTokens = b } -func (l *Lexer) AddError(e *errors.Error) { - l.Errors = append(l.Errors, e) -} - -func (l *Lexer) SetErrors(e []*errors.Error) { - l.Errors = e -} - func (lex *Lexer) setTokenPosition(token *Token) { token.Position.StartLine = lex.NewLines.GetLine(lex.ts) token.Position.EndLine = lex.NewLines.GetLine(lex.te - 1) @@ -230,7 +233,11 @@ func (lex *Lexer) ungetCnt(n int) { lex.te = lex.te - n } -func (lex *Lexer) Error(msg string) { +func (lex *Lexer) error(msg string) { + if lex.errHandlerFunc == nil { + return + } + pos := position.NewPosition( lex.NewLines.GetLine(lex.ts), lex.NewLines.GetLine(lex.te-1), @@ -238,7 +245,7 @@ func (lex *Lexer) Error(msg string) { lex.te, ) - lex.Errors = append(lex.Errors, errors.NewError(msg, pos)) + lex.errHandlerFunc(errors.NewError(msg, pos)) } func isValidVarNameStart(r byte) bool { diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 95db2b2208248f3035172eed40ec71fb126387fa..576f19af7fa11f6a1cac2a43292aba794790ce26 100644 GIT binary patch delta 5951 zcmZ`-d3=vo*8iO6xld(l61zx5LEO zXK1V~LZ8~Q5OkSNk}9pSgi?e?qeiEMX3o98weP&|U(bEc_ug~QIrrSN+}p=nmmF)o zZ@Jof+U#lb|2R2)^6On@PEL=Clf$l23wgB`tC$UZ3d>Loj^cYP02Hge__5aSO(h|K z&)pQhj{EZ!StkDOqFy-H4`Sp`r!4u?f|p%xLxeGk#eyH?vi_>UXv1>5X627A$MRL# z6^g}()omf1&(5h)tTs6=o}T+6sAiLkeG8tov=8r`?@-J(J~6*cG1>T#CC7Np;;vq{ zlJ-zBo1EOUmS*q)OIu=n12ghI%T{Kx4u12%y}ml zVtH&qj%sokF}IgyAfO%pwVDJIs%_|7_vdw`Fk{P ztcvAVYG2}KzUapN&vYnm{$+1aZC>H#{k#6 zZd-WB)nvZp;cBn>EFx}nD_-`?Sm4VaxhHny=3fhVgZd|1`0$&_{M^$uq+IpSyLd=rFZZ5`L6X)#2l0H^ z<5bKB@LOLB={%+(S^O*&A+2A{AaeSlSfoI_VzA){Dh$RL6&8Y#ztcDf@2QZDC41?* zCf5wa;|vy&PYK{{4Kis@8uHK|7>;}fGO_TOYhFwf$PrS@5R6q#;Qb8&kb5F;(kWI&UzhNLn4L^NI00evJ72R>8*ipot#ifDJtqn;D7L2_w=W zNUuwS@stiNIA|JdRuZf@aj{~+!ub%cTc^WZ#RY|9#Z1T+@)^#nar$es;3Oz^qm$9z zS0R|c5*mPWUxR5b9l9W!1DQ&KL8cQ7n+NUj>pAe82e!>6*kE_6b9*j~^dQq;C!a9M zoF>+7QEXNm{U(It*?B?)n@9Q-9C%O(#;W;H>k;$(8#Kpm_oxws8$%%k2Tg|wsJ;oq zUCcHs27~0IlNBbAmR8KlAOl#eP6hifgqDhGa2RmRBG^O&vy&d31(OxwJ{CNd17}?_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b/internal/scanner/scanner.rl index abd03b4..f885098 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -14,17 +14,8 @@ import ( variable pe lex.pe; }%% -func NewLexer(data []byte) *Lexer { - lex := &Lexer{ - data: data, - pe: len(data), - stack: make([]int, 0), - - TokenPool: &TokenPool{}, - NewLines: NewLines{make([]int, 0, 128)}, - } +func initLexer(lex *Lexer) { %% write init; - return lex } func (lex *Lexer) Lex() *Token { @@ -382,7 +373,7 @@ func (lex *Lexer) Lex() *Token { any_line => { c := lex.data[lex.p] - lex.Error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", c, c)); + lex.error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", c, c)); }; *|; @@ -473,7 +464,7 @@ func (lex *Lexer) Lex() *Token { ']' > (svi, 2) => {lex.setTokenPosition(token); tok = TokenID(int(']')); lex.ret(2); goto _out;}; any_line => { c := lex.data[lex.p] - lex.Error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", c, c)); + lex.error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", c, c)); }; *|; diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index ec61cbc..c9f63af 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -1,6 +1,8 @@ package scanner import ( + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" "testing" "github.com/z7zmey/php-parser/pkg/token" @@ -351,7 +353,7 @@ func TestTokens(t *testing.T) { T_UNSET_CAST.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -379,7 +381,7 @@ func TestShebang(t *testing.T) { "\n", } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -399,7 +401,7 @@ func TestShebangHtml(t *testing.T) { 0.1 ` - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -449,7 +451,7 @@ func TestNumberTokens(t *testing.T) { T_DNUMBER.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -506,7 +508,7 @@ func TestConstantStrings(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -553,7 +555,7 @@ func TestSingleQuoteStringTokens(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) actual := []string{} for { @@ -640,7 +642,7 @@ func TestTeplateStringTokens(t *testing.T) { TokenID(int('"')).String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -725,7 +727,7 @@ func TestBackquoteStringTokens(t *testing.T) { TokenID(int('`')).String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -819,7 +821,7 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -892,7 +894,7 @@ CAT T_END_HEREDOC.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -931,7 +933,7 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -962,7 +964,7 @@ func TestHereDocTokens73(t *testing.T) { T_VARIABLE.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -992,7 +994,7 @@ CAT;` TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.PHPVersion = "7.2" lexer.WithHiddenTokens = true actual := []string{} @@ -1025,7 +1027,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { T_INLINE_HTML.String(), } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true actual := []string{} @@ -1060,7 +1062,7 @@ func TestStringTokensAfterVariable(t *testing.T) { "\"", } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) actual := []string{} actualTokens := []string{} @@ -1093,7 +1095,7 @@ func TestSlashAfterVariable(t *testing.T) { "3", } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) actual := []string{} actualTokens := []string{} @@ -1130,7 +1132,7 @@ func TestCommentEnd(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true lexer.Lex() @@ -1159,7 +1161,7 @@ func TestCommentNewLine(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1188,7 +1190,7 @@ func TestCommentNewLine1(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1217,7 +1219,7 @@ func TestCommentNewLine2(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1247,7 +1249,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1277,7 +1279,7 @@ func TestInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1307,7 +1309,7 @@ func TestInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true lexer.Lex() @@ -1341,7 +1343,7 @@ func TestEmptyInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true lexer.Lex() @@ -1371,7 +1373,7 @@ func TestEmptyInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true tkn := lexer.Lex() @@ -1385,7 +1387,7 @@ func TestMethodCallTokens(t *testing.T) { src := ` bar ( '' ) ;` - lexer := NewLexer([]byte(src)) + lexer := NewLexer([]byte(src), nil) lexer.WithHiddenTokens = true expected := []token.Token{ @@ -1467,7 +1469,7 @@ func TestYieldFromTokens(t *testing.T) { src := ` Date: Mon, 18 May 2020 21:15:07 +0300 Subject: [PATCH 017/140] [refactoring] scanner.Lexer.withHiddenTokens --- cmd/php-parser/main.go | 6 +- internal/php5/parser.go | 32 +- internal/php5/parser_test.go | 516 +++++++++++----------- internal/php5/php5_bench_test.go | 2 +- internal/php5/php5_test.go | 8 +- internal/php7/parser.go | 32 +- internal/php7/parser_test.go | 564 ++++++++++++------------ internal/php7/php7_bench_test.go | 2 +- internal/php7/php7_test.go | 8 +- internal/scanner/lexer.go | 71 ++- internal/scanner/scanner.go | Bin 384574 -> 383542 bytes internal/scanner/scanner.rl | 36 +- internal/scanner/scanner_test.go | 124 +++--- pkg/parser/parser.go | 7 +- pkg/printer/printer_parsed_php5_test.go | 3 +- pkg/printer/printer_parsed_php7_test.go | 6 +- 16 files changed, 706 insertions(+), 711 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 33d03e0..9300288 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -108,15 +108,11 @@ func parserWorker(fileCh <-chan *file, r chan<- result) { return } - parserWorker, err := parser.NewParser(f.content, phpVersion) + parserWorker, err := parser.NewParser(f.content, phpVersion, *withFreeFloating) if err != nil { panic(err.Error()) } - if *withFreeFloating { - parserWorker.WithTokens() - } - parserWorker.Parse() r <- result{path: f.path, parser: parserWorker} diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 1315a54..0f4441d 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -22,17 +22,23 @@ type Parser struct { positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex errors []*errors.Error + withTokens bool } // NewParser creates and returns new Parser -func NewParser(src []byte, v string) *Parser { - parser := &Parser{} +func NewParser(src []byte, v string, withTokens bool) *Parser { + parser := &Parser{ + withTokens: withTokens, + } - lexer := scanner.NewLexer(src, func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }) - lexer.PHPVersion = v + scannerConfig := scanner.Config{ + WithHiddenTokens: withTokens, + ErrHandlerFunc: func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }, + } + lexer := scanner.NewLexer(src, v, scannerConfig) parser.Lexer = lexer return parser @@ -59,10 +65,6 @@ func (l *Parser) GetErrors() []*errors.Error { return l.errors } -func (l *Parser) WithTokens() { - l.Lexer.SetWithHiddenTokens(true) -} - // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init @@ -98,7 +100,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -111,7 +113,7 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { } func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -128,7 +130,7 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return []token.Token{} } @@ -141,7 +143,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } func (l *Parser) addDollarToken(v ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -154,7 +156,7 @@ func (l *Parser) addDollarToken(v ast.Vertex) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 638d1df..c5b5d58 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -56,7 +56,7 @@ func TestIdentifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -838,7 +838,7 @@ func TestPhp5ArgumentNode(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1591,7 +1591,7 @@ func TestPhp5ParameterNode(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1612,7 +1612,7 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1689,7 +1689,7 @@ func TestName(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1764,7 +1764,7 @@ func TestFullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1839,7 +1839,7 @@ func TestRelative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1917,7 +1917,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1993,7 +1993,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2080,7 +2080,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2177,7 +2177,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2285,7 +2285,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2361,7 +2361,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2458,7 +2458,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2565,7 +2565,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2656,7 +2656,7 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2747,7 +2747,7 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2806,7 +2806,7 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2851,7 +2851,7 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2910,7 +2910,7 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2954,7 +2954,7 @@ func TestScalarMagicConstant(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2997,7 +2997,7 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3040,7 +3040,7 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3083,7 +3083,7 @@ func TestScalarNumber_Float(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3126,7 +3126,7 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3169,7 +3169,7 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3212,7 +3212,7 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3255,7 +3255,7 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3298,7 +3298,7 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3341,7 +3341,7 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3386,7 +3386,7 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3429,7 +3429,7 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3474,7 +3474,7 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3543,7 +3543,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3655,7 +3655,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3744,7 +3744,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3921,7 +3921,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4042,7 +4042,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4120,7 +4120,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4268,7 +4268,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4370,7 +4370,7 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4484,7 +4484,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4528,7 +4528,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4585,7 +4585,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4675,7 +4675,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4767,7 +4767,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4882,7 +4882,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4980,7 +4980,7 @@ func TestStmtConstList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5045,7 +5045,7 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5121,7 +5121,7 @@ func TestStmtContinue_Light(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5197,7 +5197,7 @@ func TestStmtContinue(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5273,7 +5273,7 @@ func TestStmtDeclare(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5382,7 +5382,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5460,7 +5460,7 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5514,7 +5514,7 @@ func TestStmtDo(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5580,7 +5580,7 @@ func TestStmtEcho(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5635,7 +5635,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5678,7 +5678,7 @@ func TestStmtExpression(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5873,7 +5873,7 @@ func TestStmtFor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5993,7 +5993,7 @@ func TestStmtFor_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6078,7 +6078,7 @@ func TestStmtForeach(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6153,7 +6153,7 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6238,7 +6238,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6344,7 +6344,7 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6440,7 +6440,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6556,7 +6556,7 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6684,7 +6684,7 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6729,7 +6729,7 @@ func TestStmtFunction(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6785,7 +6785,7 @@ func TestStmtFunction_Return(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6952,7 +6952,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7019,7 +7019,7 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7074,7 +7074,7 @@ func TestStmtGlobal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7234,7 +7234,7 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7298,7 +7298,7 @@ func TestStmtGotoLabel(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7330,7 +7330,7 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7394,7 +7394,7 @@ func TestStmtIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7502,7 +7502,7 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7587,7 +7587,7 @@ func TestStmtIf_Else(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7758,7 +7758,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7939,7 +7939,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7982,7 +7982,7 @@ func TestStmtInlineHtml(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8026,7 +8026,7 @@ func TestStmtInterface(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8105,7 +8105,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8207,7 +8207,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8262,7 +8262,7 @@ func TestStmtNamespace(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8318,7 +8318,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8351,7 +8351,7 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8452,7 +8452,7 @@ func TestStmtProperty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8606,7 +8606,7 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8760,7 +8760,7 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8825,7 +8825,7 @@ func TestStmtStaticVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8932,7 +8932,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9039,7 +9039,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9165,7 +9165,7 @@ func TestStmtSwitch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9291,7 +9291,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9407,7 +9407,7 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9511,7 +9511,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9564,7 +9564,7 @@ func TestStmtThrow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9608,7 +9608,7 @@ func TestStmtTrait(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9698,7 +9698,7 @@ func TestStmtTraitUse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9811,7 +9811,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9924,7 +9924,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10081,7 +10081,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10249,7 +10249,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10531,7 +10531,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10567,7 +10567,7 @@ func TestStmtTry_Try(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10661,7 +10661,7 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10812,7 +10812,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10917,7 +10917,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11123,7 +11123,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11178,7 +11178,7 @@ func TestStmtUnset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11254,7 +11254,7 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11321,7 +11321,7 @@ func TestStmtUse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11388,7 +11388,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11466,7 +11466,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11566,7 +11566,7 @@ func TestStmtUse_List(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11677,7 +11677,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11788,7 +11788,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11921,7 +11921,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12032,7 +12032,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12165,7 +12165,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12230,7 +12230,7 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12306,7 +12306,7 @@ func TestStmtBreak_Light(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12382,7 +12382,7 @@ func TestStmtBreak(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12458,7 +12458,7 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12553,7 +12553,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12596,7 +12596,7 @@ func TestExprArray(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12661,7 +12661,7 @@ func TestExprArray_Item(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12779,7 +12779,7 @@ func TestExprArray_Items(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12842,7 +12842,7 @@ func TestExprBitwiseNot(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12905,7 +12905,7 @@ func TestExprBooleanNot(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12981,7 +12981,7 @@ func TestExprClassConstFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13045,7 +13045,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13108,7 +13108,7 @@ func TestExprClone_Brackets(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13171,7 +13171,7 @@ func TestExprClone(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13216,7 +13216,7 @@ func TestExprClosure(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13393,7 +13393,7 @@ func TestExprClosure_Use(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13570,7 +13570,7 @@ func TestExprClosure_Use2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13635,7 +13635,7 @@ func TestExprConstFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13700,7 +13700,7 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13765,7 +13765,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13828,7 +13828,7 @@ func TestExprEmpty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13891,7 +13891,7 @@ func TestExprErrorSuppress(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13954,7 +13954,7 @@ func TestExprEval(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13997,7 +13997,7 @@ func TestExprExit(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14040,7 +14040,7 @@ func TestExprExit_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14104,7 +14104,7 @@ func TestExprExit_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14147,7 +14147,7 @@ func TestExprDie(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14190,7 +14190,7 @@ func TestExprDie_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14254,7 +14254,7 @@ func TestExprDie_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14329,7 +14329,7 @@ func TestExprFunctionCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14404,7 +14404,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14504,7 +14504,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14622,7 +14622,7 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14753,7 +14753,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14816,7 +14816,7 @@ func TestExprPostDec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14879,7 +14879,7 @@ func TestExprPostInc(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14942,7 +14942,7 @@ func TestExprPreDec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15005,7 +15005,7 @@ func TestExprPreInc(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15068,7 +15068,7 @@ func TestExprInclude(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15131,7 +15131,7 @@ func TestExprInclude_Once(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15194,7 +15194,7 @@ func TestExprRequire(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15257,7 +15257,7 @@ func TestExprRequire_Once(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15343,7 +15343,7 @@ func TestExprInstanceOf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15429,7 +15429,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15515,7 +15515,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15580,7 +15580,7 @@ func TestExprIsset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15666,7 +15666,7 @@ func TestExprIsset_Variables(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15740,7 +15740,7 @@ func TestExprList_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15846,7 +15846,7 @@ func TestExprList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15962,7 +15962,7 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16090,7 +16090,7 @@ func TestExprList_List(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16197,7 +16197,7 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16306,7 +16306,7 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16390,7 +16390,7 @@ func TestExprMethodCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16455,7 +16455,7 @@ func TestExprNew(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16530,7 +16530,7 @@ func TestExprNew_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16605,7 +16605,7 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16668,7 +16668,7 @@ func TestExprPrint(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16742,7 +16742,7 @@ func TestExprPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16859,7 +16859,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16935,7 +16935,7 @@ func TestExprShellExec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16978,7 +16978,7 @@ func TestExprShortArray(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17043,7 +17043,7 @@ func TestExprShortArray_Item(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17161,7 +17161,7 @@ func TestExprShortArray_Items(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17247,7 +17247,7 @@ func TestExprStaticCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17333,7 +17333,7 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17419,7 +17419,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17515,7 +17515,7 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17609,7 +17609,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17695,7 +17695,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17781,7 +17781,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17867,7 +17867,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17972,7 +17972,7 @@ func TestExprTernary(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18056,7 +18056,7 @@ func TestExprTernary_Simple(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18213,7 +18213,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18370,7 +18370,7 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18433,7 +18433,7 @@ func TestExprUnaryMinus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18496,7 +18496,7 @@ func TestExprUnaryPlus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18549,7 +18549,7 @@ func TestExprVariable(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18612,7 +18612,7 @@ func TestExprVariable_Variable(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18654,7 +18654,7 @@ func TestExprYield(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18717,7 +18717,7 @@ func TestExprYield_Val(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18801,7 +18801,7 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18854,7 +18854,7 @@ func TestExprYield_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18928,7 +18928,7 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19014,7 +19014,7 @@ func TestExprAssign_Assign(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19098,7 +19098,7 @@ func TestExprAssign_Reference(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19194,7 +19194,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19335,7 +19335,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19419,7 +19419,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19503,7 +19503,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19587,7 +19587,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19671,7 +19671,7 @@ func TestExprAssign_Concat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19755,7 +19755,7 @@ func TestExprAssign_Div(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19839,7 +19839,7 @@ func TestExprAssign_Minus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19923,7 +19923,7 @@ func TestExprAssign_Mod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20007,7 +20007,7 @@ func TestExprAssign_Mul(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20091,7 +20091,7 @@ func TestExprAssign_Plus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20175,7 +20175,7 @@ func TestExprAssign_Pow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20259,7 +20259,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20343,7 +20343,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20429,7 +20429,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20513,7 +20513,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20597,7 +20597,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20681,7 +20681,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20765,7 +20765,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20849,7 +20849,7 @@ func TestExprBinary_Concat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20933,7 +20933,7 @@ func TestExprBinary_Div(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21017,7 +21017,7 @@ func TestExprBinary_Equal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21101,7 +21101,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21185,7 +21185,7 @@ func TestExprBinary_Greater(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21269,7 +21269,7 @@ func TestExprBinary_Identical(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21353,7 +21353,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21437,7 +21437,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21521,7 +21521,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21605,7 +21605,7 @@ func TestExprBinary_Minus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21689,7 +21689,7 @@ func TestExprBinary_Mod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21773,7 +21773,7 @@ func TestExprBinary_Mul(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21857,7 +21857,7 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21941,7 +21941,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22025,7 +22025,7 @@ func TestExprBinary_Plus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22109,7 +22109,7 @@ func TestExprBinary_Pow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22193,7 +22193,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22277,7 +22277,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22361,7 +22361,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22445,7 +22445,7 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22510,7 +22510,7 @@ func TestExprCast_Array(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22573,7 +22573,7 @@ func TestExprCast_Bool(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22636,7 +22636,7 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22699,7 +22699,7 @@ func TestExprCast_Double(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22762,7 +22762,7 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22825,7 +22825,7 @@ func TestExprCast_Int(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22888,7 +22888,7 @@ func TestExprCast_IntShort(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22951,7 +22951,7 @@ func TestExprCast_Object(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23014,7 +23014,7 @@ func TestExprCast_String(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23077,7 +23077,7 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23140,7 +23140,7 @@ func TestExprCast_Unset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 2c7d11c..2b94e89 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -413,7 +413,7 @@ CAD; ` for n := 0; n < b.N; n++ { - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() } } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 295e0b0..68a7b05 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -22455,7 +22455,7 @@ func TestPhp5(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22592,7 +22592,7 @@ func TestPhp5Strings(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22818,7 +22818,7 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22838,7 +22838,7 @@ func TestPhp5ControlCharsErrors(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6") + php5parser := php5.NewParser([]byte(src), "5.6", false) php5parser.Parse() actual := php5parser.GetErrors() assert.DeepEqual(t, expected, actual) diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 72dab68..df00e2d 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -21,17 +21,23 @@ type Parser struct { positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex errors []*errors.Error + withTokens bool } // NewParser creates and returns new Parser -func NewParser(src []byte, v string) *Parser { - parser := &Parser{} +func NewParser(src []byte, v string, withTokens bool) *Parser { + parser := &Parser{ + withTokens: withTokens, + } - lexer := scanner.NewLexer(src, func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }) - lexer.PHPVersion = v + scannerConfig := scanner.Config{ + WithHiddenTokens: withTokens, + ErrHandlerFunc: func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }, + } + lexer := scanner.NewLexer(src, v, scannerConfig) parser.Lexer = lexer return parser @@ -57,10 +63,6 @@ func (l *Parser) GetErrors() []*errors.Error { return l.errors } -func (l *Parser) WithTokens() { - l.Lexer.SetWithHiddenTokens(true) -} - // Parse the php7 Parser entrypoint func (l *Parser) Parse() int { // init @@ -96,7 +98,7 @@ func isDollar(r rune) bool { } func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -109,7 +111,7 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { } func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -126,7 +128,7 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return []token.Token{} } @@ -139,7 +141,7 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } func (l *Parser) addDollarToken(v ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } @@ -152,7 +154,7 @@ func (l *Parser) addDollarToken(v ast.Vertex) { } func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.Lexer.GetWithHiddenTokens() == false { + if l.withTokens == false { return } diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index bceae9c..e4a2100 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -56,7 +56,7 @@ func TestIdentifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -949,7 +949,7 @@ func TestPhp7ArgumentNode(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1742,7 +1742,7 @@ func TestPhp7ParameterNode(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1763,7 +1763,7 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1840,7 +1840,7 @@ func TestName(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1915,7 +1915,7 @@ func TestFullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1990,7 +1990,7 @@ func TestRelative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2068,7 +2068,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2144,7 +2144,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2231,7 +2231,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2328,7 +2328,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2436,7 +2436,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2512,7 +2512,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2609,7 +2609,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2716,7 +2716,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2807,7 +2807,7 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2898,7 +2898,7 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2957,7 +2957,7 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3002,7 +3002,7 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3061,7 +3061,7 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3105,7 +3105,7 @@ func TestScalarMagicConstant(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3148,7 +3148,7 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3191,7 +3191,7 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3234,7 +3234,7 @@ func TestScalarNumber_Float(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3277,7 +3277,7 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3320,7 +3320,7 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3363,7 +3363,7 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3406,7 +3406,7 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3449,7 +3449,7 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3492,7 +3492,7 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3537,7 +3537,7 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3580,7 +3580,7 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3625,7 +3625,7 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3694,7 +3694,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3806,7 +3806,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3895,7 +3895,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4072,7 +4072,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4206,7 +4206,7 @@ func TestStmtClassConstList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4327,7 +4327,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4405,7 +4405,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4553,7 +4553,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4678,7 +4678,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4792,7 +4792,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4918,7 +4918,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4962,7 +4962,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5019,7 +5019,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5109,7 +5109,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5201,7 +5201,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5316,7 +5316,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5470,7 +5470,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5568,7 +5568,7 @@ func TestStmtConstList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5633,7 +5633,7 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5709,7 +5709,7 @@ func TestStmtContinue_Light(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5785,7 +5785,7 @@ func TestStmtContinue(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5861,7 +5861,7 @@ func TestStmtDeclare(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5970,7 +5970,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6048,7 +6048,7 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6102,7 +6102,7 @@ func TestStmtDo(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6168,7 +6168,7 @@ func TestStmtEcho(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6223,7 +6223,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6266,7 +6266,7 @@ func TestStmtExpression(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6461,7 +6461,7 @@ func TestStmtFor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6581,7 +6581,7 @@ func TestStmtFor_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6666,7 +6666,7 @@ func TestStmtForeach(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6741,7 +6741,7 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6826,7 +6826,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6932,7 +6932,7 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7028,7 +7028,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7144,7 +7144,7 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7272,7 +7272,7 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7317,7 +7317,7 @@ func TestStmtFunction(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7373,7 +7373,7 @@ func TestStmtFunction_Return(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7540,7 +7540,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7607,7 +7607,7 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7675,7 +7675,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7730,7 +7730,7 @@ func TestStmtGlobal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7890,7 +7890,7 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7954,7 +7954,7 @@ func TestStmtGotoLabel(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7986,7 +7986,7 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8050,7 +8050,7 @@ func TestStmtIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8158,7 +8158,7 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8243,7 +8243,7 @@ func TestStmtIf_Else(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8414,7 +8414,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8595,7 +8595,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8638,7 +8638,7 @@ func TestStmtInlineHtml(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8682,7 +8682,7 @@ func TestStmtInterface(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8761,7 +8761,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8863,7 +8863,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8918,7 +8918,7 @@ func TestStmtNamespace(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8974,7 +8974,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9007,7 +9007,7 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9108,7 +9108,7 @@ func TestStmtProperty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9262,7 +9262,7 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9416,7 +9416,7 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9540,7 +9540,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9605,7 +9605,7 @@ func TestStmtStaticVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9712,7 +9712,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9819,7 +9819,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9945,7 +9945,7 @@ func TestStmtSwitch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10071,7 +10071,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10187,7 +10187,7 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10291,7 +10291,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10344,7 +10344,7 @@ func TestStmtThrow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10388,7 +10388,7 @@ func TestStmtTrait(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10478,7 +10478,7 @@ func TestStmtTraitUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10591,7 +10591,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10704,7 +10704,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10861,7 +10861,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11029,7 +11029,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11311,7 +11311,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11347,7 +11347,7 @@ func TestStmtTry_Try(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11441,7 +11441,7 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11558,7 +11558,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11709,7 +11709,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11814,7 +11814,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12020,7 +12020,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12075,7 +12075,7 @@ func TestStmtUnset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12151,7 +12151,7 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12227,7 +12227,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12294,7 +12294,7 @@ func TestStmtUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12361,7 +12361,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12439,7 +12439,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12539,7 +12539,7 @@ func TestStmtUse_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12650,7 +12650,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12761,7 +12761,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12894,7 +12894,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13005,7 +13005,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13138,7 +13138,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13261,7 +13261,7 @@ func TestStmtUse_GroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13395,7 +13395,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13529,7 +13529,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13663,7 +13663,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13808,7 +13808,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13873,7 +13873,7 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13949,7 +13949,7 @@ func TestStmtBreak_Light(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14025,7 +14025,7 @@ func TestStmtBreak(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14101,7 +14101,7 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14196,7 +14196,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14239,7 +14239,7 @@ func TestExprArray(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14304,7 +14304,7 @@ func TestExprArray_Item(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14422,7 +14422,7 @@ func TestExprArray_Items(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14498,7 +14498,7 @@ func TestExprArray_ItemUnpack(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14563,7 +14563,7 @@ func TestExprArrowFunction(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14651,7 +14651,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14714,7 +14714,7 @@ func TestExprBitwiseNot(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14777,7 +14777,7 @@ func TestExprBooleanNot(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14853,7 +14853,7 @@ func TestExprClassConstFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14917,7 +14917,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14980,7 +14980,7 @@ func TestExprClone_Brackets(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15043,7 +15043,7 @@ func TestExprClone(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15088,7 +15088,7 @@ func TestExprClosure(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15265,7 +15265,7 @@ func TestExprClosure_Use(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15442,7 +15442,7 @@ func TestExprClosure_Use2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15510,7 +15510,7 @@ func TestExprClosure_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15575,7 +15575,7 @@ func TestExprConstFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15640,7 +15640,7 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15705,7 +15705,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15768,7 +15768,7 @@ func TestExprEmpty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15831,7 +15831,7 @@ func TestExprErrorSuppress(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15894,7 +15894,7 @@ func TestExprEval(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15937,7 +15937,7 @@ func TestExprExit(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15980,7 +15980,7 @@ func TestExprExit_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16044,7 +16044,7 @@ func TestExprExit_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16087,7 +16087,7 @@ func TestExprDie(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16130,7 +16130,7 @@ func TestExprDie_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16194,7 +16194,7 @@ func TestExprDie_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16269,7 +16269,7 @@ func TestExprFunctionCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16344,7 +16344,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16444,7 +16444,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16562,7 +16562,7 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16693,7 +16693,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16756,7 +16756,7 @@ func TestExprPostDec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16819,7 +16819,7 @@ func TestExprPostInc(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16882,7 +16882,7 @@ func TestExprPreDec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16945,7 +16945,7 @@ func TestExprPreInc(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17008,7 +17008,7 @@ func TestExprInclude(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17071,7 +17071,7 @@ func TestExprInclude_Once(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17134,7 +17134,7 @@ func TestExprRequire(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17197,7 +17197,7 @@ func TestExprRequire_Once(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17283,7 +17283,7 @@ func TestExprInstanceOf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17369,7 +17369,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17455,7 +17455,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17520,7 +17520,7 @@ func TestExprIsset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17606,7 +17606,7 @@ func TestExprIsset_Variables(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17680,7 +17680,7 @@ func TestExprList_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17786,7 +17786,7 @@ func TestExprList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17902,7 +17902,7 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18030,7 +18030,7 @@ func TestExprList_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18137,7 +18137,7 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18246,7 +18246,7 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18330,7 +18330,7 @@ func TestExprMethodCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18395,7 +18395,7 @@ func TestExprNew(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18470,7 +18470,7 @@ func TestExprNew_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18545,7 +18545,7 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18676,7 +18676,7 @@ func TestExprNew_Anonymous(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18739,7 +18739,7 @@ func TestExprPrint(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18813,7 +18813,7 @@ func TestExprPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18930,7 +18930,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19006,7 +19006,7 @@ func TestExprShellExec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19049,7 +19049,7 @@ func TestExprShortArray(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19114,7 +19114,7 @@ func TestExprShortArray_Item(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19232,7 +19232,7 @@ func TestExprShortArray_Items(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19338,7 +19338,7 @@ func TestExprShortList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19454,7 +19454,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19582,7 +19582,7 @@ func TestExprShortList_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19668,7 +19668,7 @@ func TestExprStaticCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19754,7 +19754,7 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19840,7 +19840,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19936,7 +19936,7 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20030,7 +20030,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20116,7 +20116,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20202,7 +20202,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20288,7 +20288,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20393,7 +20393,7 @@ func TestExprTernary(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20477,7 +20477,7 @@ func TestExprTernary_Simple(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20634,7 +20634,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20791,7 +20791,7 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20854,7 +20854,7 @@ func TestExprUnaryMinus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20917,7 +20917,7 @@ func TestExprUnaryPlus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20970,7 +20970,7 @@ func TestExprVariable(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21033,7 +21033,7 @@ func TestExprVariable_Variable(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21075,7 +21075,7 @@ func TestExprYield(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21138,7 +21138,7 @@ func TestExprYield_Val(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21222,7 +21222,7 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21275,7 +21275,7 @@ func TestExprYield_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21349,7 +21349,7 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21412,7 +21412,7 @@ func TestExprYieldFrom(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21498,7 +21498,7 @@ func TestExprAssign_Assign(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21582,7 +21582,7 @@ func TestExprAssign_Reference(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21678,7 +21678,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21819,7 +21819,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21903,7 +21903,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21987,7 +21987,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22071,7 +22071,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22155,7 +22155,7 @@ func TestExprAssign_Concat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22239,7 +22239,7 @@ func TestExprAssign_Div(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22323,7 +22323,7 @@ func TestExprAssign_Minus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22407,7 +22407,7 @@ func TestExprAssign_Mod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22491,7 +22491,7 @@ func TestExprAssign_Mul(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22575,7 +22575,7 @@ func TestExprAssign_Plus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22659,7 +22659,7 @@ func TestExprAssign_Pow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22743,7 +22743,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22827,7 +22827,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22911,7 +22911,7 @@ func TestExprAssign_Coalesce(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22997,7 +22997,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23081,7 +23081,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23165,7 +23165,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23249,7 +23249,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23333,7 +23333,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23417,7 +23417,7 @@ func TestExprBinary_Coalesce(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23501,7 +23501,7 @@ func TestExprBinary_Concat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23585,7 +23585,7 @@ func TestExprBinary_Div(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23669,7 +23669,7 @@ func TestExprBinary_Equal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23753,7 +23753,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23837,7 +23837,7 @@ func TestExprBinary_Greater(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23921,7 +23921,7 @@ func TestExprBinary_Identical(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24005,7 +24005,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24089,7 +24089,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24173,7 +24173,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24257,7 +24257,7 @@ func TestExprBinary_Minus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24341,7 +24341,7 @@ func TestExprBinary_Mod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24425,7 +24425,7 @@ func TestExprBinary_Mul(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24509,7 +24509,7 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24593,7 +24593,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24677,7 +24677,7 @@ func TestExprBinary_Plus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24761,7 +24761,7 @@ func TestExprBinary_Pow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24845,7 +24845,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24929,7 +24929,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25013,7 +25013,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25097,7 +25097,7 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25181,7 +25181,7 @@ func TestExprBinary_Spaceship(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25246,7 +25246,7 @@ func TestExprCast_Array(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25309,7 +25309,7 @@ func TestExprCast_Bool(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25372,7 +25372,7 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25435,7 +25435,7 @@ func TestExprCast_Double(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25498,7 +25498,7 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25561,7 +25561,7 @@ func TestExprCast_Int(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25624,7 +25624,7 @@ func TestExprCast_IntShort(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25687,7 +25687,7 @@ func TestExprCast_Object(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25750,7 +25750,7 @@ func TestExprCast_String(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25813,7 +25813,7 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25876,7 +25876,7 @@ func TestExprCast_Unset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index a5a9aee..8058be7 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -381,7 +381,7 @@ CAD; ` for n := 0; n < b.N; n++ { - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() } } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 5e0268a..7b78b29 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -19633,7 +19633,7 @@ func TestPhp7(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19770,7 +19770,7 @@ func TestPhp5Strings(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19996,7 +19996,7 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20016,7 +20016,7 @@ func TestPhp7ControlCharsErrors(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4") + php7parser := php7.NewParser([]byte(src), "7.4", false) php7parser.Parse() actual := php7parser.GetErrors() assert.DeepEqual(t, expected, actual) diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 60aaec9..4b242d3 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -13,37 +13,42 @@ import ( type Scanner interface { Lex() *Token ReturnTokenToPool(t *Token) - GetWithHiddenTokens() bool - SetWithHiddenTokens(bool) +} + +type Config struct { + WithHiddenTokens bool + ErrHandlerFunc func(*errors.Error) } type Lexer struct { - data []byte - errHandlerFunc func(*errors.Error) + data []byte + phpVersion string + withHiddenTokens bool + errHandlerFunc func(*errors.Error) + + p, pe, cs int + ts, te, act int + stack []int + top int - p, pe, cs int - ts, te, act int - stack []int - top int heredocLabel []byte - - TokenPool *TokenPool - HiddenTokens []token.Token - WithHiddenTokens bool - NewLines NewLines - PHPVersion string + tokenPool *TokenPool + hiddenTokens []token.Token + newLines NewLines } -func NewLexer(data []byte, errHandlerFunc func(*errors.Error)) *Lexer { +func NewLexer(data []byte, phpVersion string, config Config) *Lexer { lex := &Lexer{ - data: data, - errHandlerFunc: errHandlerFunc, + data: data, + phpVersion: phpVersion, + errHandlerFunc: config.ErrHandlerFunc, + withHiddenTokens: config.WithHiddenTokens, pe: len(data), stack: make([]int, 0), - TokenPool: &TokenPool{}, - NewLines: NewLines{make([]int, 0, 128)}, + tokenPool: &TokenPool{}, + newLines: NewLines{make([]int, 0, 128)}, } initLexer(lex) @@ -51,31 +56,23 @@ func NewLexer(data []byte, errHandlerFunc func(*errors.Error)) *Lexer { return lex } -func (l *Lexer) ReturnTokenToPool(t *Token) { - l.TokenPool.Put(t) -} - -func (l *Lexer) GetWithHiddenTokens() bool { - return l.WithHiddenTokens -} - -func (l *Lexer) SetWithHiddenTokens(b bool) { - l.WithHiddenTokens = b +func (lex *Lexer) ReturnTokenToPool(t *Token) { + lex.tokenPool.Put(t) } func (lex *Lexer) setTokenPosition(token *Token) { - token.Position.StartLine = lex.NewLines.GetLine(lex.ts) - token.Position.EndLine = lex.NewLines.GetLine(lex.te - 1) + token.Position.StartLine = lex.newLines.GetLine(lex.ts) + token.Position.EndLine = lex.newLines.GetLine(lex.te - 1) token.Position.StartPos = lex.ts token.Position.EndPos = lex.te } -func (lex *Lexer) addToken(id TokenID, ps, pe int) { - if !lex.WithHiddenTokens { +func (lex *Lexer) addHiddenToken(id TokenID, ps, pe int) { + if !lex.withHiddenTokens { return } - lex.HiddenTokens = append(lex.HiddenTokens, token.Token{ + lex.hiddenTokens = append(lex.hiddenTokens, token.Token{ ID: token.ID(id), Value: lex.data[ps:pe], }) @@ -112,7 +109,7 @@ func (lex *Lexer) isNotStringEnd(s byte) bool { } func (lex *Lexer) isHeredocEnd(p int) bool { - r, err := version.Compare(lex.PHPVersion, "7.3") + r, err := version.Compare(lex.phpVersion, "7.3") if err != nil { return lex.isHeredocEndSince73(p) } @@ -239,8 +236,8 @@ func (lex *Lexer) error(msg string) { } pos := position.NewPosition( - lex.NewLines.GetLine(lex.ts), - lex.NewLines.GetLine(lex.te-1), + lex.newLines.GetLine(lex.ts), + lex.newLines.GetLine(lex.te-1), lex.ts, lex.te, ) diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 576f19af7fa11f6a1cac2a43292aba794790ce26..0a3ecd8d212164c15f9b4c3623b56b6c696f10cf 100644 GIT binary patch delta 6409 zcmai2d0f=h7XMu4ULC~e17vfDWQHx38Fq2QtTZb#F%j*hR%%5ef|}+Asfc0`KlQjH zN`j#Y4m#n2qNSEAnw9a?T0W~8bAM5&(Xsf?=k zRQk_+S~K@AsGWnlpb1LlIX^x>OVTnQa^9Bq8q9BPU!sJv#4MWk!xS zpB|U%3w^HPHp-gZP7>dp`>f(Q3mX!;x8OQcKd5aS;?xgnl-K787pvzv!aX`~1h;r` z{^rIO<8p^O{l6%Z7`4EWgh|=IAkAqL0D(1z=E}^x;WP`A@>iZK_W44A#V>Nj?kwV% zEi-=z;_N8*7pE{!w)Z|^xk=)&|eX2rKixT1`=t(*Nr{k{EKNha4sy>1E44;^n5G+u=&hu_~puAzWE|{1avZ zFKs|XNk6d~GHldq)X5^axRVYZoMda8l$7s%X_>WzYxnR>mKRQ-Wy28Ll2iUjgmU_{ zjq7gtri}m3IJ1QR$9AC)GHyu4ir;Ru&npU5tRvC>=>cxxYXdv6T(Ba_>X(0vT1=$6 z`qJ~8gzvEziWSRcv(oLy4gCMXk3v3hu~-RuXjbwsvH3$nIq=FVu5|gzdNHx(r&VGw z@n@0Efd7I%VVUt+f=R+h@e$4Yx~ptY6<*&;OVFu~nx>H@D*M z>xg5Cf7*nR-@RfnxNxsT49f49ah3NUFn4u)-1d=hdF9boT4kq{aSh&D*R>62xLVEM z+;r)OXd~MxR)p?K_1$2&Wk8)_&aXH`Ie9RGM8!wZZ9}H zV>VNOQ3g7T`|O&i0CMA)d#WG5Depe(J|E~O4zXSYSQMqpK9~AKdN)_xG(?> zW*$pX8|20vaC!!}LzDSJH`<{?5Hty!p}su|JPN#vuAsqv3eR zqJfc|At)G&SoaLJw;G4~alH^(`R!rvc-5fCTPQ;%Ky7mEp>3K9LK^DDEiGW2AiTl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z<9`|GZjh*`@3xf1tviFVfDzHkdGsJ5^@sJq2A-0l z9-5L8r#tQ#uf)K$7!z>F>Zs7G6zL_adaA1+y{nxpdQ&^AdS*t^uq0N|FL3ge%B`Hl zfbK|=3lx5r!lAWCp$Gj`c-f=0GuW?+_# zR08aNZ!loRUIVb+C>WG(|E`vFw{=WpJ_R2i)LnSXr{Ke-I?44b)LP(nl, 1) | '\r' >(nl, 0) | '\n' >(nl, 0)) %{lex.NewLines.Append(lex.p);}; + newline = ('\r\n' >(nl, 1) | '\r' >(nl, 0) | '\n' >(nl, 0)) %{lex.newLines.Append(lex.p);}; any_line = any | newline; whitespace = [\t\v\f ]; whitespace_line = [\t\v\f ] | newline; @@ -125,7 +125,7 @@ func (lex *Lexer) Lex() *Token { main := |* "#!" any* :>> newline => { - lex.addToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -141,12 +141,12 @@ func (lex *Lexer) Lex() *Token { fbreak; }; ' { - lex.addToken(T_OPEN_TAG, lex.ts, lex.te) + lex.addHiddenToken(T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addToken(T_OPEN_TAG, lex.ts, lex.ts+5) + lex.addHiddenToken(T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { @@ -158,7 +158,7 @@ func (lex *Lexer) Lex() *Token { *|; php := |* - whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; @@ -318,7 +318,7 @@ func (lex *Lexer) Lex() *Token { ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; @@ -327,9 +327,9 @@ func (lex *Lexer) Lex() *Token { } if isDocComment { - lex.addToken(T_DOC_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(T_DOC_COMMENT, lex.ts, lex.te) } else { - lex.addToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) } }; @@ -378,7 +378,7 @@ func (lex *Lexer) Lex() *Token { *|; property := |* - whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; "->" => {lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; varname => {lex.setTokenPosition(token); tok = T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; @@ -474,31 +474,31 @@ func (lex *Lexer) Lex() *Token { *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; "(" => {lex.setTokenPosition(token); tok = TokenID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; ")" => {lex.setTokenPosition(token); tok = TokenID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; ";" => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addToken(T_HALT_COMPILER, lex.ts, lex.te); }; + any_line* => { lex.addHiddenToken(T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - token.Hidden = lex.HiddenTokens + token.Hidden = lex.hiddenTokens token.Value = lex.data[lex.ts:lex.te] token.ID = tok diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index c9f63af..9199f1d 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -353,8 +353,8 @@ func TestTokens(t *testing.T) { T_UNSET_CAST.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -381,8 +381,8 @@ func TestShebang(t *testing.T) { "\n", } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} tkn := lexer.Lex() @@ -401,8 +401,8 @@ func TestShebangHtml(t *testing.T) { 0.1 ` - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() assert.Equal(t, tkn.ID, T_INLINE_HTML) @@ -451,8 +451,8 @@ func TestNumberTokens(t *testing.T) { T_DNUMBER.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -508,8 +508,8 @@ func TestConstantStrings(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -555,7 +555,7 @@ func TestSingleQuoteStringTokens(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), nil) + lexer := NewLexer([]byte(src), "7.4", Config{}) actual := []string{} for { @@ -642,8 +642,8 @@ func TestTeplateStringTokens(t *testing.T) { TokenID(int('"')).String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -727,8 +727,8 @@ func TestBackquoteStringTokens(t *testing.T) { TokenID(int('`')).String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -821,8 +821,8 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -894,8 +894,8 @@ CAT T_END_HEREDOC.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -933,8 +933,8 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -964,8 +964,8 @@ func TestHereDocTokens73(t *testing.T) { T_VARIABLE.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -994,9 +994,9 @@ CAT;` TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), nil) - lexer.PHPVersion = "7.2" - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.phpVersion = "7.2" + lexer.withHiddenTokens = true actual := []string{} for { @@ -1027,8 +1027,8 @@ func TestInlineHtmlNopTokens(t *testing.T) { T_INLINE_HTML.String(), } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true actual := []string{} for { @@ -1062,7 +1062,7 @@ func TestStringTokensAfterVariable(t *testing.T) { "\"", } - lexer := NewLexer([]byte(src), nil) + lexer := NewLexer([]byte(src), "7.4", Config{}) actual := []string{} actualTokens := []string{} @@ -1095,7 +1095,7 @@ func TestSlashAfterVariable(t *testing.T) { "3", } - lexer := NewLexer([]byte(src), nil) + lexer := NewLexer([]byte(src), "7.4", Config{}) actual := []string{} actualTokens := []string{} @@ -1132,12 +1132,12 @@ func TestCommentEnd(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true lexer.Lex() - actual := lexer.HiddenTokens + actual := lexer.hiddenTokens assert.DeepEqual(t, expected, actual) } @@ -1161,8 +1161,8 @@ func TestCommentNewLine(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1190,8 +1190,8 @@ func TestCommentNewLine1(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1219,8 +1219,8 @@ func TestCommentNewLine2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1249,8 +1249,8 @@ func TestCommentWithPhpEndTag(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1279,8 +1279,8 @@ func TestInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1309,12 +1309,12 @@ func TestInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true lexer.Lex() - actual := lexer.HiddenTokens + actual := lexer.hiddenTokens assert.DeepEqual(t, expected, actual) } @@ -1343,12 +1343,12 @@ func TestEmptyInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true lexer.Lex() - actual := lexer.HiddenTokens + actual := lexer.hiddenTokens assert.DeepEqual(t, expected, actual) } @@ -1373,8 +1373,8 @@ func TestEmptyInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1387,8 +1387,8 @@ func TestMethodCallTokens(t *testing.T) { src := ` bar ( '' ) ;` - lexer := NewLexer([]byte(src), nil) - lexer.WithHiddenTokens = true + lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer.withHiddenTokens = true expected := []token.Token{ { @@ -1469,8 +1469,8 @@ func TestYieldFromTokens(t *testing.T) { src := ` Date: Mon, 18 May 2020 21:40:49 +0300 Subject: [PATCH 018/140] [refactoring] scanner DefaultConfig --- internal/scanner/lexer.go | 2 ++ internal/scanner/scanner.go | Bin 383542 -> 384730 bytes internal/scanner/scanner_test.go | 60 +++++++++++++++---------------- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 4b242d3..8cfc2b3 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -20,6 +20,8 @@ type Config struct { ErrHandlerFunc func(*errors.Error) } +var DefaultConfig = Config{} + type Lexer struct { data []byte phpVersion string diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 0a3ecd8d212164c15f9b4c3623b56b6c696f10cf..c4b5ae58209aa13baa797cba467c654341cf4d94 100644 GIT binary patch delta 6643 zcmZu#d0bV+9{-GY4uav50h&u{a*sl0+zW_cnqbQ(3yYqnmhJV*9Tl}crMO^GKmrFF zd)lI;WDrUhy(*w!x#!yQGEE~x#aAyCHI1S-zu%lQb2#_?bMMUew|{?gX6Bqtm0iBC z>9S#!i-Z`fT(9!qg^S!qGChOyNZ$im_qlCCLW~(%x{>?ZWNX-S-b6JFGiv9J;!{>1 zPVPnfx%1Ouo)$vJ7KqWAdBh zzyYLn?o9=+e#?Y)qjwHe4Sq)%$8rGnd2(NdOhpC9^2`c!-?+DzyTDuWLETvJZ)$Wa zoCE6lg|FQXaDA=Y@YHS)!^0q{s2hqU7o5E;hK0tUYK3iHzKfLmu4Mao-3G$6M^1yZ;v)gG&AdYUCZL1eeJN5AnZc zt4OqwbZ8|XGEWeREW9ru>T!Z`8jihf3YuNNn4%i9KrfYGk&jOkWQW2mNUua>*@bBIP zhzBwz92L;@x{GbSakxZ`iw(MwcPWge&!$6+uP==cit~a?#I@so;Y~MwI=&u;1t&`R zpI9{oCrX0iV?Y^mOgs58Xn?<7rzEotr#=#>+bI7LsfQ|O*W=LBq#HwjDz+4~)24!M z95@XOa%XNM?`Km%Hy&*;(eJnrgZ_2~I6}Ruvq&gsfpwfrf{nM&Vbj6IBaP^o_mRCn zn?I@JPxkhuoZo6SlvTe>f_>4yEJpykefHPYvLofcRYM5T_-%YBsu%Oppuvi+yh~WC zr)duuKyke;18c$nR#d{3=g=?6YOnf04fuNZ_f^*L>1!rmx)FUH2?gD2*G6H!CCrNMseIeC0mT zhJaj5qFg8erdgAVKsvD0byhiZF7(vS8)m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dn_SU9J|{bLvt`gQ+7@r;ECoCC25F5xAeWgy_PPHNt>0I$zddM;XmF)ZxRedL6vC(d|#b z=~Mg)npn#hZF&^z0fANY9jU9X;yr-Y)d%_Faw!bnJ46dr&b(S9jph+Ys45+~Q~?*i zpzivHjE4S4TQdIiXftDd0uRVMMW3-abk?Y^KB=#&=-%cK=-W}QKKIl10gm82=1JCG z-8y7| zAD%ugM)WVbbJH(;Kca5$4O%9p6~7u!m&}_j<2K%;*Rfk2!0zgqFTG2*XvvKIlNPU8 z%Fct$vgc-i1WVx9e+u|X79B{>p$&&)&Td}iJH_fW))SsWdkix*@3exZo_6tsZU#WOiFwFnP858z<5JoHx>l%`?DvT zjq%MH4}g>aX840gW_&h)MQJggYp2KD*N)xAnE7&^g&o-pDYXh@B|-{?hCn9&U68P< z6H9G&#ySSThn-oJA$E&cNBE&XgE zx?fQU_tU>!J>h5(f(XW$hL25HHW(eR}Dwk0f{%Cd(=P zBMiheof@fgI@p^rCAg*oTUfUF5=Pc({RG47l}c zvD0B{Kb>OQbN{6139P?f_l*87ijhdMulW0@`F bar ( '' ) ;` - lexer := NewLexer([]byte(src), "7.4", Config{}) + lexer := NewLexer([]byte(src), "7.4", DefaultConfig) lexer.withHiddenTokens = true expected := []token.Token{ @@ -1469,7 +1469,7 @@ func TestYieldFromTokens(t *testing.T) { src := ` Date: Mon, 18 May 2020 21:44:03 +0300 Subject: [PATCH 019/140] [refactoring] remove scanner interface --- internal/php5/parser.go | 6 +----- internal/php7/parser.go | 6 +----- internal/scanner/lexer.go | 5 ----- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 0f4441d..c0e2ac4 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -11,13 +11,9 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -func (lval *yySymType) Token(t *scanner.Token) { - lval.token = t -} - // Parser structure type Parser struct { - Lexer scanner.Scanner + Lexer *scanner.Lexer currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex diff --git a/internal/php7/parser.go b/internal/php7/parser.go index df00e2d..f34ddc4 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -10,13 +10,9 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -func (lval *yySymType) Token(t *scanner.Token) { - lval.token = t -} - // Parser structure type Parser struct { - Lexer scanner.Scanner + Lexer *scanner.Lexer currentToken *scanner.Token positionBuilder *positionbuilder.PositionBuilder rootNode ast.Vertex diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 8cfc2b3..2308bcd 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -10,11 +10,6 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -type Scanner interface { - Lex() *Token - ReturnTokenToPool(t *Token) -} - type Config struct { WithHiddenTokens bool ErrHandlerFunc func(*errors.Error) From 21f3d88b0f5afa6c04503b4f227065ad9886947e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 22:36:39 +0300 Subject: [PATCH 020/140] [refactoring] update makefile --- Makefile | 12 ++++++------ cmd/php-parser/main.go | 21 ++++++++++++--------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 5f88103..6bcfbcd 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,8 @@ cover: go test ./... --cover bench: - go test -benchmem -bench=. ./php5 - go test -benchmem -bench=. ./php7 + go test -benchmem -bench=. ./internal/php5 + go test -benchmem -bench=. ./internal/php7 compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scanner.go fmt sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go @@ -40,17 +40,17 @@ compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scan goyacc -o $@ $< cpu_pprof: - go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./php7 + go test -cpuprofile cpu.pprof -bench=. -benchtime=20s ./internal/php7 go tool pprof ./php7.test cpu.pprof mem_pprof: - go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./php7 + go test -memprofile mem.pprof -bench=. -benchtime=20s -benchmem ./internal/php7 go tool pprof -alloc_objects ./php7.test mem.pprof cpu_pprof_php5: - go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./php5 + go test -cpuprofile cpu.prof -bench=. -benchtime=20s ./internal/php5 go tool pprof ./php5.test cpu.prof mem_pprof_php5: - go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./php5 + go test -memprofile mem.prof -bench=. -benchtime=20s -benchmem ./internal/php5 go tool pprof -alloc_objects ./php5.test mem.prof diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 9300288..06b11a2 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -1,9 +1,9 @@ package main import ( + "bytes" "flag" "fmt" - "github.com/z7zmey/php-parser/pkg/ast/traverser" "io/ioutil" "log" "os" @@ -13,8 +13,11 @@ import ( "github.com/pkg/profile" "github.com/yookoala/realpath" + + "github.com/z7zmey/php-parser/pkg/ast/traverser" "github.com/z7zmey/php-parser/pkg/ast/visitor" "github.com/z7zmey/php-parser/pkg/parser" + "github.com/z7zmey/php-parser/pkg/printer" ) var wg sync.WaitGroup @@ -138,14 +141,14 @@ func printerWorker(r <-chan result) { fmt.Fprintf(os.Stdout, "==> %s\n", e) } - //if *printBack { - // o := bytes.NewBuffer([]byte{}) - // p := printer.NewPrinter(o) - // p.Print(res.parser.GetRootNode()) - // - // err := ioutil.WriteFile(res.path, o.Bytes(), 0644) - // checkErr(err) - //} + if *printBack { + o := bytes.NewBuffer([]byte{}) + p := printer.NewPrinter(o) + p.Print(res.parser.GetRootNode()) + + err := ioutil.WriteFile(res.path, o.Bytes(), 0644) + checkErr(err) + } if *showResolvedNs { v := visitor.NewNamespaceResolver() From 009d638ee24e0df5e76c22dd5ea66fe57b011d8d Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 18 May 2020 22:37:13 +0300 Subject: [PATCH 021/140] [refactoring] version testing --- internal/version/version.go | 8 ++++---- internal/version/version_test.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 internal/version/version_test.go diff --git a/internal/version/version.go b/internal/version/version.go index f11d933..9834ebf 100644 --- a/internal/version/version.go +++ b/internal/version/version.go @@ -42,17 +42,17 @@ func Compare(a string, b string) (int, error) { } func parse(v string) (version, error) { - parts := strings.Split(v, ".") - if len(parts) != 2 { + i := strings.Index(v, ".") + if i == -1 { return version{}, errors.New("version must contain major and minor parts") } - major, err := strconv.Atoi(parts[0]) + major, err := strconv.Atoi(v[:i]) if err != nil { return version{}, err } - minor, err := strconv.Atoi(parts[1]) + minor, err := strconv.Atoi(v[i+1:]) if err != nil { return version{}, err } diff --git a/internal/version/version_test.go b/internal/version/version_test.go new file mode 100644 index 0000000..5f8a2f7 --- /dev/null +++ b/internal/version/version_test.go @@ -0,0 +1,29 @@ +package version_test + +import ( + "gotest.tools/assert" + "testing" + + "github.com/z7zmey/php-parser/internal/version" +) + +func TestSmaller(t *testing.T) { + r, err := version.Compare("7.3", "5.6") + + assert.NilError(t, err) + assert.Equal(t, 1, r) +} + +func TestGreater(t *testing.T) { + r, err := version.Compare("5.6", "7.3") + + assert.NilError(t, err) + assert.Equal(t, -1, r) +} + +func TestEqual(t *testing.T) { + r, err := version.Compare("7.3", "7.3") + + assert.NilError(t, err) + assert.Equal(t, 0, r) +} From ee673e5667014765b7e76710137055f51e414cb0 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 29 Jun 2020 14:15:58 +0300 Subject: [PATCH 022/140] [refactoring] update internal parser --- cmd/php-parser/main.go | 10 +++++++ internal/php5/parser.go | 64 +++++++++++++++++++---------------------- internal/php7/parser.go | 10 ++----- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 06b11a2..557f699 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -10,6 +10,7 @@ import ( "path/filepath" "runtime" "sync" + "time" "github.com/pkg/profile" "github.com/yookoala/realpath" @@ -28,6 +29,7 @@ var withFreeFloating *bool var showResolvedNs *bool var printBack *bool var printPath *bool +var printExecTime *bool type file struct { path string @@ -40,6 +42,9 @@ type result struct { } func main() { + start := time.Now() + + printExecTime = flag.Bool("time", false, "print execution time") withFreeFloating = flag.Bool("ff", false, "parse and show free floating strings") showResolvedNs = flag.Bool("r", false, "resolve names") printBack = flag.Bool("pb", false, "print AST back into the parsed file") @@ -84,6 +89,11 @@ func main() { wg.Wait() close(fileCh) close(resultCh) + + elapsed := time.Since(start) + if *printExecTime { + log.Printf("took: %s", elapsed) + } } func processPath(pathList []string, fileCh chan<- *file) { diff --git a/internal/php5/parser.go b/internal/php5/parser.go index c0e2ac4..fe3e295 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -41,41 +41,41 @@ func NewParser(src []byte, v string, withTokens bool) *Parser { } // Lex proxy to scanner Lex -func (l *Parser) Lex(lval *yySymType) int { - t := l.Lexer.Lex() +func (p *Parser) Lex(lval *yySymType) int { + t := p.Lexer.Lex() - l.currentToken = t + p.currentToken = t lval.token = t return int(t.ID) } -func (l *Parser) Error(msg string) { - var pos = l.currentToken.Position +func (p *Parser) Error(msg string) { + var pos = p.currentToken.Position - l.errors = append(l.errors, errors.NewError(msg, &pos)) + p.errors = append(p.errors, errors.NewError(msg, &pos)) } // GetErrors returns errors list -func (l *Parser) GetErrors() []*errors.Error { - return l.errors +func (p *Parser) GetErrors() []*errors.Error { + return p.errors } // Parse the php7 Parser entrypoint -func (l *Parser) Parse() int { +func (p *Parser) Parse() int { // init - l.errors = nil - l.rootNode = nil - l.positionBuilder = &positionbuilder.PositionBuilder{} + p.errors = nil + p.rootNode = nil + p.positionBuilder = &positionbuilder.PositionBuilder{} // parse - return yyParse(l) + return yyParse(p) } // GetRootNode returns root node -func (l *Parser) GetRootNode() ast.Vertex { - return l.rootNode +func (p *Parser) GetRootNode() ast.Vertex { + return p.rootNode } // helpers @@ -87,16 +87,12 @@ func lastNode(nn []ast.Vertex) ast.Vertex { return nn[len(nn)-1] } -func firstNode(nn []ast.Vertex) ast.Vertex { - return nn[0] -} - func isDollar(r rune) bool { return r == '$' } -func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.withTokens == false { +func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { + if p.withTokens == false { return } @@ -104,12 +100,12 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { return } - l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + p.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) delete(src.GetNode().Tokens, token.Start) } -func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.withTokens == false { +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, strings []token.Token) { + if p.withTokens == false { return } @@ -122,11 +118,11 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok *dstCollection = make(token.Collection) } - (*dstCollection)[p] = strings + (*dstCollection)[pos] = strings } -func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.withTokens == false { +func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { + if p.withTokens == false { return []token.Token{} } @@ -138,12 +134,12 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } } -func (l *Parser) addDollarToken(v ast.Vertex) { - if l.withTokens == false { +func (p *Parser) addDollarToken(v ast.Vertex) { + if p.withTokens == false { return } - l.setFreeFloating(v, token.Dollar, []token.Token{ + p.setFreeFloating(v, token.Dollar, []token.Token{ { ID: token.ID('$'), Value: []byte("$"), @@ -151,8 +147,8 @@ func (l *Parser) addDollarToken(v ast.Vertex) { }) } -func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.withTokens == false { +func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { + if p.withTokens == false { return } @@ -163,7 +159,7 @@ func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloating(prevNode, token.SemiColon, []token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -192,7 +188,7 @@ func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. Value: semiColon[0].Value[vlen-tlen:], }) - l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) + p.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/php7/parser.go b/internal/php7/parser.go index f34ddc4..1b3c0a6 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -85,10 +85,6 @@ func lastNode(nn []ast.Vertex) ast.Vertex { return nn[len(nn)-1] } -func firstNode(nn []ast.Vertex) ast.Vertex { - return nn[0] -} - func isDollar(r rune) bool { return r == '$' } @@ -106,8 +102,8 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { delete(src.GetNode().Tokens, token.Start) } -func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []token.Token) { - if l.withTokens == false { +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, strings []token.Token) { + if p.withTokens == false { return } @@ -120,7 +116,7 @@ func (l *Parser) setFreeFloating(dst ast.Vertex, p token.Position, strings []tok *dstCollection = make(token.Collection) } - (*dstCollection)[p] = strings + (*dstCollection)[pos] = strings } func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { From 7eff83624ea2b9cb045ddaf46106aa6645f53a74 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 29 Jun 2020 14:38:10 +0300 Subject: [PATCH 023/140] [refactoring] internal position package --- internal/php5/parser.go | 13 +- internal/php5/php5.go | Bin 353481 -> 342054 bytes internal/php5/php5.y | 1005 +++++++++-------- internal/php7/parser.go | 13 +- internal/php7/php7.go | Bin 288939 -> 280801 bytes internal/php7/php7.y | 719 ++++++------ internal/position/position.go | 204 ++++ .../position_test.go} | 40 +- internal/positionbuilder/position_builder.go | 207 ---- 9 files changed, 1079 insertions(+), 1122 deletions(-) create mode 100644 internal/position/position.go rename internal/{positionbuilder/position_builder_test.go => position/position_test.go} (90%) delete mode 100644 internal/positionbuilder/position_builder.go diff --git a/internal/php5/parser.go b/internal/php5/parser.go index fe3e295..19702d0 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" - "github.com/z7zmey/php-parser/internal/positionbuilder" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -13,12 +12,11 @@ import ( // Parser structure type Parser struct { - Lexer *scanner.Lexer - currentToken *scanner.Token - positionBuilder *positionbuilder.PositionBuilder - rootNode ast.Vertex - errors []*errors.Error - withTokens bool + Lexer *scanner.Lexer + currentToken *scanner.Token + rootNode ast.Vertex + errors []*errors.Error + withTokens bool } // NewParser creates and returns new Parser @@ -66,7 +64,6 @@ func (p *Parser) Parse() int { // init p.errors = nil p.rootNode = nil - p.positionBuilder = &positionbuilder.PositionBuilder{} // parse diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a087602c1c796d9be2c5162e8bb4bb707e8d53b3..22e8d54e951aceb2210da573ee1977d0171e989c 100644 GIT binary patch delta 18421 zcmbtcd3;UR_W$g?&q*YNgoq(zGS5jw%*2!g5kU+sAu-RAQmwH`_0eB71eMj6n)*%=v(o9cTIKiM``mlaxi^<;fB$gL*=w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&jJSx}I)q%`>a6wCtbw zs5`3yoL=9C@5|UTU!XN8$Ls*5$G2492~&^{%0I>T5iDFDZsX4Eb9S5R7eKV$H26kd z7;x8oOB{ejdrsC*4+#B<>n-CBf_0?WifUxpvzJbMVkU^cL-NE9&d;5l5r@TI9`%{5 zX8xT~@N_dS{j5;#5=Zv`u!D0wa7%WT5F=Ny0)KaE7}{Q7C!o5I>lryl#Y+1A~HEVsy%Z_S{;@Ydgdd-mk)H?Xe=++2Ez zFl0~V{I#zyS#8gmdnHsU{FRI9erImTb3Y!y(VMx~%Su@vUoh7S2s~e*)N%oAYe!L{ z7vdB8@q6hY@*hbNmAeAczYr;-;yQx{J4!Q94i98Ma7r;ROUrhA{SlMgX|GLJM@y$_`b=TZwrvftY za$av}MwfoYlqL3(DsI6C(z<)5`T~5OJ%1l4X~ZLhFV3Ik>Ppieh zuY*`yCyKlLae!DiO1QeIoie_CimH@$B_J=zP7zNOoAXhIHGYd56B$lbxg37LLs_%;~(6g(LR&jaScuo4L zs-AGyD5knIq2<-p!V!eKM!$x*lPY00xoIfWbKSUnyi67XSbN diff --git a/internal/php5/php5.y b/internal/php5/php5.y index cb70cfe..7b05f37 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5,9 +5,10 @@ import ( "bytes" "strconv" - "github.com/z7zmey/php-parser/pkg/token" - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/internal/position" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" ) %} @@ -275,7 +276,7 @@ start: top_statement_list { yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} - yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + yylex.(*Parser).rootNode.GetNode().Position = position.NewNodeListPosition($1) yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Hidden) @@ -312,7 +313,7 @@ namespace_name: $$ = []ast.Vertex{namePart} // save position - namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + namePart.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Hidden) @@ -325,7 +326,7 @@ namespace_name: $$ = append($1, namePart) // save position - namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + namePart.GetNode().Position = position.NewTokenPosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -366,7 +367,7 @@ top_statement: $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -383,8 +384,8 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -400,8 +401,8 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, name, $4} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -416,7 +417,7 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -430,7 +431,7 @@ top_statement: $$ = &ast.StmtUseList{ast.Node{}, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -445,8 +446,8 @@ top_statement: $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + useType.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -462,8 +463,8 @@ top_statement: $$ = &ast.StmtUseList{ast.Node{}, useType, $3} // save position - useType.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + useType.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -478,7 +479,7 @@ top_statement: $$ = $1 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Hidden) @@ -513,8 +514,8 @@ use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -528,9 +529,9 @@ use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($1) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -545,8 +546,8 @@ use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewNodeListPosition($2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -562,9 +563,9 @@ use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) + name.GetNode().Position = position.NewNodeListPosition($2) + alias.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -602,8 +603,8 @@ use_function_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -617,9 +618,9 @@ use_function_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($1) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -634,8 +635,8 @@ use_function_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewNodeListPosition($2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -651,9 +652,9 @@ use_function_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) + name.GetNode().Position = position.NewNodeListPosition($2) + alias.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -691,8 +692,8 @@ use_const_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -706,9 +707,9 @@ use_const_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($1) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -723,8 +724,8 @@ use_const_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewNodeListPosition($2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -740,9 +741,9 @@ use_const_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($2, $4) + name.GetNode().Position = position.NewNodeListPosition($2) + alias.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -766,9 +767,9 @@ constant_declaration: $$ = $1 // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, constList.Consts) + name.GetNode().Position = position.NewTokenPosition($3) + constant.GetNode().Position = position.NewTokenNodePosition($3, $5) + $$.GetNode().Position = position.NewNodeNodeListPosition($1, constList.Consts) // save comments yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Hidden) @@ -785,9 +786,9 @@ constant_declaration: $$ = &ast.StmtConstList{ast.Node{}, constList} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, constList) + name.GetNode().Position = position.NewTokenPosition($2) + constant.GetNode().Position = position.NewTokenNodePosition($2, $4) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, constList) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -852,7 +853,7 @@ inner_statement: $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -879,8 +880,8 @@ statement: $$ = &ast.StmtLabel{ast.Node{}, label} // save position - label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + label.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -896,7 +897,7 @@ unticked_statement: $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -910,11 +911,11 @@ unticked_statement: // save position if $5 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) } else if len($4) > 0 { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $4) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $4) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) } // save comments @@ -934,8 +935,8 @@ unticked_statement: $$ = &ast.StmtAltIf{ast.Node{}, $2, stmts, $5, $6} // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + stmts.GetNode().Position = position.NewNodeListPosition($4) + $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -964,7 +965,7 @@ unticked_statement: $$ = $3 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -982,7 +983,7 @@ unticked_statement: $$ = &ast.StmtDo{ast.Node{}, $2, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1014,7 +1015,7 @@ unticked_statement: $$ = $9 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1039,7 +1040,7 @@ unticked_statement: $$ = $3 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1057,7 +1058,7 @@ unticked_statement: $$ = &ast.StmtBreak{ast.Node{}, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1071,7 +1072,7 @@ unticked_statement: $$ = &ast.StmtBreak{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1085,7 +1086,7 @@ unticked_statement: $$ = &ast.StmtContinue{ast.Node{}, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1099,7 +1100,7 @@ unticked_statement: $$ = &ast.StmtContinue{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1113,7 +1114,7 @@ unticked_statement: $$ = &ast.StmtReturn{ast.Node{}, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1127,7 +1128,7 @@ unticked_statement: $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1141,7 +1142,7 @@ unticked_statement: $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1155,7 +1156,7 @@ unticked_statement: $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -1169,7 +1170,7 @@ unticked_statement: $$ = &ast.StmtGlobal{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1183,7 +1184,7 @@ unticked_statement: $$ = &ast.StmtStatic{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1197,7 +1198,7 @@ unticked_statement: $$ = &ast.StmtEcho{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1212,7 +1213,7 @@ unticked_statement: $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1224,7 +1225,7 @@ unticked_statement: $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -1238,7 +1239,7 @@ unticked_statement: $$ = &ast.StmtUnset{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1276,7 +1277,7 @@ unticked_statement: $$ = $8 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) + $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1316,7 +1317,7 @@ unticked_statement: // save position $$ = $8 - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $8) + $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1335,7 +1336,7 @@ unticked_statement: $$.(*ast.StmtDeclare).Consts = $3 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1349,7 +1350,7 @@ unticked_statement: $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1363,9 +1364,9 @@ unticked_statement: // save position if $6 == nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + $$.GetNode().Position = position.NewTokenNodePosition($1, $6) } // save comments @@ -1380,7 +1381,7 @@ unticked_statement: $$ = &ast.StmtThrow{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1395,8 +1396,8 @@ unticked_statement: $$ = &ast.StmtGoto{ast.Node{}, label} // save position - label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + label.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1423,9 +1424,9 @@ catch_statement: $$ = append([]ast.Vertex{catchNode}, $9...) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - catchNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) + catchNode.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Hidden) @@ -1452,7 +1453,7 @@ finally_statement: $$ = &ast.StmtFinally{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1501,9 +1502,9 @@ additional_catch: $$ = &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1592,8 +1593,8 @@ unticked_function_declaration_statement: $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $5, nil, $8} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) + name.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1631,8 +1632,8 @@ unticked_class_declaration_statement: $$ = $1 // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $7) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) @@ -1647,8 +1648,8 @@ unticked_class_declaration_statement: $$ = &ast.StmtInterface{ast.Node{}, name, $3, $5} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1667,7 +1668,7 @@ class_entry_type: $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1680,8 +1681,8 @@ class_entry_type: $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + classModifier.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1694,7 +1695,7 @@ class_entry_type: $$ = &ast.StmtTrait{ast.Node{}, nil, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1707,8 +1708,8 @@ class_entry_type: $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} // save position - classModifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + classModifier.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1730,7 +1731,7 @@ extends_from: $$ = &ast.StmtClassExtends{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1758,7 +1759,7 @@ interface_extends_list: $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1779,7 +1780,7 @@ implements_list: $$ = &ast.StmtClassImplements{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1836,7 +1837,7 @@ foreach_variable: $$ = &ast.ExprReference{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1848,7 +1849,7 @@ foreach_variable: $$ = &ast.ExprList{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1865,7 +1866,7 @@ for_statement: $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1875,8 +1876,8 @@ for_statement: $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1894,7 +1895,7 @@ foreach_statement: $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1904,8 +1905,8 @@ foreach_statement: $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1924,7 +1925,7 @@ declare_statement: $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1934,8 +1935,8 @@ declare_statement: $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1956,8 +1957,8 @@ declare_list: $$ = []ast.Vertex{constant} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + name.GetNode().Position = position.NewTokenPosition($1) + constant.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Hidden) @@ -1972,8 +1973,8 @@ declare_list: $$ = append($1, constant) // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + name.GetNode().Position = position.NewTokenPosition($3) + constant.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -1992,8 +1993,8 @@ switch_case_list: $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + caseList.GetNode().Position = position.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) @@ -2007,8 +2008,8 @@ switch_case_list: $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + caseList.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) @@ -2023,8 +2024,8 @@ switch_case_list: $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + caseList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -2041,8 +2042,8 @@ switch_case_list: $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + caseList.GetNode().Position = position.NewNodeListPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -2069,7 +2070,7 @@ case_list: $$ = append($1, _case) // save position - _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) + _case.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Hidden) @@ -2084,7 +2085,7 @@ case_list: $$ = append($1, _default) // save position - _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + _default.GetNode().Position = position.NewTokenNodeListPosition($2, $4) // save comments yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Hidden) @@ -2114,7 +2115,7 @@ while_statement: $$ = &ast.StmtWhile{ast.Node{}, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2124,8 +2125,8 @@ while_statement: $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -2152,7 +2153,7 @@ elseif_list: $$ = append($1, _elseIf) // save position - _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) + _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $4) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) @@ -2182,8 +2183,8 @@ new_elseif_list: $$ = append($1, _elseIf) // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($5) - _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) + stmts.GetNode().Position = position.NewNodeListPosition($5) + _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) @@ -2212,7 +2213,7 @@ else_single: $$ = &ast.StmtElse{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2235,8 +2236,8 @@ new_else_single: $$ = &ast.StmtAltElse{ast.Node{}, stmts} // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + stmts.GetNode().Position = position.NewNodeListPosition($3) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2288,16 +2289,16 @@ parameter: $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) + $$.GetNode().Position = position.NewTokensPosition($2, $4) } else if $3 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) + $$.GetNode().Position = position.NewTokensPosition($3, $4) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = position.NewTokenPosition($4) } // save comments @@ -2333,16 +2334,16 @@ parameter: $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + $$.GetNode().Position = position.NewNodesPosition($1, $6) } else if $2 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + $$.GetNode().Position = position.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) + $$.GetNode().Position = position.NewTokenNodePosition($3, $6) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) + $$.GetNode().Position = position.NewTokenNodePosition($4, $6) } // save comments @@ -2387,7 +2388,7 @@ optional_class_type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2399,7 +2400,7 @@ optional_class_type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2421,7 +2422,7 @@ function_call_parameter_list: $$ = &ast.ArgumentList{ast.Node{}, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2434,7 +2435,7 @@ function_call_parameter_list: $$ = &ast.ArgumentList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2448,8 +2449,8 @@ function_call_parameter_list: $$ = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} // save position - arg.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + arg.GetNode().Position = position.NewNodePosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2484,7 +2485,7 @@ function_call_parameter: $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2496,7 +2497,7 @@ function_call_parameter: $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2508,7 +2509,7 @@ function_call_parameter: $$ = &ast.Argument{ast.Node{}, false, true, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + $$.GetNode().Position = position.NewNodePosition($2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2520,7 +2521,7 @@ function_call_parameter: $$ = &ast.Argument{ast.Node{}, true, false, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2555,8 +2556,8 @@ global_var: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2569,7 +2570,7 @@ global_var: $$ = &ast.ExprVariable{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2582,7 +2583,7 @@ global_var: $$ = &ast.ExprVariable{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2604,9 +2605,9 @@ static_var_list: $$ = append($1, staticVar) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + identifier.GetNode().Position = position.NewTokenPosition($3) + variable.GetNode().Position = position.NewTokenPosition($3) + staticVar.GetNode().Position = position.NewTokenPosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -2623,9 +2624,9 @@ static_var_list: $$ = append($1, staticVar) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + identifier.GetNode().Position = position.NewTokenPosition($3) + variable.GetNode().Position = position.NewTokenPosition($3) + staticVar.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -2643,9 +2644,9 @@ static_var_list: $$ = []ast.Vertex{staticVar} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + staticVar.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).addDollarToken(variable) @@ -2661,9 +2662,9 @@ static_var_list: $$ = []ast.Vertex{staticVar} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - staticVar.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + staticVar.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).addDollarToken(variable) @@ -2697,7 +2698,7 @@ class_statement: $$ = &ast.StmtPropertyList{ast.Node{}, $1, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -2711,7 +2712,7 @@ class_statement: $$ = $1 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Hidden) @@ -2731,11 +2732,11 @@ class_statement: $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $6, nil, $8} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + name.GetNode().Position = position.NewTokenPosition($4) if $1 == nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $8) + $$.GetNode().Position = position.NewTokenNodePosition($2, $8) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $8) + $$.GetNode().Position = position.NewNodeListNodePosition($1, $8) } // save comments @@ -2764,7 +2765,7 @@ trait_use_statement: $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2796,7 +2797,7 @@ trait_adaptations: { $$ = &ast.StmtNop{ast.Node{}, } - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2808,7 +2809,7 @@ trait_adaptations: { $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2877,7 +2878,7 @@ trait_precedence: $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) + $$.GetNode().Position = position.NewNodeNodeListPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2912,8 +2913,8 @@ trait_method_reference: $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2935,8 +2936,8 @@ trait_method_reference_fully_qualified: $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2954,8 +2955,8 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} // save position - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + alias.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2969,7 +2970,7 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3000,7 +3001,7 @@ method_body: $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3013,7 +3014,7 @@ method_body: $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3036,7 +3037,7 @@ variable_modifiers: $$ = []ast.Vertex{modifier} // save position - modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + modifier.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) @@ -3081,7 +3082,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3093,7 +3094,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3105,7 +3106,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3117,7 +3118,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3129,7 +3130,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3141,7 +3142,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3159,9 +3160,9 @@ class_variable_declaration: $$ = append($1, property) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + identifier.GetNode().Position = position.NewTokenPosition($3) + variable.GetNode().Position = position.NewTokenPosition($3) + property.GetNode().Position = position.NewTokenPosition($3) // save comments yylex.(*Parser).addDollarToken(variable) @@ -3178,9 +3179,9 @@ class_variable_declaration: $$ = append($1, property) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) + identifier.GetNode().Position = position.NewTokenPosition($3) + variable.GetNode().Position = position.NewTokenPosition($3) + property.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -3198,9 +3199,9 @@ class_variable_declaration: $$ = []ast.Vertex{property} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + property.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).addDollarToken(variable) @@ -3216,9 +3217,9 @@ class_variable_declaration: $$ = []ast.Vertex{property} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - property.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + property.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).addDollarToken(variable) @@ -3240,9 +3241,9 @@ class_constant_declaration: $$ = $1 // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $5) - $1.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + name.GetNode().Position = position.NewTokenPosition($3) + constant.GetNode().Position = position.NewTokenNodePosition($3, $5) + $1.GetNode().Position = position.NewNodesPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Hidden) @@ -3258,9 +3259,9 @@ class_constant_declaration: $$ = &ast.StmtClassConstList{ast.Node{}, nil, []ast.Vertex{constant}} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - constant.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + name.GetNode().Position = position.NewTokenPosition($2) + constant.GetNode().Position = position.NewTokenNodePosition($2, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3345,7 +3346,7 @@ chaining_dereference: $$ = append($1, fetch) // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + fetch.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) @@ -3359,7 +3360,7 @@ chaining_dereference: $$ = []ast.Vertex{fetch} // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($2) + fetch.GetNode().Position = position.NewNodePosition($2) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) @@ -3411,10 +3412,10 @@ new_expr: if $3 != nil { $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) } else { $$ = &ast.ExprNew{ast.Node{}, $2, nil} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) } // save comments @@ -3431,8 +3432,8 @@ expr_without_variable: $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position - listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + listNode.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3447,7 +3448,7 @@ expr_without_variable: $$ = &ast.ExprAssign{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3460,7 +3461,7 @@ expr_without_variable: $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3482,11 +3483,11 @@ expr_without_variable: // save position if $6 != nil { - _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) + _new.GetNode().Position = position.NewTokenNodePosition($4, $6) } else { - _new.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $5) + _new.GetNode().Position = position.NewTokenNodePosition($4, $5) } - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, _new) + $$.GetNode().Position = position.NewNodesPosition($1, _new) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3501,7 +3502,7 @@ expr_without_variable: $$ = &ast.ExprClone{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3513,7 +3514,7 @@ expr_without_variable: $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) @@ -3525,7 +3526,7 @@ expr_without_variable: $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3538,7 +3539,7 @@ expr_without_variable: $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3551,7 +3552,7 @@ expr_without_variable: $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3564,7 +3565,7 @@ expr_without_variable: $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3577,7 +3578,7 @@ expr_without_variable: $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3590,7 +3591,7 @@ expr_without_variable: $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3603,7 +3604,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3616,7 +3617,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3629,7 +3630,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3642,7 +3643,7 @@ expr_without_variable: $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3655,7 +3656,7 @@ expr_without_variable: $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3668,7 +3669,7 @@ expr_without_variable: $$ = &ast.ExprPostInc{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3681,7 +3682,7 @@ expr_without_variable: $$ = &ast.ExprPreInc{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3693,7 +3694,7 @@ expr_without_variable: $$ = &ast.ExprPostDec{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3706,7 +3707,7 @@ expr_without_variable: $$ = &ast.ExprPreDec{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3718,7 +3719,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3731,7 +3732,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3744,7 +3745,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3757,7 +3758,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3770,7 +3771,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3783,7 +3784,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3796,7 +3797,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3809,7 +3810,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3822,7 +3823,7 @@ expr_without_variable: $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3835,7 +3836,7 @@ expr_without_variable: $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3848,7 +3849,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3861,7 +3862,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3874,7 +3875,7 @@ expr_without_variable: $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3887,7 +3888,7 @@ expr_without_variable: $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3900,7 +3901,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3913,7 +3914,7 @@ expr_without_variable: $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3926,7 +3927,7 @@ expr_without_variable: $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3939,7 +3940,7 @@ expr_without_variable: $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3951,7 +3952,7 @@ expr_without_variable: $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3963,7 +3964,7 @@ expr_without_variable: $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3975,7 +3976,7 @@ expr_without_variable: $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3987,7 +3988,7 @@ expr_without_variable: $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4000,7 +4001,7 @@ expr_without_variable: $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4013,7 +4014,7 @@ expr_without_variable: $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4026,7 +4027,7 @@ expr_without_variable: $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4040,7 +4041,7 @@ expr_without_variable: $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4053,7 +4054,7 @@ expr_without_variable: $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4066,7 +4067,7 @@ expr_without_variable: $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4079,7 +4080,7 @@ expr_without_variable: $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4092,7 +4093,7 @@ expr_without_variable: $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4142,7 +4143,7 @@ expr_without_variable: } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, n) + $$.GetNode().Position = position.NewNodesPosition($$, n) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4152,7 +4153,7 @@ expr_without_variable: $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + $$.GetNode().Position = position.NewNodesPosition($1, $5) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4166,7 +4167,7 @@ expr_without_variable: $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4186,7 +4187,7 @@ expr_without_variable: $$ = &ast.ExprCastInt{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4199,7 +4200,7 @@ expr_without_variable: $$ = &ast.ExprCastDouble{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4212,7 +4213,7 @@ expr_without_variable: $$ = &ast.ExprCastString{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4225,7 +4226,7 @@ expr_without_variable: $$ = &ast.ExprCastArray{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4238,7 +4239,7 @@ expr_without_variable: $$ = &ast.ExprCastObject{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4251,7 +4252,7 @@ expr_without_variable: $$ = &ast.ExprCastBool{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4264,7 +4265,7 @@ expr_without_variable: $$ = &ast.ExprCastUnset{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4283,9 +4284,9 @@ expr_without_variable: // save position if $2.GetNode().Position == nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) } // save comments @@ -4298,7 +4299,7 @@ expr_without_variable: $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4328,7 +4329,7 @@ expr_without_variable: $$ = &ast.ExprShellExec{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4340,7 +4341,7 @@ expr_without_variable: $$ = &ast.ExprPrint{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4352,7 +4353,7 @@ expr_without_variable: $$ = &ast.ExprYield{ast.Node{}, nil, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4364,7 +4365,7 @@ expr_without_variable: $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $4, $6, nil, $8} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $9) + $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4390,7 +4391,7 @@ expr_without_variable: $$ = &ast.ExprClosure{ast.Node{}, $3 != nil, true, $5, $7, nil, $9} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $10) + $$.GetNode().Position = position.NewTokensPosition($1, $10) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4420,7 +4421,7 @@ yield_expr: $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4432,7 +4433,7 @@ yield_expr: $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4444,7 +4445,7 @@ yield_expr: $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4457,7 +4458,7 @@ yield_expr: $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4473,7 +4474,7 @@ combined_scalar_offset: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4487,7 +4488,7 @@ combined_scalar_offset: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4502,8 +4503,8 @@ combined_scalar_offset: $$ = &ast.ExprArrayDimFetch{ast.Node{}, str, $3} // save position - str.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition(str, $4) + str.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewNodeTokenPosition(str, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4517,7 +4518,7 @@ combined_scalar_offset: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4534,7 +4535,7 @@ combined_scalar: $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4548,7 +4549,7 @@ combined_scalar: $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4577,7 +4578,7 @@ lexical_vars: $$ = &ast.ExprClosureUse{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4596,8 +4597,8 @@ lexical_var_list: $$ = append($1, variable) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + identifier.GetNode().Position = position.NewTokenPosition($3) + variable.GetNode().Position = position.NewTokenPosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -4614,9 +4615,9 @@ lexical_var_list: $$ = append($1, reference) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) + reference.GetNode().Position = position.NewTokensPosition($3, $4) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -4633,8 +4634,8 @@ lexical_var_list: $$ = []ast.Vertex{variable} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Hidden) @@ -4650,9 +4651,9 @@ lexical_var_list: $$ = []ast.Vertex{reference} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + identifier.GetNode().Position = position.NewTokenPosition($2) + variable.GetNode().Position = position.NewTokenPosition($2) + reference.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Hidden) @@ -4670,8 +4671,8 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, name, $2.(*ast.ArgumentList)} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(name, $2) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodesPosition(name, $2) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4684,8 +4685,8 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $4.(*ast.ArgumentList)} // save position - funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $4) + funcName.GetNode().Position = position.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition(funcName, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4699,8 +4700,8 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, funcName, $3.(*ast.ArgumentList)} // save position - funcName.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(funcName, $3) + funcName.GetNode().Position = position.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewNodesPosition(funcName, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4712,7 +4713,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4725,7 +4726,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4738,7 +4739,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4751,7 +4752,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4764,7 +4765,7 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + $$.GetNode().Position = position.NewNodesPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4779,7 +4780,7 @@ class_name: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4791,7 +4792,7 @@ class_name: $$ = &ast.NameName{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4803,7 +4804,7 @@ class_name: $$ = &ast.NameRelative{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4816,7 +4817,7 @@ class_name: $$ = &ast.NameFullyQualified{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4831,7 +4832,7 @@ fully_qualified_class_name: $$ = &ast.NameName{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -4843,7 +4844,7 @@ fully_qualified_class_name: $$ = &ast.NameRelative{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4856,7 +4857,7 @@ fully_qualified_class_name: $$ = &ast.NameFullyQualified{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4892,13 +4893,13 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } @@ -4908,13 +4909,13 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } @@ -4971,7 +4972,7 @@ exit_expr: $$ = &ast.ExprExit{ast.Node{}, false, nil}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) @@ -4985,9 +4986,9 @@ exit_expr: // save position if bytes.Compare(yylex.(*Parser).currentToken.Value, []byte(")")) == 0 { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition(yylex.(*Parser).currentToken) + $$.GetNode().Position = position.NewTokenPosition(yylex.(*Parser).currentToken) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5011,7 +5012,7 @@ backticks_expr: $$ = []ast.Vertex{part} // save position - part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + part.GetNode().Position = position.NewTokenPosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5044,7 +5045,7 @@ common_scalar: $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5056,7 +5057,7 @@ common_scalar: $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5068,7 +5069,7 @@ common_scalar: $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5080,7 +5081,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5092,7 +5093,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5104,7 +5105,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5116,7 +5117,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5128,7 +5129,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5140,7 +5141,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5152,7 +5153,7 @@ common_scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5165,8 +5166,8 @@ common_scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + encapsed.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5178,7 +5179,7 @@ common_scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5194,8 +5195,8 @@ static_class_constant: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5234,8 +5235,8 @@ static_scalar_value: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5248,8 +5249,8 @@ static_scalar_value: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + name.GetNode().Position = position.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5263,8 +5264,8 @@ static_scalar_value: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + name.GetNode().Position = position.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5276,7 +5277,7 @@ static_scalar_value: $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5290,7 +5291,7 @@ static_scalar_value: $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5309,7 +5310,7 @@ static_scalar_value: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5330,7 +5331,7 @@ static_operation: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5344,7 +5345,7 @@ static_operation: $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5357,7 +5358,7 @@ static_operation: $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5370,7 +5371,7 @@ static_operation: $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5383,7 +5384,7 @@ static_operation: $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5396,7 +5397,7 @@ static_operation: $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5409,7 +5410,7 @@ static_operation: $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5422,7 +5423,7 @@ static_operation: $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5434,7 +5435,7 @@ static_operation: $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5446,7 +5447,7 @@ static_operation: $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5459,7 +5460,7 @@ static_operation: $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5472,7 +5473,7 @@ static_operation: $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5485,7 +5486,7 @@ static_operation: $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5498,7 +5499,7 @@ static_operation: $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5511,7 +5512,7 @@ static_operation: $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5524,7 +5525,7 @@ static_operation: $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5537,7 +5538,7 @@ static_operation: $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5550,7 +5551,7 @@ static_operation: $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5563,7 +5564,7 @@ static_operation: $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5576,7 +5577,7 @@ static_operation: $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5589,7 +5590,7 @@ static_operation: $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5602,7 +5603,7 @@ static_operation: $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5615,7 +5616,7 @@ static_operation: $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5628,7 +5629,7 @@ static_operation: $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5642,7 +5643,7 @@ static_operation: $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5655,7 +5656,7 @@ static_operation: $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5668,7 +5669,7 @@ static_operation: $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5681,7 +5682,7 @@ static_operation: $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5694,7 +5695,7 @@ static_operation: $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5708,7 +5709,7 @@ static_operation: $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + $$.GetNode().Position = position.NewNodesPosition($1, $5) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5722,7 +5723,7 @@ static_operation: $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5734,7 +5735,7 @@ static_operation: $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5766,8 +5767,8 @@ general_constant: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodePosition(name) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -5780,8 +5781,8 @@ general_constant: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + name.GetNode().Position = position.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewNodePosition(name) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5795,8 +5796,8 @@ general_constant: $$ = &ast.ExprConstFetch{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(name) + name.GetNode().Position = position.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewNodePosition(name) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5812,8 +5813,8 @@ scalar: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5843,7 +5844,7 @@ scalar: $$ = &ast.ScalarEncapsed{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5855,7 +5856,7 @@ scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5867,7 +5868,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5914,7 +5915,7 @@ non_empty_static_array_pair_list: $$ = append($1, arrayItem) // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -5929,7 +5930,7 @@ non_empty_static_array_pair_list: $$ = append($1, arrayItem) // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -5943,7 +5944,7 @@ non_empty_static_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + arrayItem.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -5957,7 +5958,7 @@ non_empty_static_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + arrayItem.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6062,19 +6063,19 @@ variable: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprMethodCall: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } @@ -6084,19 +6085,19 @@ variable: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprMethodCall: nn.Var = $$ - nn.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($$, nn) + nn.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } @@ -6152,7 +6153,7 @@ array_method_dereference: $$ = append($1, fetch) // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + fetch.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) @@ -6166,7 +6167,7 @@ array_method_dereference: $$ = []ast.Vertex{$1, fetch} // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + fetch.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) @@ -6182,7 +6183,7 @@ method: $$ = &ast.ExprMethodCall{ast.Node{}, nil, nil, $1.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6221,7 +6222,7 @@ variable_without_objects: $1.last.VarName = $2 for _, n := range($1.all) { - n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) + n.GetNode().Position = position.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6236,7 +6237,7 @@ static_member: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6249,7 +6250,7 @@ static_member: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6274,7 +6275,7 @@ array_function_dereference: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6288,7 +6289,7 @@ array_function_dereference: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6333,7 +6334,7 @@ base_variable: $1.last.VarName = $2 for _, n := range($1.all) { - n.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition(n, $2) + n.GetNode().Position = position.NewNodesPosition(n, $2) } $$ = $1.all[0] @@ -6354,7 +6355,7 @@ reference_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6368,7 +6369,7 @@ reference_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6393,8 +6394,8 @@ compound_variable: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6407,7 +6408,7 @@ compound_variable: $$ = &ast.ExprVariable{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6448,7 +6449,7 @@ object_property: $$ = []ast.Vertex{fetch} // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + fetch.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6461,7 +6462,7 @@ object_dim_list: $$ = append($1, fetch) // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + fetch.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) @@ -6475,7 +6476,7 @@ object_dim_list: $$ = append($1, fetch) // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + fetch.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) @@ -6489,7 +6490,7 @@ object_dim_list: $$ = []ast.Vertex{fetch} // save position - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + fetch.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6501,7 +6502,7 @@ variable_name: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6513,7 +6514,7 @@ variable_name: $$ = $2 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) @@ -6530,7 +6531,7 @@ simple_indirect_reference: $$ = simpleIndirectReference{[]*ast.ExprVariable{n}, n} // save position - n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + n.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(n, token.Start, $1.Hidden) @@ -6548,7 +6549,7 @@ simple_indirect_reference: $$ = $1 // save position - n.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + n.GetNode().Position = position.NewTokenPosition($2) // save comments yylex.(*Parser).setFreeFloating(n, token.Start, $2.Hidden) @@ -6591,7 +6592,7 @@ assignment_list_element: $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -6604,8 +6605,8 @@ assignment_list_element: $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} // save position - listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition(listNode) + listNode.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewNodePosition(listNode) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6654,7 +6655,7 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $5) + arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -6669,7 +6670,7 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($3) + arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -6683,7 +6684,7 @@ non_empty_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + arrayItem.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6697,7 +6698,7 @@ non_empty_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + arrayItem.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6711,8 +6712,8 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($5, $6) - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($3, $6) + reference.GetNode().Position = position.NewTokenNodePosition($5, $6) + arrayItem.GetNode().Position = position.NewNodesPosition($3, $6) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -6729,8 +6730,8 @@ non_empty_array_pair_list: $$ = append($1, arrayItem) // save position - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + reference.GetNode().Position = position.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = position.NewTokenNodePosition($3, $4) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -6745,8 +6746,8 @@ non_empty_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + reference.GetNode().Position = position.NewTokenNodePosition($3, $4) + arrayItem.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) @@ -6762,8 +6763,8 @@ non_empty_array_pair_list: $$ = []ast.Vertex{arrayItem} // save position - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) - arrayItem.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + reference.GetNode().Position = position.NewTokenNodePosition($1, $2) + arrayItem.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Hidden) @@ -6785,7 +6786,7 @@ encaps_list: $$ = append($1, encapsed) // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) @@ -6804,7 +6805,7 @@ encaps_list: $$ = []ast.Vertex{encapsed, $2} // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) @@ -6820,8 +6821,8 @@ encaps_var: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6836,9 +6837,9 @@ encaps_var: $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).addDollarToken(variable) @@ -6855,10 +6856,10 @@ encaps_var: $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + fetch.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).addDollarToken(variable) @@ -6874,7 +6875,7 @@ encaps_var: $$ = variable // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -6890,8 +6891,8 @@ encaps_var: $$ = variable // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -6906,9 +6907,9 @@ encaps_var: $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + identifier.GetNode().Position = position.NewTokenPosition($2) + variable.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -6936,7 +6937,7 @@ encaps_var_offset: $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6953,7 +6954,7 @@ encaps_var_offset: } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6966,8 +6967,8 @@ encaps_var_offset: $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6983,7 +6984,7 @@ internal_functions_in_yacc: $$ = &ast.ExprIsset{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -6997,7 +6998,7 @@ internal_functions_in_yacc: $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7011,7 +7012,7 @@ internal_functions_in_yacc: $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7025,7 +7026,7 @@ internal_functions_in_yacc: $$ = &ast.ExprInclude{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7037,7 +7038,7 @@ internal_functions_in_yacc: $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7049,7 +7050,7 @@ internal_functions_in_yacc: $$ = &ast.ExprEval{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7063,7 +7064,7 @@ internal_functions_in_yacc: $$ = &ast.ExprRequire{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7075,7 +7076,7 @@ internal_functions_in_yacc: $$ = &ast.ExprRequireOnce{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -7124,8 +7125,8 @@ class_constant: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -7140,8 +7141,8 @@ class_constant: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -7159,8 +7160,8 @@ static_class_name_scalar: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -7178,8 +7179,8 @@ class_name_scalar: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 1b3c0a6..25f28d5 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -3,7 +3,6 @@ package php7 import ( "bytes" - "github.com/z7zmey/php-parser/internal/positionbuilder" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -12,12 +11,11 @@ import ( // Parser structure type Parser struct { - Lexer *scanner.Lexer - currentToken *scanner.Token - positionBuilder *positionbuilder.PositionBuilder - rootNode ast.Vertex - errors []*errors.Error - withTokens bool + Lexer *scanner.Lexer + currentToken *scanner.Token + rootNode ast.Vertex + errors []*errors.Error + withTokens bool } // NewParser creates and returns new Parser @@ -64,7 +62,6 @@ func (l *Parser) Parse() int { // init l.errors = nil l.rootNode = nil - l.positionBuilder = &positionbuilder.PositionBuilder{} // parse diff --git a/internal/php7/php7.go b/internal/php7/php7.go index ff4af9bee78e4ed3a7cbc4d5294e27f6a990fac8..cccb6d9d9f63af960fc8838cd1b8ec3206146153 100644 GIT binary patch delta 14877 zcmbtbd3;Vs_y5e?8FN7A0t_cHVCKYAyX~QA>Z{nfu&l?vp&Kzu)@@=DBm`%sFSyK4abCYUdYM z+oUt^{Jcrok7wuQzEp*UFTORK#eeV&n^v2}d~mnU=NG(UeSLhUQdA5J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@U8Y{;&2;&-gmSNlLQkXFKHjDl%1frN+)#&Pp5dH7^0lfZ|4L#G|Sh3>Utcmq{ z)UC?Kc4!(#dL~j_Rp@D=3`6x}BDi>i3BZw*6@Xx;Mkpx#Yy8vf8rWJ*gqf86y{JPK z8{!q1|A(n{S(O<|ZMX2gX70zL6{BavL0N*Vi@ZgXY8zX%+JFOaK1JV%*4Ht@ob2h# zEGe#t;$aMxMHpv5{ozPM|7#(Dns45$Z{UaD0;3FBH?@b-0;D>&p%0^szd0k-E(STs zRoqA)ly7W8$cb{sRN*`78>+vi?u4HWm`{+&XgP}HM^FhDtsTTeijIm{%GitPwTBuT zJJnbeeq+J&Ggt+UjIos62Ck${6QkU{5Y)Rsbfi@=xar;mYknMlNuz9q{x_y9znT?m zbn{c=xs;w@G&hgO8d3VXyz-+Z@zPJ3H4}^|u9Ywn!j?2G$!O%{n=2^4wb79lHb;W{ zSJo=GSW)QY7KXOn>wU4<^Sh7toA0F>$ahqta=4X#4>KXnIPIy3pKpuvoOM?8*Gfb= z#mQ}P%!pdhpK5F9D{2ZRF+)WXS04b>YZ->N6-JUkI@!*+V+rPZdqY2vqcC;o2u$wQ m-AT$tP-;MQBJJo5{t$BABHk4%_m7SCruAKo#Qz3NRAdtX diff --git a/internal/php7/php7.y b/internal/php7/php7.y index a929753..16e3936 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -5,9 +5,10 @@ import ( "bytes" "strconv" - "github.com/z7zmey/php-parser/pkg/token" - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/internal/position" + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" ) %} @@ -294,7 +295,7 @@ start: yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} // save position - yylex.(*Parser).rootNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + yylex.(*Parser).rootNode.GetNode().Position = position.NewNodeListPosition($1) yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Hidden) @@ -360,7 +361,7 @@ namespace_name: $$ = []ast.Vertex{namePart} // save position - namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + namePart.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Hidden) @@ -373,7 +374,7 @@ namespace_name: $$ = append($1, namePart) // save position - namePart.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) + namePart.GetNode().Position = position.NewTokenPosition($3) // save comments yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) @@ -389,7 +390,7 @@ name: $$ = &ast.NameName{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -401,7 +402,7 @@ name: $$ = &ast.NameRelative{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $3) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -414,7 +415,7 @@ name: $$ = &ast.NameFullyQualified{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -466,7 +467,7 @@ top_statement: $$ = &ast.StmtHaltCompiler{ast.Node{}} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -483,8 +484,8 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -500,8 +501,8 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, name, $4} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -516,7 +517,7 @@ top_statement: $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -530,7 +531,7 @@ top_statement: $$ = $2 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -545,7 +546,7 @@ top_statement: $$ = $3 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -559,7 +560,7 @@ top_statement: $$ = &ast.StmtUseList{ast.Node{}, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -573,7 +574,7 @@ top_statement: $$ = &ast.StmtUseList{ast.Node{}, $2, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -587,7 +588,7 @@ top_statement: $$ = &ast.StmtConstList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -604,7 +605,7 @@ use_type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -616,7 +617,7 @@ use_type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -632,8 +633,8 @@ group_use_declaration: $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) @@ -653,8 +654,8 @@ group_use_declaration: $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.UseType, $1.Hidden) @@ -678,8 +679,8 @@ mixed_group_use_declaration: $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $4} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $6) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) @@ -699,8 +700,8 @@ mixed_group_use_declaration: $$ = &ast.StmtGroupUse{ast.Node{}, nil, name, $5} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + name.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.Use, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) @@ -805,8 +806,8 @@ unprefixed_use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) + name.GetNode().Position = position.NewNodeListPosition($1) + $$.GetNode().Position = position.NewNodeListPosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) @@ -820,9 +821,9 @@ unprefixed_use_declaration: $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($1) - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $3) + name.GetNode().Position = position.NewNodeListPosition($1) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1[0], name) @@ -941,7 +942,7 @@ inner_statement: $$ = &ast.StmtHaltCompiler{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -959,7 +960,7 @@ statement: $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -991,7 +992,7 @@ statement: $$ = $5 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1005,7 +1006,7 @@ statement: $$ = &ast.StmtDo{ast.Node{}, $2, $5} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1033,7 +1034,7 @@ statement: $$ = $9 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1058,7 +1059,7 @@ statement: $$ = $5 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1072,7 +1073,7 @@ statement: $$ = &ast.StmtBreak{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1086,7 +1087,7 @@ statement: $$ = &ast.StmtContinue{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1100,7 +1101,7 @@ statement: $$ = &ast.StmtReturn{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1114,7 +1115,7 @@ statement: $$ = &ast.StmtGlobal{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1128,7 +1129,7 @@ statement: $$ = &ast.StmtStatic{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1142,7 +1143,7 @@ statement: $$ = &ast.StmtEcho{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1157,7 +1158,7 @@ statement: $$ = &ast.StmtInlineHtml{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1169,7 +1170,7 @@ statement: $$ = &ast.StmtExpression{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -1183,7 +1184,7 @@ statement: $$ = &ast.StmtUnset{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1212,7 +1213,7 @@ statement: $$ = $7 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $7) + $$.GetNode().Position = position.NewTokenNodePosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1239,7 +1240,7 @@ statement: $$ = $9 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1256,7 +1257,7 @@ statement: $$.(*ast.StmtDeclare).Consts = $3 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1270,7 +1271,7 @@ statement: $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1282,10 +1283,10 @@ statement: { if $6 == nil { $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $5) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) } else { $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + $$.GetNode().Position = position.NewTokenNodePosition($1, $6) } // save comments @@ -1300,7 +1301,7 @@ statement: $$ = &ast.StmtThrow{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1315,8 +1316,8 @@ statement: $$ = &ast.StmtGoto{ast.Node{}, label} // save position - label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + label.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1332,8 +1333,8 @@ statement: $$ = &ast.StmtLabel{ast.Node{}, label} // save position - label.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + label.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1357,9 +1358,9 @@ catch_list: $$ = append($1, catch) // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($5) - catch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $9) + identifier.GetNode().Position = position.NewTokenPosition($5) + variable.GetNode().Position = position.NewTokenPosition($5) + catch.GetNode().Position = position.NewTokensPosition($2, $9) // save comments yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Hidden) @@ -1403,7 +1404,7 @@ finally_statement: $$ = &ast.StmtFinally{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1448,8 +1449,8 @@ function_declaration_statement: $$ = &ast.StmtFunction{ast.Node{}, $2 != nil, name, $6, $8, $10} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + name.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $11) // save comments @@ -1506,8 +1507,8 @@ class_declaration_statement: $$ = &ast.StmtClass{ast.Node{}, name, $1, nil, $4, $5, $8} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $9) + name.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewOptionalListTokensPosition($1, $2, $9) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -1524,8 +1525,8 @@ class_declaration_statement: $$ = &ast.StmtClass{ast.Node{}, name, nil, nil, $3, $4, $7} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1558,7 +1559,7 @@ class_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1570,7 +1571,7 @@ class_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1586,8 +1587,8 @@ trait_declaration_statement: $$ = &ast.StmtTrait{ast.Node{}, name, $5} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1606,8 +1607,8 @@ interface_declaration_statement: $$ = &ast.StmtInterface{ast.Node{}, name, $3, $6} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $7) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1631,7 +1632,7 @@ extends_from: $$ = &ast.StmtClassExtends{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1652,7 +1653,7 @@ interface_extends_list: $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1673,7 +1674,7 @@ implements_list: $$ = &ast.StmtClassImplements{ast.Node{}, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $2) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1694,7 +1695,7 @@ foreach_variable: $$ = &ast.ExprReference{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1706,7 +1707,7 @@ foreach_variable: $$ = &ast.ExprList{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1720,7 +1721,7 @@ foreach_variable: $$ = &ast.ExprShortList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save commentsc yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1736,7 +1737,7 @@ for_statement: $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1746,8 +1747,8 @@ for_statement: $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1765,7 +1766,7 @@ foreach_statement: $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1775,8 +1776,8 @@ foreach_statement: $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1794,7 +1795,7 @@ declare_statement: $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1804,8 +1805,8 @@ declare_statement: $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1824,8 +1825,8 @@ switch_case_list: $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + caseList.GetNode().Position = position.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) @@ -1839,8 +1840,8 @@ switch_case_list: $$ = &ast.StmtSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + caseList.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) @@ -1855,8 +1856,8 @@ switch_case_list: $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + caseList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1873,8 +1874,8 @@ switch_case_list: $$ = &ast.StmtAltSwitch{ast.Node{}, nil, caseList} // save position - caseList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + caseList.GetNode().Position = position.NewNodeListPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1900,7 +1901,7 @@ case_list: $$ = append($1, _case) // save position - _case.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $5) + _case.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Hidden) @@ -1915,7 +1916,7 @@ case_list: $$ = append($1, _default) // save position - _default.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) + _default.GetNode().Position = position.NewTokenNodeListPosition($2, $4) // save comments yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Hidden) @@ -1943,7 +1944,7 @@ while_statement: $$ = &ast.StmtWhile{ast.Node{}, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1953,8 +1954,8 @@ while_statement: $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + stmtList.GetNode().Position = position.NewNodeListPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) @@ -1972,7 +1973,7 @@ if_stmt_without_else: $$ = &ast.StmtIf{ast.Node{}, $3, $5, nil, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -1989,8 +1990,8 @@ if_stmt_without_else: $$ = $1 // save position - _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $6) + $$.GetNode().Position = position.NewNodesPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) @@ -2016,8 +2017,8 @@ if_stmt: $$ = $1 // save position - _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + _else.GetNode().Position = position.NewTokenNodePosition($2, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Hidden) @@ -2033,8 +2034,8 @@ alt_if_stmt_without_else: $$ = &ast.StmtAltIf{ast.Node{}, $3, stmts, nil, nil} // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($6) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($1, $6) + stmts.GetNode().Position = position.NewNodeListPosition($6) + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2053,8 +2054,8 @@ alt_if_stmt_without_else: $$ = $1 // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($7) - _elseIf.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $7) + stmts.GetNode().Position = position.NewNodeListPosition($7) + _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $7) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) @@ -2072,7 +2073,7 @@ alt_if_stmt: $$ = $1 // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Hidden) @@ -2090,9 +2091,9 @@ alt_if_stmt: $$ = $1 // save position - stmts.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListPosition($4) - _else.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodeListPosition($2, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + stmts.GetNode().Position = position.NewNodeListPosition($4) + _else.GetNode().Position = position.NewTokenNodeListPosition($2, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Hidden) @@ -2146,16 +2147,16 @@ parameter: $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($2, $4) + $$.GetNode().Position = position.NewTokensPosition($2, $4) } else if $3 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $4) + $$.GetNode().Position = position.NewTokensPosition($3, $4) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + $$.GetNode().Position = position.NewTokenPosition($4) } // save comments @@ -2192,16 +2193,16 @@ parameter: $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + identifier.GetNode().Position = position.NewTokenPosition($4) + variable.GetNode().Position = position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $6) + $$.GetNode().Position = position.NewNodesPosition($1, $6) } else if $2 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $6) + $$.GetNode().Position = position.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $6) + $$.GetNode().Position = position.NewTokenNodePosition($3, $6) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($4, $6) + $$.GetNode().Position = position.NewTokenNodePosition($4, $6) } // save comments @@ -2261,7 +2262,7 @@ type_expr: $$ = &ast.Nullable{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2276,7 +2277,7 @@ type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2288,7 +2289,7 @@ type: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2327,7 +2328,7 @@ argument_list: $$ = &ast.ArgumentList{ast.Node{}, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2340,7 +2341,7 @@ argument_list: $$ = &ast.ArgumentList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2378,7 +2379,7 @@ argument: $$ = &ast.Argument{ast.Node{}, false, false, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2390,7 +2391,7 @@ argument: $$ = &ast.Argument{ast.Node{}, true, false, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2452,9 +2453,9 @@ static_var: $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2469,9 +2470,9 @@ static_var: $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2503,7 +2504,7 @@ class_statement: $$ = &ast.StmtPropertyList{ast.Node{}, $1, $2, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeListTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) @@ -2517,7 +2518,7 @@ class_statement: $$ = &ast.StmtClassConstList{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewOptionalListTokensPosition($1, $2, $4) + $$.GetNode().Position = position.NewOptionalListTokensPosition($1, $2, $4) // save comments if len($1) > 0 { @@ -2536,7 +2537,7 @@ class_statement: $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2549,11 +2550,11 @@ class_statement: $$ = &ast.StmtClassMethod{ast.Node{}, $3 != nil, name, $1, $7, $9, $10} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) + name.GetNode().Position = position.NewTokenPosition($4) if $1 == nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($2, $10) + $$.GetNode().Position = position.NewTokenNodePosition($2, $10) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeListNodePosition($1, $10) + $$.GetNode().Position = position.NewNodeListNodePosition($1, $10) } // save comments @@ -2602,7 +2603,7 @@ trait_adaptations: { $$ = &ast.StmtNop{ast.Node{}, } - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2615,7 +2616,7 @@ trait_adaptations: { $$ = &ast.StmtTraitAdaptationList{ast.Node{}, nil} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2627,7 +2628,7 @@ trait_adaptations: { $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2681,7 +2682,7 @@ trait_precedence: $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeNodeListPosition($1, $3) + $$.GetNode().Position = position.NewNodeNodeListPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2698,8 +2699,8 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} // save position - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2714,8 +2715,8 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} // save position - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + alias.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2730,8 +2731,8 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} // save position - alias.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + alias.GetNode().Position = position.NewTokenPosition($4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2745,7 +2746,7 @@ trait_alias: $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2762,8 +2763,8 @@ trait_method_reference: $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2785,8 +2786,8 @@ absolute_trait_method_reference: $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -2803,7 +2804,7 @@ method_body: $$ = &ast.StmtNop{ast.Node{}, } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2816,7 +2817,7 @@ method_body: $$ = &ast.StmtStmtList{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2839,7 +2840,7 @@ variable_modifiers: $$ = []ast.Vertex{modifier} // save position - modifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + modifier.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) @@ -2884,7 +2885,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2896,7 +2897,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2908,7 +2909,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2920,7 +2921,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2932,7 +2933,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2944,7 +2945,7 @@ member_modifier: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2979,9 +2980,9 @@ property: $$ = &ast.StmtProperty{ast.Node{}, variable, nil} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -2996,9 +2997,9 @@ property: $$ = &ast.StmtProperty{ast.Node{}, variable, $3} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3034,8 +3035,8 @@ class_const_decl: $$ = &ast.StmtConstant{ast.Node{}, name, $3} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3052,8 +3053,8 @@ const_decl: $$ = &ast.StmtConstant{ast.Node{}, name, $3} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3133,7 +3134,7 @@ anonymous_class: } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $8) + $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3149,10 +3150,10 @@ new_expr: { if $3 != nil { $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $3) } else { $$ = &ast.ExprNew{ast.Node{}, $2, nil} - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) } // save comments @@ -3165,7 +3166,7 @@ new_expr: $$ = &ast.ExprNew{ast.Node{}, $2, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3181,8 +3182,8 @@ expr_without_variable: $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position - listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $6) + listNode.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3198,8 +3199,8 @@ expr_without_variable: $$ = &ast.ExprAssign{ast.Node{}, shortList, $5} // save position - shortList.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $5) + shortList.GetNode().Position = position.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3213,7 +3214,7 @@ expr_without_variable: $$ = &ast.ExprAssign{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3226,7 +3227,7 @@ expr_without_variable: $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3240,7 +3241,7 @@ expr_without_variable: $$ = &ast.ExprClone{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3252,7 +3253,7 @@ expr_without_variable: $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3265,7 +3266,7 @@ expr_without_variable: $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3278,7 +3279,7 @@ expr_without_variable: $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3291,7 +3292,7 @@ expr_without_variable: $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3304,7 +3305,7 @@ expr_without_variable: $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3317,7 +3318,7 @@ expr_without_variable: $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3330,7 +3331,7 @@ expr_without_variable: $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3343,7 +3344,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3356,7 +3357,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3369,7 +3370,7 @@ expr_without_variable: $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3382,7 +3383,7 @@ expr_without_variable: $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3395,7 +3396,7 @@ expr_without_variable: $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3408,7 +3409,7 @@ expr_without_variable: $$ = &ast.ExprAssignCoalesce{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3421,7 +3422,7 @@ expr_without_variable: $$ = &ast.ExprPostInc{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3434,7 +3435,7 @@ expr_without_variable: $$ = &ast.ExprPreInc{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3446,7 +3447,7 @@ expr_without_variable: $$ = &ast.ExprPostDec{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $2) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3459,7 +3460,7 @@ expr_without_variable: $$ = &ast.ExprPreDec{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3471,7 +3472,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3484,7 +3485,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3497,7 +3498,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3510,7 +3511,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3523,7 +3524,7 @@ expr_without_variable: $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3536,7 +3537,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3549,7 +3550,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3562,7 +3563,7 @@ expr_without_variable: $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3575,7 +3576,7 @@ expr_without_variable: $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3588,7 +3589,7 @@ expr_without_variable: $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3601,7 +3602,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3614,7 +3615,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3627,7 +3628,7 @@ expr_without_variable: $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3640,7 +3641,7 @@ expr_without_variable: $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3653,7 +3654,7 @@ expr_without_variable: $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3666,7 +3667,7 @@ expr_without_variable: $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3679,7 +3680,7 @@ expr_without_variable: $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3692,7 +3693,7 @@ expr_without_variable: $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3704,7 +3705,7 @@ expr_without_variable: $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3716,7 +3717,7 @@ expr_without_variable: $$ = &ast.ExprBooleanNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3728,7 +3729,7 @@ expr_without_variable: $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3740,7 +3741,7 @@ expr_without_variable: $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3753,7 +3754,7 @@ expr_without_variable: $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3766,7 +3767,7 @@ expr_without_variable: $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3779,7 +3780,7 @@ expr_without_variable: $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3793,7 +3794,7 @@ expr_without_variable: $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3806,7 +3807,7 @@ expr_without_variable: $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3819,7 +3820,7 @@ expr_without_variable: $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3832,7 +3833,7 @@ expr_without_variable: $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3845,7 +3846,7 @@ expr_without_variable: $$ = &ast.ExprBinarySpaceship{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3858,7 +3859,7 @@ expr_without_variable: $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3887,7 +3888,7 @@ expr_without_variable: $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $5) + $$.GetNode().Position = position.NewNodesPosition($1, $5) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3901,7 +3902,7 @@ expr_without_variable: $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3915,7 +3916,7 @@ expr_without_variable: $$ = &ast.ExprBinaryCoalesce{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -3934,7 +3935,7 @@ expr_without_variable: $$ = &ast.ExprCastInt{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3947,7 +3948,7 @@ expr_without_variable: $$ = &ast.ExprCastDouble{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3960,7 +3961,7 @@ expr_without_variable: $$ = &ast.ExprCastString{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3973,7 +3974,7 @@ expr_without_variable: $$ = &ast.ExprCastArray{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3986,7 +3987,7 @@ expr_without_variable: $$ = &ast.ExprCastObject{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -3999,7 +4000,7 @@ expr_without_variable: $$ = &ast.ExprCastBool{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4012,7 +4013,7 @@ expr_without_variable: $$ = &ast.ExprCastUnset{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4037,9 +4038,9 @@ expr_without_variable: // save position if $2 == nil { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) } else { - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) } // save comments @@ -4052,7 +4053,7 @@ expr_without_variable: $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4070,7 +4071,7 @@ expr_without_variable: $$ = &ast.ExprShellExec{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4082,7 +4083,7 @@ expr_without_variable: $$ = &ast.ExprPrint{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4094,7 +4095,7 @@ expr_without_variable: $$ = &ast.ExprYield{ast.Node{}, nil, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4106,7 +4107,7 @@ expr_without_variable: $$ = &ast.ExprYield{ast.Node{}, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4118,7 +4119,7 @@ expr_without_variable: $$ = &ast.ExprYield{ast.Node{}, $2, $4} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $4) + $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4131,7 +4132,7 @@ expr_without_variable: $$ = &ast.ExprYieldFrom{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4156,7 +4157,7 @@ expr_without_variable: }; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) @@ -4172,7 +4173,7 @@ inline_function: $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $5, $7, $8, $10} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $11) + $$.GetNode().Position = position.NewTokensPosition($1, $11) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4204,7 +4205,7 @@ inline_function: $$ = &ast.ExprArrowFunction{ast.Node{}, $2 != nil, false, $4, $6, $9} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $9) + $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4256,7 +4257,7 @@ lexical_vars: $$ = &ast.ExprClosureUse{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4292,8 +4293,8 @@ lexical_var: $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4308,9 +4309,9 @@ lexical_var: $$ = &ast.ExprReference{ast.Node{}, variable} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + identifier.GetNode().Position = position.NewTokenPosition($2) + variable.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4327,7 +4328,7 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + $$.GetNode().Position = position.NewNodesPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4339,7 +4340,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4352,7 +4353,7 @@ function_call: $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4365,7 +4366,7 @@ function_call: $$ = &ast.ExprFunctionCall{ast.Node{}, $1, $2.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $2) + $$.GetNode().Position = position.NewNodesPosition($1, $2) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4380,7 +4381,7 @@ class_name: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4422,7 +4423,7 @@ exit_expr: $$ = &ast.ExprExit{ast.Node{}, false, $2}; // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) @@ -4445,7 +4446,7 @@ backticks_expr: $$ = []ast.Vertex{part} // save position - part.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + part.GetNode().Position = position.NewTokenPosition($1) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4478,7 +4479,7 @@ dereferencable_scalar: $$ = &ast.ExprArray{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4492,7 +4493,7 @@ dereferencable_scalar: $$ = &ast.ExprShortArray{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4505,7 +4506,7 @@ dereferencable_scalar: $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4520,7 +4521,7 @@ scalar: $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4532,7 +4533,7 @@ scalar: $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4544,7 +4545,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4556,7 +4557,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4568,7 +4569,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4580,7 +4581,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4592,7 +4593,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4604,7 +4605,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4616,7 +4617,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4628,7 +4629,7 @@ scalar: $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4641,8 +4642,8 @@ scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + encapsed.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4654,7 +4655,7 @@ scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4666,7 +4667,7 @@ scalar: $$ = &ast.ScalarEncapsed{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4678,7 +4679,7 @@ scalar: $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4705,7 +4706,7 @@ constant: $$ = &ast.ExprConstFetch{ast.Node{}, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4718,8 +4719,8 @@ constant: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4734,8 +4735,8 @@ constant: $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} // save position - target.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $3) + target.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4847,7 +4848,7 @@ callable_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4861,7 +4862,7 @@ callable_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4875,7 +4876,7 @@ callable_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4889,7 +4890,7 @@ callable_variable: $$ = &ast.ExprMethodCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4923,7 +4924,7 @@ variable: $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4940,8 +4941,8 @@ simple_variable: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4954,7 +4955,7 @@ simple_variable: $$ = &ast.ExprVariable{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4969,7 +4970,7 @@ simple_variable: $$ = &ast.ExprVariable{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -4985,7 +4986,7 @@ static_member: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -4998,7 +4999,7 @@ static_member: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5020,7 +5021,7 @@ new_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5034,7 +5035,7 @@ new_variable: $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $4) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5048,7 +5049,7 @@ new_variable: $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5061,7 +5062,7 @@ new_variable: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5074,7 +5075,7 @@ new_variable: $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5090,7 +5091,7 @@ member_name: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5121,7 +5122,7 @@ property_name: $$ = &ast.Identifier{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5202,7 +5203,7 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $3) + $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5215,7 +5216,7 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodePosition($1) + $$.GetNode().Position = position.NewNodePosition($1) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5228,8 +5229,8 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, reference} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodesPosition($1, $4) - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($3, $4) + $$.GetNode().Position = position.NewNodesPosition($1, $4) + reference.GetNode().Position = position.NewTokenNodePosition($3, $4) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5244,8 +5245,8 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) - reference.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) + reference.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5257,7 +5258,7 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, true, nil, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5271,8 +5272,8 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, listNode} // save position - listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($3, $6) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewNodeTokenPosition($1, $6) + listNode.GetNode().Position = position.NewTokensPosition($3, $6) + $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) @@ -5290,8 +5291,8 @@ array_pair: $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} // save position - listNode.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + listNode.GetNode().Position = position.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5315,7 +5316,7 @@ encaps_list: $$ = append($1, encapsed) // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) + encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) @@ -5334,7 +5335,7 @@ encaps_list: $$ = []ast.Vertex{encapsed, $2} // save position - encapsed.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) @@ -5350,8 +5351,8 @@ encaps_var: $$ = &ast.ExprVariable{ast.Node{}, name} // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + name.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5366,9 +5367,9 @@ encaps_var: $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).addDollarToken(variable) @@ -5385,10 +5386,10 @@ encaps_var: $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - fetch.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($3) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + identifier.GetNode().Position = position.NewTokenPosition($1) + variable.GetNode().Position = position.NewTokenPosition($1) + fetch.GetNode().Position = position.NewTokenPosition($3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).addDollarToken(variable) @@ -5404,7 +5405,7 @@ encaps_var: $$ = variable // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -5420,8 +5421,8 @@ encaps_var: $$ = variable // save position - name.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $3) + name.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -5436,9 +5437,9 @@ encaps_var: $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - variable.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($2) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $6) + identifier.GetNode().Position = position.NewTokenPosition($2) + variable.GetNode().Position = position.NewTokenPosition($2) + $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) @@ -5466,7 +5467,7 @@ encaps_var_offset: $$ = &ast.ScalarString{ast.Node{}, $1.Value} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5483,7 +5484,7 @@ encaps_var_offset: } // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5507,9 +5508,9 @@ encaps_var_offset: // save position if isInt { - lnumber.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + lnumber.GetNode().Position = position.NewTokensPosition($1, $2) } - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $2) + $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5522,8 +5523,8 @@ encaps_var_offset: $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position - identifier.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenPosition($1) + identifier.GetNode().Position = position.NewTokenPosition($1) + $$.GetNode().Position = position.NewTokenPosition($1) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5539,7 +5540,7 @@ internal_functions_in_yacc: $$ = &ast.ExprIsset{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $5) + $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5557,7 +5558,7 @@ internal_functions_in_yacc: $$ = &ast.ExprEmpty{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5571,7 +5572,7 @@ internal_functions_in_yacc: $$ = &ast.ExprInclude{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5583,7 +5584,7 @@ internal_functions_in_yacc: $$ = &ast.ExprIncludeOnce{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5595,7 +5596,7 @@ internal_functions_in_yacc: $$ = &ast.ExprEval{ast.Node{}, $3} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokensPosition($1, $4) + $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5609,7 +5610,7 @@ internal_functions_in_yacc: $$ = &ast.ExprRequire{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) @@ -5621,7 +5622,7 @@ internal_functions_in_yacc: $$ = &ast.ExprRequireOnce{ast.Node{}, $2} // save position - $$.GetNode().Position = yylex.(*Parser).positionBuilder.NewTokenNodePosition($1, $2) + $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) diff --git a/internal/position/position.go b/internal/position/position.go new file mode 100644 index 0000000..cbcc309 --- /dev/null +++ b/internal/position/position.go @@ -0,0 +1,204 @@ +package position + +import ( + "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" +) + +type startPos struct { + startLine int + startPos int +} + +type endPos struct { + endLine int + endPos int +} + +func getListStartPos(l []ast.Vertex) startPos { + if l == nil { + return startPos{-1, -1} + } + + if len(l) == 0 { + return startPos{-1, -1} + } + + return getNodeStartPos(l[0]) +} + +func getNodeStartPos(n ast.Vertex) startPos { + sl := -1 + sp := -1 + + if n == nil { + return startPos{-1, -1} + } + + p := n.GetNode().Position + if p != nil { + sl = p.StartLine + sp = p.StartPos + } + + return startPos{sl, sp} +} + +func getListEndPos(l []ast.Vertex) endPos { + if l == nil { + return endPos{-1, -1} + } + + if len(l) == 0 { + return endPos{-1, -1} + } + + return getNodeEndPos(l[len(l)-1]) +} + +func getNodeEndPos(n ast.Vertex) endPos { + el := -1 + ep := -1 + + if n == nil { + return endPos{-1, -1} + } + + p := n.GetNode().Position + if p != nil { + el = p.EndLine + ep = p.EndPos + } + + return endPos{el, ep} +} + +// NewNodeListPosition returns new Position +func NewNodeListPosition(list []ast.Vertex) *position.Position { + return &position.Position{ + StartLine: getListStartPos(list).startLine, + EndLine: getListEndPos(list).endLine, + StartPos: getListStartPos(list).startPos, + EndPos: getListEndPos(list).endPos, + } +} + +// NewNodePosition returns new Position +func NewNodePosition(n ast.Vertex) *position.Position { + return &position.Position{ + StartLine: getNodeStartPos(n).startLine, + EndLine: getNodeEndPos(n).endLine, + StartPos: getNodeStartPos(n).startPos, + EndPos: getNodeEndPos(n).endPos, + } +} + +// NewTokenPosition returns new Position +func NewTokenPosition(t *scanner.Token) *position.Position { + return &position.Position{ + StartLine: t.Position.StartLine, + EndLine: t.Position.EndLine, + StartPos: t.Position.StartPos, + EndPos: t.Position.EndPos, + } +} + +// NewTokensPosition returns new Position +func NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *position.Position { + return &position.Position{ + StartLine: startToken.Position.StartLine, + EndLine: endToken.Position.EndLine, + StartPos: startToken.Position.StartPos, + EndPos: endToken.Position.EndPos, + } +} + +// NewTokenNodePosition returns new Position +func NewTokenNodePosition(t *scanner.Token, n ast.Vertex) *position.Position { + return &position.Position{ + StartLine: t.Position.StartLine, + EndLine: getNodeEndPos(n).endLine, + StartPos: t.Position.StartPos, + EndPos: getNodeEndPos(n).endPos, + } +} + +// NewNodeTokenPosition returns new Position +func NewNodeTokenPosition(n ast.Vertex, t *scanner.Token) *position.Position { + return &position.Position{ + StartLine: getNodeStartPos(n).startLine, + EndLine: t.Position.EndLine, + StartPos: getNodeStartPos(n).startPos, + EndPos: t.Position.EndPos, + } +} + +// NewNodesPosition returns new Position +func NewNodesPosition(startNode ast.Vertex, endNode ast.Vertex) *position.Position { + return &position.Position{ + StartLine: getNodeStartPos(startNode).startLine, + EndLine: getNodeEndPos(endNode).endLine, + StartPos: getNodeStartPos(startNode).startPos, + EndPos: getNodeEndPos(endNode).endPos, + } +} + +// NewNodeListTokenPosition returns new Position +func NewNodeListTokenPosition(list []ast.Vertex, t *scanner.Token) *position.Position { + return &position.Position{ + StartLine: getListStartPos(list).startLine, + EndLine: t.Position.EndLine, + StartPos: getListStartPos(list).startPos, + EndPos: t.Position.EndPos, + } +} + +// NewTokenNodeListPosition returns new Position +func NewTokenNodeListPosition(t *scanner.Token, list []ast.Vertex) *position.Position { + return &position.Position{ + StartLine: t.Position.StartLine, + EndLine: getListEndPos(list).endLine, + StartPos: t.Position.StartPos, + EndPos: getListEndPos(list).endPos, + } +} + +// NewNodeNodeListPosition returns new Position +func NewNodeNodeListPosition(n ast.Vertex, list []ast.Vertex) *position.Position { + return &position.Position{ + StartLine: getNodeStartPos(n).startLine, + EndLine: getListEndPos(list).endLine, + StartPos: getNodeStartPos(n).startPos, + EndPos: getListEndPos(list).endPos, + } +} + +// NewNodeListNodePosition returns new Position +func NewNodeListNodePosition(list []ast.Vertex, n ast.Vertex) *position.Position { + return &position.Position{ + StartLine: getListStartPos(list).startLine, + EndLine: getNodeEndPos(n).endLine, + StartPos: getListStartPos(list).startPos, + EndPos: getNodeEndPos(n).endPos, + } +} + +// NewOptionalListTokensPosition returns new Position +func NewOptionalListTokensPosition(list []ast.Vertex, t *scanner.Token, endToken *scanner.Token) *position.Position { + if list == nil { + return &position.Position{ + StartLine: t.Position.StartLine, + EndLine: endToken.Position.EndLine, + StartPos: t.Position.StartPos, + EndPos: endToken.Position.EndPos, + } + } + + return &position.Position{ + StartLine: getListStartPos(list).startLine, + EndLine: endToken.Position.EndLine, + StartPos: getListStartPos(list).startPos, + EndPos: endToken.Position.EndPos, + } +} diff --git a/internal/positionbuilder/position_builder_test.go b/internal/position/position_test.go similarity index 90% rename from internal/positionbuilder/position_builder_test.go rename to internal/position/position_test.go index 24652d9..f932f2d 100644 --- a/internal/positionbuilder/position_builder_test.go +++ b/internal/position/position_test.go @@ -1,18 +1,16 @@ -package positionbuilder_test +package position_test import ( "gotest.tools/assert" "testing" - "github.com/z7zmey/php-parser/internal/positionbuilder" + builder "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/position" ) func TestNewTokenPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - tkn := &scanner.Token{ Value: []byte(`foo`), Position: position.Position{ @@ -31,8 +29,6 @@ func TestNewTokenPosition(t *testing.T) { } func TestNewTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - token1 := &scanner.Token{ Value: []byte(`foo`), Position: position.Position{ @@ -69,8 +65,6 @@ func TestNewNodePosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodePosition(n) assert.DeepEqual(t, &position.Position{1, 1, 0, 3}, pos) @@ -97,8 +91,6 @@ func TestNewTokenNodePosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewTokenNodePosition(tkn, n) assert.DeepEqual(t, &position.Position{1, 2, 0, 12}, pos) @@ -126,8 +118,6 @@ func TestNewNodeTokenPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeTokenPosition(n, tkn) assert.DeepEqual(t, &position.Position{1, 2, 0, 12}, pos) @@ -156,8 +146,6 @@ func TestNewNodeListPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeListPosition([]ast.Vertex{n1, n2}) assert.DeepEqual(t, &position.Position{1, 2, 0, 19}, pos) @@ -186,8 +174,6 @@ func TestNewNodesPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodesPosition(n1, n2) assert.DeepEqual(t, &position.Position{1, 2, 0, 19}, pos) @@ -226,8 +212,6 @@ func TestNewNodeListTokenPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeListTokenPosition([]ast.Vertex{n1, n2}, tkn) assert.DeepEqual(t, &position.Position{1, 3, 0, 22}, pos) @@ -266,8 +250,6 @@ func TestNewTokenNodeListPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewTokenNodeListPosition(tkn, []ast.Vertex{n1, n2}) assert.DeepEqual(t, &position.Position{1, 3, 0, 20}, pos) @@ -307,8 +289,6 @@ func TestNewNodeNodeListPosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{n2, n3}) assert.DeepEqual(t, &position.Position{1, 3, 0, 26}, pos) @@ -346,16 +326,12 @@ func TestNewNodeListNodePosition(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeListNodePosition([]ast.Vertex{n1, n2}, n3) assert.DeepEqual(t, &position.Position{1, 3, 0, 26}, pos) } func TestNewOptionalListTokensPosition(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - token1 := &scanner.Token{ Value: []byte(`foo`), Position: position.Position{ @@ -402,8 +378,6 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - token1 := &scanner.Token{ Value: []byte(`foo`), Position: position.Position{ @@ -429,8 +403,6 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { } func TestNilNodePos(t *testing.T) { - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodesPosition(nil, nil) assert.DeepEqual(t, &position.Position{-1, -1, -1, -1}, pos) @@ -448,8 +420,6 @@ func TestNilNodeListPos(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeNodeListPosition(n1, nil) assert.DeepEqual(t, &position.Position{1, -1, 0, -1}, pos) @@ -466,8 +436,6 @@ func TestNilNodeListTokenPos(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeListTokenPosition(nil, token) assert.DeepEqual(t, &position.Position{-1, 1, -1, 3}, pos) @@ -485,8 +453,6 @@ func TestEmptyNodeListPos(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{}) assert.DeepEqual(t, &position.Position{1, -1, 0, -1}, pos) @@ -503,8 +469,6 @@ func TestEmptyNodeListTokenPos(t *testing.T) { }, } - builder := positionbuilder.PositionBuilder{} - pos := builder.NewNodeListTokenPosition([]ast.Vertex{}, token) assert.DeepEqual(t, &position.Position{-1, 1, -1, 3}, pos) diff --git a/internal/positionbuilder/position_builder.go b/internal/positionbuilder/position_builder.go deleted file mode 100644 index 4f69393..0000000 --- a/internal/positionbuilder/position_builder.go +++ /dev/null @@ -1,207 +0,0 @@ -package positionbuilder - -import ( - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/position" -) - -// PositionBuilder provide functions to constuct positions -type PositionBuilder struct{} - -type startPos struct { - startLine int - startPos int -} - -type endPos struct { - endLine int - endPos int -} - -func (b *PositionBuilder) getListStartPos(l []ast.Vertex) startPos { - if l == nil { - return startPos{-1, -1} - } - - if len(l) == 0 { - return startPos{-1, -1} - } - - return b.getNodeStartPos(l[0]) -} - -func (b *PositionBuilder) getNodeStartPos(n ast.Vertex) startPos { - sl := -1 - sp := -1 - - if n == nil { - return startPos{-1, -1} - } - - p := n.GetNode().Position - if p != nil { - sl = p.StartLine - sp = p.StartPos - } - - return startPos{sl, sp} -} - -func (b *PositionBuilder) getListEndPos(l []ast.Vertex) endPos { - if l == nil { - return endPos{-1, -1} - } - - if len(l) == 0 { - return endPos{-1, -1} - } - - return b.getNodeEndPos(l[len(l)-1]) -} - -func (b *PositionBuilder) getNodeEndPos(n ast.Vertex) endPos { - el := -1 - ep := -1 - - if n == nil { - return endPos{-1, -1} - } - - p := n.GetNode().Position - if p != nil { - el = p.EndLine - ep = p.EndPos - } - - return endPos{el, ep} -} - -// NewNodeListPosition returns new Position -func (b *PositionBuilder) NewNodeListPosition(list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: b.getListStartPos(list).startLine, - EndLine: b.getListEndPos(list).endLine, - StartPos: b.getListStartPos(list).startPos, - EndPos: b.getListEndPos(list).endPos, - } -} - -// NewNodePosition returns new Position -func (b *PositionBuilder) NewNodePosition(n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: b.getNodeStartPos(n).startLine, - EndLine: b.getNodeEndPos(n).endLine, - StartPos: b.getNodeStartPos(n).startPos, - EndPos: b.getNodeEndPos(n).endPos, - } -} - -// NewTokenPosition returns new Position -func (b *PositionBuilder) NewTokenPosition(t *scanner.Token) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: t.Position.EndLine, - StartPos: t.Position.StartPos, - EndPos: t.Position.EndPos, - } -} - -// NewTokensPosition returns new Position -func (b *PositionBuilder) NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *position.Position { - return &position.Position{ - StartLine: startToken.Position.StartLine, - EndLine: endToken.Position.EndLine, - StartPos: startToken.Position.StartPos, - EndPos: endToken.Position.EndPos, - } -} - -// NewTokenNodePosition returns new Position -func (b *PositionBuilder) NewTokenNodePosition(t *scanner.Token, n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: b.getNodeEndPos(n).endLine, - StartPos: t.Position.StartPos, - EndPos: b.getNodeEndPos(n).endPos, - } -} - -// NewNodeTokenPosition returns new Position -func (b *PositionBuilder) NewNodeTokenPosition(n ast.Vertex, t *scanner.Token) *position.Position { - return &position.Position{ - StartLine: b.getNodeStartPos(n).startLine, - EndLine: t.Position.EndLine, - StartPos: b.getNodeStartPos(n).startPos, - EndPos: t.Position.EndPos, - } -} - -// NewNodesPosition returns new Position -func (b *PositionBuilder) NewNodesPosition(startNode ast.Vertex, endNode ast.Vertex) *position.Position { - return &position.Position{ - StartLine: b.getNodeStartPos(startNode).startLine, - EndLine: b.getNodeEndPos(endNode).endLine, - StartPos: b.getNodeStartPos(startNode).startPos, - EndPos: b.getNodeEndPos(endNode).endPos, - } -} - -// NewNodeListTokenPosition returns new Position -func (b *PositionBuilder) NewNodeListTokenPosition(list []ast.Vertex, t *scanner.Token) *position.Position { - return &position.Position{ - StartLine: b.getListStartPos(list).startLine, - EndLine: t.Position.EndLine, - StartPos: b.getListStartPos(list).startPos, - EndPos: t.Position.EndPos, - } -} - -// NewTokenNodeListPosition returns new Position -func (b *PositionBuilder) NewTokenNodeListPosition(t *scanner.Token, list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: b.getListEndPos(list).endLine, - StartPos: t.Position.StartPos, - EndPos: b.getListEndPos(list).endPos, - } -} - -// NewNodeNodeListPosition returns new Position -func (b *PositionBuilder) NewNodeNodeListPosition(n ast.Vertex, list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: b.getNodeStartPos(n).startLine, - EndLine: b.getListEndPos(list).endLine, - StartPos: b.getNodeStartPos(n).startPos, - EndPos: b.getListEndPos(list).endPos, - } -} - -// NewNodeListNodePosition returns new Position -func (b *PositionBuilder) NewNodeListNodePosition(list []ast.Vertex, n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: b.getListStartPos(list).startLine, - EndLine: b.getNodeEndPos(n).endLine, - StartPos: b.getListStartPos(list).startPos, - EndPos: b.getNodeEndPos(n).endPos, - } -} - -// NewOptionalListTokensPosition returns new Position -func (b *PositionBuilder) NewOptionalListTokensPosition(list []ast.Vertex, t *scanner.Token, endToken *scanner.Token) *position.Position { - if list == nil { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: endToken.Position.EndLine, - StartPos: t.Position.StartPos, - EndPos: endToken.Position.EndPos, - } - } - - return &position.Position{ - StartLine: b.getListStartPos(list).startLine, - EndLine: endToken.Position.EndLine, - StartPos: b.getListStartPos(list).startPos, - EndPos: endToken.Position.EndPos, - } -} From 424f7a132c2c5ff2095597ad44e074b001beb79a Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 29 Jun 2020 14:52:43 +0300 Subject: [PATCH 024/140] [refactoring] remove lexer config struct --- internal/php5/parser.go | 11 ++--- internal/php7/parser.go | 63 +++++++++++++--------------- internal/scanner/lexer.go | 13 ++---- internal/scanner/scanner_test.go | 70 +++++++++++++++----------------- 4 files changed, 68 insertions(+), 89 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 19702d0..8fe09e9 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -25,14 +25,9 @@ func NewParser(src []byte, v string, withTokens bool) *Parser { withTokens: withTokens, } - scannerConfig := scanner.Config{ - WithHiddenTokens: withTokens, - ErrHandlerFunc: func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }, - } - - lexer := scanner.NewLexer(src, v, scannerConfig) + lexer := scanner.NewLexer(src, v, withTokens, func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }) parser.Lexer = lexer return parser diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 25f28d5..97261be 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -24,53 +24,48 @@ func NewParser(src []byte, v string, withTokens bool) *Parser { withTokens: withTokens, } - scannerConfig := scanner.Config{ - WithHiddenTokens: withTokens, - ErrHandlerFunc: func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }, - } - - lexer := scanner.NewLexer(src, v, scannerConfig) + lexer := scanner.NewLexer(src, v, withTokens, func(e *errors.Error) { + parser.errors = append(parser.errors, e) + }) parser.Lexer = lexer return parser } -func (l *Parser) Lex(lval *yySymType) int { - t := l.Lexer.Lex() +func (p *Parser) Lex(lval *yySymType) int { + t := p.Lexer.Lex() - l.currentToken = t + p.currentToken = t lval.token = t return int(t.ID) } -func (l *Parser) Error(msg string) { - var pos = l.currentToken.Position +func (p *Parser) Error(msg string) { + var pos = p.currentToken.Position - l.errors = append(l.errors, errors.NewError(msg, &pos)) + p.errors = append(p.errors, errors.NewError(msg, &pos)) } // GetErrors returns errors list -func (l *Parser) GetErrors() []*errors.Error { - return l.errors +func (p *Parser) GetErrors() []*errors.Error { + return p.errors } // Parse the php7 Parser entrypoint -func (l *Parser) Parse() int { +func (p *Parser) Parse() int { // init - l.errors = nil - l.rootNode = nil + p.errors = nil + p.rootNode = nil // parse - return yyParse(l) + return yyParse(p) } // GetRootNode returns root node -func (l *Parser) GetRootNode() ast.Vertex { - return l.rootNode +func (p *Parser) GetRootNode() ast.Vertex { + return p.rootNode } // helpers @@ -86,8 +81,8 @@ func isDollar(r rune) bool { return r == '$' } -func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if l.withTokens == false { +func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { + if p.withTokens == false { return } @@ -95,7 +90,7 @@ func (l *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { return } - l.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) + p.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) delete(src.GetNode().Tokens, token.Start) } @@ -116,8 +111,8 @@ func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, strings []t (*dstCollection)[pos] = strings } -func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if l.withTokens == false { +func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { + if p.withTokens == false { return []token.Token{} } @@ -129,12 +124,12 @@ func (l *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } } -func (l *Parser) addDollarToken(v ast.Vertex) { - if l.withTokens == false { +func (p *Parser) addDollarToken(v ast.Vertex) { + if p.withTokens == false { return } - l.setFreeFloating(v, token.Dollar, []token.Token{ + p.setFreeFloating(v, token.Dollar, []token.Token{ { ID: token.ID('$'), Value: []byte("$"), @@ -142,8 +137,8 @@ func (l *Parser) addDollarToken(v ast.Vertex) { }) } -func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if l.withTokens == false { +func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { + if p.withTokens == false { return } @@ -154,7 +149,7 @@ func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - l.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloating(prevNode, token.SemiColon, []token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -181,7 +176,7 @@ func (l *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. Value: semiColon[0].Value[vlen-tlen:], }) - l.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) + p.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 2308bcd..e20e701 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -10,13 +10,6 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -type Config struct { - WithHiddenTokens bool - ErrHandlerFunc func(*errors.Error) -} - -var DefaultConfig = Config{} - type Lexer struct { data []byte phpVersion string @@ -34,12 +27,12 @@ type Lexer struct { newLines NewLines } -func NewLexer(data []byte, phpVersion string, config Config) *Lexer { +func NewLexer(data []byte, phpVersion string, withHiddenTokens bool, errHandlerFunc func(*errors.Error)) *Lexer { lex := &Lexer{ data: data, phpVersion: phpVersion, - errHandlerFunc: config.ErrHandlerFunc, - withHiddenTokens: config.WithHiddenTokens, + withHiddenTokens: withHiddenTokens, + errHandlerFunc: errHandlerFunc, pe: len(data), stack: make([]int, 0), diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 41a7092..7399c08 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -353,7 +353,7 @@ func TestTokens(t *testing.T) { T_UNSET_CAST.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -381,7 +381,7 @@ func TestShebang(t *testing.T) { "\n", } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -401,7 +401,7 @@ func TestShebangHtml(t *testing.T) { 0.1 ` - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -451,7 +451,7 @@ func TestNumberTokens(t *testing.T) { T_DNUMBER.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -508,7 +508,7 @@ func TestConstantStrings(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -555,7 +555,7 @@ func TestSingleQuoteStringTokens(t *testing.T) { T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) actual := []string{} for { @@ -642,7 +642,7 @@ func TestTeplateStringTokens(t *testing.T) { TokenID(int('"')).String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -727,7 +727,7 @@ func TestBackquoteStringTokens(t *testing.T) { TokenID(int('`')).String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -821,7 +821,7 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -894,7 +894,7 @@ CAT T_END_HEREDOC.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -933,7 +933,7 @@ CAT; TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -964,7 +964,7 @@ func TestHereDocTokens73(t *testing.T) { T_VARIABLE.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -994,7 +994,7 @@ CAT;` TokenID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.phpVersion = "7.2" lexer.withHiddenTokens = true actual := []string{} @@ -1027,7 +1027,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { T_INLINE_HTML.String(), } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true actual := []string{} @@ -1062,7 +1062,7 @@ func TestStringTokensAfterVariable(t *testing.T) { "\"", } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) actual := []string{} actualTokens := []string{} @@ -1095,7 +1095,7 @@ func TestSlashAfterVariable(t *testing.T) { "3", } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) actual := []string{} actualTokens := []string{} @@ -1132,7 +1132,7 @@ func TestCommentEnd(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true lexer.Lex() @@ -1161,7 +1161,7 @@ func TestCommentNewLine(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1190,7 +1190,7 @@ func TestCommentNewLine1(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1219,7 +1219,7 @@ func TestCommentNewLine2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1249,7 +1249,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1279,7 +1279,7 @@ func TestInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1309,7 +1309,7 @@ func TestInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true lexer.Lex() @@ -1343,7 +1343,7 @@ func TestEmptyInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true lexer.Lex() @@ -1373,7 +1373,7 @@ func TestEmptyInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true tkn := lexer.Lex() @@ -1387,7 +1387,7 @@ func TestMethodCallTokens(t *testing.T) { src := ` bar ( '' ) ;` - lexer := NewLexer([]byte(src), "7.4", DefaultConfig) + lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.withHiddenTokens = true expected := []token.Token{ @@ -1469,7 +1469,7 @@ func TestYieldFromTokens(t *testing.T) { src := ` Date: Mon, 29 Jun 2020 23:00:56 +0300 Subject: [PATCH 025/140] [refactoring] parsing error handler --- cmd/php-parser/main.go | 27 +- internal/php5/parser.go | 38 +- internal/php5/parser_test.go | 778 ++++++++++++++-------- internal/php5/php5_bench_test.go | 4 +- internal/php5/php5_test.go | 24 +- internal/php7/parser.go | 37 +- internal/php7/parser_test.go | 850 ++++++++++++++++-------- internal/php7/php7_bench_test.go | 4 +- internal/php7/php7_test.go | 21 +- pkg/parser/parser.go | 22 +- pkg/printer/printer_parsed_php5_test.go | 7 +- pkg/printer/printer_parsed_php7_test.go | 10 +- 12 files changed, 1191 insertions(+), 631 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 557f699..8e9bbe1 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -15,8 +15,10 @@ import ( "github.com/pkg/profile" "github.com/yookoala/realpath" + "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/ast/traverser" "github.com/z7zmey/php-parser/pkg/ast/visitor" + "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/parser" "github.com/z7zmey/php-parser/pkg/printer" ) @@ -37,8 +39,9 @@ type file struct { } type result struct { - path string - parser parser.Parser + path string + rootNode ast.Vertex + errors []*errors.Error } func main() { @@ -121,14 +124,18 @@ func parserWorker(fileCh <-chan *file, r chan<- result) { return } - parserWorker, err := parser.NewParser(f.content, phpVersion, *withFreeFloating) + parserErrors := []*errors.Error{} + cfg := parser.Config{ + ErrorHandlerFunc: func(e *errors.Error) { + parserErrors = append(parserErrors, e) + }, + } + rootNode, err := parser.Parse(f.content, phpVersion, cfg) if err != nil { panic(err.Error()) } - parserWorker.Parse() - - r <- result{path: f.path, parser: parserWorker} + r <- result{path: f.path, rootNode: rootNode, errors: parserErrors} } } @@ -147,14 +154,14 @@ func printerWorker(r <-chan result) { fmt.Fprintf(os.Stdout, "==> [%d] %s\n", counter, res.path) } - for _, e := range res.parser.GetErrors() { + for _, e := range res.errors { fmt.Fprintf(os.Stdout, "==> %s\n", e) } if *printBack { o := bytes.NewBuffer([]byte{}) p := printer.NewPrinter(o) - p.Print(res.parser.GetRootNode()) + p.Print(res.rootNode) err := ioutil.WriteFile(res.path, o.Bytes(), 0644) checkErr(err) @@ -163,14 +170,14 @@ func printerWorker(r <-chan result) { if *showResolvedNs { v := visitor.NewNamespaceResolver() t := traverser.NewDFS(v) - t.Traverse(res.parser.GetRootNode()) + t.Traverse(res.rootNode) fmt.Printf("%+v", v.ResolvedNames) } if *dump == true { v := visitor.NewDump(os.Stdout) t := traverser.NewDFS(v) - t.Traverse(res.parser.GetRootNode()) + t.Traverse(res.rootNode) } wg.Done() diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 8fe09e9..f7c244f 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -12,25 +12,20 @@ import ( // Parser structure type Parser struct { - Lexer *scanner.Lexer - currentToken *scanner.Token - rootNode ast.Vertex - errors []*errors.Error - withTokens bool + Lexer *scanner.Lexer + currentToken *scanner.Token + rootNode ast.Vertex + withTokens bool + errHandlerFunc func(*errors.Error) } // NewParser creates and returns new Parser -func NewParser(src []byte, v string, withTokens bool) *Parser { - parser := &Parser{ - withTokens: withTokens, +func NewParser(lexer *scanner.Lexer, withTokens bool, errHandlerFunc func(*errors.Error)) *Parser { + return &Parser{ + withTokens: withTokens, + Lexer: lexer, + errHandlerFunc: errHandlerFunc, } - - lexer := scanner.NewLexer(src, v, withTokens, func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }) - parser.Lexer = lexer - - return parser } // Lex proxy to scanner Lex @@ -45,23 +40,12 @@ func (p *Parser) Lex(lval *yySymType) int { func (p *Parser) Error(msg string) { var pos = p.currentToken.Position - - p.errors = append(p.errors, errors.NewError(msg, &pos)) -} - -// GetErrors returns errors list -func (p *Parser) GetErrors() []*errors.Error { - return p.errors + p.errHandlerFunc(errors.NewError(msg, &pos)) } // Parse the php7 Parser entrypoint func (p *Parser) Parse() int { - // init - p.errors = nil p.rootNode = nil - - // parse - return yyParse(p) } diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index c5b5d58..ec349e5 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -1,10 +1,12 @@ package php5_test import ( - "gotest.tools/assert" "testing" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/position" ) @@ -56,7 +58,8 @@ func TestIdentifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -838,7 +841,8 @@ func TestPhp5ArgumentNode(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1591,7 +1595,8 @@ func TestPhp5ParameterNode(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1612,7 +1617,8 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1689,7 +1695,8 @@ func TestName(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1764,7 +1771,8 @@ func TestFullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1839,7 +1847,8 @@ func TestRelative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1917,7 +1926,8 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1993,7 +2003,8 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2080,7 +2091,8 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2177,7 +2189,8 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2285,7 +2298,8 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2361,7 +2375,8 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2458,7 +2473,8 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2565,7 +2581,8 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2656,7 +2673,8 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2747,7 +2765,8 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2806,7 +2825,8 @@ LBL; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2851,7 +2871,8 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2910,7 +2931,8 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2954,7 +2976,8 @@ func TestScalarMagicConstant(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2997,7 +3020,8 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3040,7 +3064,8 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3083,7 +3108,8 @@ func TestScalarNumber_Float(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3126,7 +3152,8 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3169,7 +3196,8 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3212,7 +3240,8 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3255,7 +3284,8 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3298,7 +3328,8 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3341,7 +3372,8 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3386,7 +3418,8 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3429,7 +3462,8 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3474,7 +3508,8 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3543,7 +3578,8 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3655,7 +3691,8 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3744,7 +3781,8 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3921,7 +3959,8 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4042,7 +4081,8 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4120,7 +4160,8 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4268,7 +4309,8 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4370,7 +4412,8 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4484,7 +4527,8 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4528,7 +4572,8 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4585,7 +4630,8 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4675,7 +4721,8 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4767,7 +4814,8 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4882,7 +4930,8 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4980,7 +5029,8 @@ func TestStmtConstList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5045,7 +5095,8 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5121,7 +5172,8 @@ func TestStmtContinue_Light(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5197,7 +5249,8 @@ func TestStmtContinue(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5273,7 +5326,8 @@ func TestStmtDeclare(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5382,7 +5436,8 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5460,7 +5515,8 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5514,7 +5570,8 @@ func TestStmtDo(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5580,7 +5637,8 @@ func TestStmtEcho(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5635,7 +5693,8 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5678,7 +5737,8 @@ func TestStmtExpression(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5873,7 +5933,8 @@ func TestStmtFor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5993,7 +6054,8 @@ func TestStmtFor_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6078,7 +6140,8 @@ func TestStmtForeach(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6153,7 +6216,8 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6238,7 +6302,8 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6344,7 +6409,8 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6440,7 +6506,8 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6556,7 +6623,8 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6684,7 +6752,8 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6729,7 +6798,8 @@ func TestStmtFunction(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6785,7 +6855,8 @@ func TestStmtFunction_Return(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6952,7 +7023,8 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7019,7 +7091,8 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7074,7 +7147,8 @@ func TestStmtGlobal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7234,7 +7308,8 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7298,7 +7373,8 @@ func TestStmtGotoLabel(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7330,7 +7406,8 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7394,7 +7471,8 @@ func TestStmtIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7502,7 +7580,8 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7587,7 +7666,8 @@ func TestStmtIf_Else(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7758,7 +7838,8 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7939,7 +8020,8 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7982,7 +8064,8 @@ func TestStmtInlineHtml(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8026,7 +8109,8 @@ func TestStmtInterface(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8105,7 +8189,8 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8207,7 +8292,8 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8262,7 +8348,8 @@ func TestStmtNamespace(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8318,7 +8405,8 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8351,7 +8439,8 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8452,7 +8541,8 @@ func TestStmtProperty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8606,7 +8696,8 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8760,7 +8851,8 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8825,7 +8917,8 @@ func TestStmtStaticVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8932,7 +9025,8 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9039,7 +9133,8 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9165,7 +9260,8 @@ func TestStmtSwitch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9291,7 +9387,8 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9407,7 +9504,8 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9511,7 +9609,8 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9564,7 +9663,8 @@ func TestStmtThrow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9608,7 +9708,8 @@ func TestStmtTrait(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9698,7 +9799,8 @@ func TestStmtTraitUse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9811,7 +9913,8 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9924,7 +10027,8 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10081,7 +10185,8 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10249,7 +10354,8 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10531,7 +10637,8 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10567,7 +10674,8 @@ func TestStmtTry_Try(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10661,7 +10769,8 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10812,7 +10921,8 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10917,7 +11027,8 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11123,7 +11234,8 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11178,7 +11290,8 @@ func TestStmtUnset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11254,7 +11367,8 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11321,7 +11435,8 @@ func TestStmtUse(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11388,7 +11503,8 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11466,7 +11582,8 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11566,7 +11683,8 @@ func TestStmtUse_List(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11677,7 +11795,8 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11788,7 +11907,8 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11921,7 +12041,8 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12032,7 +12153,8 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12165,7 +12287,8 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12230,7 +12353,8 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12306,7 +12430,8 @@ func TestStmtBreak_Light(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12382,7 +12507,8 @@ func TestStmtBreak(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12458,7 +12584,8 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12553,7 +12680,8 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12596,7 +12724,8 @@ func TestExprArray(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12661,7 +12790,8 @@ func TestExprArray_Item(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12779,7 +12909,8 @@ func TestExprArray_Items(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12842,7 +12973,8 @@ func TestExprBitwiseNot(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12905,7 +13037,8 @@ func TestExprBooleanNot(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12981,7 +13114,8 @@ func TestExprClassConstFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13045,7 +13179,8 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13108,7 +13243,8 @@ func TestExprClone_Brackets(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13171,7 +13307,8 @@ func TestExprClone(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13216,7 +13353,8 @@ func TestExprClosure(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13393,7 +13531,8 @@ func TestExprClosure_Use(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13570,7 +13709,8 @@ func TestExprClosure_Use2(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13635,7 +13775,8 @@ func TestExprConstFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13700,7 +13841,8 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13765,7 +13907,8 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13828,7 +13971,8 @@ func TestExprEmpty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13891,7 +14035,8 @@ func TestExprErrorSuppress(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13954,7 +14099,8 @@ func TestExprEval(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13997,7 +14143,8 @@ func TestExprExit(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14040,7 +14187,8 @@ func TestExprExit_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14104,7 +14252,8 @@ func TestExprExit_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14147,7 +14296,8 @@ func TestExprDie(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14190,7 +14340,8 @@ func TestExprDie_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14254,7 +14405,8 @@ func TestExprDie_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14329,7 +14481,8 @@ func TestExprFunctionCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14404,7 +14557,8 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14504,7 +14658,8 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14622,7 +14777,8 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14753,7 +14909,8 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14816,7 +14973,8 @@ func TestExprPostDec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14879,7 +15037,8 @@ func TestExprPostInc(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14942,7 +15101,8 @@ func TestExprPreDec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15005,7 +15165,8 @@ func TestExprPreInc(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15068,7 +15229,8 @@ func TestExprInclude(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15131,7 +15293,8 @@ func TestExprInclude_Once(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15194,7 +15357,8 @@ func TestExprRequire(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15257,7 +15421,8 @@ func TestExprRequire_Once(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15343,7 +15508,8 @@ func TestExprInstanceOf(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15429,7 +15595,8 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15515,7 +15682,8 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15580,7 +15748,8 @@ func TestExprIsset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15666,7 +15835,8 @@ func TestExprIsset_Variables(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15740,7 +15910,8 @@ func TestExprList_Empty(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15846,7 +16017,8 @@ func TestExprList(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15962,7 +16134,8 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16090,7 +16263,8 @@ func TestExprList_List(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16197,7 +16371,8 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16306,7 +16481,8 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16390,7 +16566,8 @@ func TestExprMethodCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16455,7 +16632,8 @@ func TestExprNew(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16530,7 +16708,8 @@ func TestExprNew_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16605,7 +16784,8 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16668,7 +16848,8 @@ func TestExprPrint(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16742,7 +16923,8 @@ func TestExprPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16859,7 +17041,8 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16935,7 +17118,8 @@ func TestExprShellExec(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16978,7 +17162,8 @@ func TestExprShortArray(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17043,7 +17228,8 @@ func TestExprShortArray_Item(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17161,7 +17347,8 @@ func TestExprShortArray_Items(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17247,7 +17434,8 @@ func TestExprStaticCall(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17333,7 +17521,8 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17419,7 +17608,8 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17515,7 +17705,8 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17609,7 +17800,8 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17695,7 +17887,8 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17781,7 +17974,8 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17867,7 +18061,8 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17972,7 +18167,8 @@ func TestExprTernary(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18056,7 +18252,8 @@ func TestExprTernary_Simple(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18213,7 +18410,8 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18370,7 +18568,8 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18433,7 +18632,8 @@ func TestExprUnaryMinus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18496,7 +18696,8 @@ func TestExprUnaryPlus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18549,7 +18750,8 @@ func TestExprVariable(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18612,7 +18814,8 @@ func TestExprVariable_Variable(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18654,7 +18857,8 @@ func TestExprYield(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18717,7 +18921,8 @@ func TestExprYield_Val(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18801,7 +19006,8 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18854,7 +19060,8 @@ func TestExprYield_Expr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18928,7 +19135,8 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19014,7 +19222,8 @@ func TestExprAssign_Assign(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19098,7 +19307,8 @@ func TestExprAssign_Reference(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19194,7 +19404,8 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19335,7 +19546,8 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19419,7 +19631,8 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19503,7 +19716,8 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19587,7 +19801,8 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19671,7 +19886,8 @@ func TestExprAssign_Concat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19755,7 +19971,8 @@ func TestExprAssign_Div(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19839,7 +20056,8 @@ func TestExprAssign_Minus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19923,7 +20141,8 @@ func TestExprAssign_Mod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20007,7 +20226,8 @@ func TestExprAssign_Mul(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20091,7 +20311,8 @@ func TestExprAssign_Plus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20175,7 +20396,8 @@ func TestExprAssign_Pow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20259,7 +20481,8 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20343,7 +20566,8 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20429,7 +20653,8 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20513,7 +20738,8 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20597,7 +20823,8 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20681,7 +20908,8 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20765,7 +20993,8 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20849,7 +21078,8 @@ func TestExprBinary_Concat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20933,7 +21163,8 @@ func TestExprBinary_Div(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21017,7 +21248,8 @@ func TestExprBinary_Equal(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21101,7 +21333,8 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21185,7 +21418,8 @@ func TestExprBinary_Greater(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21269,7 +21503,8 @@ func TestExprBinary_Identical(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21353,7 +21588,8 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21437,7 +21673,8 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21521,7 +21758,8 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21605,7 +21843,8 @@ func TestExprBinary_Minus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21689,7 +21928,8 @@ func TestExprBinary_Mod(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21773,7 +22013,8 @@ func TestExprBinary_Mul(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21857,7 +22098,8 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21941,7 +22183,8 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22025,7 +22268,8 @@ func TestExprBinary_Plus(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22109,7 +22353,8 @@ func TestExprBinary_Pow(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22193,7 +22438,8 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22277,7 +22523,8 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22361,7 +22608,8 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22445,7 +22693,8 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22510,7 +22759,8 @@ func TestExprCast_Array(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22573,7 +22823,8 @@ func TestExprCast_Bool(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22636,7 +22887,8 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22699,7 +22951,8 @@ func TestExprCast_Double(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22762,7 +23015,8 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22825,7 +23079,8 @@ func TestExprCast_Int(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22888,7 +23143,8 @@ func TestExprCast_IntShort(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22951,7 +23207,8 @@ func TestExprCast_Object(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23014,7 +23271,8 @@ func TestExprCast_String(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23077,7 +23335,8 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23140,7 +23399,8 @@ func TestExprCast_Unset(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 2b94e89..4ce4b1e 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/scanner" ) func BenchmarkPhp5(b *testing.B) { @@ -413,7 +414,8 @@ CAD; ` for n := 0; n < b.N; n++ { - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() } } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 68a7b05..5bef94b 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -1,10 +1,12 @@ package php5_test import ( - "gotest.tools/assert" "testing" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" @@ -22455,7 +22457,8 @@ func TestPhp5(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22592,7 +22595,8 @@ func TestPhp5Strings(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22818,7 +22822,8 @@ CAD; }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + php5parser := php5.NewParser(lexer, false, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22838,8 +22843,13 @@ func TestPhp5ControlCharsErrors(t *testing.T) { }, } - php5parser := php5.NewParser([]byte(src), "5.6", false) + parserErrors := []*errors.Error{} + errorHandlerFunc := func(e *errors.Error) { + parserErrors = append(parserErrors, e) + } + + lexer := scanner.NewLexer([]byte(src), "5.6", false, errorHandlerFunc) + php5parser := php5.NewParser(lexer, false, errorHandlerFunc) php5parser.Parse() - actual := php5parser.GetErrors() - assert.DeepEqual(t, expected, actual) + assert.DeepEqual(t, expected, parserErrors) } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 97261be..c219232 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -11,25 +11,20 @@ import ( // Parser structure type Parser struct { - Lexer *scanner.Lexer - currentToken *scanner.Token - rootNode ast.Vertex - errors []*errors.Error - withTokens bool + Lexer *scanner.Lexer + currentToken *scanner.Token + rootNode ast.Vertex + withTokens bool + errHandlerFunc func(*errors.Error) } // NewParser creates and returns new Parser -func NewParser(src []byte, v string, withTokens bool) *Parser { - parser := &Parser{ - withTokens: withTokens, +func NewParser(lexer *scanner.Lexer, withTokens bool, errHandlerFunc func(*errors.Error)) *Parser { + return &Parser{ + withTokens: withTokens, + Lexer: lexer, + errHandlerFunc: errHandlerFunc, } - - lexer := scanner.NewLexer(src, v, withTokens, func(e *errors.Error) { - parser.errors = append(parser.errors, e) - }) - parser.Lexer = lexer - - return parser } func (p *Parser) Lex(lval *yySymType) int { @@ -43,23 +38,13 @@ func (p *Parser) Lex(lval *yySymType) int { func (p *Parser) Error(msg string) { var pos = p.currentToken.Position - - p.errors = append(p.errors, errors.NewError(msg, &pos)) -} - -// GetErrors returns errors list -func (p *Parser) GetErrors() []*errors.Error { - return p.errors + p.errHandlerFunc(errors.NewError(msg, &pos)) } // Parse the php7 Parser entrypoint func (p *Parser) Parse() int { - // init - p.errors = nil p.rootNode = nil - // parse - return yyParse(p) } diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index e4a2100..a7d2ced 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -1,10 +1,12 @@ package php7_test import ( - "gotest.tools/assert" "testing" + "gotest.tools/assert" + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/position" ) @@ -56,7 +58,8 @@ func TestIdentifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -949,7 +952,8 @@ func TestPhp7ArgumentNode(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1742,7 +1746,8 @@ func TestPhp7ParameterNode(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1763,7 +1768,8 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1840,7 +1846,8 @@ func TestName(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1915,7 +1922,8 @@ func TestFullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1990,7 +1998,8 @@ func TestRelative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2068,7 +2077,8 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2144,7 +2154,8 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2231,7 +2242,8 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2328,7 +2340,8 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2436,7 +2449,8 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2512,7 +2526,8 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2609,7 +2624,8 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2716,7 +2732,8 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2807,7 +2824,8 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2898,7 +2916,8 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2957,7 +2976,8 @@ LBL; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3002,7 +3022,8 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3061,7 +3082,8 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3105,7 +3127,8 @@ func TestScalarMagicConstant(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3148,7 +3171,8 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3191,7 +3215,8 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3234,7 +3259,8 @@ func TestScalarNumber_Float(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3277,7 +3303,8 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3320,7 +3347,8 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3363,7 +3391,8 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3406,7 +3435,8 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3449,7 +3479,8 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3492,7 +3523,8 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3537,7 +3569,8 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3580,7 +3613,8 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3625,7 +3659,8 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3694,7 +3729,8 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3806,7 +3842,8 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3895,7 +3932,8 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4072,7 +4110,8 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4206,7 +4245,8 @@ func TestStmtClassConstList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4327,7 +4367,8 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4405,7 +4446,8 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4553,7 +4595,8 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4678,7 +4721,8 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4792,7 +4836,8 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4918,7 +4963,8 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4962,7 +5008,8 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5019,7 +5066,8 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5109,7 +5157,8 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5201,7 +5250,8 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5316,7 +5366,8 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5470,7 +5521,8 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5568,7 +5620,8 @@ func TestStmtConstList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5633,7 +5686,8 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5709,7 +5763,8 @@ func TestStmtContinue_Light(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5785,7 +5840,8 @@ func TestStmtContinue(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5861,7 +5917,8 @@ func TestStmtDeclare(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5970,7 +6027,8 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6048,7 +6106,8 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6102,7 +6161,8 @@ func TestStmtDo(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6168,7 +6228,8 @@ func TestStmtEcho(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6223,7 +6284,8 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6266,7 +6328,8 @@ func TestStmtExpression(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6461,7 +6524,8 @@ func TestStmtFor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6581,7 +6645,8 @@ func TestStmtFor_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6666,7 +6731,8 @@ func TestStmtForeach(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6741,7 +6807,8 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6826,7 +6893,8 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6932,7 +7000,8 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7028,7 +7097,8 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7144,7 +7214,8 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7272,7 +7343,8 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7317,7 +7389,8 @@ func TestStmtFunction(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7373,7 +7446,8 @@ func TestStmtFunction_Return(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7540,7 +7614,8 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7607,7 +7682,8 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7675,7 +7751,8 @@ func TestStmtFunction_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7730,7 +7807,8 @@ func TestStmtGlobal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7890,7 +7968,8 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7954,7 +8033,8 @@ func TestStmtGotoLabel(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7986,7 +8066,8 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8050,7 +8131,8 @@ func TestStmtIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8158,7 +8240,8 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8243,7 +8326,8 @@ func TestStmtIf_Else(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8414,7 +8498,8 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8595,7 +8680,8 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8638,7 +8724,8 @@ func TestStmtInlineHtml(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8682,7 +8769,8 @@ func TestStmtInterface(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8761,7 +8849,8 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8863,7 +8952,8 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8918,7 +9008,8 @@ func TestStmtNamespace(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8974,7 +9065,8 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9007,7 +9099,8 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9108,7 +9201,8 @@ func TestStmtProperty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9262,7 +9356,8 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9416,7 +9511,8 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9540,7 +9636,8 @@ func TestStmtProperty_PropertyType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9605,7 +9702,8 @@ func TestStmtStaticVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9712,7 +9810,8 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9819,7 +9918,8 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9945,7 +10045,8 @@ func TestStmtSwitch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10071,7 +10172,8 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10187,7 +10289,8 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10291,7 +10394,8 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10344,7 +10448,8 @@ func TestStmtThrow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10388,7 +10493,8 @@ func TestStmtTrait(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10478,7 +10584,8 @@ func TestStmtTraitUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10591,7 +10698,8 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10704,7 +10812,8 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10861,7 +10970,8 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11029,7 +11139,8 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11311,7 +11422,8 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11347,7 +11459,8 @@ func TestStmtTry_Try(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11441,7 +11554,8 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11558,7 +11672,8 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11709,7 +11824,8 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11814,7 +11930,8 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12020,7 +12137,8 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12075,7 +12193,8 @@ func TestStmtUnset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12151,7 +12270,8 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12227,7 +12347,8 @@ func TestStmtUnset_TrailingComma(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12294,7 +12415,8 @@ func TestStmtUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12361,7 +12483,8 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12439,7 +12562,8 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12539,7 +12663,8 @@ func TestStmtUse_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12650,7 +12775,8 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12761,7 +12887,8 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12894,7 +13021,8 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13005,7 +13133,8 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13138,7 +13267,8 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13261,7 +13391,8 @@ func TestStmtUse_GroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13395,7 +13526,8 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13529,7 +13661,8 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13663,7 +13796,8 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13808,7 +13942,8 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13873,7 +14008,8 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13949,7 +14085,8 @@ func TestStmtBreak_Light(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14025,7 +14162,8 @@ func TestStmtBreak(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14101,7 +14239,8 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14196,7 +14335,8 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14239,7 +14379,8 @@ func TestExprArray(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14304,7 +14445,8 @@ func TestExprArray_Item(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14422,7 +14564,8 @@ func TestExprArray_Items(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14498,7 +14641,8 @@ func TestExprArray_ItemUnpack(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14563,7 +14707,8 @@ func TestExprArrowFunction(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14651,7 +14796,8 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14714,7 +14860,8 @@ func TestExprBitwiseNot(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14777,7 +14924,8 @@ func TestExprBooleanNot(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14853,7 +15001,8 @@ func TestExprClassConstFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14917,7 +15066,8 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14980,7 +15130,8 @@ func TestExprClone_Brackets(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15043,7 +15194,8 @@ func TestExprClone(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15088,7 +15240,8 @@ func TestExprClosure(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15265,7 +15418,8 @@ func TestExprClosure_Use(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15442,7 +15596,8 @@ func TestExprClosure_Use2(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15510,7 +15665,8 @@ func TestExprClosure_ReturnType(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15575,7 +15731,8 @@ func TestExprConstFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15640,7 +15797,8 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15705,7 +15863,8 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15768,7 +15927,8 @@ func TestExprEmpty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15831,7 +15991,8 @@ func TestExprErrorSuppress(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15894,7 +16055,8 @@ func TestExprEval(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15937,7 +16099,8 @@ func TestExprExit(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15980,7 +16143,8 @@ func TestExprExit_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16044,7 +16208,8 @@ func TestExprExit_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16087,7 +16252,8 @@ func TestExprDie(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16130,7 +16296,8 @@ func TestExprDie_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16194,7 +16361,8 @@ func TestExprDie_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16269,7 +16437,8 @@ func TestExprFunctionCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16344,7 +16513,8 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16444,7 +16614,8 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16562,7 +16733,8 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16693,7 +16865,8 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16756,7 +16929,8 @@ func TestExprPostDec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16819,7 +16993,8 @@ func TestExprPostInc(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16882,7 +17057,8 @@ func TestExprPreDec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16945,7 +17121,8 @@ func TestExprPreInc(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17008,7 +17185,8 @@ func TestExprInclude(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17071,7 +17249,8 @@ func TestExprInclude_Once(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17134,7 +17313,8 @@ func TestExprRequire(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17197,7 +17377,8 @@ func TestExprRequire_Once(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17283,7 +17464,8 @@ func TestExprInstanceOf(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17369,7 +17551,8 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17455,7 +17638,8 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17520,7 +17704,8 @@ func TestExprIsset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17606,7 +17791,8 @@ func TestExprIsset_Variables(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17680,7 +17866,8 @@ func TestExprList_Empty(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17786,7 +17973,8 @@ func TestExprList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17902,7 +18090,8 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18030,7 +18219,8 @@ func TestExprList_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18137,7 +18327,8 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18246,7 +18437,8 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18330,7 +18522,8 @@ func TestExprMethodCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18395,7 +18588,8 @@ func TestExprNew(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18470,7 +18664,8 @@ func TestExprNew_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18545,7 +18740,8 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18676,7 +18872,8 @@ func TestExprNew_Anonymous(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18739,7 +18936,8 @@ func TestExprPrint(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18813,7 +19011,8 @@ func TestExprPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18930,7 +19129,8 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19006,7 +19206,8 @@ func TestExprShellExec(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19049,7 +19250,8 @@ func TestExprShortArray(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19114,7 +19316,8 @@ func TestExprShortArray_Item(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19232,7 +19435,8 @@ func TestExprShortArray_Items(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19338,7 +19542,8 @@ func TestExprShortList(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19454,7 +19659,8 @@ func TestExprShortList_ArrayIndex(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19582,7 +19788,8 @@ func TestExprShortList_List(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19668,7 +19875,8 @@ func TestExprStaticCall(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19754,7 +19962,8 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19840,7 +20049,8 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19936,7 +20146,8 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20030,7 +20241,8 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20116,7 +20328,8 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20202,7 +20415,8 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20288,7 +20502,8 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20393,7 +20608,8 @@ func TestExprTernary(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20477,7 +20693,8 @@ func TestExprTernary_Simple(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20634,7 +20851,8 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20791,7 +21009,8 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20854,7 +21073,8 @@ func TestExprUnaryMinus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20917,7 +21137,8 @@ func TestExprUnaryPlus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20970,7 +21191,8 @@ func TestExprVariable(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21033,7 +21255,8 @@ func TestExprVariable_Variable(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21075,7 +21298,8 @@ func TestExprYield(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21138,7 +21362,8 @@ func TestExprYield_Val(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21222,7 +21447,8 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21275,7 +21501,8 @@ func TestExprYield_Expr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21349,7 +21576,8 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21412,7 +21640,8 @@ func TestExprYieldFrom(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21498,7 +21727,8 @@ func TestExprAssign_Assign(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21582,7 +21812,8 @@ func TestExprAssign_Reference(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21678,7 +21909,8 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21819,7 +22051,8 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21903,7 +22136,8 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21987,7 +22221,8 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22071,7 +22306,8 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22155,7 +22391,8 @@ func TestExprAssign_Concat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22239,7 +22476,8 @@ func TestExprAssign_Div(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22323,7 +22561,8 @@ func TestExprAssign_Minus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22407,7 +22646,8 @@ func TestExprAssign_Mod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22491,7 +22731,8 @@ func TestExprAssign_Mul(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22575,7 +22816,8 @@ func TestExprAssign_Plus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22659,7 +22901,8 @@ func TestExprAssign_Pow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22743,7 +22986,8 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22827,7 +23071,8 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22911,7 +23156,8 @@ func TestExprAssign_Coalesce(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22997,7 +23243,8 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23081,7 +23328,8 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23165,7 +23413,8 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23249,7 +23498,8 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23333,7 +23583,8 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23417,7 +23668,8 @@ func TestExprBinary_Coalesce(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23501,7 +23753,8 @@ func TestExprBinary_Concat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23585,7 +23838,8 @@ func TestExprBinary_Div(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23669,7 +23923,8 @@ func TestExprBinary_Equal(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23753,7 +24008,8 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23837,7 +24093,8 @@ func TestExprBinary_Greater(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23921,7 +24178,8 @@ func TestExprBinary_Identical(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24005,7 +24263,8 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24089,7 +24348,8 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24173,7 +24433,8 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24257,7 +24518,8 @@ func TestExprBinary_Minus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24341,7 +24603,8 @@ func TestExprBinary_Mod(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24425,7 +24688,8 @@ func TestExprBinary_Mul(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24509,7 +24773,8 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24593,7 +24858,8 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24677,7 +24943,8 @@ func TestExprBinary_Plus(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24761,7 +25028,8 @@ func TestExprBinary_Pow(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24845,7 +25113,8 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24929,7 +25198,8 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25013,7 +25283,8 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25097,7 +25368,8 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25181,7 +25453,8 @@ func TestExprBinary_Spaceship(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25246,7 +25519,8 @@ func TestExprCast_Array(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25309,7 +25583,8 @@ func TestExprCast_Bool(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25372,7 +25647,8 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25435,7 +25711,8 @@ func TestExprCast_Double(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25498,7 +25775,8 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25561,7 +25839,8 @@ func TestExprCast_Int(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25624,7 +25903,8 @@ func TestExprCast_IntShort(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25687,7 +25967,8 @@ func TestExprCast_Object(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25750,7 +26031,8 @@ func TestExprCast_String(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25813,7 +26095,8 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25876,7 +26159,8 @@ func TestExprCast_Unset(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index 8058be7..61045b0 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/scanner" ) func BenchmarkPhp7(b *testing.B) { @@ -381,7 +382,8 @@ CAD; ` for n := 0; n < b.N; n++ { - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() } } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 7b78b29..1fd25a0 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -6,6 +6,7 @@ import ( "gotest.tools/assert" "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" @@ -19633,7 +19634,8 @@ func TestPhp7(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19770,7 +19772,8 @@ func TestPhp5Strings(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19996,7 +19999,8 @@ CAD; }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + php7parser := php7.NewParser(lexer, false, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20016,8 +20020,13 @@ func TestPhp7ControlCharsErrors(t *testing.T) { }, } - php7parser := php7.NewParser([]byte(src), "7.4", false) + parserErrors := []*errors.Error{} + errorHandlerFunc := func(e *errors.Error) { + parserErrors = append(parserErrors, e) + } + + lexer := scanner.NewLexer([]byte(src), "7.4", false, errorHandlerFunc) + php7parser := php7.NewParser(lexer, false, errorHandlerFunc) php7parser.Parse() - actual := php7parser.GetErrors() - assert.DeepEqual(t, expected, actual) + assert.DeepEqual(t, expected, parserErrors) } diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 18d5439..0ee65f5 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -3,6 +3,7 @@ package parser import ( "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/internal/version" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -12,22 +13,31 @@ import ( type Parser interface { Parse() int GetRootNode() ast.Vertex - GetErrors() []*errors.Error } -func NewParser(src []byte, v string, withTokens bool) (Parser, error) { +type Config struct { + WithTokens bool + WithPositions bool + ErrorHandlerFunc func(e *errors.Error) +} + +func Parse(src []byte, ver string, cfg Config) (ast.Vertex, error) { var parser Parser - r, err := version.Compare(v, "7.0") + r, err := version.Compare(ver, "7.0") if err != nil { return nil, err } + lexer := scanner.NewLexer(src, ver, cfg.WithTokens, cfg.ErrorHandlerFunc) + if r == -1 { - parser = php5.NewParser(src, v, withTokens) + parser = php5.NewParser(lexer, cfg.WithTokens, cfg.ErrorHandlerFunc) } else { - parser = php7.NewParser(src, v, withTokens) + parser = php7.NewParser(lexer, cfg.WithTokens, cfg.ErrorHandlerFunc) } - return parser, nil + parser.Parse() + + return parser.GetRootNode(), nil } diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 0546caf..e632f11 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -2,15 +2,18 @@ package printer_test import ( "bytes" - "github.com/z7zmey/php-parser/pkg/ast" "testing" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/internal/php5" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/printer" ) func parsePhp5(src string) ast.Vertex { - php5parser := php5.NewParser([]byte(src), "5.6", true) + lexer := scanner.NewLexer([]byte(src), "5.6", true, nil) + php5parser := php5.NewParser(lexer, true, nil) php5parser.Parse() return php5parser.GetRootNode() diff --git a/pkg/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go index d4599b1..7b634a4 100644 --- a/pkg/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -2,11 +2,13 @@ package printer_test import ( "bytes" - "github.com/z7zmey/php-parser/pkg/ast" "os" "testing" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/internal/php7" + "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/printer" ) @@ -27,7 +29,8 @@ abstract class Bar extends Baz // parse - php7parser := php7.NewParser([]byte(src), "7.4", true) + lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) + php7parser := php7.NewParser(lexer, true, nil) php7parser.Parse() rootNode := php7parser.GetRootNode() @@ -58,7 +61,8 @@ abstract class Bar extends Baz } func parse(src string) ast.Vertex { - php7parser := php7.NewParser([]byte(src), "7.4", true) + lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) + php7parser := php7.NewParser(lexer, true, nil) php7parser.Parse() return php7parser.GetRootNode() From ee3fe3b5c0933501cc219e01f2e504bf823ce647 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 30 Jun 2020 00:45:15 +0300 Subject: [PATCH 026/140] [refactoring] keep $ in variable identifier --- internal/php5/parser.go | 19 - internal/php5/parser_test.go | 558 ++++++++++---------- internal/php5/php5.go | Bin 342054 -> 339846 bytes internal/php5/php5.y | 73 +-- internal/php5/php5_test.go | 666 ++++++++++++------------ internal/php7/parser.go | 17 - internal/php7/parser_test.go | 606 ++++++++++----------- internal/php7/php7.go | Bin 280801 -> 278533 bytes internal/php7/php7.y | 44 +- internal/php7/php7_test.go | 580 ++++++++++----------- pkg/printer/printer.go | 7 +- pkg/printer/printer_parsed_php5_test.go | 2 +- pkg/printer/printer_test.go | 533 +++++++++---------- 13 files changed, 1506 insertions(+), 1599 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index f7c244f..02bc113 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -2,7 +2,6 @@ package php5 import ( "bytes" - "fmt" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" @@ -63,10 +62,6 @@ func lastNode(nn []ast.Vertex) ast.Vertex { return nn[len(nn)-1] } -func isDollar(r rune) bool { - return r == '$' -} - func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { if p.withTokens == false { return @@ -110,19 +105,6 @@ func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { } } -func (p *Parser) addDollarToken(v ast.Vertex) { - if p.withTokens == false { - return - } - - p.setFreeFloating(v, token.Dollar, []token.Token{ - { - ID: token.ID('$'), - Value: []byte("$"), - }, - }) -} - func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { if p.withTokens == false { return @@ -144,7 +126,6 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } vlen := len(semiColon[0].Value) - fmt.Printf("vlen: %q\n", string(semiColon[0].Value)) tlen := 2 if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index ec349e5..223eb2b 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -51,7 +51,7 @@ func TestIdentifier(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -165,7 +165,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -198,7 +198,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -242,7 +242,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 28, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -284,7 +284,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 31, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -317,7 +317,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -361,7 +361,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 47, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -414,7 +414,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 55, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -447,7 +447,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 62, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -546,7 +546,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 78, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -579,7 +579,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 85, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -623,7 +623,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 94, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -676,7 +676,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 102, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -709,7 +709,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 109, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -797,7 +797,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 124, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -830,7 +830,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 131, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -940,7 +940,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 27, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1029,7 +1029,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 46, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1144,7 +1144,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 92, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1233,7 +1233,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 111, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1325,7 +1325,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 136, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1414,7 +1414,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 155, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1495,7 +1495,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 187, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1584,7 +1584,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 206, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1917,7 +1917,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -1994,7 +1994,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -2071,7 +2071,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { EndPos: 13, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2159,7 +2159,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -2180,7 +2180,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -2266,7 +2266,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndPos: 13, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -2550,7 +2550,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndPos: 14, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -2653,7 +2653,7 @@ LBL; EndPos: 19, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -2745,7 +2745,7 @@ LBL; EndPos: 21, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, &ast.ScalarEncapsedStringPart{ @@ -3560,7 +3560,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3629,7 +3629,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3671,7 +3671,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3742,7 +3742,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3834,7 +3834,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3876,7 +3876,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 27, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3918,7 +3918,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 42, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -5618,7 +5618,7 @@ func TestStmtEcho(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -5685,7 +5685,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5794,7 +5794,7 @@ func TestStmtFor(t *testing.T) { EndPos: 9, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -5838,7 +5838,7 @@ func TestStmtFor(t *testing.T) { EndPos: 17, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5882,7 +5882,7 @@ func TestStmtFor(t *testing.T) { EndPos: 26, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5913,7 +5913,7 @@ func TestStmtFor(t *testing.T) { EndPos: 32, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5990,7 +5990,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 11, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -6034,7 +6034,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -6101,7 +6101,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6122,7 +6122,7 @@ func TestStmtForeach(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6198,7 +6198,7 @@ func TestStmtForeach_Expr(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6263,7 +6263,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -6284,7 +6284,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 20, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6349,7 +6349,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6370,7 +6370,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6391,7 +6391,7 @@ func TestStmtForeach_WithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6467,7 +6467,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6488,7 +6488,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndPos: 26, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6553,7 +6553,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6574,7 +6574,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -6604,7 +6604,7 @@ func TestStmtForeach_WithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6670,7 +6670,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6691,7 +6691,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -6731,7 +6731,7 @@ func TestStmtForeach_WithList(t *testing.T) { EndPos: 31, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6937,7 +6937,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 24, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -6981,7 +6981,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -7014,7 +7014,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndPos: 49, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7139,7 +7139,7 @@ func TestStmtGlobal(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7195,7 +7195,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -7216,7 +7216,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, &ast.ExprVariable{ @@ -7246,7 +7246,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 21, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -7453,7 +7453,7 @@ func TestStmtIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7518,7 +7518,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7560,7 +7560,7 @@ func TestStmtIf_ElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7627,7 +7627,7 @@ func TestStmtIf_Else(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7713,7 +7713,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7755,7 +7755,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7797,7 +7797,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndPos: 39, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -7885,7 +7885,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -7927,7 +7927,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 24, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7979,7 +7979,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndPos: 40, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -8530,7 +8530,7 @@ func TestStmtProperty(t *testing.T) { EndPos: 20, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8643,7 +8643,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8674,7 +8674,7 @@ func TestStmtProperty_Properties(t *testing.T) { EndPos: 34, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -8798,7 +8798,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -8840,7 +8840,7 @@ func TestStmtProperty_Properties2(t *testing.T) { EndPos: 38, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -8908,7 +8908,7 @@ func TestStmtStaticVar(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -8974,7 +8974,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -9005,7 +9005,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -9082,7 +9082,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ScalarLnumber{ @@ -9124,7 +9124,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndPos: 20, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -9656,7 +9656,7 @@ func TestStmtThrow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -10759,7 +10759,7 @@ func TestStmtTry_TryCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -10854,7 +10854,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -10911,7 +10911,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 63, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11006,7 +11006,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndPos: 32, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11110,7 +11110,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 29, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11167,7 +11167,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 61, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11224,7 +11224,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 103, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -11282,7 +11282,7 @@ func TestStmtUnset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11338,7 +11338,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -11359,7 +11359,7 @@ func TestStmtUnset_Vars(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12565,7 +12565,7 @@ func TestExprArrayDimFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -12649,7 +12649,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -12897,7 +12897,7 @@ func TestExprArray_Items(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12965,7 +12965,7 @@ func TestExprBitwiseNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13029,7 +13029,7 @@ func TestExprBooleanNot(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13235,7 +13235,7 @@ func TestExprClone_Brackets(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13299,7 +13299,7 @@ func TestExprClone(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13423,7 +13423,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13456,7 +13456,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13489,7 +13489,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 27, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -13519,7 +13519,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -13601,7 +13601,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13634,7 +13634,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13676,7 +13676,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 28, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -13698,7 +13698,7 @@ func TestExprClosure_Use2(t *testing.T) { EndPos: 32, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -13963,7 +13963,7 @@ func TestExprEmpty(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14027,7 +14027,7 @@ func TestExprErrorSuppress(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14091,7 +14091,7 @@ func TestExprEval(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14244,7 +14244,7 @@ func TestExprExit_Expr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14397,7 +14397,7 @@ func TestExprDie_Expr(t *testing.T) { EndPos: 9, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14714,7 +14714,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -14765,7 +14765,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 16, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14886,7 +14886,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 12, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Right: &ast.ScalarLnumber{ @@ -14965,7 +14965,7 @@ func TestExprPostDec(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15029,7 +15029,7 @@ func TestExprPostInc(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15093,7 +15093,7 @@ func TestExprPreDec(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15157,7 +15157,7 @@ func TestExprPreInc(t *testing.T) { EndPos: 7, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15221,7 +15221,7 @@ func TestExprInclude(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15285,7 +15285,7 @@ func TestExprInclude_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15349,7 +15349,7 @@ func TestExprRequire(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15413,7 +15413,7 @@ func TestExprRequire_Once(t *testing.T) { EndPos: 18, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15477,7 +15477,7 @@ func TestExprInstanceOf(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -15564,7 +15564,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -15651,7 +15651,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -15739,7 +15739,7 @@ func TestExprIsset(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15805,7 +15805,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -15826,7 +15826,7 @@ func TestExprIsset_Variables(t *testing.T) { EndPos: 15, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15902,7 +15902,7 @@ func TestExprList_Empty(t *testing.T) { EndPos: 14, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15985,7 +15985,7 @@ func TestExprList(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16009,7 +16009,7 @@ func TestExprList(t *testing.T) { EndPos: 16, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16101,7 +16101,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16126,7 +16126,7 @@ func TestExprList_ArrayIndex(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16228,7 +16228,7 @@ func TestExprList_List(t *testing.T) { EndPos: 15, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16255,7 +16255,7 @@ func TestExprList_List(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16339,7 +16339,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16363,7 +16363,7 @@ func TestExprList_EmptyItem(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16448,7 +16448,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16473,7 +16473,7 @@ func TestExprList_EmptyItems(t *testing.T) { EndPos: 22, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16537,7 +16537,7 @@ func TestExprMethodCall(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -16840,7 +16840,7 @@ func TestExprPrint(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -16904,7 +16904,7 @@ func TestExprPropertyFetch(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -16971,7 +16971,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -16992,7 +16992,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 20, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -17022,7 +17022,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { EndPos: 27, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -17109,7 +17109,7 @@ func TestExprShellExec(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -17335,7 +17335,7 @@ func TestExprShortArray_Items(t *testing.T) { EndPos: 13, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17687,7 +17687,7 @@ func TestExprStaticCall_Var(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -17761,7 +17761,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 7, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.ExprVariable{ @@ -17782,7 +17782,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -17879,7 +17879,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 12, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -17966,7 +17966,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndPos: 22, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -18053,7 +18053,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndPos: 13, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -18117,7 +18117,7 @@ func TestExprTernary(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -18138,7 +18138,7 @@ func TestExprTernary(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -18159,7 +18159,7 @@ func TestExprTernary(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18223,7 +18223,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -18244,7 +18244,7 @@ func TestExprTernary_Simple(t *testing.T) { EndPos: 12, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18308,7 +18308,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -18338,7 +18338,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -18359,7 +18359,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -18380,7 +18380,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -18402,7 +18402,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -18475,7 +18475,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -18496,7 +18496,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -18517,7 +18517,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 15, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -18539,7 +18539,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 20, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -18560,7 +18560,7 @@ func TestExprTernary_NestedCond(t *testing.T) { EndPos: 25, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -18624,7 +18624,7 @@ func TestExprUnaryMinus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18688,7 +18688,7 @@ func TestExprUnaryPlus(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18743,7 +18743,7 @@ func TestExprVariable(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18806,7 +18806,7 @@ func TestExprVariable_Variable(t *testing.T) { EndPos: 6, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18913,7 +18913,7 @@ func TestExprYield_Val(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18977,7 +18977,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -18998,7 +18998,7 @@ func TestExprYield_KeyVal(t *testing.T) { EndPos: 17, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19116,7 +19116,7 @@ func TestExprYield_KeyExpr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ScalarLnumber{ @@ -19193,7 +19193,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19214,7 +19214,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19278,7 +19278,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19299,7 +19299,7 @@ func TestExprAssign_Reference(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19363,7 +19363,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -19460,7 +19460,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprNew{ @@ -19534,7 +19534,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { EndPos: 19, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19602,7 +19602,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19623,7 +19623,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19687,7 +19687,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19708,7 +19708,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19772,7 +19772,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19793,7 +19793,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19857,7 +19857,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19878,7 +19878,7 @@ func TestExprAssign_Concat(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19942,7 +19942,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -19963,7 +19963,7 @@ func TestExprAssign_Div(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20027,7 +20027,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20048,7 +20048,7 @@ func TestExprAssign_Minus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20112,7 +20112,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20133,7 +20133,7 @@ func TestExprAssign_Mod(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20197,7 +20197,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20218,7 +20218,7 @@ func TestExprAssign_Mul(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20282,7 +20282,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20303,7 +20303,7 @@ func TestExprAssign_Plus(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20367,7 +20367,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20388,7 +20388,7 @@ func TestExprAssign_Pow(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20452,7 +20452,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20473,7 +20473,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20537,7 +20537,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -20558,7 +20558,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20624,7 +20624,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20645,7 +20645,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20709,7 +20709,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20730,7 +20730,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20794,7 +20794,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20815,7 +20815,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20879,7 +20879,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20900,7 +20900,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -20964,7 +20964,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -20985,7 +20985,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21049,7 +21049,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21070,7 +21070,7 @@ func TestExprBinary_Concat(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21134,7 +21134,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21155,7 +21155,7 @@ func TestExprBinary_Div(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21219,7 +21219,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21240,7 +21240,7 @@ func TestExprBinary_Equal(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21304,7 +21304,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21325,7 +21325,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21389,7 +21389,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21410,7 +21410,7 @@ func TestExprBinary_Greater(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21474,7 +21474,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21495,7 +21495,7 @@ func TestExprBinary_Identical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21559,7 +21559,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21580,7 +21580,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21644,7 +21644,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21665,7 +21665,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21729,7 +21729,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21750,7 +21750,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21814,7 +21814,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21835,7 +21835,7 @@ func TestExprBinary_Minus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21899,7 +21899,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -21920,7 +21920,7 @@ func TestExprBinary_Mod(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -21984,7 +21984,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22005,7 +22005,7 @@ func TestExprBinary_Mul(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22069,7 +22069,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22090,7 +22090,7 @@ func TestExprBinary_NotEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22154,7 +22154,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22175,7 +22175,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { EndPos: 12, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22239,7 +22239,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22260,7 +22260,7 @@ func TestExprBinary_Plus(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22324,7 +22324,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22345,7 +22345,7 @@ func TestExprBinary_Pow(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22409,7 +22409,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22430,7 +22430,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22494,7 +22494,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22515,7 +22515,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22579,7 +22579,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22600,7 +22600,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { EndPos: 11, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22664,7 +22664,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 5, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -22685,7 +22685,7 @@ func TestExprBinary_Smaller(t *testing.T) { EndPos: 10, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -22751,7 +22751,7 @@ func TestExprCast_Array(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22815,7 +22815,7 @@ func TestExprCast_Bool(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22879,7 +22879,7 @@ func TestExprCast_BoolShort(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -22943,7 +22943,7 @@ func TestExprCast_Double(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23007,7 +23007,7 @@ func TestExprCast_CastFloat(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23071,7 +23071,7 @@ func TestExprCast_Int(t *testing.T) { EndPos: 14, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23135,7 +23135,7 @@ func TestExprCast_IntShort(t *testing.T) { EndPos: 10, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23199,7 +23199,7 @@ func TestExprCast_Object(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23263,7 +23263,7 @@ func TestExprCast_String(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23327,7 +23327,7 @@ func TestExprCast_BinaryString(t *testing.T) { EndPos: 13, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -23391,7 +23391,7 @@ func TestExprCast_Unset(t *testing.T) { EndPos: 12, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 22e8d54e951aceb2210da573ee1977d0171e989c..01c6d9df5118607f062b72163c0e10a752c85bb5 100644 GIT binary patch delta 8942 zcmb7Kd0drc_WwM~3j!*jf`K4QqM{P_UM`!dfhk}%DXB9#<%ms|Yoa-+nTBRLmWn#b zahGgUM;)Bh$I8sg78_HiMW>IsHfpIUt!85VzUO)G1!`*M^ZSeYp7&YKe!l0tJX_o9 z(POP@o{JC5$qf&mIHi1eGKnp^^}}z)o44Y{xYwx0kzsWHHqnwkZ{l>KG z@fejVn$ZtObuYTO;tH`tc`3=-A@QVRrHdnH0HcmP77;;SC$uwfi(SdQ7n8EJsE5#7l_mJ z+6C~HTB-1OQ7j|xTHTs|4WzVMQ6#cybB6nBARVm5)?8})g%~5e{3n)infWzv1mOAh2A~bt1d!N!g@IIf5=M7^nr{Hyfk@!v$#Dokz_PB^#r4}^IaWy%BR<)9S=;S`= zE4h^lGa)f@si1|W*l3@3#>(E3QWAomlNu+J1Q=h}Q>5|R zGTPFUs@lm`lz3b>r3Eu|3#x9fN+{|{J%k2dEBm<1hiq$yQ`qb<0@bF#r5`#i^G#(3 znJ;BdUSs1#@T=Zb^MGz|rgf5&BpYvaro5h#GDRxYWy(sb-KWE8Riw_O1&Mkr?efbg zdZ#0H9l1`v3e{tIiGpV9x0&8qU?3znJS=Q#IGy*&+{I<8Emb@!La8K6PNyM*WOu6e ziT31q6~1@0jl7YMy@pnLmwH4xVRXDo^rD!qP;coOsJ9`q z-T)2ejJ#g{T?(&xt-IVV!BEibiL|LemLN_V2%QQ8USt*)%GS`cfu4seI(Z)cpY#s| z_^2XTBK`ShOOdS6Zd_UVuD+nd|0@T|Jk#@L+0UWq&DdnU;zFtGBuQq_t?~&$x84$b zQ#249_zZT<1&cJ}iX1_+eg{#8O@t`+J)@kZLN@#j_xk{k2p)$-=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ch_name_list T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($5.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $5.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} catch := &ast.StmtCatch{ast.Node{}, $4, variable, $8} $$ = append($1, catch) @@ -1366,7 +1366,6 @@ catch_list: yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Hidden) yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Hidden) @@ -2142,7 +2141,7 @@ non_empty_parameter_list: parameter: optional_type is_reference is_variadic T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, nil} @@ -2171,7 +2170,6 @@ parameter: } yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2188,7 +2186,7 @@ parameter: } | optional_type is_reference is_variadic T_VARIABLE '=' expr { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($4.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.Parameter{ast.Node{}, $2 != nil, $3 != nil, $1, variable, $6} @@ -2218,7 +2216,6 @@ parameter: yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) - yylex.(*Parser).addDollarToken(variable) // normalize if $3 == nil { @@ -2448,7 +2445,7 @@ static_var_list: static_var: T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} @@ -2459,13 +2456,12 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' expr { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} @@ -2476,7 +2472,6 @@ static_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2975,7 +2970,7 @@ property_list: property: T_VARIABLE backup_doc_comment { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtProperty{ast.Node{}, variable, nil} @@ -2986,13 +2981,12 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '=' expr backup_doc_comment { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtProperty{ast.Node{}, variable, $3} @@ -3003,7 +2997,6 @@ property: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4289,7 +4282,7 @@ lexical_var_list: lexical_var: T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position @@ -4298,13 +4291,12 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($2.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $2.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.ExprReference{ast.Node{}, variable} @@ -4316,7 +4308,6 @@ lexical_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4937,7 +4928,7 @@ variable: simple_variable: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -4946,7 +4937,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4959,7 +4949,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) @@ -4974,7 +4963,6 @@ simple_variable: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Dollar, yylex.(*Parser).GetFreeFloatingToken($1)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5347,7 +5335,7 @@ encaps_list: encaps_var: T_VARIABLE { - name := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + name := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, name} // save position @@ -5356,13 +5344,12 @@ encaps_var: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} @@ -5372,7 +5359,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) @@ -5380,7 +5366,7 @@ encaps_var: } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} fetch := &ast.Identifier{ast.Node{}, $3.Value} $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} @@ -5392,7 +5378,6 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).addDollarToken(variable) yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) @@ -5519,7 +5504,7 @@ encaps_var_offset: } | T_VARIABLE { - identifier := &ast.Identifier{ast.Node{}, bytes.TrimLeftFunc($1.Value, isDollar)} + identifier := &ast.Identifier{ast.Node{}, $1.Value} $$ = &ast.ExprVariable{ast.Node{}, identifier} // save position @@ -5528,7 +5513,6 @@ encaps_var_offset: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).addDollarToken($$) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 1fd25a0..169e62c 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -455,7 +455,7 @@ func TestPhp7(t *testing.T) { EndPos: 11, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -488,7 +488,7 @@ func TestPhp7(t *testing.T) { EndPos: 18, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -532,7 +532,7 @@ func TestPhp7(t *testing.T) { EndPos: 27, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -574,7 +574,7 @@ func TestPhp7(t *testing.T) { EndPos: 30, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -607,7 +607,7 @@ func TestPhp7(t *testing.T) { EndPos: 37, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -651,7 +651,7 @@ func TestPhp7(t *testing.T) { EndPos: 46, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -704,7 +704,7 @@ func TestPhp7(t *testing.T) { EndPos: 54, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -737,7 +737,7 @@ func TestPhp7(t *testing.T) { EndPos: 61, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -836,7 +836,7 @@ func TestPhp7(t *testing.T) { EndPos: 77, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -869,7 +869,7 @@ func TestPhp7(t *testing.T) { EndPos: 84, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -913,7 +913,7 @@ func TestPhp7(t *testing.T) { EndPos: 93, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Call: &ast.Identifier{ @@ -966,7 +966,7 @@ func TestPhp7(t *testing.T) { EndPos: 101, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -999,7 +999,7 @@ func TestPhp7(t *testing.T) { EndPos: 108, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1087,7 +1087,7 @@ func TestPhp7(t *testing.T) { EndPos: 123, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1120,7 +1120,7 @@ func TestPhp7(t *testing.T) { EndPos: 130, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1194,7 +1194,7 @@ func TestPhp7(t *testing.T) { EndPos: 173, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -1227,7 +1227,7 @@ func TestPhp7(t *testing.T) { EndPos: 180, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -1304,7 +1304,7 @@ func TestPhp7(t *testing.T) { EndPos: 212, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -1354,7 +1354,7 @@ func TestPhp7(t *testing.T) { EndPos: 224, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Dim: &ast.ScalarLnumber{ @@ -1416,7 +1416,7 @@ func TestPhp7(t *testing.T) { EndPos: 239, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Dim: &ast.ExprVariable{ @@ -1437,7 +1437,7 @@ func TestPhp7(t *testing.T) { EndPos: 244, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1488,7 +1488,7 @@ func TestPhp7(t *testing.T) { EndPos: 257, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -1550,7 +1550,7 @@ func TestPhp7(t *testing.T) { EndPos: 274, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -1571,7 +1571,7 @@ func TestPhp7(t *testing.T) { EndPos: 280, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1633,7 +1633,7 @@ func TestPhp7(t *testing.T) { EndPos: 300, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -1723,7 +1723,7 @@ func TestPhp7(t *testing.T) { EndPos: 327, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -1812,7 +1812,7 @@ func TestPhp7(t *testing.T) { EndPos: 346, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -1937,7 +1937,7 @@ func TestPhp7(t *testing.T) { EndPos: 393, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2026,7 +2026,7 @@ func TestPhp7(t *testing.T) { EndPos: 412, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2128,7 +2128,7 @@ func TestPhp7(t *testing.T) { EndPos: 438, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2217,7 +2217,7 @@ func TestPhp7(t *testing.T) { EndPos: 457, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2308,7 +2308,7 @@ func TestPhp7(t *testing.T) { EndPos: 490, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, DefaultValue: &ast.ExprConstFetch{ @@ -2397,7 +2397,7 @@ func TestPhp7(t *testing.T) { EndPos: 509, }, }, - Value: []byte("baz"), + Value: []byte("$baz"), }, }, }, @@ -2768,7 +2768,7 @@ func TestPhp7(t *testing.T) { EndPos: 876, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, }, @@ -2831,7 +2831,7 @@ func TestPhp7(t *testing.T) { EndPos: 891, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarLnumber{ @@ -2906,7 +2906,7 @@ func TestPhp7(t *testing.T) { EndPos: 909, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ExprUnaryMinus{ @@ -2991,7 +2991,7 @@ func TestPhp7(t *testing.T) { EndPos: 928, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3066,7 +3066,7 @@ func TestPhp7(t *testing.T) { EndPos: 985, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3141,7 +3141,7 @@ func TestPhp7(t *testing.T) { EndPos: 1043, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ScalarString{ @@ -3216,7 +3216,7 @@ func TestPhp7(t *testing.T) { EndPos: 1063, }, }, - Value: []byte("var"), + Value: []byte("$var"), }, }, Dim: &ast.ExprVariable{ @@ -3237,7 +3237,7 @@ func TestPhp7(t *testing.T) { EndPos: 1068, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -3281,7 +3281,7 @@ func TestPhp7(t *testing.T) { EndPos: 1079, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, &ast.ScalarEncapsedStringPart{ @@ -3313,7 +3313,7 @@ func TestPhp7(t *testing.T) { EndPos: 1084, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -3376,7 +3376,7 @@ func TestPhp7(t *testing.T) { EndPos: 1099, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.Identifier{ @@ -3591,7 +3591,7 @@ func TestPhp7(t *testing.T) { EndPos: 1160, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -3655,7 +3655,7 @@ func TestPhp7(t *testing.T) { EndPos: 1177, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Method: &ast.Identifier{ @@ -3710,7 +3710,7 @@ func TestPhp7(t *testing.T) { EndPos: 1197, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3752,7 +3752,7 @@ func TestPhp7(t *testing.T) { EndPos: 1218, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3794,7 +3794,7 @@ func TestPhp7(t *testing.T) { EndPos: 1234, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3838,7 +3838,7 @@ func TestPhp7(t *testing.T) { EndPos: 1254, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3901,7 +3901,7 @@ func TestPhp7(t *testing.T) { EndPos: 1283, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -3943,7 +3943,7 @@ func TestPhp7(t *testing.T) { EndPos: 1299, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -3985,7 +3985,7 @@ func TestPhp7(t *testing.T) { EndPos: 1314, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -5476,7 +5476,7 @@ func TestPhp7(t *testing.T) { EndPos: 2036, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ScalarLnumber{ @@ -5520,7 +5520,7 @@ func TestPhp7(t *testing.T) { EndPos: 2050, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -5562,7 +5562,7 @@ func TestPhp7(t *testing.T) { EndPos: 2061, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Expr: &ast.ScalarLnumber{ @@ -5606,7 +5606,7 @@ func TestPhp7(t *testing.T) { EndPos: 2069, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5650,7 +5650,7 @@ func TestPhp7(t *testing.T) { EndPos: 2078, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5681,7 +5681,7 @@ func TestPhp7(t *testing.T) { EndPos: 2084, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5735,7 +5735,7 @@ func TestPhp7(t *testing.T) { EndPos: 2101, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, Right: &ast.ScalarLnumber{ @@ -5779,7 +5779,7 @@ func TestPhp7(t *testing.T) { EndPos: 2110, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5810,7 +5810,7 @@ func TestPhp7(t *testing.T) { EndPos: 2116, }, }, - Value: []byte("i"), + Value: []byte("$i"), }, }, }, @@ -5854,7 +5854,7 @@ func TestPhp7(t *testing.T) { EndPos: 2143, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -5875,7 +5875,7 @@ func TestPhp7(t *testing.T) { EndPos: 2149, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5917,7 +5917,7 @@ func TestPhp7(t *testing.T) { EndPos: 2167, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Var: &ast.ExprVariable{ @@ -5938,7 +5938,7 @@ func TestPhp7(t *testing.T) { EndPos: 2173, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -5980,7 +5980,7 @@ func TestPhp7(t *testing.T) { EndPos: 2202, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6001,7 +6001,7 @@ func TestPhp7(t *testing.T) { EndPos: 2208, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprVariable{ @@ -6022,7 +6022,7 @@ func TestPhp7(t *testing.T) { EndPos: 2214, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, Stmt: &ast.StmtStmtList{ @@ -6064,7 +6064,7 @@ func TestPhp7(t *testing.T) { EndPos: 2232, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6085,7 +6085,7 @@ func TestPhp7(t *testing.T) { EndPos: 2238, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprReference{ @@ -6115,7 +6115,7 @@ func TestPhp7(t *testing.T) { EndPos: 2245, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6158,7 +6158,7 @@ func TestPhp7(t *testing.T) { EndPos: 2263, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6179,7 +6179,7 @@ func TestPhp7(t *testing.T) { EndPos: 2269, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprList{ @@ -6219,7 +6219,7 @@ func TestPhp7(t *testing.T) { EndPos: 2280, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6264,7 +6264,7 @@ func TestPhp7(t *testing.T) { EndPos: 2299, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Key: &ast.ExprVariable{ @@ -6285,7 +6285,7 @@ func TestPhp7(t *testing.T) { EndPos: 2305, }, }, - Value: []byte("k"), + Value: []byte("$k"), }, }, Var: &ast.ExprShortList{ @@ -6325,7 +6325,7 @@ func TestPhp7(t *testing.T) { EndPos: 2312, }, }, - Value: []byte("v"), + Value: []byte("$v"), }, }, }, @@ -6519,7 +6519,7 @@ func TestPhp7(t *testing.T) { EndPos: 2433, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -6540,7 +6540,7 @@ func TestPhp7(t *testing.T) { EndPos: 2437, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -6614,7 +6614,7 @@ func TestPhp7(t *testing.T) { EndPos: 2463, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6656,7 +6656,7 @@ func TestPhp7(t *testing.T) { EndPos: 2476, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6698,7 +6698,7 @@ func TestPhp7(t *testing.T) { EndPos: 2491, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6742,7 +6742,7 @@ func TestPhp7(t *testing.T) { EndPos: 2504, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6805,7 +6805,7 @@ func TestPhp7(t *testing.T) { EndPos: 2525, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6847,7 +6847,7 @@ func TestPhp7(t *testing.T) { EndPos: 2540, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -6889,7 +6889,7 @@ func TestPhp7(t *testing.T) { EndPos: 2555, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -6954,7 +6954,7 @@ func TestPhp7(t *testing.T) { EndPos: 2576, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Stmt: &ast.StmtStmtList{ @@ -6996,7 +6996,7 @@ func TestPhp7(t *testing.T) { EndPos: 2591, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Stmt: &ast.StmtStmtList{ @@ -7048,7 +7048,7 @@ func TestPhp7(t *testing.T) { EndPos: 2607, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, Stmt: &ast.StmtStmtList{ @@ -7415,7 +7415,7 @@ func TestPhp7(t *testing.T) { EndPos: 2796, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7505,7 +7505,7 @@ func TestPhp7(t *testing.T) { EndPos: 2828, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7536,7 +7536,7 @@ func TestPhp7(t *testing.T) { EndPos: 2832, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -7592,7 +7592,7 @@ func TestPhp7(t *testing.T) { EndPos: 2850, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -7623,7 +7623,7 @@ func TestPhp7(t *testing.T) { EndPos: 2854, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, Expr: &ast.ScalarLnumber{ @@ -8030,7 +8030,7 @@ func TestPhp7(t *testing.T) { EndPos: 3103, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -8966,7 +8966,7 @@ func TestPhp7(t *testing.T) { EndPos: 3445, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9059,7 +9059,7 @@ func TestPhp7(t *testing.T) { EndPos: 3495, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9129,7 +9129,7 @@ func TestPhp7(t *testing.T) { EndPos: 3528, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9186,7 +9186,7 @@ func TestPhp7(t *testing.T) { EndPos: 3559, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9256,7 +9256,7 @@ func TestPhp7(t *testing.T) { EndPos: 3592, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, Stmts: []ast.Vertex{}, @@ -9302,7 +9302,7 @@ func TestPhp7(t *testing.T) { EndPos: 3619, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -9323,7 +9323,7 @@ func TestPhp7(t *testing.T) { EndPos: 3623, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10637,7 +10637,7 @@ func TestPhp7(t *testing.T) { EndPos: 3991, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -10698,7 +10698,7 @@ func TestPhp7(t *testing.T) { EndPos: 4000, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Dim: &ast.ScalarLnumber{ @@ -10877,7 +10877,7 @@ func TestPhp7(t *testing.T) { EndPos: 4048, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -10922,7 +10922,7 @@ func TestPhp7(t *testing.T) { EndPos: 4057, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -10963,7 +10963,7 @@ func TestPhp7(t *testing.T) { EndPos: 4064, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11058,7 +11058,7 @@ func TestPhp7(t *testing.T) { EndPos: 4085, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ConstantName: &ast.Identifier{ @@ -11110,7 +11110,7 @@ func TestPhp7(t *testing.T) { EndPos: 4102, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11151,7 +11151,7 @@ func TestPhp7(t *testing.T) { EndPos: 4115, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11229,7 +11229,7 @@ func TestPhp7(t *testing.T) { EndPos: 4146, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11262,7 +11262,7 @@ func TestPhp7(t *testing.T) { EndPos: 4150, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -11295,7 +11295,7 @@ func TestPhp7(t *testing.T) { EndPos: 4159, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, &ast.ExprReference{ @@ -11325,7 +11325,7 @@ func TestPhp7(t *testing.T) { EndPos: 4164, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -11545,7 +11545,7 @@ func TestPhp7(t *testing.T) { EndPos: 4236, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11586,7 +11586,7 @@ func TestPhp7(t *testing.T) { EndPos: 4244, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11627,7 +11627,7 @@ func TestPhp7(t *testing.T) { EndPos: 4255, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11690,7 +11690,7 @@ func TestPhp7(t *testing.T) { EndPos: 4275, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11753,7 +11753,7 @@ func TestPhp7(t *testing.T) { EndPos: 4293, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -11953,7 +11953,7 @@ func TestPhp7(t *testing.T) { EndPos: 4340, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, ArgumentList: &ast.ArgumentList{ @@ -12004,7 +12004,7 @@ func TestPhp7(t *testing.T) { EndPos: 4349, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12045,7 +12045,7 @@ func TestPhp7(t *testing.T) { EndPos: 4357, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12086,7 +12086,7 @@ func TestPhp7(t *testing.T) { EndPos: 4367, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12127,7 +12127,7 @@ func TestPhp7(t *testing.T) { EndPos: 4375, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12168,7 +12168,7 @@ func TestPhp7(t *testing.T) { EndPos: 4390, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12209,7 +12209,7 @@ func TestPhp7(t *testing.T) { EndPos: 4409, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12250,7 +12250,7 @@ func TestPhp7(t *testing.T) { EndPos: 4423, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12291,7 +12291,7 @@ func TestPhp7(t *testing.T) { EndPos: 4442, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12332,7 +12332,7 @@ func TestPhp7(t *testing.T) { EndPos: 4449, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameName{ @@ -12396,7 +12396,7 @@ func TestPhp7(t *testing.T) { EndPos: 4470, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameRelative{ @@ -12460,7 +12460,7 @@ func TestPhp7(t *testing.T) { EndPos: 4501, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Class: &ast.NameFullyQualified{ @@ -12525,7 +12525,7 @@ func TestPhp7(t *testing.T) { EndPos: 4530, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, &ast.ExprVariable{ @@ -12546,7 +12546,7 @@ func TestPhp7(t *testing.T) { EndPos: 4534, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12607,7 +12607,7 @@ func TestPhp7(t *testing.T) { EndPos: 4546, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12631,7 +12631,7 @@ func TestPhp7(t *testing.T) { EndPos: 4552, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12700,7 +12700,7 @@ func TestPhp7(t *testing.T) { EndPos: 4563, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12725,7 +12725,7 @@ func TestPhp7(t *testing.T) { EndPos: 4571, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12804,7 +12804,7 @@ func TestPhp7(t *testing.T) { EndPos: 4587, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -12831,7 +12831,7 @@ func TestPhp7(t *testing.T) { EndPos: 4594, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -12872,7 +12872,7 @@ func TestPhp7(t *testing.T) { EndPos: 4601, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Method: &ast.Identifier{ @@ -13123,7 +13123,7 @@ func TestPhp7(t *testing.T) { EndPos: 4675, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13156,7 +13156,7 @@ func TestPhp7(t *testing.T) { EndPos: 4682, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13202,7 +13202,7 @@ func TestPhp7(t *testing.T) { EndPos: 4698, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13243,7 +13243,7 @@ func TestPhp7(t *testing.T) { EndPos: 4705, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Property: &ast.Identifier{ @@ -13307,7 +13307,7 @@ func TestPhp7(t *testing.T) { EndPos: 4721, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13518,7 +13518,7 @@ func TestPhp7(t *testing.T) { EndPos: 4764, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13582,7 +13582,7 @@ func TestPhp7(t *testing.T) { EndPos: 4774, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13606,7 +13606,7 @@ func TestPhp7(t *testing.T) { EndPos: 4780, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13675,7 +13675,7 @@ func TestPhp7(t *testing.T) { EndPos: 4787, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13700,7 +13700,7 @@ func TestPhp7(t *testing.T) { EndPos: 4795, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -13779,7 +13779,7 @@ func TestPhp7(t *testing.T) { EndPos: 4807, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -13806,7 +13806,7 @@ func TestPhp7(t *testing.T) { EndPos: 4814, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14062,7 +14062,7 @@ func TestPhp7(t *testing.T) { EndPos: 4880, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14103,7 +14103,7 @@ func TestPhp7(t *testing.T) { EndPos: 4888, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -14124,7 +14124,7 @@ func TestPhp7(t *testing.T) { EndPos: 4894, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14188,7 +14188,7 @@ func TestPhp7(t *testing.T) { EndPos: 4917, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14252,7 +14252,7 @@ func TestPhp7(t *testing.T) { EndPos: 4931, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -14293,7 +14293,7 @@ func TestPhp7(t *testing.T) { EndPos: 4937, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -14314,7 +14314,7 @@ func TestPhp7(t *testing.T) { EndPos: 4942, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -14335,7 +14335,7 @@ func TestPhp7(t *testing.T) { EndPos: 4947, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14376,7 +14376,7 @@ func TestPhp7(t *testing.T) { EndPos: 4953, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfFalse: &ast.ExprVariable{ @@ -14397,7 +14397,7 @@ func TestPhp7(t *testing.T) { EndPos: 4960, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14438,7 +14438,7 @@ func TestPhp7(t *testing.T) { EndPos: 4966, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprTernary{ @@ -14468,7 +14468,7 @@ func TestPhp7(t *testing.T) { EndPos: 4971, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfTrue: &ast.ExprVariable{ @@ -14489,7 +14489,7 @@ func TestPhp7(t *testing.T) { EndPos: 4976, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, IfFalse: &ast.ExprVariable{ @@ -14510,7 +14510,7 @@ func TestPhp7(t *testing.T) { EndPos: 4981, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, }, @@ -14532,7 +14532,7 @@ func TestPhp7(t *testing.T) { EndPos: 4986, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14582,7 +14582,7 @@ func TestPhp7(t *testing.T) { EndPos: 4992, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, IfTrue: &ast.ExprVariable{ @@ -14603,7 +14603,7 @@ func TestPhp7(t *testing.T) { EndPos: 4997, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, IfFalse: &ast.ExprVariable{ @@ -14624,7 +14624,7 @@ func TestPhp7(t *testing.T) { EndPos: 5002, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, }, @@ -14646,7 +14646,7 @@ func TestPhp7(t *testing.T) { EndPos: 5007, }, }, - Value: []byte("d"), + Value: []byte("$d"), }, }, IfFalse: &ast.ExprVariable{ @@ -14667,7 +14667,7 @@ func TestPhp7(t *testing.T) { EndPos: 5012, }, }, - Value: []byte("e"), + Value: []byte("$e"), }, }, }, @@ -14708,7 +14708,7 @@ func TestPhp7(t *testing.T) { EndPos: 5019, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14749,7 +14749,7 @@ func TestPhp7(t *testing.T) { EndPos: 5026, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14790,7 +14790,7 @@ func TestPhp7(t *testing.T) { EndPos: 5033, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14851,7 +14851,7 @@ func TestPhp7(t *testing.T) { EndPos: 5054, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14892,7 +14892,7 @@ func TestPhp7(t *testing.T) { EndPos: 5066, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Value: &ast.ExprVariable{ @@ -14913,7 +14913,7 @@ func TestPhp7(t *testing.T) { EndPos: 5072, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -14954,7 +14954,7 @@ func TestPhp7(t *testing.T) { EndPos: 5089, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -14995,7 +14995,7 @@ func TestPhp7(t *testing.T) { EndPos: 5105, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15036,7 +15036,7 @@ func TestPhp7(t *testing.T) { EndPos: 5120, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15077,7 +15077,7 @@ func TestPhp7(t *testing.T) { EndPos: 5132, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15118,7 +15118,7 @@ func TestPhp7(t *testing.T) { EndPos: 5146, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15159,7 +15159,7 @@ func TestPhp7(t *testing.T) { EndPos: 5159, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15200,7 +15200,7 @@ func TestPhp7(t *testing.T) { EndPos: 5174, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15241,7 +15241,7 @@ func TestPhp7(t *testing.T) { EndPos: 5185, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15282,7 +15282,7 @@ func TestPhp7(t *testing.T) { EndPos: 5199, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15323,7 +15323,7 @@ func TestPhp7(t *testing.T) { EndPos: 5213, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15364,7 +15364,7 @@ func TestPhp7(t *testing.T) { EndPos: 5226, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -15405,7 +15405,7 @@ func TestPhp7(t *testing.T) { EndPos: 5233, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15426,7 +15426,7 @@ func TestPhp7(t *testing.T) { EndPos: 5238, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15467,7 +15467,7 @@ func TestPhp7(t *testing.T) { EndPos: 5244, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15488,7 +15488,7 @@ func TestPhp7(t *testing.T) { EndPos: 5249, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15529,7 +15529,7 @@ func TestPhp7(t *testing.T) { EndPos: 5255, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15550,7 +15550,7 @@ func TestPhp7(t *testing.T) { EndPos: 5260, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15591,7 +15591,7 @@ func TestPhp7(t *testing.T) { EndPos: 5266, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15612,7 +15612,7 @@ func TestPhp7(t *testing.T) { EndPos: 5272, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15653,7 +15653,7 @@ func TestPhp7(t *testing.T) { EndPos: 5278, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15674,7 +15674,7 @@ func TestPhp7(t *testing.T) { EndPos: 5284, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15715,7 +15715,7 @@ func TestPhp7(t *testing.T) { EndPos: 5290, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15736,7 +15736,7 @@ func TestPhp7(t *testing.T) { EndPos: 5296, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15777,7 +15777,7 @@ func TestPhp7(t *testing.T) { EndPos: 5302, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15798,7 +15798,7 @@ func TestPhp7(t *testing.T) { EndPos: 5307, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15839,7 +15839,7 @@ func TestPhp7(t *testing.T) { EndPos: 5313, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15860,7 +15860,7 @@ func TestPhp7(t *testing.T) { EndPos: 5318, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15901,7 +15901,7 @@ func TestPhp7(t *testing.T) { EndPos: 5324, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15922,7 +15922,7 @@ func TestPhp7(t *testing.T) { EndPos: 5330, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -15963,7 +15963,7 @@ func TestPhp7(t *testing.T) { EndPos: 5336, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -15984,7 +15984,7 @@ func TestPhp7(t *testing.T) { EndPos: 5342, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16025,7 +16025,7 @@ func TestPhp7(t *testing.T) { EndPos: 5348, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16046,7 +16046,7 @@ func TestPhp7(t *testing.T) { EndPos: 5353, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16087,7 +16087,7 @@ func TestPhp7(t *testing.T) { EndPos: 5359, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16108,7 +16108,7 @@ func TestPhp7(t *testing.T) { EndPos: 5366, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16149,7 +16149,7 @@ func TestPhp7(t *testing.T) { EndPos: 5372, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16170,7 +16170,7 @@ func TestPhp7(t *testing.T) { EndPos: 5379, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16211,7 +16211,7 @@ func TestPhp7(t *testing.T) { EndPos: 5385, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16232,7 +16232,7 @@ func TestPhp7(t *testing.T) { EndPos: 5391, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16273,7 +16273,7 @@ func TestPhp7(t *testing.T) { EndPos: 5397, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16294,7 +16294,7 @@ func TestPhp7(t *testing.T) { EndPos: 5404, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16335,7 +16335,7 @@ func TestPhp7(t *testing.T) { EndPos: 5410, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16356,7 +16356,7 @@ func TestPhp7(t *testing.T) { EndPos: 5415, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16397,7 +16397,7 @@ func TestPhp7(t *testing.T) { EndPos: 5421, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16418,7 +16418,7 @@ func TestPhp7(t *testing.T) { EndPos: 5426, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16459,7 +16459,7 @@ func TestPhp7(t *testing.T) { EndPos: 5432, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16480,7 +16480,7 @@ func TestPhp7(t *testing.T) { EndPos: 5437, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16521,7 +16521,7 @@ func TestPhp7(t *testing.T) { EndPos: 5443, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16542,7 +16542,7 @@ func TestPhp7(t *testing.T) { EndPos: 5449, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16583,7 +16583,7 @@ func TestPhp7(t *testing.T) { EndPos: 5455, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16604,7 +16604,7 @@ func TestPhp7(t *testing.T) { EndPos: 5462, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16645,7 +16645,7 @@ func TestPhp7(t *testing.T) { EndPos: 5468, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16666,7 +16666,7 @@ func TestPhp7(t *testing.T) { EndPos: 5473, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16707,7 +16707,7 @@ func TestPhp7(t *testing.T) { EndPos: 5479, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16728,7 +16728,7 @@ func TestPhp7(t *testing.T) { EndPos: 5485, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16769,7 +16769,7 @@ func TestPhp7(t *testing.T) { EndPos: 5491, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16790,7 +16790,7 @@ func TestPhp7(t *testing.T) { EndPos: 5497, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16831,7 +16831,7 @@ func TestPhp7(t *testing.T) { EndPos: 5503, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16852,7 +16852,7 @@ func TestPhp7(t *testing.T) { EndPos: 5509, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16893,7 +16893,7 @@ func TestPhp7(t *testing.T) { EndPos: 5515, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16914,7 +16914,7 @@ func TestPhp7(t *testing.T) { EndPos: 5521, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -16955,7 +16955,7 @@ func TestPhp7(t *testing.T) { EndPos: 5527, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -16976,7 +16976,7 @@ func TestPhp7(t *testing.T) { EndPos: 5532, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17017,7 +17017,7 @@ func TestPhp7(t *testing.T) { EndPos: 5538, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Right: &ast.ExprVariable{ @@ -17038,7 +17038,7 @@ func TestPhp7(t *testing.T) { EndPos: 5545, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17079,7 +17079,7 @@ func TestPhp7(t *testing.T) { EndPos: 5552, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17100,7 +17100,7 @@ func TestPhp7(t *testing.T) { EndPos: 5558, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17141,7 +17141,7 @@ func TestPhp7(t *testing.T) { EndPos: 5564, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17162,7 +17162,7 @@ func TestPhp7(t *testing.T) { EndPos: 5569, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17203,7 +17203,7 @@ func TestPhp7(t *testing.T) { EndPos: 5575, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17224,7 +17224,7 @@ func TestPhp7(t *testing.T) { EndPos: 5581, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17265,7 +17265,7 @@ func TestPhp7(t *testing.T) { EndPos: 5587, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17286,7 +17286,7 @@ func TestPhp7(t *testing.T) { EndPos: 5593, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17327,7 +17327,7 @@ func TestPhp7(t *testing.T) { EndPos: 5599, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17348,7 +17348,7 @@ func TestPhp7(t *testing.T) { EndPos: 5605, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17389,7 +17389,7 @@ func TestPhp7(t *testing.T) { EndPos: 5611, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17410,7 +17410,7 @@ func TestPhp7(t *testing.T) { EndPos: 5617, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17451,7 +17451,7 @@ func TestPhp7(t *testing.T) { EndPos: 5623, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17472,7 +17472,7 @@ func TestPhp7(t *testing.T) { EndPos: 5629, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17513,7 +17513,7 @@ func TestPhp7(t *testing.T) { EndPos: 5635, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17534,7 +17534,7 @@ func TestPhp7(t *testing.T) { EndPos: 5641, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17575,7 +17575,7 @@ func TestPhp7(t *testing.T) { EndPos: 5647, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17596,7 +17596,7 @@ func TestPhp7(t *testing.T) { EndPos: 5653, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17637,7 +17637,7 @@ func TestPhp7(t *testing.T) { EndPos: 5659, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17658,7 +17658,7 @@ func TestPhp7(t *testing.T) { EndPos: 5665, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17699,7 +17699,7 @@ func TestPhp7(t *testing.T) { EndPos: 5671, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17720,7 +17720,7 @@ func TestPhp7(t *testing.T) { EndPos: 5677, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17761,7 +17761,7 @@ func TestPhp7(t *testing.T) { EndPos: 5683, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17782,7 +17782,7 @@ func TestPhp7(t *testing.T) { EndPos: 5690, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17823,7 +17823,7 @@ func TestPhp7(t *testing.T) { EndPos: 5696, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17844,7 +17844,7 @@ func TestPhp7(t *testing.T) { EndPos: 5703, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -17885,7 +17885,7 @@ func TestPhp7(t *testing.T) { EndPos: 5709, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, Expr: &ast.ExprVariable{ @@ -17906,7 +17906,7 @@ func TestPhp7(t *testing.T) { EndPos: 5716, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18095,7 +18095,7 @@ func TestPhp7(t *testing.T) { EndPos: 5794, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18128,7 +18128,7 @@ func TestPhp7(t *testing.T) { EndPos: 5801, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18276,7 +18276,7 @@ func TestPhp7(t *testing.T) { EndPos: 5927, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18320,7 +18320,7 @@ func TestPhp7(t *testing.T) { EndPos: 5938, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18364,7 +18364,7 @@ func TestPhp7(t *testing.T) { EndPos: 5946, }, }, - Value: []byte("c"), + Value: []byte("$c"), }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18444,7 +18444,7 @@ func TestPhp7(t *testing.T) { EndPos: 5978, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -18488,7 +18488,7 @@ func TestPhp7(t *testing.T) { EndPos: 5991, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -18857,7 +18857,7 @@ func TestPhp7(t *testing.T) { EndPos: 6142, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -19090,7 +19090,7 @@ func TestPhp7(t *testing.T) { EndPos: 6183, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, }, @@ -19228,7 +19228,7 @@ func TestPhp7(t *testing.T) { EndPos: 6212, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, ArgumentList: &ast.ArgumentList{ @@ -19311,7 +19311,7 @@ func TestPhp7(t *testing.T) { EndPos: 6228, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, Dim: &ast.ScalarLnumber{ @@ -19374,7 +19374,7 @@ func TestPhp7(t *testing.T) { EndPos: 6245, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprVariable{ @@ -19395,7 +19395,7 @@ func TestPhp7(t *testing.T) { EndPos: 6251, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, }, @@ -19436,7 +19436,7 @@ func TestPhp7(t *testing.T) { EndPos: 6259, }, }, - Value: []byte("foo"), + Value: []byte("$foo"), }, }, Property: &ast.ExprArrayDimFetch{ @@ -19466,7 +19466,7 @@ func TestPhp7(t *testing.T) { EndPos: 6266, }, }, - Value: []byte("bar"), + Value: []byte("$bar"), }, }, Dim: &ast.ScalarLnumber{ @@ -19549,7 +19549,7 @@ func TestPhp7(t *testing.T) { EndPos: 6282, }, }, - Value: []byte("a"), + Value: []byte("$a"), }, }, }, @@ -19611,7 +19611,7 @@ func TestPhp7(t *testing.T) { EndPos: 6294, }, }, - Value: []byte("b"), + Value: []byte("$b"), }, }, }, @@ -19945,7 +19945,7 @@ CAD; EndPos: 85, }, }, - Value: []byte("world"), + Value: []byte("$world"), }, }, &ast.ScalarEncapsedStringPart{ diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 421db21..09399dd 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1,10 +1,11 @@ package printer import ( - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/token" "io" "strings" + + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" ) type printerState int @@ -1860,7 +1861,7 @@ func (p *Printer) printExprVariable(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.printFreeFloating(nn, token.Dollar) - if nn.GetNode().Tokens.IsEmpty() { + if _, ok := nn.VarName.(*ast.Identifier); !ok { io.WriteString(p.w, "$") } diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index e632f11..2257614 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1084,7 +1084,7 @@ func TestParseAndPrintPhp5Shebang(t *testing.T) { test Date: Fri, 3 Jul 2020 00:20:32 +0300 Subject: [PATCH 027/140] [refactoring] remove param withTokens from parser --- internal/php5/parser.go | 79 +- internal/php5/parser_test.go | 516 ++++----- internal/php5/php5.go | Bin 339846 -> 334300 bytes internal/php5/php5.y | 1370 +++++++++++------------ internal/php5/php5_bench_test.go | 2 +- internal/php5/php5_test.go | 8 +- internal/php7/parser.go | 78 +- internal/php7/parser_test.go | 564 +++++----- internal/php7/php7.go | Bin 278533 -> 274859 bytes internal/php7/php7.y | 1155 ++++++++++--------- internal/php7/php7_bench_test.go | 2 +- internal/php7/php7_test.go | 8 +- internal/scanner/lexer.go | 29 +- internal/scanner/scanner.go | Bin 384730 -> 384916 bytes internal/scanner/scanner.rl | 29 +- internal/scanner/scanner_test.go | 113 +- internal/scanner/token.go | 2 +- pkg/parser/parser.go | 4 +- pkg/printer/printer_parsed_php5_test.go | 5 +- pkg/printer/printer_parsed_php7_test.go | 4 +- 20 files changed, 2011 insertions(+), 1957 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 02bc113..04a37f3 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -14,14 +14,12 @@ type Parser struct { Lexer *scanner.Lexer currentToken *scanner.Token rootNode ast.Vertex - withTokens bool errHandlerFunc func(*errors.Error) } // NewParser creates and returns new Parser -func NewParser(lexer *scanner.Lexer, withTokens bool, errHandlerFunc func(*errors.Error)) *Parser { +func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser { return &Parser{ - withTokens: withTokens, Lexer: lexer, errHandlerFunc: errHandlerFunc, } @@ -63,7 +61,7 @@ func lastNode(nn []ast.Vertex) ast.Vertex { } func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if p.withTokens == false { + if _, ok := src.GetNode().Tokens[token.Start]; !ok { return } @@ -71,42 +69,64 @@ func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { return } - p.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) - delete(src.GetNode().Tokens, token.Start) -} - -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, strings []token.Token) { - if p.withTokens == false { - return - } - - if len(strings) == 0 { - return - } - dstCollection := &dst.GetNode().Tokens if *dstCollection == nil { *dstCollection = make(token.Collection) } - (*dstCollection)[pos] = strings + (*dstCollection)[token.Start] = src.GetNode().Tokens[token.Start] + delete(src.GetNode().Tokens, token.Start) } -func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if p.withTokens == false { - return []token.Token{} +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return } - return []token.Token{ - { - ID: token.ID(t.ID), - Value: t.Value, - }, + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) } + + l := len(tokens) + for _, v := range tokens[0 : l-1] { + (*dstCollection)[pos] = append((*dstCollection)[pos], v) + } +} + +func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + (*dstCollection)[pos] = make([]token.Token, 0) + + for _, v := range tokens { + (*dstCollection)[pos] = append((*dstCollection)[pos], v) + } +} + +func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + l := len(tokens) + (*dstCollection)[pos] = append((*dstCollection)[pos], tokens[l-1]) } func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if p.withTokens == false { + if _, ok := prevNode.GetNode().Tokens[token.SemiColon]; !ok { return } @@ -117,7 +137,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - p.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloatingTokens(prevNode, token.SemiColon, []token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -126,7 +146,6 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } vlen := len(semiColon[0].Value) - tlen := 2 if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { tlen = 3 @@ -145,7 +164,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. Value: semiColon[0].Value[vlen-tlen:], }) - p.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) + p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 223eb2b..2102e1c 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -59,7 +59,7 @@ func TestIdentifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -842,7 +842,7 @@ func TestPhp5ArgumentNode(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1596,7 +1596,7 @@ func TestPhp5ParameterNode(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1618,7 +1618,7 @@ func TestCommentEndFile(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1696,7 +1696,7 @@ func TestName(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1772,7 +1772,7 @@ func TestFullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1848,7 +1848,7 @@ func TestRelative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1927,7 +1927,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2004,7 +2004,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2092,7 +2092,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2190,7 +2190,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2299,7 +2299,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2376,7 +2376,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2474,7 +2474,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2582,7 +2582,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2674,7 +2674,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2766,7 +2766,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2826,7 +2826,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2872,7 +2872,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2932,7 +2932,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2977,7 +2977,7 @@ func TestScalarMagicConstant(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3021,7 +3021,7 @@ func TestScalarNumber_LNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3065,7 +3065,7 @@ func TestScalarNumber_DNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3109,7 +3109,7 @@ func TestScalarNumber_Float(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3153,7 +3153,7 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3197,7 +3197,7 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3241,7 +3241,7 @@ func TestScalarNumber_HLNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3285,7 +3285,7 @@ func TestScalarNumber_HDNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3329,7 +3329,7 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3373,7 +3373,7 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3419,7 +3419,7 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3463,7 +3463,7 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3509,7 +3509,7 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3579,7 +3579,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3692,7 +3692,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3782,7 +3782,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3960,7 +3960,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4082,7 +4082,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4161,7 +4161,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4310,7 +4310,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4413,7 +4413,7 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4528,7 +4528,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4573,7 +4573,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4631,7 +4631,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4722,7 +4722,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4815,7 +4815,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4931,7 +4931,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5030,7 +5030,7 @@ func TestStmtConstList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5096,7 +5096,7 @@ func TestStmtContinue_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5173,7 +5173,7 @@ func TestStmtContinue_Light(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5250,7 +5250,7 @@ func TestStmtContinue(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5327,7 +5327,7 @@ func TestStmtDeclare(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5437,7 +5437,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5516,7 +5516,7 @@ func TestStmtDeclare_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5571,7 +5571,7 @@ func TestStmtDo(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5638,7 +5638,7 @@ func TestStmtEcho(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5694,7 +5694,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5738,7 +5738,7 @@ func TestStmtExpression(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5934,7 +5934,7 @@ func TestStmtFor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6055,7 +6055,7 @@ func TestStmtFor_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6141,7 +6141,7 @@ func TestStmtForeach(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6217,7 +6217,7 @@ func TestStmtForeach_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6303,7 +6303,7 @@ func TestStmtForeach_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6410,7 +6410,7 @@ func TestStmtForeach_WithKey(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6507,7 +6507,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6624,7 +6624,7 @@ func TestStmtForeach_WithRef(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6753,7 +6753,7 @@ func TestStmtForeach_WithList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6799,7 +6799,7 @@ func TestStmtFunction(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6856,7 +6856,7 @@ func TestStmtFunction_Return(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7024,7 +7024,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7092,7 +7092,7 @@ func TestStmtFunction_Ref(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7148,7 +7148,7 @@ func TestStmtGlobal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7309,7 +7309,7 @@ func TestStmtGlobal_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7374,7 +7374,7 @@ func TestStmtGotoLabel(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7407,7 +7407,7 @@ func TestStmtHaltCompiler(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7472,7 +7472,7 @@ func TestStmtIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7581,7 +7581,7 @@ func TestStmtIf_ElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7667,7 +7667,7 @@ func TestStmtIf_Else(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7839,7 +7839,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8021,7 +8021,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8065,7 +8065,7 @@ func TestStmtInlineHtml(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8110,7 +8110,7 @@ func TestStmtInterface(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8190,7 +8190,7 @@ func TestStmtInterface_Extend(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8293,7 +8293,7 @@ func TestStmtInterface_Extends(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8349,7 +8349,7 @@ func TestStmtNamespace(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8406,7 +8406,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8440,7 +8440,7 @@ func TestStmtNamespace_Anonymous(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8542,7 +8542,7 @@ func TestStmtProperty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8697,7 +8697,7 @@ func TestStmtProperty_Properties(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8852,7 +8852,7 @@ func TestStmtProperty_Properties2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8918,7 +8918,7 @@ func TestStmtStaticVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9026,7 +9026,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9134,7 +9134,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9261,7 +9261,7 @@ func TestStmtSwitch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9388,7 +9388,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9505,7 +9505,7 @@ func TestStmtSwitch_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9610,7 +9610,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9664,7 +9664,7 @@ func TestStmtThrow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9709,7 +9709,7 @@ func TestStmtTrait(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9800,7 +9800,7 @@ func TestStmtTraitUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9914,7 +9914,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10028,7 +10028,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10186,7 +10186,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10355,7 +10355,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10638,7 +10638,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10675,7 +10675,7 @@ func TestStmtTry_Try(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10770,7 +10770,7 @@ func TestStmtTry_TryCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10922,7 +10922,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11028,7 +11028,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11235,7 +11235,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11291,7 +11291,7 @@ func TestStmtUnset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11368,7 +11368,7 @@ func TestStmtUnset_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11436,7 +11436,7 @@ func TestStmtUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11504,7 +11504,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11583,7 +11583,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11684,7 +11684,7 @@ func TestStmtUse_List(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11796,7 +11796,7 @@ func TestStmtUse_ListAlias(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11908,7 +11908,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12042,7 +12042,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12154,7 +12154,7 @@ func TestStmtUse_ListConstType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12288,7 +12288,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12354,7 +12354,7 @@ func TestStmtBreak_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12431,7 +12431,7 @@ func TestStmtBreak_Light(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12508,7 +12508,7 @@ func TestStmtBreak(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12585,7 +12585,7 @@ func TestExprArrayDimFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12681,7 +12681,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12725,7 +12725,7 @@ func TestExprArray(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12791,7 +12791,7 @@ func TestExprArray_Item(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12910,7 +12910,7 @@ func TestExprArray_Items(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12974,7 +12974,7 @@ func TestExprBitwiseNot(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13038,7 +13038,7 @@ func TestExprBooleanNot(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13115,7 +13115,7 @@ func TestExprClassConstFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13180,7 +13180,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13244,7 +13244,7 @@ func TestExprClone_Brackets(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13308,7 +13308,7 @@ func TestExprClone(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13354,7 +13354,7 @@ func TestExprClosure(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13532,7 +13532,7 @@ func TestExprClosure_Use(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13710,7 +13710,7 @@ func TestExprClosure_Use2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13776,7 +13776,7 @@ func TestExprConstFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13842,7 +13842,7 @@ func TestExprConstFetch_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13908,7 +13908,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13972,7 +13972,7 @@ func TestExprEmpty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14036,7 +14036,7 @@ func TestExprErrorSuppress(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14100,7 +14100,7 @@ func TestExprEval(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14144,7 +14144,7 @@ func TestExprExit(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14188,7 +14188,7 @@ func TestExprExit_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14253,7 +14253,7 @@ func TestExprExit_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14297,7 +14297,7 @@ func TestExprDie(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14341,7 +14341,7 @@ func TestExprDie_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14406,7 +14406,7 @@ func TestExprDie_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14482,7 +14482,7 @@ func TestExprFunctionCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14558,7 +14558,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14659,7 +14659,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14778,7 +14778,7 @@ func TestExprFunctionCall_Var(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14910,7 +14910,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14974,7 +14974,7 @@ func TestExprPostDec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15038,7 +15038,7 @@ func TestExprPostInc(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15102,7 +15102,7 @@ func TestExprPreDec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15166,7 +15166,7 @@ func TestExprPreInc(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15230,7 +15230,7 @@ func TestExprInclude(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15294,7 +15294,7 @@ func TestExprInclude_Once(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15358,7 +15358,7 @@ func TestExprRequire(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15422,7 +15422,7 @@ func TestExprRequire_Once(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15509,7 +15509,7 @@ func TestExprInstanceOf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15596,7 +15596,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15683,7 +15683,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15749,7 +15749,7 @@ func TestExprIsset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15836,7 +15836,7 @@ func TestExprIsset_Variables(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15911,7 +15911,7 @@ func TestExprList_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16018,7 +16018,7 @@ func TestExprList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16135,7 +16135,7 @@ func TestExprList_ArrayIndex(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16264,7 +16264,7 @@ func TestExprList_List(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16372,7 +16372,7 @@ func TestExprList_EmptyItem(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16482,7 +16482,7 @@ func TestExprList_EmptyItems(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16567,7 +16567,7 @@ func TestExprMethodCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16633,7 +16633,7 @@ func TestExprNew(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16709,7 +16709,7 @@ func TestExprNew_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16785,7 +16785,7 @@ func TestExprNew_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16849,7 +16849,7 @@ func TestExprPrint(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16924,7 +16924,7 @@ func TestExprPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17042,7 +17042,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17119,7 +17119,7 @@ func TestExprShellExec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17163,7 +17163,7 @@ func TestExprShortArray(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17229,7 +17229,7 @@ func TestExprShortArray_Item(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17348,7 +17348,7 @@ func TestExprShortArray_Items(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17435,7 +17435,7 @@ func TestExprStaticCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17522,7 +17522,7 @@ func TestExprStaticCall_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17609,7 +17609,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17706,7 +17706,7 @@ func TestExprStaticCall_Var(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17801,7 +17801,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17888,7 +17888,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17975,7 +17975,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18062,7 +18062,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18168,7 +18168,7 @@ func TestExprTernary(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18253,7 +18253,7 @@ func TestExprTernary_Simple(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18411,7 +18411,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18569,7 +18569,7 @@ func TestExprTernary_NestedCond(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18633,7 +18633,7 @@ func TestExprUnaryMinus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18697,7 +18697,7 @@ func TestExprUnaryPlus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18751,7 +18751,7 @@ func TestExprVariable(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18815,7 +18815,7 @@ func TestExprVariable_Variable(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18858,7 +18858,7 @@ func TestExprYield(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18922,7 +18922,7 @@ func TestExprYield_Val(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19007,7 +19007,7 @@ func TestExprYield_KeyVal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19061,7 +19061,7 @@ func TestExprYield_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19136,7 +19136,7 @@ func TestExprYield_KeyExpr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19223,7 +19223,7 @@ func TestExprAssign_Assign(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19308,7 +19308,7 @@ func TestExprAssign_Reference(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19405,7 +19405,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19547,7 +19547,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19632,7 +19632,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19717,7 +19717,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19802,7 +19802,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19887,7 +19887,7 @@ func TestExprAssign_Concat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19972,7 +19972,7 @@ func TestExprAssign_Div(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20057,7 +20057,7 @@ func TestExprAssign_Minus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20142,7 +20142,7 @@ func TestExprAssign_Mod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20227,7 +20227,7 @@ func TestExprAssign_Mul(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20312,7 +20312,7 @@ func TestExprAssign_Plus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20397,7 +20397,7 @@ func TestExprAssign_Pow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20482,7 +20482,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20567,7 +20567,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20654,7 +20654,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20739,7 +20739,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20824,7 +20824,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20909,7 +20909,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20994,7 +20994,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21079,7 +21079,7 @@ func TestExprBinary_Concat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21164,7 +21164,7 @@ func TestExprBinary_Div(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21249,7 +21249,7 @@ func TestExprBinary_Equal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21334,7 +21334,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21419,7 +21419,7 @@ func TestExprBinary_Greater(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21504,7 +21504,7 @@ func TestExprBinary_Identical(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21589,7 +21589,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21674,7 +21674,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21759,7 +21759,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21844,7 +21844,7 @@ func TestExprBinary_Minus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21929,7 +21929,7 @@ func TestExprBinary_Mod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22014,7 +22014,7 @@ func TestExprBinary_Mul(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22099,7 +22099,7 @@ func TestExprBinary_NotEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22184,7 +22184,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22269,7 +22269,7 @@ func TestExprBinary_Plus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22354,7 +22354,7 @@ func TestExprBinary_Pow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22439,7 +22439,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22524,7 +22524,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22609,7 +22609,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22694,7 +22694,7 @@ func TestExprBinary_Smaller(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22760,7 +22760,7 @@ func TestExprCast_Array(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22824,7 +22824,7 @@ func TestExprCast_Bool(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22888,7 +22888,7 @@ func TestExprCast_BoolShort(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22952,7 +22952,7 @@ func TestExprCast_Double(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23016,7 +23016,7 @@ func TestExprCast_CastFloat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23080,7 +23080,7 @@ func TestExprCast_Int(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23144,7 +23144,7 @@ func TestExprCast_IntShort(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23208,7 +23208,7 @@ func TestExprCast_Object(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23272,7 +23272,7 @@ func TestExprCast_String(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23336,7 +23336,7 @@ func TestExprCast_BinaryString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23400,7 +23400,7 @@ func TestExprCast_Unset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 01c6d9df5118607f062b72163c0e10a752c85bb5..3e695433aeea4a4a5decbdbc43e303a1b66ac780 100644 GIT binary patch delta 14009 zcmcIrd3?>+w*TzmBw|VsA*MtK5k$C%A(bE}s3}@XV@m27u4|6=wyGtj+tSyf*hmfa zDel!GO6;Ou#8A~CLTR-{u3ouM%T3W5TE*MHb+U)w??_1G{TJV}roHysYp=ET&w~8G zvpWN4??Rgz_zax{|yG<+jMiuE7Jhff$H+#1u3S|XDP=KUP z55tLkN^^A4w4^4BABv_)5+{56cd=q`-A=G?ibB_lXJ2v|^MdeU`YZzeJ>(APgGkpLGgeiK95E9S$rl@bS2qp>1B944Q8R7wBSB5XrGeS zH5T=i%BAEc22hg!+?zXhLRb<%mL#6_1nRAfaxP}`ueN=2v%_)dw$uw=_3esgxg>I8 zAnGmuUUEb1Q==Z}L@~kxSz$7&zzW7`4MID_K?|PQ3++?uvl~?cpNb!0M>iHXUT-Fx z2fu#Wb_?Kr`WIt6{5p0JI#~wWnXtV(?=S?tSe^^W*-hN6-!Q!Z0G8gy!7MX_w%}h6 zN1YzH4FfKbM80)YnYO`NN;f`p40@?Nm(sNYP2|hQqac}VpAef4R${SS7n8NR)#aMHD!?oQrqI5{vC!#O}Flq zVzPTs!sH1PQl|}dl8LLt&F8&=eniC^oAWkm#QvB|L#)-;Wa}5BDC@5vwz#JV?R$&G z-SI{t31%s;qvyRmVJ+u6pSc7*@9k_;WgvTfIRXvRzg*~j&U9^_8r78mNNtgU>XZ;2 z;!X|Zr`DkU<`O*7;ql2c>rt}uNwuA*zm#szrJ>AB@SyqF1~kUxOl1A{>2Pqen-?>% z_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).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -939,17 +939,17 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($8)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -968,12 +968,12 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -986,16 +986,16 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) if len($4.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) } if len($4.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1018,11 +1018,11 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.For, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1043,12 +1043,12 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1061,9 +1061,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1075,9 +1075,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1089,9 +1089,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1103,9 +1103,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1117,9 +1117,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1131,9 +1131,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1145,9 +1145,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1160,8 +1160,8 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1173,9 +1173,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1187,9 +1187,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1201,10 +1201,10 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Echo, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Echo, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1216,7 +1216,7 @@ unticked_statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1229,8 +1229,8 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1242,11 +1242,11 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1280,13 +1280,13 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) + yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1320,13 +1320,13 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) + yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1339,9 +1339,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1353,8 +1353,8 @@ unticked_statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1370,9 +1370,9 @@ unticked_statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1384,9 +1384,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1400,10 +1400,10 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(label, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1429,12 +1429,12 @@ catch_statement: catchNode.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) - yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Hidden) - yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Hidden) - yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Hidden) + yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1455,9 +1455,9 @@ finally_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1506,12 +1506,12 @@ additional_catch: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1529,7 +1529,7 @@ unset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1595,17 +1595,17 @@ unticked_function_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Params, $7.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Params, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1634,9 +1634,9 @@ unticked_class_declaration_statement: $$.GetNode().Position = position.NewNodeTokenPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Hidden) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1650,10 +1650,10 @@ unticked_class_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1669,7 +1669,7 @@ class_entry_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1683,8 +1683,8 @@ class_entry_type: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1696,7 +1696,7 @@ class_entry_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1710,8 +1710,8 @@ class_entry_type: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1732,7 +1732,7 @@ extends_from: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1760,7 +1760,7 @@ interface_extends_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1781,7 +1781,7 @@ implements_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1799,7 +1799,7 @@ interface_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1817,7 +1817,7 @@ foreach_optional_arg: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Key, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Key, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1838,7 +1838,7 @@ foreach_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1850,9 +1850,9 @@ foreach_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.List, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1878,10 +1878,10 @@ for_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1907,10 +1907,10 @@ foreach_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1937,10 +1937,10 @@ declare_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1959,8 +1959,8 @@ declare_list: constant.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1975,9 +1975,9 @@ declare_list: constant.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1995,8 +1995,8 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2010,9 +2010,9 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2026,10 +2026,10 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2044,11 +2044,11 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListStart, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($5)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2071,9 +2071,9 @@ case_list: _case.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Hidden) - yylex.(*Parser).setFreeFloating(_case, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Tokens) + yylex.(*Parser).setToken(_case, token.CaseSeparator, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2086,9 +2086,9 @@ case_list: _default.GetNode().Position = position.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Hidden) - yylex.(*Parser).setFreeFloating(_default, token.CaseSeparator, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) + yylex.(*Parser).setToken(_default, token.CaseSeparator, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2127,10 +2127,10 @@ while_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2154,12 +2154,12 @@ elseif_list: _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2185,14 +2185,14 @@ new_elseif_list: _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Hidden) + yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2214,7 +2214,7 @@ else_single: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2238,8 +2238,8 @@ new_else_single: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Else, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Else, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2273,7 +2273,7 @@ non_empty_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2304,22 +2304,22 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + yylex.(*Parser).setFreeFloatingTokens($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + yylex.(*Parser).setFreeFloatingTokens($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2348,23 +2348,23 @@ parameter: yylex.(*Parser).MoveFreeFloating($1, $$) } if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.OptionalType, $2.Tokens) } if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Variadic, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) // normalize if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) + yylex.(*Parser).setFreeFloatingTokens($$, token.Ampersand, $$.GetNode().Tokens[token.Variadic]); delete($$.GetNode().Tokens, token.Variadic) } if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) + yylex.(*Parser).setFreeFloatingTokens($$, token.OptionalType, $$.GetNode().Tokens[token.Ampersand]); delete($$.GetNode().Tokens, token.Ampersand) } if $1 == nil { - yylex.(*Parser).setFreeFloating($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $$.GetNode().Tokens[token.OptionalType]); delete($$.GetNode().Tokens, token.OptionalType) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2387,7 +2387,7 @@ optional_class_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2399,7 +2399,7 @@ optional_class_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2421,8 +2421,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2434,8 +2434,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2449,8 +2449,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2469,7 +2469,7 @@ non_empty_function_call_parameter_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2508,7 +2508,7 @@ function_call_parameter: $$.GetNode().Position = position.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2520,7 +2520,7 @@ function_call_parameter: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2532,7 +2532,7 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2556,7 +2556,7 @@ global_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2568,7 +2568,7 @@ global_var: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2580,9 +2580,9 @@ global_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2603,8 +2603,8 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2621,9 +2621,9 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2640,7 +2640,7 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2657,8 +2657,8 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2691,8 +2691,8 @@ class_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($3)) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2704,8 +2704,8 @@ class_statement: $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2731,18 +2731,18 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2757,7 +2757,7 @@ trait_use_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2775,7 +2775,7 @@ trait_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2789,8 +2789,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2801,8 +2801,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2844,8 +2844,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2854,8 +2854,8 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2871,7 +2871,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2889,7 +2889,7 @@ trait_reference_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2906,7 +2906,7 @@ trait_method_reference: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2930,8 +2930,8 @@ trait_method_reference_fully_qualified: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2949,8 +2949,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2963,7 +2963,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2993,8 +2993,8 @@ method_body: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3006,8 +3006,8 @@ method_body: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3029,7 +3029,7 @@ variable_modifiers: modifier.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3074,7 +3074,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3086,7 +3086,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3098,7 +3098,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3110,7 +3110,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3122,7 +3122,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3134,7 +3134,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3154,8 +3154,8 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3172,9 +3172,9 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(property, token.Var, $4.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3191,7 +3191,7 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(property, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3208,8 +3208,8 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(property, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating(property, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3231,9 +3231,9 @@ class_constant_declaration: $1.GetNode().Position = position.NewNodesPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Hidden) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3249,9 +3249,9 @@ class_constant_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Hidden) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3263,7 +3263,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3297,7 +3297,7 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3334,8 +3334,8 @@ chaining_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3348,8 +3348,8 @@ chaining_dereference: fetch.GetNode().Position = position.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3404,7 +3404,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3421,10 +3421,10 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3437,7 +3437,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3450,8 +3450,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3476,9 +3476,9 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) - yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) + yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3490,7 +3490,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3502,7 +3502,7 @@ expr_without_variable: $$.GetNode().Position = position.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3515,7 +3515,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3528,7 +3528,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3541,7 +3541,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3554,7 +3554,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3567,7 +3567,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3580,7 +3580,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3593,7 +3593,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3606,7 +3606,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3619,7 +3619,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3632,7 +3632,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3645,7 +3645,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3658,7 +3658,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3670,7 +3670,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3683,7 +3683,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3695,7 +3695,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3708,7 +3708,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3721,7 +3721,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3734,7 +3734,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3747,7 +3747,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3760,7 +3760,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3773,7 +3773,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3786,7 +3786,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3799,7 +3799,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3812,7 +3812,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3825,7 +3825,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3838,7 +3838,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3851,7 +3851,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3864,7 +3864,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3877,7 +3877,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3890,7 +3890,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3903,7 +3903,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3916,7 +3916,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3928,7 +3928,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3940,7 +3940,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3952,7 +3952,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3964,7 +3964,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3977,7 +3977,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3990,7 +3990,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4003,7 +4003,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4016,8 +4016,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4030,7 +4030,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4043,7 +4043,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4056,7 +4056,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4069,7 +4069,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4082,7 +4082,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4092,8 +4092,8 @@ expr_without_variable: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - yylex.(*Parser).setFreeFloating($1, token.Start, append($1.GetNode().Tokens[token.OpenParenthesisToken], $1.GetNode().Tokens[token.Start]...)); delete($1.GetNode().Tokens, token.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($1, token.End, append($1.GetNode().Tokens[token.End], $1.GetNode().Tokens[token.CloseParenthesisToken]...)); delete($1.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($1, token.Start, append($1.GetNode().Tokens[token.OpenParenthesisToken], $1.GetNode().Tokens[token.Start]...)); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($1, token.End, append($1.GetNode().Tokens[token.End], $1.GetNode().Tokens[token.CloseParenthesisToken]...)); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } | new_expr { @@ -4106,8 +4106,8 @@ expr_without_variable: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) for _, n := range($4) { switch nn := n.(type) { @@ -4142,8 +4142,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4156,8 +4156,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4175,8 +4175,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4188,8 +4188,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4201,8 +4201,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4214,8 +4214,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4227,8 +4227,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4240,8 +4240,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4253,8 +4253,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4275,7 +4275,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4287,7 +4287,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4317,7 +4317,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4329,7 +4329,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4341,7 +4341,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4353,20 +4353,20 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Hidden) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) // normalize if $6 == nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4379,21 +4379,21 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $10) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Static, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Static, $2.Tokens) if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Tokens) // normalize if $7 == nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4409,7 +4409,7 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4421,7 +4421,7 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4433,8 +4433,8 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4446,8 +4446,8 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4463,8 +4463,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4477,8 +4477,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4492,9 +4492,9 @@ combined_scalar_offset: $$.GetNode().Position = position.NewNodeTokenPosition(str, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4507,8 +4507,8 @@ combined_scalar_offset: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4523,9 +4523,9 @@ combined_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4537,8 +4537,8 @@ combined_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4566,9 +4566,9 @@ lexical_vars: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4586,8 +4586,8 @@ lexical_var_list: variable.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4604,9 +4604,9 @@ lexical_var_list: reference.GetNode().Position = position.NewTokensPosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4621,7 +4621,7 @@ lexical_var_list: variable.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4638,8 +4638,8 @@ lexical_var_list: reference.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4670,8 +4670,8 @@ function_call: $$.GetNode().Position = position.NewNodesPosition(funcName, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4685,7 +4685,7 @@ function_call: $$.GetNode().Position = position.NewNodesPosition(funcName, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4698,7 +4698,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4711,7 +4711,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4724,7 +4724,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4737,7 +4737,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4764,7 +4764,7 @@ class_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4788,8 +4788,8 @@ class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4801,7 +4801,7 @@ class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4828,8 +4828,8 @@ fully_qualified_class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4841,7 +4841,7 @@ fully_qualified_class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4868,7 +4868,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { @@ -4935,7 +4935,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Hidden) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4956,8 +4956,8 @@ exit_expr: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4975,8 +4975,8 @@ exit_expr: yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) // save comments - yylex.(*Parser).setFreeFloating($$, token.Exit, $1.GetNode().Tokens[token.OpenParenthesisToken]); delete($1.GetNode().Tokens, token.OpenParenthesisToken) - yylex.(*Parser).setFreeFloating($$, token.Expr, $1.GetNode().Tokens[token.CloseParenthesisToken]); delete($1.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.GetNode().Tokens[token.OpenParenthesisToken]); delete($1.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $1.GetNode().Tokens[token.CloseParenthesisToken]); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } ; @@ -5029,7 +5029,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5041,7 +5041,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5053,7 +5053,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5065,7 +5065,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5077,7 +5077,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5089,7 +5089,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5101,7 +5101,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5113,7 +5113,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5125,7 +5125,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5137,7 +5137,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5151,7 +5151,7 @@ common_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5163,7 +5163,7 @@ common_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5181,8 +5181,8 @@ static_class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5234,8 +5234,8 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5249,7 +5249,7 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5261,9 +5261,9 @@ static_scalar_value: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5275,8 +5275,8 @@ static_scalar_value: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5294,7 +5294,7 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5316,8 +5316,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5330,7 +5330,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5343,7 +5343,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5356,7 +5356,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5369,7 +5369,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5382,7 +5382,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5395,7 +5395,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5407,7 +5407,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5419,7 +5419,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5432,7 +5432,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5445,7 +5445,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5458,7 +5458,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5471,7 +5471,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5484,7 +5484,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5497,7 +5497,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5510,7 +5510,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5523,7 +5523,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5536,7 +5536,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5549,7 +5549,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5562,7 +5562,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5575,7 +5575,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5588,7 +5588,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5601,7 +5601,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5614,8 +5614,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5628,7 +5628,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5641,7 +5641,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5654,7 +5654,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5667,7 +5667,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5680,8 +5680,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5694,8 +5694,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5707,7 +5707,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5719,7 +5719,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5728,8 +5728,8 @@ static_operation: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5766,8 +5766,8 @@ general_constant: $$.GetNode().Position = position.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5781,7 +5781,7 @@ general_constant: $$.GetNode().Position = position.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5798,7 +5798,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5828,7 +5828,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5840,7 +5840,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5852,7 +5852,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5871,7 +5871,7 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5899,9 +5899,9 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5914,7 +5914,7 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5929,7 +5929,7 @@ non_empty_static_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5975,8 +5975,8 @@ parenthesis_expr: if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloatingTokens($2, token.OpenParenthesisToken, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($2, token.CloseParenthesisToken, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5991,8 +5991,8 @@ parenthesis_expr: if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) } - yylex.(*Parser).setFreeFloating($2, token.OpenParenthesisToken, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($2, token.CloseParenthesisToken, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloatingTokens($2, token.OpenParenthesisToken, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($2, token.CloseParenthesisToken, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6038,7 +6038,7 @@ variable: } // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) for _, n := range($3) { switch nn := n.(type) { @@ -6121,7 +6121,7 @@ variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Hidden) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6137,8 +6137,8 @@ array_method_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6151,8 +6151,8 @@ array_method_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6222,7 +6222,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6235,7 +6235,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6260,8 +6260,8 @@ array_function_dereference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6274,8 +6274,8 @@ array_function_dereference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6340,8 +6340,8 @@ reference_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6354,8 +6354,8 @@ reference_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6379,7 +6379,7 @@ compound_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6391,9 +6391,9 @@ compound_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6444,8 +6444,8 @@ object_dim_list: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6458,8 +6458,8 @@ object_dim_list: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(fetch, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating(fetch, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6484,7 +6484,7 @@ variable_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6496,8 +6496,8 @@ variable_name: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6513,7 +6513,7 @@ simple_indirect_reference: n.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(n, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6530,9 +6530,9 @@ simple_indirect_reference: n.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(n, token.Start, $2.Tokens) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6546,7 +6546,7 @@ assignment_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6586,9 +6586,9 @@ assignment_list_element: $$.GetNode().Position = position.NewNodePosition(listNode) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6618,7 +6618,7 @@ array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6635,9 +6635,9 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6650,7 +6650,7 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -6665,7 +6665,7 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6693,10 +6693,10 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $6) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Hidden) - yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6711,8 +6711,8 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewTokenNodePosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6728,8 +6728,8 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6744,7 +6744,7 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6766,7 +6766,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6785,7 +6785,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6802,7 +6802,7 @@ encaps_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6818,8 +6818,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6837,8 +6837,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6852,8 +6852,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6869,8 +6869,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6886,10 +6886,10 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Hidden, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($6.Hidden, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6898,8 +6898,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6914,7 +6914,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6931,7 +6931,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6945,7 +6945,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6960,9 +6960,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6974,9 +6974,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6988,9 +6988,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7002,7 +7002,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7014,7 +7014,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7026,9 +7026,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7040,7 +7040,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7052,7 +7052,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7070,7 +7070,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7103,8 +7103,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7119,8 +7119,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7138,8 +7138,8 @@ static_class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -7157,8 +7157,8 @@ class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 4ce4b1e..49efe90 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -415,7 +415,7 @@ CAD; for n := 0; n < b.N; n++ { lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() } } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 6f4d199..e3b98ab 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -22458,7 +22458,7 @@ func TestPhp5(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22596,7 +22596,7 @@ func TestPhp5Strings(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22823,7 +22823,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) - php5parser := php5.NewParser(lexer, false, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22849,7 +22849,7 @@ func TestPhp5ControlCharsErrors(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "5.6", false, errorHandlerFunc) - php5parser := php5.NewParser(lexer, false, errorHandlerFunc) + php5parser := php5.NewParser(lexer, errorHandlerFunc) php5parser.Parse() assert.DeepEqual(t, expected, parserErrors) } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 7426278..e7aa50e 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -14,14 +14,12 @@ type Parser struct { Lexer *scanner.Lexer currentToken *scanner.Token rootNode ast.Vertex - withTokens bool errHandlerFunc func(*errors.Error) } // NewParser creates and returns new Parser -func NewParser(lexer *scanner.Lexer, withTokens bool, errHandlerFunc func(*errors.Error)) *Parser { +func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser { return &Parser{ - withTokens: withTokens, Lexer: lexer, errHandlerFunc: errHandlerFunc, } @@ -63,7 +61,7 @@ func lastNode(nn []ast.Vertex) ast.Vertex { } func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if p.withTokens == false { + if _, ok := src.GetNode().Tokens[token.Start]; !ok { return } @@ -71,42 +69,64 @@ func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { return } - p.setFreeFloating(dst, token.Start, src.GetNode().Tokens[token.Start]) - delete(src.GetNode().Tokens, token.Start) -} - -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, strings []token.Token) { - if p.withTokens == false { - return - } - - if len(strings) == 0 { - return - } - dstCollection := &dst.GetNode().Tokens if *dstCollection == nil { *dstCollection = make(token.Collection) } - (*dstCollection)[pos] = strings + (*dstCollection)[token.Start] = src.GetNode().Tokens[token.Start] + delete(src.GetNode().Tokens, token.Start) } -func (p *Parser) GetFreeFloatingToken(t *scanner.Token) []token.Token { - if p.withTokens == false { - return []token.Token{} +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return } - return []token.Token{ - { - ID: token.ID(t.ID), - Value: t.Value, - }, + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) } + + l := len(tokens) + for _, v := range tokens[0 : l-1] { + (*dstCollection)[pos] = append((*dstCollection)[pos], v) + } +} + +func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + (*dstCollection)[pos] = make([]token.Token, 0) + + for _, v := range tokens { + (*dstCollection)[pos] = append((*dstCollection)[pos], v) + } +} + +func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []token.Token) { + if len(tokens) == 0 { + return + } + + dstCollection := &dst.GetNode().Tokens + if *dstCollection == nil { + *dstCollection = make(token.Collection) + } + + l := len(tokens) + (*dstCollection)[pos] = append((*dstCollection)[pos], tokens[l-1]) } func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if p.withTokens == false { + if _, ok := prevNode.GetNode().Tokens[token.SemiColon]; !ok { return } @@ -117,7 +137,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - p.setFreeFloating(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloatingTokens(prevNode, token.SemiColon, []token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -144,7 +164,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. Value: semiColon[0].Value[vlen-tlen:], }) - p.setFreeFloating(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) + p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 05cdefc..60e0289 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -59,7 +59,7 @@ func TestIdentifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -953,7 +953,7 @@ func TestPhp7ArgumentNode(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1747,7 +1747,7 @@ func TestPhp7ParameterNode(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1769,7 +1769,7 @@ func TestCommentEndFile(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1847,7 +1847,7 @@ func TestName(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1923,7 +1923,7 @@ func TestFullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1999,7 +1999,7 @@ func TestRelative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2078,7 +2078,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2155,7 +2155,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2243,7 +2243,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2341,7 +2341,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2450,7 +2450,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2527,7 +2527,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2625,7 +2625,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2733,7 +2733,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2825,7 +2825,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2917,7 +2917,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2977,7 +2977,7 @@ LBL; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3023,7 +3023,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3083,7 +3083,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3128,7 +3128,7 @@ func TestScalarMagicConstant(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3172,7 +3172,7 @@ func TestScalarNumber_LNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3216,7 +3216,7 @@ func TestScalarNumber_DNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3260,7 +3260,7 @@ func TestScalarNumber_Float(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3304,7 +3304,7 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3348,7 +3348,7 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3392,7 +3392,7 @@ func TestScalarNumber_HLNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3436,7 +3436,7 @@ func TestScalarNumber_HDNumber(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3480,7 +3480,7 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3524,7 +3524,7 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3570,7 +3570,7 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3614,7 +3614,7 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3660,7 +3660,7 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3730,7 +3730,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3843,7 +3843,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3933,7 +3933,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4111,7 +4111,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4246,7 +4246,7 @@ func TestStmtClassConstList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4368,7 +4368,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4447,7 +4447,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4596,7 +4596,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4722,7 +4722,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4837,7 +4837,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4964,7 +4964,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5009,7 +5009,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5067,7 +5067,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5158,7 +5158,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5251,7 +5251,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5367,7 +5367,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5522,7 +5522,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5621,7 +5621,7 @@ func TestStmtConstList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5687,7 +5687,7 @@ func TestStmtContinue_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5764,7 +5764,7 @@ func TestStmtContinue_Light(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5841,7 +5841,7 @@ func TestStmtContinue(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5918,7 +5918,7 @@ func TestStmtDeclare(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6028,7 +6028,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6107,7 +6107,7 @@ func TestStmtDeclare_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6162,7 +6162,7 @@ func TestStmtDo(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6229,7 +6229,7 @@ func TestStmtEcho(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6285,7 +6285,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6329,7 +6329,7 @@ func TestStmtExpression(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6525,7 +6525,7 @@ func TestStmtFor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6646,7 +6646,7 @@ func TestStmtFor_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6732,7 +6732,7 @@ func TestStmtForeach(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6808,7 +6808,7 @@ func TestStmtForeach_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6894,7 +6894,7 @@ func TestStmtForeach_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7001,7 +7001,7 @@ func TestStmtForeach_WithKey(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7098,7 +7098,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7215,7 +7215,7 @@ func TestStmtForeach_WithRef(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7344,7 +7344,7 @@ func TestStmtForeach_WithList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7390,7 +7390,7 @@ func TestStmtFunction(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7447,7 +7447,7 @@ func TestStmtFunction_Return(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7615,7 +7615,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7683,7 +7683,7 @@ func TestStmtFunction_Ref(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7752,7 +7752,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7808,7 +7808,7 @@ func TestStmtGlobal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7969,7 +7969,7 @@ func TestStmtGlobal_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8034,7 +8034,7 @@ func TestStmtGotoLabel(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8067,7 +8067,7 @@ func TestStmtHaltCompiler(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8132,7 +8132,7 @@ func TestStmtIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8241,7 +8241,7 @@ func TestStmtIf_ElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8327,7 +8327,7 @@ func TestStmtIf_Else(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8499,7 +8499,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8681,7 +8681,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8725,7 +8725,7 @@ func TestStmtInlineHtml(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8770,7 +8770,7 @@ func TestStmtInterface(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8850,7 +8850,7 @@ func TestStmtInterface_Extend(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8953,7 +8953,7 @@ func TestStmtInterface_Extends(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9009,7 +9009,7 @@ func TestStmtNamespace(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9066,7 +9066,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9100,7 +9100,7 @@ func TestStmtNamespace_Anonymous(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9202,7 +9202,7 @@ func TestStmtProperty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9357,7 +9357,7 @@ func TestStmtProperty_Properties(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9512,7 +9512,7 @@ func TestStmtProperty_Properties2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9637,7 +9637,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9703,7 +9703,7 @@ func TestStmtStaticVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9811,7 +9811,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9919,7 +9919,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10046,7 +10046,7 @@ func TestStmtSwitch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10173,7 +10173,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10290,7 +10290,7 @@ func TestStmtSwitch_Alt(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10395,7 +10395,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10449,7 +10449,7 @@ func TestStmtThrow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10494,7 +10494,7 @@ func TestStmtTrait(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10585,7 +10585,7 @@ func TestStmtTraitUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10699,7 +10699,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10813,7 +10813,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10971,7 +10971,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11140,7 +11140,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11423,7 +11423,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11460,7 +11460,7 @@ func TestStmtTry_Try(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11555,7 +11555,7 @@ func TestStmtTry_TryCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11673,7 +11673,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11825,7 +11825,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11931,7 +11931,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12138,7 +12138,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12194,7 +12194,7 @@ func TestStmtUnset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12271,7 +12271,7 @@ func TestStmtUnset_Vars(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12348,7 +12348,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12416,7 +12416,7 @@ func TestStmtUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12484,7 +12484,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12563,7 +12563,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12664,7 +12664,7 @@ func TestStmtUse_List(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12776,7 +12776,7 @@ func TestStmtUse_ListAlias(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12888,7 +12888,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13022,7 +13022,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13134,7 +13134,7 @@ func TestStmtUse_ListConstType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13268,7 +13268,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13392,7 +13392,7 @@ func TestStmtUse_GroupUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13527,7 +13527,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13662,7 +13662,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13797,7 +13797,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13943,7 +13943,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14009,7 +14009,7 @@ func TestStmtBreak_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14086,7 +14086,7 @@ func TestStmtBreak_Light(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14163,7 +14163,7 @@ func TestStmtBreak(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14240,7 +14240,7 @@ func TestExprArrayDimFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14336,7 +14336,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14380,7 +14380,7 @@ func TestExprArray(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14446,7 +14446,7 @@ func TestExprArray_Item(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14565,7 +14565,7 @@ func TestExprArray_Items(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14642,7 +14642,7 @@ func TestExprArray_ItemUnpack(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14708,7 +14708,7 @@ func TestExprArrowFunction(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14797,7 +14797,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14861,7 +14861,7 @@ func TestExprBitwiseNot(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14925,7 +14925,7 @@ func TestExprBooleanNot(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15002,7 +15002,7 @@ func TestExprClassConstFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15067,7 +15067,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15131,7 +15131,7 @@ func TestExprClone_Brackets(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15195,7 +15195,7 @@ func TestExprClone(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15241,7 +15241,7 @@ func TestExprClosure(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15419,7 +15419,7 @@ func TestExprClosure_Use(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15597,7 +15597,7 @@ func TestExprClosure_Use2(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15666,7 +15666,7 @@ func TestExprClosure_ReturnType(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15732,7 +15732,7 @@ func TestExprConstFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15798,7 +15798,7 @@ func TestExprConstFetch_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15864,7 +15864,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15928,7 +15928,7 @@ func TestExprEmpty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15992,7 +15992,7 @@ func TestExprErrorSuppress(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16056,7 +16056,7 @@ func TestExprEval(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16100,7 +16100,7 @@ func TestExprExit(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16144,7 +16144,7 @@ func TestExprExit_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16209,7 +16209,7 @@ func TestExprExit_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16253,7 +16253,7 @@ func TestExprDie(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16297,7 +16297,7 @@ func TestExprDie_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16362,7 +16362,7 @@ func TestExprDie_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16438,7 +16438,7 @@ func TestExprFunctionCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16514,7 +16514,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16615,7 +16615,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16734,7 +16734,7 @@ func TestExprFunctionCall_Var(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16866,7 +16866,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16930,7 +16930,7 @@ func TestExprPostDec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16994,7 +16994,7 @@ func TestExprPostInc(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17058,7 +17058,7 @@ func TestExprPreDec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17122,7 +17122,7 @@ func TestExprPreInc(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17186,7 +17186,7 @@ func TestExprInclude(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17250,7 +17250,7 @@ func TestExprInclude_Once(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17314,7 +17314,7 @@ func TestExprRequire(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17378,7 +17378,7 @@ func TestExprRequire_Once(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17465,7 +17465,7 @@ func TestExprInstanceOf(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17552,7 +17552,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17639,7 +17639,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17705,7 +17705,7 @@ func TestExprIsset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17792,7 +17792,7 @@ func TestExprIsset_Variables(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17867,7 +17867,7 @@ func TestExprList_Empty(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17974,7 +17974,7 @@ func TestExprList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18091,7 +18091,7 @@ func TestExprList_ArrayIndex(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18220,7 +18220,7 @@ func TestExprList_List(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18328,7 +18328,7 @@ func TestExprList_EmptyItem(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18438,7 +18438,7 @@ func TestExprList_EmptyItems(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18523,7 +18523,7 @@ func TestExprMethodCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18589,7 +18589,7 @@ func TestExprNew(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18665,7 +18665,7 @@ func TestExprNew_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18741,7 +18741,7 @@ func TestExprNew_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18873,7 +18873,7 @@ func TestExprNew_Anonymous(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18937,7 +18937,7 @@ func TestExprPrint(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19012,7 +19012,7 @@ func TestExprPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19130,7 +19130,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19207,7 +19207,7 @@ func TestExprShellExec(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19251,7 +19251,7 @@ func TestExprShortArray(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19317,7 +19317,7 @@ func TestExprShortArray_Item(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19436,7 +19436,7 @@ func TestExprShortArray_Items(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19543,7 +19543,7 @@ func TestExprShortList(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19660,7 +19660,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19789,7 +19789,7 @@ func TestExprShortList_List(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19876,7 +19876,7 @@ func TestExprStaticCall(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19963,7 +19963,7 @@ func TestExprStaticCall_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20050,7 +20050,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20147,7 +20147,7 @@ func TestExprStaticCall_Var(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20242,7 +20242,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20329,7 +20329,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20416,7 +20416,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20503,7 +20503,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20609,7 +20609,7 @@ func TestExprTernary(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20694,7 +20694,7 @@ func TestExprTernary_Simple(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20852,7 +20852,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21010,7 +21010,7 @@ func TestExprTernary_NestedCond(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21074,7 +21074,7 @@ func TestExprUnaryMinus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21138,7 +21138,7 @@ func TestExprUnaryPlus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21192,7 +21192,7 @@ func TestExprVariable(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21256,7 +21256,7 @@ func TestExprVariable_Variable(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21299,7 +21299,7 @@ func TestExprYield(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21363,7 +21363,7 @@ func TestExprYield_Val(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21448,7 +21448,7 @@ func TestExprYield_KeyVal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21502,7 +21502,7 @@ func TestExprYield_Expr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21577,7 +21577,7 @@ func TestExprYield_KeyExpr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21641,7 +21641,7 @@ func TestExprYieldFrom(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21728,7 +21728,7 @@ func TestExprAssign_Assign(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21813,7 +21813,7 @@ func TestExprAssign_Reference(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21910,7 +21910,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22052,7 +22052,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22137,7 +22137,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22222,7 +22222,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22307,7 +22307,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22392,7 +22392,7 @@ func TestExprAssign_Concat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22477,7 +22477,7 @@ func TestExprAssign_Div(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22562,7 +22562,7 @@ func TestExprAssign_Minus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22647,7 +22647,7 @@ func TestExprAssign_Mod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22732,7 +22732,7 @@ func TestExprAssign_Mul(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22817,7 +22817,7 @@ func TestExprAssign_Plus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22902,7 +22902,7 @@ func TestExprAssign_Pow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22987,7 +22987,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23072,7 +23072,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23157,7 +23157,7 @@ func TestExprAssign_Coalesce(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23244,7 +23244,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23329,7 +23329,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23414,7 +23414,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23499,7 +23499,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23584,7 +23584,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23669,7 +23669,7 @@ func TestExprBinary_Coalesce(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23754,7 +23754,7 @@ func TestExprBinary_Concat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23839,7 +23839,7 @@ func TestExprBinary_Div(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23924,7 +23924,7 @@ func TestExprBinary_Equal(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24009,7 +24009,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24094,7 +24094,7 @@ func TestExprBinary_Greater(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24179,7 +24179,7 @@ func TestExprBinary_Identical(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24264,7 +24264,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24349,7 +24349,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24434,7 +24434,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24519,7 +24519,7 @@ func TestExprBinary_Minus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24604,7 +24604,7 @@ func TestExprBinary_Mod(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24689,7 +24689,7 @@ func TestExprBinary_Mul(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24774,7 +24774,7 @@ func TestExprBinary_NotEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24859,7 +24859,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24944,7 +24944,7 @@ func TestExprBinary_Plus(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25029,7 +25029,7 @@ func TestExprBinary_Pow(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25114,7 +25114,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25199,7 +25199,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25284,7 +25284,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25369,7 +25369,7 @@ func TestExprBinary_Smaller(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25454,7 +25454,7 @@ func TestExprBinary_Spaceship(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25520,7 +25520,7 @@ func TestExprCast_Array(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25584,7 +25584,7 @@ func TestExprCast_Bool(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25648,7 +25648,7 @@ func TestExprCast_BoolShort(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25712,7 +25712,7 @@ func TestExprCast_Double(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25776,7 +25776,7 @@ func TestExprCast_CastFloat(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25840,7 +25840,7 @@ func TestExprCast_Int(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25904,7 +25904,7 @@ func TestExprCast_IntShort(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25968,7 +25968,7 @@ func TestExprCast_Object(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26032,7 +26032,7 @@ func TestExprCast_String(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26096,7 +26096,7 @@ func TestExprCast_BinaryString(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26160,7 +26160,7 @@ func TestExprCast_Unset(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 90532bc886fed31f3bdaca20230dd97786964247..b80599360aa14fb46d461c41d34b92bba19b3f3e 100644 GIT binary patch delta 21858 zcmcIsd3aPsw*RWCvw@I=H6)Pku*q(^JDu)k5l|9A5Q3nBfPjdsvIs6HC_F_`R6vA- z4-|0pfq=3&SPVJ>>gTuu8Ff?^Au0ok0ugmkp72hc+qbH2#}RRS|M1aO=ltr_sj5?F zshim|v)6u}wc(;%R`fz)?y4g^BLgbebHDt7vkO^j|B2&9PM8AOVO|2GeXJ>Ur?4yG zQy*)le_WMf{dm{>xJ^@RO|>Y3Y1WU`_78tLYo6fo!@hJ@1WVF2Ewv2vcF)PMy5G%U zN!_VC71)m^=Aa`%?HR`+SU8-GM#bv>*5Xg!O2Z++}uQs3&v7Be<=&&jd6-^oet zzP*9f{ZfPE?$Nnc_u5>m8-GM#K%UjTG%vZkdqb;xZbPdZe?%bG$m+hcQF3>Se5-q0 zesXt?-|8OZx4Q911kwXmch7*;jXxrA%I@w^klcNwz~XM*IJx`d##VP;ljQCjr;m4v#QY@QN4I8*o`9&vtD zA|w1W!sgSI)Q`uCtsj>}ogZDFMxM&3!=rx4+xDIz_sUBc=kT}}%9AIh_M0RA~oWa>_u!txGg3i9&~Y=u2&U0891=faO& z*Z_B+WW*cWvn;od0N=mZ0<7PeJ$DX3c9dNPPj+P)9+b+i4$6W`)J5?ntc6CYvQPvt zZ)+03fNl;z`2k$HW!;!h1CZ|gJy~;iz;jONjZz0|N3PE=t6#=St6(*P6X`xZgJi&} zTEDGFLb?b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z7{>;xg3!s z-#97WG8ib5-+x+k&<2h8!oS z1%+z%GtgeR{d>J;fmn|9jpCpmaN*UT`{MZNl!|C1Ml?uYF<^g!t2tRoy*c+g8hinU8wYo_VHCXTERpZgMUx# zM{;VeyqNj)L`NZc@Vkb#qOf~PMM+-uwE@)%lm6c~lW1%f4NvZy>N{u3g-mViIiu|v z?YgI$*no+l9IIvP!RDTj?9|k=-553k?9kj`jAqLln|rcF9HOsU>G$Dm?3vrd2VN)v zOz6Bm8=PBdFz<$?KBvZqM>hid(mf`v_d&YnCU;W4wWpw(ZaaOor~ZIRUF(~A<9yRM z6J0JryGe&GjQuvH18~tExWp6xM`I4R@t8}&{oNYLu_D8k1JiV>2}GXBz>^xMnakT5 z&E!zyRGQq_&QmiU==)5g4_9dqCbqA@%=!) 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($4)) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2535,7 +2532,7 @@ class_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2555,20 +2552,20 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) if $9 != nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2587,7 +2584,7 @@ name_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2601,8 +2598,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2614,8 +2611,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2626,8 +2623,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2654,8 +2651,8 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2664,8 +2661,8 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2681,7 +2678,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2699,8 +2696,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2715,8 +2712,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2731,8 +2728,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2745,7 +2742,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2762,7 +2759,7 @@ trait_method_reference: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2786,15 +2783,15 @@ absolute_trait_method_reference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; method_body: - ';' /* abstract method */ + ';' /* abstract method */ { $$ = &ast.StmtNop{ast.Node{}, } @@ -2802,8 +2799,8 @@ method_body: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.SemiColon, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2815,8 +2812,8 @@ method_body: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2838,7 +2835,7 @@ variable_modifiers: modifier.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2883,7 +2880,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2895,7 +2892,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2907,7 +2904,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2919,7 +2916,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2931,7 +2928,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2943,7 +2940,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2955,7 +2952,7 @@ property_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2980,7 +2977,7 @@ property: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2996,8 +2993,8 @@ property: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3009,7 +3006,7 @@ class_const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3032,8 +3029,8 @@ class_const_decl: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3050,8 +3047,8 @@ const_decl: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3063,7 +3060,7 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3105,7 +3102,7 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3130,9 +3127,9 @@ anonymous_class: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3150,7 +3147,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3162,7 +3159,7 @@ new_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3179,10 +3176,10 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3196,9 +3193,9 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Var, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3211,7 +3208,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3224,8 +3221,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3237,7 +3234,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3250,7 +3247,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3263,7 +3260,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3276,7 +3273,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3289,7 +3286,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3302,7 +3299,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3315,7 +3312,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3328,7 +3325,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3341,7 +3338,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3354,7 +3351,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3367,7 +3364,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3380,7 +3377,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3393,7 +3390,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3406,7 +3403,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3419,7 +3416,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3431,7 +3428,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3444,7 +3441,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3456,7 +3453,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3469,7 +3466,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3482,7 +3479,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3495,7 +3492,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3508,7 +3505,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3521,7 +3518,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3534,7 +3531,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3547,7 +3544,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3560,7 +3557,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3573,7 +3570,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3586,7 +3583,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3599,7 +3596,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3612,7 +3609,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3625,7 +3622,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3638,7 +3635,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3651,7 +3648,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3664,7 +3661,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3677,7 +3674,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3689,7 +3686,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3701,7 +3698,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3713,7 +3710,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3725,7 +3722,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3738,7 +3735,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3751,7 +3748,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3764,7 +3761,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3777,8 +3774,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Equal, yylex.(*Parser).GetFreeFloatingToken($2)) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3791,7 +3788,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3804,7 +3801,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3817,7 +3814,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3830,7 +3827,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3843,7 +3840,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3856,7 +3853,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3865,8 +3862,8 @@ expr_without_variable: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3885,8 +3882,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3899,8 +3896,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3913,7 +3910,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3931,8 +3928,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3944,8 +3941,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3957,8 +3954,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3970,8 +3967,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3983,8 +3980,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3996,8 +3993,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4009,8 +4006,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Cast, yylex.(*Parser).GetFreeFloatingToken($1)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4037,7 +4034,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4049,7 +4046,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4067,7 +4064,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4079,7 +4076,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4091,7 +4088,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4103,7 +4100,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4115,8 +4112,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4128,7 +4125,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4153,8 +4150,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden); + yylex.(*Parser).setFreeFloatingTokens($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens); yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4167,28 +4164,28 @@ inline_function: // save position $$.GetNode().Position = position.NewTokensPosition($1, $11) - + // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) if $8 != nil { - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) + yylex.(*Parser).setFreeFloatingTokens($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) } - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) // normalize if $8 == nil { - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + yylex.(*Parser).setFreeFloatingTokens($$, token.LexicalVars, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) } if $7 == nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4199,24 +4196,24 @@ inline_function: // save position $$.GetNode().Position = position.NewTokenNodePosition($1, $9) - + // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) }; - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) }; - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Hidden) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) // normalize if $6 == nil { - yylex.(*Parser).setFreeFloating($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) + yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) }; yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4253,9 +4250,9 @@ lexical_vars: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4267,7 +4264,7 @@ lexical_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4290,7 +4287,7 @@ lexical_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4306,8 +4303,8 @@ lexical_var: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4335,7 +4332,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4348,7 +4345,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4375,7 +4372,7 @@ class_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4417,8 +4414,8 @@ exit_expr: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Exit, append($1.Hidden, yylex.(*Parser).GetFreeFloatingToken($1)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4473,9 +4470,9 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4487,8 +4484,8 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4500,7 +4497,7 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4515,7 +4512,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4527,7 +4524,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4539,7 +4536,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4551,7 +4548,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4563,7 +4560,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4575,7 +4572,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4587,7 +4584,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4599,7 +4596,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4611,7 +4608,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4623,7 +4620,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4637,7 +4634,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4649,7 +4646,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4661,7 +4658,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4673,7 +4670,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4715,8 +4712,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4731,8 +4728,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4789,8 +4786,8 @@ dereferencable: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4814,8 +4811,8 @@ callable_expr: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4843,8 +4840,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4857,8 +4854,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4871,8 +4868,8 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4885,7 +4882,7 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4919,7 +4916,7 @@ variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4936,7 +4933,7 @@ simple_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4948,9 +4945,9 @@ simple_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($3, token.Start, append($2.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($2), $3.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($3, token.End, append($3.GetNode().Tokens[token.End], append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)...)) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4962,7 +4959,7 @@ simple_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4978,7 +4975,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4991,7 +4988,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5013,8 +5010,8 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5027,8 +5024,8 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5041,7 +5038,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5054,7 +5051,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5067,7 +5064,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5082,7 +5079,7 @@ member_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5091,8 +5088,8 @@ member_name: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5113,17 +5110,17 @@ property_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '{' expr '}' { $$ = $2; - + // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, append($1.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($1), $$.GetNode().Tokens[token.Start]...)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($$.GetNode().Tokens[token.End], append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5169,7 +5166,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5195,7 +5192,7 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5222,8 +5219,8 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5237,7 +5234,7 @@ array_pair: reference.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5249,7 +5246,7 @@ array_pair: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5265,10 +5262,10 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5281,11 +5278,11 @@ array_pair: // save position listNode.GetNode().Position = position.NewTokensPosition($1, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) - + // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Hidden) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5307,7 +5304,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Hidden) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5326,7 +5323,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5343,7 +5340,7 @@ encaps_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5359,8 +5356,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, append($2.Hidden, yylex.(*Parser).GetFreeFloatingToken($2)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($4.Hidden, yylex.(*Parser).GetFreeFloatingToken($4)...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5378,8 +5375,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Hidden) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5393,8 +5390,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5410,8 +5407,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5427,10 +5424,10 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.Var, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) - yylex.(*Parser).setFreeFloating($$, token.Expr, append($5.Hidden, yylex.(*Parser).GetFreeFloatingToken($5)...)) - yylex.(*Parser).setFreeFloating($$, token.End, append($6.Hidden, yylex.(*Parser).GetFreeFloatingToken($6)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5439,8 +5436,8 @@ encaps_var: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, yylex.(*Parser).GetFreeFloatingToken($1)) - yylex.(*Parser).setFreeFloating($$, token.End, append($3.Hidden, yylex.(*Parser).GetFreeFloatingToken($3)...)) + yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5455,7 +5452,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5472,7 +5469,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5498,7 +5495,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5512,7 +5509,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5527,12 +5524,12 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) if $4 == nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Hidden) + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Hidden, append(yylex.(*Parser).GetFreeFloatingToken($4), $5.Hidden...)...)) + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, $5.Tokens...)) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -5545,9 +5542,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5559,7 +5556,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5571,7 +5568,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5583,9 +5580,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Hidden) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5597,7 +5594,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5609,7 +5606,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Hidden) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5627,7 +5624,7 @@ isset_variables: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Hidden) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index 61045b0..558c54b 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -383,7 +383,7 @@ CAD; for n := 0; n < b.N; n++ { lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() } } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 169e62c..6d214a7 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -19635,7 +19635,7 @@ func TestPhp7(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19773,7 +19773,7 @@ func TestPhp5Strings(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20000,7 +20000,7 @@ CAD; } lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) - php7parser := php7.NewParser(lexer, false, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20026,7 +20026,7 @@ func TestPhp7ControlCharsErrors(t *testing.T) { } lexer := scanner.NewLexer([]byte(src), "7.4", false, errorHandlerFunc) - php7parser := php7.NewParser(lexer, false, errorHandlerFunc) + php7parser := php7.NewParser(lexer, errorHandlerFunc) php7parser.Parse() assert.DeepEqual(t, expected, parserErrors) } diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index e20e701..7456961 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -11,10 +11,10 @@ import ( ) type Lexer struct { - data []byte - phpVersion string - withHiddenTokens bool - errHandlerFunc func(*errors.Error) + data []byte + phpVersion string + withTokens bool + errHandlerFunc func(*errors.Error) p, pe, cs int ts, te, act int @@ -23,16 +23,15 @@ type Lexer struct { heredocLabel []byte tokenPool *TokenPool - hiddenTokens []token.Token newLines NewLines } -func NewLexer(data []byte, phpVersion string, withHiddenTokens bool, errHandlerFunc func(*errors.Error)) *Lexer { +func NewLexer(data []byte, phpVersion string, withTokens bool, errHandlerFunc func(*errors.Error)) *Lexer { lex := &Lexer{ - data: data, - phpVersion: phpVersion, - withHiddenTokens: withHiddenTokens, - errHandlerFunc: errHandlerFunc, + data: data, + phpVersion: phpVersion, + withTokens: withTokens, + errHandlerFunc: errHandlerFunc, pe: len(data), stack: make([]int, 0), @@ -57,12 +56,12 @@ func (lex *Lexer) setTokenPosition(token *Token) { token.Position.EndPos = lex.te } -func (lex *Lexer) addHiddenToken(id TokenID, ps, pe int) { - if !lex.withHiddenTokens { +func (lex *Lexer) addHiddenToken(t *Token, id TokenID, ps, pe int) { + if !lex.withTokens { return } - lex.hiddenTokens = append(lex.hiddenTokens, token.Token{ + t.Tokens = append(t.Tokens, token.Token{ ID: token.ID(id), Value: lex.data[ps:pe], }) @@ -236,9 +235,9 @@ func (lex *Lexer) error(msg string) { } func isValidVarNameStart(r byte) bool { - return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || r == '_' || (r >= 0x80 && r <= 0xff) + return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || r == '_' || r >= 0x80 } func isValidVarName(r byte) bool { - return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || (r >= 0x80 && r <= 0xff) + return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r >= 0x80 } diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index c4b5ae58209aa13baa797cba467c654341cf4d94..86a2eb1c9f693603f775dccdf6361a5ae7439282 100644 GIT binary patch delta 6077 zcmaJld0bRS(!ZYRmf_IB6H(MbJWvJ$47ZAS;FygY@Q5Z}NH#`Hh@hY*atMP2F&=0K zOQX@a5%E?WXs*g0N>D5+f~z5{rJcJj-;+-?y)W28nVvr|`8kmKbN4LD<8%E; zD9_0c;K`R6FV8Ktt2Q{I^ZAUtND|c87)87<_xrpL4BJFJdG_af?aPD3@_3s*b6viQ z2-*@7%#SW;#{&xnD6BdN2xc0-svrj)vywaVl=)GO$mi$hK>vN}AU^+#_(p^l3vx(^ zyv}@d!6~8&iGb!qNjI})(Q-9klFLPGZi!40m}O`C%*DT9}*&@n4g_^MELRQ^}Mh;l8;{6jX$j3%ypHW zQG78vZr8NsbQTnr5e-j#*pE;9As4*=qN3p3c&js|JmEJTUv}|#e*Q;2RFu)d{LQmP z!r|dOpe9phg>PQaC|+MPg>S7H&i9>5fB{ZK&oh_463A0OYIwnUKP4Z7Fn#@wPJM+;p)Lp|LDXmmu>c_4T1lgZRZs|PdsPU=YKT^v>IaMPp+Ey z#D_*+RyP;EaYjVJ&n7g|$cJAu@!bE!a-Ux^xa&0|zwwKSKe=w?+kegAFK-$7^y|5N z+f^g)b0eMiygr22-{5Ft!o$I$Fk14vH)p^FpDyQiBl+oDdcNitBOiEM zsIkW4-tB9I``_~Amir%?$KQ*TtIFX4aM zpNo0>^Lk$QQ)eY-eXED@t$*1~^*rCJG3{c#KY#yaEOa15Q#77@R@8)uf;9+4KEHA$ z7B^uNsJlnKc|ffn#HffrHZ_c6EL5sU28`cIH1I5xxruV>4GYy|4#WxSSW2=)amya` zfgX&ci(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aGPNlIo$Y*pmX#VJ>mrM#@j~DdMq16}&8toea?P(Z6%MO!HU`|B) zl;ws?sdx{mWN*?)o){k?MdO`t$=8}L`j6BFuSQ5S#k_VYD~f!cvc(bY5s}1zyQ4(P za{iRExM+eT{<9h6$o@7+{`lbliGHZ82$RPQY=^2WM&TN8!b{IF8Dphf@qRX=S`sI9 zl{>^q2Ee#MlBMX!tD=-xM$5XFCGl1lx`8-lh~$RL221~-NH-6bEM0)2OhZqsikGs@ z(Nc5=oA;AHel>)GtJv_DvyIXQ^oeqGbeJc8zxK2JbN%ywS@8olvWug`oXPX%&q?)C Jv>me?{|ob)YTN(- diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index 0dc87ad..a45c164 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -19,12 +19,11 @@ func initLexer(lex *Lexer) { } func (lex *Lexer) Lex() *Token { - lex.hiddenTokens = nil eof := lex.pe var tok TokenID token := lex.tokenPool.Get() - token.Hidden = nil + token.Tokens = token.Tokens[:0] token.Value = lex.data[0:0] lblStart := 0 @@ -125,7 +124,7 @@ func (lex *Lexer) Lex() *Token { main := |* "#!" any* :>> newline => { - lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -141,12 +140,12 @@ func (lex *Lexer) Lex() *Token { fbreak; }; ' { - lex.addHiddenToken(T_OPEN_TAG, lex.ts, lex.te) + lex.addHiddenToken(token, T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addHiddenToken(T_OPEN_TAG, lex.ts, lex.ts+5) + lex.addHiddenToken(token, T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { @@ -158,7 +157,7 @@ func (lex *Lexer) Lex() *Token { *|; php := |* - whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; @@ -318,7 +317,7 @@ func (lex *Lexer) Lex() *Token { ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; @@ -327,9 +326,9 @@ func (lex *Lexer) Lex() *Token { } if isDocComment { - lex.addHiddenToken(T_DOC_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(token, T_DOC_COMMENT, lex.ts, lex.te) } else { - lex.addHiddenToken(T_COMMENT, lex.ts, lex.te) + lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) } }; @@ -378,7 +377,7 @@ func (lex *Lexer) Lex() *Token { *|; property := |* - whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; "->" => {lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; varname => {lex.setTokenPosition(token); tok = T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; @@ -474,33 +473,33 @@ func (lex *Lexer) Lex() *Token { *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; "(" => {lex.setTokenPosition(token); tok = TokenID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; ")" => {lex.setTokenPosition(token); tok = TokenID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addHiddenToken(T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; ";" => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addHiddenToken(T_HALT_COMPILER, lex.ts, lex.te); }; + any_line* => { lex.addHiddenToken(token, T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - token.Hidden = lex.hiddenTokens token.Value = lex.data[lex.ts:lex.te] token.ID = tok + lex.addHiddenToken(token, tok, lex.ts, lex.te); return token } \ No newline at end of file diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 7399c08..c05a527 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -354,7 +354,7 @@ func TestTokens(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -382,13 +382,14 @@ func TestShebang(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} tkn := lexer.Lex() assert.Equal(t, tkn.ID, T_DNUMBER) - for _, tt := range tkn.Hidden { + l := len(tkn.Tokens) + for _, tt := range tkn.Tokens[:l-1] { actual = append(actual, string(tt.Value)) } @@ -402,11 +403,11 @@ func TestShebangHtml(t *testing.T) { ` lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() assert.Equal(t, tkn.ID, T_INLINE_HTML) - assert.Equal(t, string(tkn.Hidden[0].Value), "#!/usr/bin/env php\n") + assert.Equal(t, string(tkn.Tokens[0].Value), "#!/usr/bin/env php\n") tkn = lexer.Lex() assert.Equal(t, tkn.ID, T_DNUMBER) @@ -452,7 +453,7 @@ func TestNumberTokens(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -509,7 +510,7 @@ func TestConstantStrings(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -643,7 +644,7 @@ func TestTeplateStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -728,7 +729,7 @@ func TestBackquoteStringTokens(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -822,7 +823,7 @@ CAT; } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -895,7 +896,7 @@ CAT } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -934,7 +935,7 @@ CAT; } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -965,7 +966,7 @@ func TestHereDocTokens73(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -996,7 +997,7 @@ CAT;` lexer := NewLexer([]byte(src), "7.4", false, nil) lexer.phpVersion = "7.2" - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -1028,7 +1029,7 @@ func TestInlineHtmlNopTokens(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true actual := []string{} for { @@ -1133,11 +1134,12 @@ func TestCommentEnd(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true - lexer.Lex() + tkn := lexer.Lex() - actual := lexer.hiddenTokens + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1162,11 +1164,12 @@ func TestCommentNewLine(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1191,11 +1194,12 @@ func TestCommentNewLine1(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1220,11 +1224,12 @@ func TestCommentNewLine2(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1250,11 +1255,12 @@ func TestCommentWithPhpEndTag(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1280,11 +1286,12 @@ func TestInlineComment(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1310,11 +1317,12 @@ func TestInlineComment2(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true - lexer.Lex() + tkn := lexer.Lex() - actual := lexer.hiddenTokens + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1344,11 +1352,12 @@ func TestEmptyInlineComment(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true - lexer.Lex() + tkn := lexer.Lex() - actual := lexer.hiddenTokens + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1374,11 +1383,12 @@ func TestEmptyInlineComment2(t *testing.T) { } lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1388,7 +1398,7 @@ func TestMethodCallTokens(t *testing.T) { $a -> bar ( '' ) ;` lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true expected := []token.Token{ { @@ -1401,7 +1411,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1411,7 +1422,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1421,7 +1433,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1431,7 +1444,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1441,7 +1455,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1451,7 +1466,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1461,7 +1477,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } @@ -1470,7 +1487,7 @@ func TestYieldFromTokens(t *testing.T) { yield from $a` lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withHiddenTokens = true + lexer.withTokens = true expected := []token.Token{ { @@ -1483,7 +1500,8 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn := lexer.Lex() - actual := tkn.Hidden + l := len(tkn.Tokens) + actual := tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) expected = []token.Token{ @@ -1493,7 +1511,8 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn = lexer.Lex() - actual = tkn.Hidden + l = len(tkn.Tokens) + actual = tkn.Tokens[:l-1] assert.DeepEqual(t, expected, actual) } diff --git a/internal/scanner/token.go b/internal/scanner/token.go index b46b340..793958c 100644 --- a/internal/scanner/token.go +++ b/internal/scanner/token.go @@ -9,6 +9,6 @@ import ( type Token struct { ID TokenID Value []byte - Hidden []token.Token + Tokens []token.Token Position position.Position } diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 0ee65f5..67974fd 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -32,9 +32,9 @@ func Parse(src []byte, ver string, cfg Config) (ast.Vertex, error) { lexer := scanner.NewLexer(src, ver, cfg.WithTokens, cfg.ErrorHandlerFunc) if r == -1 { - parser = php5.NewParser(lexer, cfg.WithTokens, cfg.ErrorHandlerFunc) + parser = php5.NewParser(lexer, cfg.ErrorHandlerFunc) } else { - parser = php7.NewParser(lexer, cfg.WithTokens, cfg.ErrorHandlerFunc) + parser = php7.NewParser(lexer, cfg.ErrorHandlerFunc) } parser.Parse() diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 2257614..24b5acd 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -13,7 +13,7 @@ import ( func parsePhp5(src string) ast.Vertex { lexer := scanner.NewLexer([]byte(src), "5.6", true, nil) - php5parser := php5.NewParser(lexer, true, nil) + php5parser := php5.NewParser(lexer, nil) php5parser.Parse() return php5parser.GetRootNode() @@ -832,7 +832,8 @@ func TestParseAndPrintPhp5Break(t *testing.T) { break ( 2 ) ; ` - actual := printPhp5(parsePhp5(src)) + root := parsePhp5(src) + actual := printPhp5(root) if src != actual { t.Errorf("\nexpected: %s\ngot: %s\n", src, actual) diff --git a/pkg/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go index 7b634a4..900ae22 100644 --- a/pkg/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -30,7 +30,7 @@ abstract class Bar extends Baz // parse lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) - php7parser := php7.NewParser(lexer, true, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() rootNode := php7parser.GetRootNode() @@ -62,7 +62,7 @@ abstract class Bar extends Baz func parse(src string) ast.Vertex { lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) - php7parser := php7.NewParser(lexer, true, nil) + php7parser := php7.NewParser(lexer, nil) php7parser.Parse() return php7parser.GetRootNode() From 476e84229de7f431112f77883c1298da7f6f1679 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 3 Jul 2020 00:42:16 +0300 Subject: [PATCH 028/140] [refactoring] add .gitattributes to mark autogenerated files --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..26bd28c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +internal/php5/php5.go -diff -merge +internal/php5/php5.go linguist-generated=true +internal/php7/php7.go -diff -merge +internal/php7/php7.go linguist-generated=true +internal/scanner/scanner.go -diff -merge +internal/scanner/scanner.go linguist-generated=true \ No newline at end of file From 84fe08869dfa46dc7f365cbdb0b49f3fef39636e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 4 Jul 2020 18:04:12 +0300 Subject: [PATCH 029/140] [refactoring] allow nil parser.errHandlerFunc --- internal/php5/parser.go | 4 ++++ internal/php7/parser.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 04a37f3..1fe5085 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -36,6 +36,10 @@ func (p *Parser) Lex(lval *yySymType) int { } func (p *Parser) Error(msg string) { + if p.errHandlerFunc == nil { + return + } + var pos = p.currentToken.Position p.errHandlerFunc(errors.NewError(msg, &pos)) } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index e7aa50e..f9530cc 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -35,6 +35,10 @@ func (p *Parser) Lex(lval *yySymType) int { } func (p *Parser) Error(msg string) { + if p.errHandlerFunc == nil { + return + } + var pos = p.currentToken.Position p.errHandlerFunc(errors.NewError(msg, &pos)) } From 7fc23cc1ded74d9b2e45ece785f5326ab2e6e8e8 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 4 Jul 2020 19:14:54 +0300 Subject: [PATCH 030/140] [refactoring] cli: add -e flag --- cmd/php-parser/main.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 8e9bbe1..6bccc93 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -3,12 +3,13 @@ package main import ( "bytes" "flag" - "fmt" + "io" "io/ioutil" "log" "os" "path/filepath" "runtime" + "strconv" "sync" "time" @@ -31,6 +32,7 @@ var withFreeFloating *bool var showResolvedNs *bool var printBack *bool var printPath *bool +var printErrors *bool var printExecTime *bool type file struct { @@ -52,6 +54,7 @@ func main() { showResolvedNs = flag.Bool("r", false, "resolve names") printBack = flag.Bool("pb", false, "print AST back into the parsed file") printPath = flag.Bool("p", false, "print filepath") + printErrors = flag.Bool("e", false, "print errors") dump = flag.Bool("d", false, "dump") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") flag.StringVar(&phpVersion, "phpver", "7.4", "php version") @@ -151,11 +154,13 @@ func printerWorker(r <-chan result) { counter++ if *printPath { - fmt.Fprintf(os.Stdout, "==> [%d] %s\n", counter, res.path) + _, _ = io.WriteString(os.Stderr, "==> [" + strconv.Itoa(counter) + "] " + res.path + "\n") } - for _, e := range res.errors { - fmt.Fprintf(os.Stdout, "==> %s\n", e) + if *printErrors { + for _, e := range res.errors { + _, _ = io.WriteString(os.Stderr, "==> " + e.String() + "\n") + } } if *printBack { @@ -171,7 +176,9 @@ func printerWorker(r <-chan result) { v := visitor.NewNamespaceResolver() t := traverser.NewDFS(v) t.Traverse(res.rootNode) - fmt.Printf("%+v", v.ResolvedNames) + for _, n := range v.ResolvedNames { + _, _ = io.WriteString(os.Stderr, "===> " + n + "\n") + } } if *dump == true { From 8417e7d6d27978e0720a86d8d46cceb9698d5f31 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 4 Jul 2020 20:59:26 +0300 Subject: [PATCH 031/140] [refactoring] dumper: print node position and tokens --- cmd/php-parser/main.go | 7 +- pkg/ast/visitor/dump.go | 716 +++++++++++++++++++++++++++-------- pkg/ast/visitor/dump_test.go | 34 ++ pkg/token/token.go | 1 + pkg/token/token_string.go | 161 ++++++++ 5 files changed, 763 insertions(+), 156 deletions(-) create mode 100644 pkg/token/token_string.go diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 6bccc93..1cd927c 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -129,6 +129,7 @@ func parserWorker(fileCh <-chan *file, r chan<- result) { parserErrors := []*errors.Error{} cfg := parser.Config{ + WithTokens: *withFreeFloating, ErrorHandlerFunc: func(e *errors.Error) { parserErrors = append(parserErrors, e) }, @@ -154,12 +155,12 @@ func printerWorker(r <-chan result) { counter++ if *printPath { - _, _ = io.WriteString(os.Stderr, "==> [" + strconv.Itoa(counter) + "] " + res.path + "\n") + _, _ = io.WriteString(os.Stderr, "==> ["+strconv.Itoa(counter)+"] "+res.path+"\n") } if *printErrors { for _, e := range res.errors { - _, _ = io.WriteString(os.Stderr, "==> " + e.String() + "\n") + _, _ = io.WriteString(os.Stderr, "==> "+e.String()+"\n") } } @@ -177,7 +178,7 @@ func printerWorker(r <-chan result) { t := traverser.NewDFS(v) t.Traverse(res.rootNode) for _, n := range v.ResolvedNames { - _, _ = io.WriteString(os.Stderr, "===> " + n + "\n") + _, _ = io.WriteString(os.Stderr, "===> "+n+"\n") } } diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 9d4c316..c86384d 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -3,7 +3,10 @@ package visitor import ( "fmt" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" "io" + "sort" + "strconv" "strings" ) @@ -88,14 +91,87 @@ func (v *Dump) LeaveNode(_ ast.Vertex) { v.print("\n") } -func (v *Dump) Root(_ *ast.Root) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.Root{\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) + 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) Nullable(_ *ast.Nullable) { +func (v *Dump) Root(n *ast.Root) { + v.printIndentIfNotSingle(v.indent - 1) + v.print("&ast.Root{\n") + v.printNode(n.GetNode()) +} + +func (v *Dump) Nullable(n *ast.Nullable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Nullable{\n") + + v.printNode(n.GetNode()) } func (v *Dump) Parameter(n *ast.Parameter) { @@ -111,6 +187,8 @@ func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent) v.print("Variadic: true,\n") } + + v.printNode(n.GetNode()) } func (v *Dump) Identifier(n *ast.Identifier) { @@ -119,11 +197,15 @@ func (v *Dump) Identifier(n *ast.Identifier) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } -func (v *Dump) ArgumentList(_ *ast.ArgumentList) { +func (v *Dump) ArgumentList(n *ast.ArgumentList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ArgumentList{\n") + + v.printNode(n.GetNode()) } func (v *Dump) Argument(n *ast.Argument) { @@ -139,81 +221,113 @@ func (v *Dump) Argument(n *ast.Argument) { v.printIndent(v.indent) v.print("IsReference: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltElse(_ *ast.StmtAltElse) { +func (v *Dump) StmtAltElse(n *ast.StmtAltElse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltElse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltElseIf(_ *ast.StmtAltElseIf) { +func (v *Dump) StmtAltElseIf(n *ast.StmtAltElseIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltElseIf{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltFor(_ *ast.StmtAltFor) { +func (v *Dump) StmtAltFor(n *ast.StmtAltFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltFor{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltForeach(_ *ast.StmtAltForeach) { +func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltForeach{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltIf(_ *ast.StmtAltIf) { +func (v *Dump) StmtAltIf(n *ast.StmtAltIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltIf{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltSwitch(_ *ast.StmtAltSwitch) { +func (v *Dump) StmtAltSwitch(n *ast.StmtAltSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltSwitch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtAltWhile(_ *ast.StmtAltWhile) { +func (v *Dump) StmtAltWhile(n *ast.StmtAltWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltWhile{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtBreak(_ *ast.StmtBreak) { +func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtCase(_ *ast.StmtCase) { +func (v *Dump) StmtCase(n *ast.StmtCase) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCase{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtCaseList(_ *ast.StmtCaseList) { +func (v *Dump) StmtCaseList(n *ast.StmtCaseList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCaseList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtCatch(_ *ast.StmtCatch) { +func (v *Dump) StmtCatch(n *ast.StmtCatch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCatch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtClass(_ *ast.StmtClass) { +func (v *Dump) StmtClass(n *ast.StmtClass) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClass{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtClassConstList(_ *ast.StmtClassConstList) { +func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassConstList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtClassExtends(_ *ast.StmtClassExtends) { +func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassExtends{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtClassImplements(_ *ast.StmtClassImplements) { +func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassImplements{\n") + + v.printNode(n.GetNode()) } func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { @@ -224,21 +338,29 @@ func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { v.printIndent(v.indent) v.print("ReturnsRef: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) StmtConstList(_ *ast.StmtConstList) { +func (v *Dump) StmtConstList(n *ast.StmtConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtConstant(_ *ast.StmtConstant) { +func (v *Dump) StmtConstant(n *ast.StmtConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstant{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtContinue(_ *ast.StmtContinue) { +func (v *Dump) StmtContinue(n *ast.StmtContinue) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtContinue{\n") + + v.printNode(n.GetNode()) } func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { @@ -249,51 +371,71 @@ func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { v.printIndent(v.indent) v.print("Alt: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) StmtDefault(_ *ast.StmtDefault) { +func (v *Dump) StmtDefault(n *ast.StmtDefault) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDefault{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtDo(_ *ast.StmtDo) { +func (v *Dump) StmtDo(n *ast.StmtDo) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDo{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtEcho(_ *ast.StmtEcho) { +func (v *Dump) StmtEcho(n *ast.StmtEcho) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtEcho{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtElse(_ *ast.StmtElse) { +func (v *Dump) StmtElse(n *ast.StmtElse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtElseIf(_ *ast.StmtElseIf) { +func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElseIf{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtExpression(_ *ast.StmtExpression) { +func (v *Dump) StmtExpression(n *ast.StmtExpression) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtExpression{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtFinally(_ *ast.StmtFinally) { +func (v *Dump) StmtFinally(n *ast.StmtFinally) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFinally{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtFor(_ *ast.StmtFor) { +func (v *Dump) StmtFor(n *ast.StmtFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFor{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtForeach(_ *ast.StmtForeach) { +func (v *Dump) StmtForeach(n *ast.StmtForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtForeach{\n") + + v.printNode(n.GetNode()) } func (v *Dump) StmtFunction(n *ast.StmtFunction) { @@ -304,31 +446,43 @@ func (v *Dump) StmtFunction(n *ast.StmtFunction) { v.printIndent(v.indent) v.print("ReturnsRef: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) StmtGlobal(_ *ast.StmtGlobal) { +func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGlobal{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtGoto(_ *ast.StmtGoto) { +func (v *Dump) StmtGoto(n *ast.StmtGoto) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGoto{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtGroupUse(_ *ast.StmtGroupUse) { +func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGroupUse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtHaltCompiler(_ *ast.StmtHaltCompiler) { +func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtHaltCompiler{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtIf(_ *ast.StmtIf) { +func (v *Dump) StmtIf(n *ast.StmtIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtIf{\n") + + v.printNode(n.GetNode()) } func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { @@ -337,136 +491,190 @@ func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } -func (v *Dump) StmtInterface(_ *ast.StmtInterface) { +func (v *Dump) StmtInterface(n *ast.StmtInterface) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterface{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtInterfaceExtends(_ *ast.StmtInterfaceExtends) { +func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterfaceExtends{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtLabel(_ *ast.StmtLabel) { +func (v *Dump) StmtLabel(n *ast.StmtLabel) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtLabel{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtNamespace(_ *ast.StmtNamespace) { +func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNamespace{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtNop(_ *ast.StmtNop) { +func (v *Dump) StmtNop(n *ast.StmtNop) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNop{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtProperty(_ *ast.StmtProperty) { +func (v *Dump) StmtProperty(n *ast.StmtProperty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtProperty{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtPropertyList(_ *ast.StmtPropertyList) { +func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtPropertyList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtReturn(_ *ast.StmtReturn) { +func (v *Dump) StmtReturn(n *ast.StmtReturn) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtReturn{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtStatic(_ *ast.StmtStatic) { +func (v *Dump) StmtStatic(n *ast.StmtStatic) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStatic{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtStaticVar(_ *ast.StmtStaticVar) { +func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStaticVar{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtStmtList(_ *ast.StmtStmtList) { +func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStmtList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtSwitch(_ *ast.StmtSwitch) { +func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtSwitch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtThrow(_ *ast.StmtThrow) { +func (v *Dump) StmtThrow(n *ast.StmtThrow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtThrow{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTrait(_ *ast.StmtTrait) { +func (v *Dump) StmtTrait(n *ast.StmtTrait) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTrait{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTraitAdaptationList(_ *ast.StmtTraitAdaptationList) { +func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitAdaptationList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTraitMethodRef(_ *ast.StmtTraitMethodRef) { +func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitMethodRef{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTraitUse(_ *ast.StmtTraitUse) { +func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTraitUseAlias(_ *ast.StmtTraitUseAlias) { +func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUseAlias{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTraitUsePrecedence(_ *ast.StmtTraitUsePrecedence) { +func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUsePrecedence{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtTry(_ *ast.StmtTry) { +func (v *Dump) StmtTry(n *ast.StmtTry) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTry{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtUnset(_ *ast.StmtUnset) { +func (v *Dump) StmtUnset(n *ast.StmtUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUnset{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtUse(_ *ast.StmtUse) { +func (v *Dump) StmtUse(n *ast.StmtUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtUseList(_ *ast.StmtUseList) { +func (v *Dump) StmtUseList(n *ast.StmtUseList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUseList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) StmtWhile(_ *ast.StmtWhile) { +func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtWhile{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprArray(_ *ast.ExprArray) { +func (v *Dump) ExprArray(n *ast.ExprArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArray{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprArrayDimFetch(_ *ast.ExprArrayDimFetch) { +func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayDimFetch{\n") + + v.printNode(n.GetNode()) } func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { @@ -477,6 +685,8 @@ func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { v.printIndent(v.indent) v.print("Unpack: true,\n") } + + v.printNode(n.GetNode()) } func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { @@ -492,26 +702,36 @@ func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.printIndent(v.indent) v.print("Static: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBitwiseNot(_ *ast.ExprBitwiseNot) { +func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBitwiseNot{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBooleanNot(_ *ast.ExprBooleanNot) { +func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBooleanNot{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprClassConstFetch(_ *ast.ExprClassConstFetch) { +func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClassConstFetch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprClone(_ *ast.ExprClone) { +func (v *Dump) ExprClone(n *ast.ExprClone) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClone{\n") + + v.printNode(n.GetNode()) } func (v *Dump) ExprClosure(n *ast.ExprClosure) { @@ -527,31 +747,43 @@ func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.printIndent(v.indent) v.print("Static: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) ExprClosureUse(_ *ast.ExprClosureUse) { +func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosureUse{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprConstFetch(_ *ast.ExprConstFetch) { +func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprConstFetch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprEmpty(_ *ast.ExprEmpty) { +func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEmpty{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprErrorSuppress(_ *ast.ExprErrorSuppress) { +func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprErrorSuppress{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprEval(_ *ast.ExprEval) { +func (v *Dump) ExprEval(n *ast.ExprEval) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEval{\n") + + v.printNode(n.GetNode()) } func (v *Dump) ExprExit(n *ast.ExprExit) { @@ -562,391 +794,547 @@ func (v *Dump) ExprExit(n *ast.ExprExit) { v.printIndent(v.indent) v.print("Die: true,\n") } + + v.printNode(n.GetNode()) } -func (v *Dump) ExprFunctionCall(_ *ast.ExprFunctionCall) { +func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprFunctionCall{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprInclude(_ *ast.ExprInclude) { +func (v *Dump) ExprInclude(n *ast.ExprInclude) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInclude{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprIncludeOnce(_ *ast.ExprIncludeOnce) { +func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIncludeOnce{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprInstanceOf(_ *ast.ExprInstanceOf) { +func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInstanceOf{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprIsset(_ *ast.ExprIsset) { +func (v *Dump) ExprIsset(n *ast.ExprIsset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIsset{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprList(_ *ast.ExprList) { +func (v *Dump) ExprList(n *ast.ExprList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprMethodCall(_ *ast.ExprMethodCall) { +func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprMethodCall{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprNew(_ *ast.ExprNew) { +func (v *Dump) ExprNew(n *ast.ExprNew) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprNew{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPostDec(_ *ast.ExprPostDec) { +func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostDec{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPostInc(_ *ast.ExprPostInc) { +func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostInc{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPreDec(_ *ast.ExprPreDec) { +func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreDec{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPreInc(_ *ast.ExprPreInc) { +func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreInc{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPrint(_ *ast.ExprPrint) { +func (v *Dump) ExprPrint(n *ast.ExprPrint) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPrint{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprPropertyFetch(_ *ast.ExprPropertyFetch) { +func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPropertyFetch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprReference(_ *ast.ExprReference) { +func (v *Dump) ExprReference(n *ast.ExprReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprReference{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprRequire(_ *ast.ExprRequire) { +func (v *Dump) ExprRequire(n *ast.ExprRequire) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequire{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprRequireOnce(_ *ast.ExprRequireOnce) { +func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequireOnce{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprShellExec(_ *ast.ExprShellExec) { +func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShellExec{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprShortArray(_ *ast.ExprShortArray) { +func (v *Dump) ExprShortArray(n *ast.ExprShortArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShortArray{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprShortList(_ *ast.ExprShortList) { +func (v *Dump) ExprShortList(n *ast.ExprShortList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShortList{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprStaticCall(_ *ast.ExprStaticCall) { +func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticCall{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprStaticPropertyFetch(_ *ast.ExprStaticPropertyFetch) { +func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticPropertyFetch{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprTernary(_ *ast.ExprTernary) { +func (v *Dump) ExprTernary(n *ast.ExprTernary) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprTernary{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprUnaryMinus(_ *ast.ExprUnaryMinus) { +func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryMinus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprUnaryPlus(_ *ast.ExprUnaryPlus) { +func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryPlus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprVariable(_ *ast.ExprVariable) { +func (v *Dump) ExprVariable(n *ast.ExprVariable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprVariable{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprYield(_ *ast.ExprYield) { +func (v *Dump) ExprYield(n *ast.ExprYield) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYield{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprYieldFrom(_ *ast.ExprYieldFrom) { +func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYieldFrom{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssign(_ *ast.ExprAssign) { +func (v *Dump) ExprAssign(n *ast.ExprAssign) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssign{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignReference(_ *ast.ExprAssignReference) { +func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignReference{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignBitwiseAnd(_ *ast.ExprAssignBitwiseAnd) { +func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseAnd{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignBitwiseOr(_ *ast.ExprAssignBitwiseOr) { +func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseOr{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignBitwiseXor(_ *ast.ExprAssignBitwiseXor) { +func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseXor{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignCoalesce(_ *ast.ExprAssignCoalesce) { +func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignCoalesce{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignConcat(_ *ast.ExprAssignConcat) { +func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignConcat{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignDiv(_ *ast.ExprAssignDiv) { +func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignDiv{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignMinus(_ *ast.ExprAssignMinus) { +func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMinus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignMod(_ *ast.ExprAssignMod) { +func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMod{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignMul(_ *ast.ExprAssignMul) { +func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMul{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignPlus(_ *ast.ExprAssignPlus) { +func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPlus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignPow(_ *ast.ExprAssignPow) { +func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPow{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignShiftLeft(_ *ast.ExprAssignShiftLeft) { +func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftLeft{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprAssignShiftRight(_ *ast.ExprAssignShiftRight) { +func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftRight{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryBitwiseAnd(_ *ast.ExprBinaryBitwiseAnd) { +func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseAnd{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryBitwiseOr(_ *ast.ExprBinaryBitwiseOr) { +func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseOr{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryBitwiseXor(_ *ast.ExprBinaryBitwiseXor) { +func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseXor{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryBooleanAnd(_ *ast.ExprBinaryBooleanAnd) { +func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanAnd{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryBooleanOr(_ *ast.ExprBinaryBooleanOr) { +func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanOr{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryCoalesce(_ *ast.ExprBinaryCoalesce) { +func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryCoalesce{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryConcat(_ *ast.ExprBinaryConcat) { +func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryConcat{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryDiv(_ *ast.ExprBinaryDiv) { +func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryDiv{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryEqual(_ *ast.ExprBinaryEqual) { +func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryEqual{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryGreater(_ *ast.ExprBinaryGreater) { +func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreater{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryGreaterOrEqual(_ *ast.ExprBinaryGreaterOrEqual) { +func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreaterOrEqual{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryIdentical(_ *ast.ExprBinaryIdentical) { +func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryIdentical{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryLogicalAnd(_ *ast.ExprBinaryLogicalAnd) { +func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalAnd{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryLogicalOr(_ *ast.ExprBinaryLogicalOr) { +func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalOr{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryLogicalXor(_ *ast.ExprBinaryLogicalXor) { +func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalXor{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryMinus(_ *ast.ExprBinaryMinus) { +func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMinus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryMod(_ *ast.ExprBinaryMod) { +func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMod{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryMul(_ *ast.ExprBinaryMul) { +func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMul{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryNotEqual(_ *ast.ExprBinaryNotEqual) { +func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotEqual{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryNotIdentical(_ *ast.ExprBinaryNotIdentical) { +func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotIdentical{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryPlus(_ *ast.ExprBinaryPlus) { +func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPlus{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryPow(_ *ast.ExprBinaryPow) { +func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPow{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryShiftLeft(_ *ast.ExprBinaryShiftLeft) { +func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftLeft{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinaryShiftRight(_ *ast.ExprBinaryShiftRight) { +func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftRight{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinarySmaller(_ *ast.ExprBinarySmaller) { +func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmaller{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinarySmallerOrEqual(_ *ast.ExprBinarySmallerOrEqual) { +func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmallerOrEqual{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprBinarySpaceship(_ *ast.ExprBinarySpaceship) { +func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySpaceship{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastArray(_ *ast.ExprCastArray) { +func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastArray{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastBool(_ *ast.ExprCastBool) { +func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastBool{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastDouble(_ *ast.ExprCastDouble) { +func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastDouble{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastInt(_ *ast.ExprCastInt) { +func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastInt{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastObject(_ *ast.ExprCastObject) { +func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastObject{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastString(_ *ast.ExprCastString) { +func (v *Dump) ExprCastString(n *ast.ExprCastString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastString{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) ExprCastUnset(_ *ast.ExprCastUnset) { +func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastUnset{\n") + + v.printNode(n.GetNode()) } func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { @@ -955,11 +1343,15 @@ func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } -func (v *Dump) ScalarEncapsed(_ *ast.ScalarEncapsed) { +func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsed{\n") + + v.printNode(n.GetNode()) } func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { @@ -968,6 +1360,8 @@ func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { @@ -976,6 +1370,8 @@ func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.printIndent(v.indent) v.print(fmt.Sprintf("Label: %q,\n", n.Label)) + + v.printNode(n.GetNode()) } func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { @@ -984,6 +1380,8 @@ func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { @@ -992,6 +1390,8 @@ func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } func (v *Dump) ScalarString(n *ast.ScalarString) { @@ -1000,21 +1400,29 @@ func (v *Dump) ScalarString(n *ast.ScalarString) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } -func (v *Dump) NameName(_ *ast.NameName) { +func (v *Dump) NameName(n *ast.NameName) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameName{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) NameFullyQualified(_ *ast.NameFullyQualified) { +func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameFullyQualified{\n") + + v.printNode(n.GetNode()) } -func (v *Dump) NameRelative(_ *ast.NameRelative) { +func (v *Dump) NameRelative(n *ast.NameRelative) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameRelative{\n") + + v.printNode(n.GetNode()) } func (v *Dump) NameNamePart(n *ast.NameNamePart) { @@ -1023,4 +1431,6 @@ func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.printIndent(v.indent) v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + + v.printNode(n.GetNode()) } diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 3d68a0d..df92014 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -4,11 +4,29 @@ import ( "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/ast/traverser" "github.com/z7zmey/php-parser/pkg/ast/visitor" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" "os" ) func ExampleDump() { stxTree := &ast.Root{ + Node: ast.Node{ + Tokens: token.Collection{ + token.Start: []token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + }, + }, + }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 1, + }, + }, Stmts: []ast.Vertex{ &ast.Identifier{}, &ast.Parameter{ @@ -25,6 +43,22 @@ func ExampleDump() { //output: //&ast.Root{ + // Node: ast.Node{ + // Tokens: token.Collection{ + // token.Start: []token.Token{ + // { + // ID: token.T_WHITESPACE, + // Value: []byte(" "), + // }, + // }, + // }, + // Position: &position.Position{ + // StartLine: 1, + // EndLine: 1, + // StartPos: 0, + // EndPos: 1, + // }, + // }, // Stmts: []ast.Vertex{ // &ast.Identifier{ // Value: "", diff --git a/pkg/token/token.go b/pkg/token/token.go index 6ba52d6..c1fa07e 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -1,5 +1,6 @@ package token +//go:generate stringer -type=ID -output ./token_string.go type ID int const ( diff --git a/pkg/token/token_string.go b/pkg/token/token_string.go new file mode 100644 index 0000000..ce34b14 --- /dev/null +++ b/pkg/token/token_string.go @@ -0,0 +1,161 @@ +// Code generated by "stringer -type=ID -output ./token_string.go"; DO NOT EDIT. + +package token + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[T_INCLUDE-57346] + _ = x[T_INCLUDE_ONCE-57347] + _ = x[T_EXIT-57348] + _ = x[T_IF-57349] + _ = x[T_LNUMBER-57350] + _ = x[T_DNUMBER-57351] + _ = x[T_STRING-57352] + _ = x[T_STRING_VARNAME-57353] + _ = x[T_VARIABLE-57354] + _ = x[T_NUM_STRING-57355] + _ = x[T_INLINE_HTML-57356] + _ = x[T_CHARACTER-57357] + _ = x[T_BAD_CHARACTER-57358] + _ = x[T_ENCAPSED_AND_WHITESPACE-57359] + _ = x[T_CONSTANT_ENCAPSED_STRING-57360] + _ = x[T_ECHO-57361] + _ = x[T_DO-57362] + _ = x[T_WHILE-57363] + _ = x[T_ENDWHILE-57364] + _ = x[T_FOR-57365] + _ = x[T_ENDFOR-57366] + _ = x[T_FOREACH-57367] + _ = x[T_ENDFOREACH-57368] + _ = x[T_DECLARE-57369] + _ = x[T_ENDDECLARE-57370] + _ = x[T_AS-57371] + _ = x[T_SWITCH-57372] + _ = x[T_ENDSWITCH-57373] + _ = x[T_CASE-57374] + _ = x[T_DEFAULT-57375] + _ = x[T_BREAK-57376] + _ = x[T_CONTINUE-57377] + _ = x[T_GOTO-57378] + _ = x[T_FUNCTION-57379] + _ = x[T_FN-57380] + _ = x[T_CONST-57381] + _ = x[T_RETURN-57382] + _ = x[T_TRY-57383] + _ = x[T_CATCH-57384] + _ = x[T_FINALLY-57385] + _ = x[T_THROW-57386] + _ = x[T_USE-57387] + _ = x[T_INSTEADOF-57388] + _ = x[T_GLOBAL-57389] + _ = x[T_VAR-57390] + _ = x[T_UNSET-57391] + _ = x[T_ISSET-57392] + _ = x[T_EMPTY-57393] + _ = x[T_HALT_COMPILER-57394] + _ = x[T_CLASS-57395] + _ = x[T_TRAIT-57396] + _ = x[T_INTERFACE-57397] + _ = x[T_EXTENDS-57398] + _ = x[T_IMPLEMENTS-57399] + _ = x[T_OBJECT_OPERATOR-57400] + _ = x[T_DOUBLE_ARROW-57401] + _ = x[T_LIST-57402] + _ = x[T_ARRAY-57403] + _ = x[T_CALLABLE-57404] + _ = x[T_CLASS_C-57405] + _ = x[T_TRAIT_C-57406] + _ = x[T_METHOD_C-57407] + _ = x[T_FUNC_C-57408] + _ = x[T_LINE-57409] + _ = x[T_FILE-57410] + _ = x[T_COMMENT-57411] + _ = x[T_DOC_COMMENT-57412] + _ = x[T_OPEN_TAG-57413] + _ = x[T_OPEN_TAG_WITH_ECHO-57414] + _ = x[T_CLOSE_TAG-57415] + _ = x[T_WHITESPACE-57416] + _ = x[T_START_HEREDOC-57417] + _ = x[T_END_HEREDOC-57418] + _ = x[T_DOLLAR_OPEN_CURLY_BRACES-57419] + _ = x[T_CURLY_OPEN-57420] + _ = x[T_PAAMAYIM_NEKUDOTAYIM-57421] + _ = x[T_NAMESPACE-57422] + _ = x[T_NS_C-57423] + _ = x[T_DIR-57424] + _ = x[T_NS_SEPARATOR-57425] + _ = x[T_ELLIPSIS-57426] + _ = x[T_EVAL-57427] + _ = x[T_REQUIRE-57428] + _ = x[T_REQUIRE_ONCE-57429] + _ = x[T_LOGICAL_OR-57430] + _ = x[T_LOGICAL_XOR-57431] + _ = x[T_LOGICAL_AND-57432] + _ = x[T_INSTANCEOF-57433] + _ = x[T_NEW-57434] + _ = x[T_CLONE-57435] + _ = x[T_ELSEIF-57436] + _ = x[T_ELSE-57437] + _ = x[T_ENDIF-57438] + _ = x[T_PRINT-57439] + _ = x[T_YIELD-57440] + _ = x[T_STATIC-57441] + _ = x[T_ABSTRACT-57442] + _ = x[T_FINAL-57443] + _ = x[T_PRIVATE-57444] + _ = x[T_PROTECTED-57445] + _ = x[T_PUBLIC-57446] + _ = x[T_INC-57447] + _ = x[T_DEC-57448] + _ = x[T_YIELD_FROM-57449] + _ = x[T_INT_CAST-57450] + _ = x[T_DOUBLE_CAST-57451] + _ = x[T_STRING_CAST-57452] + _ = x[T_ARRAY_CAST-57453] + _ = x[T_OBJECT_CAST-57454] + _ = x[T_BOOL_CAST-57455] + _ = x[T_UNSET_CAST-57456] + _ = x[T_COALESCE-57457] + _ = x[T_SPACESHIP-57458] + _ = x[T_NOELSE-57459] + _ = x[T_PLUS_EQUAL-57460] + _ = x[T_MINUS_EQUAL-57461] + _ = x[T_MUL_EQUAL-57462] + _ = x[T_POW_EQUAL-57463] + _ = x[T_DIV_EQUAL-57464] + _ = x[T_CONCAT_EQUAL-57465] + _ = x[T_MOD_EQUAL-57466] + _ = x[T_AND_EQUAL-57467] + _ = x[T_OR_EQUAL-57468] + _ = x[T_XOR_EQUAL-57469] + _ = x[T_SL_EQUAL-57470] + _ = x[T_SR_EQUAL-57471] + _ = x[T_COALESCE_EQUAL-57472] + _ = x[T_BOOLEAN_OR-57473] + _ = x[T_BOOLEAN_AND-57474] + _ = x[T_POW-57475] + _ = x[T_SL-57476] + _ = x[T_SR-57477] + _ = x[T_IS_IDENTICAL-57478] + _ = x[T_IS_NOT_IDENTICAL-57479] + _ = x[T_IS_EQUAL-57480] + _ = x[T_IS_NOT_EQUAL-57481] + _ = x[T_IS_SMALLER_OR_EQUAL-57482] + _ = x[T_IS_GREATER_OR_EQUAL-57483] +} + +const _ID_name = "T_INCLUDET_INCLUDE_ONCET_EXITT_IFT_LNUMBERT_DNUMBERT_STRINGT_STRING_VARNAMET_VARIABLET_NUM_STRINGT_INLINE_HTMLT_CHARACTERT_BAD_CHARACTERT_ENCAPSED_AND_WHITESPACET_CONSTANT_ENCAPSED_STRINGT_ECHOT_DOT_WHILET_ENDWHILET_FORT_ENDFORT_FOREACHT_ENDFOREACHT_DECLARET_ENDDECLARET_AST_SWITCHT_ENDSWITCHT_CASET_DEFAULTT_BREAKT_CONTINUET_GOTOT_FUNCTIONT_FNT_CONSTT_RETURNT_TRYT_CATCHT_FINALLYT_THROWT_USET_INSTEADOFT_GLOBALT_VART_UNSETT_ISSETT_EMPTYT_HALT_COMPILERT_CLASST_TRAITT_INTERFACET_EXTENDST_IMPLEMENTST_OBJECT_OPERATORT_DOUBLE_ARROWT_LISTT_ARRAYT_CALLABLET_CLASS_CT_TRAIT_CT_METHOD_CT_FUNC_CT_LINET_FILET_COMMENTT_DOC_COMMENTT_OPEN_TAGT_OPEN_TAG_WITH_ECHOT_CLOSE_TAGT_WHITESPACET_START_HEREDOCT_END_HEREDOCT_DOLLAR_OPEN_CURLY_BRACEST_CURLY_OPENT_PAAMAYIM_NEKUDOTAYIMT_NAMESPACET_NS_CT_DIRT_NS_SEPARATORT_ELLIPSIST_EVALT_REQUIRET_REQUIRE_ONCET_LOGICAL_ORT_LOGICAL_XORT_LOGICAL_ANDT_INSTANCEOFT_NEWT_CLONET_ELSEIFT_ELSET_ENDIFT_PRINTT_YIELDT_STATICT_ABSTRACTT_FINALT_PRIVATET_PROTECTEDT_PUBLICT_INCT_DECT_YIELD_FROMT_INT_CASTT_DOUBLE_CASTT_STRING_CASTT_ARRAY_CASTT_OBJECT_CASTT_BOOL_CASTT_UNSET_CASTT_COALESCET_SPACESHIPT_NOELSET_PLUS_EQUALT_MINUS_EQUALT_MUL_EQUALT_POW_EQUALT_DIV_EQUALT_CONCAT_EQUALT_MOD_EQUALT_AND_EQUALT_OR_EQUALT_XOR_EQUALT_SL_EQUALT_SR_EQUALT_COALESCE_EQUALT_BOOLEAN_ORT_BOOLEAN_ANDT_POWT_SLT_SRT_IS_IDENTICALT_IS_NOT_IDENTICALT_IS_EQUALT_IS_NOT_EQUALT_IS_SMALLER_OR_EQUALT_IS_GREATER_OR_EQUAL" + +var _ID_index = [...]uint16{0, 9, 23, 29, 33, 42, 51, 59, 75, 85, 97, 110, 121, 136, 161, 187, 193, 197, 204, 214, 219, 227, 236, 248, 257, 269, 273, 281, 292, 298, 307, 314, 324, 330, 340, 344, 351, 359, 364, 371, 380, 387, 392, 403, 411, 416, 423, 430, 437, 452, 459, 466, 477, 486, 498, 515, 529, 535, 542, 552, 561, 570, 580, 588, 594, 600, 609, 622, 632, 652, 663, 675, 690, 703, 729, 741, 763, 774, 780, 785, 799, 809, 815, 824, 838, 850, 863, 876, 888, 893, 900, 908, 914, 921, 928, 935, 943, 953, 960, 969, 980, 988, 993, 998, 1010, 1020, 1033, 1046, 1058, 1071, 1082, 1094, 1104, 1115, 1123, 1135, 1148, 1159, 1170, 1181, 1195, 1206, 1217, 1227, 1238, 1248, 1258, 1274, 1286, 1299, 1304, 1308, 1312, 1326, 1344, 1354, 1368, 1389, 1410} + +func (i ID) String() string { + i -= 57346 + if i < 0 || i >= ID(len(_ID_index)-1) { + return "ID(" + strconv.FormatInt(int64(i+57346), 10) + ")" + } + return _ID_name[_ID_index[i]:_ID_index[i+1]] +} From 7a8746600b22af34bb7ae1ee421ec6d79067bb03 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 4 Jul 2020 21:10:41 +0300 Subject: [PATCH 032/140] [refactoring] dumper: fix dumping node value --- pkg/ast/visitor/dump.go | 16 ++++++++-------- pkg/ast/visitor/dump_test.go | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index c86384d..45a06c1 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -196,7 +196,7 @@ func (v *Dump) Identifier(n *ast.Identifier) { v.print("&ast.Identifier{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -490,7 +490,7 @@ func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.print("&ast.StmtInlineHtml{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1342,7 +1342,7 @@ func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.print("&ast.ScalarDnumber{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1359,7 +1359,7 @@ func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.print("&ast.ScalarEncapsedStringPart{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1379,7 +1379,7 @@ func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.print("&ast.ScalarLnumber{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1389,7 +1389,7 @@ func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.print("&ast.ScalarMagicConstant{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1399,7 +1399,7 @@ func (v *Dump) ScalarString(n *ast.ScalarString) { v.print("&ast.ScalarString{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } @@ -1430,7 +1430,7 @@ func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.print("&ast.NameNamePart{\n") v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: %q,\n", n.Value)) + v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) v.printNode(n.GetNode()) } diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index df92014..c257ed5 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -61,7 +61,7 @@ func ExampleDump() { // }, // Stmts: []ast.Vertex{ // &ast.Identifier{ - // Value: "", + // Value: []byte(""), // }, // &ast.Parameter{ // Variadic: true, @@ -69,7 +69,7 @@ func ExampleDump() { // }, // }, // &ast.StmtInlineHtml{ - // Value: "foo", + // Value: []byte("foo"), // }, // }, //} From 5cc3b502911a1e30207eefb8cf31aa1ad4c5ed36 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 4 Jul 2020 21:22:32 +0300 Subject: [PATCH 033/140] [refactoring] dumper: print Node first --- pkg/ast/visitor/dump.go | 204 ++++------------------------------------ 1 file changed, 18 insertions(+), 186 deletions(-) diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 45a06c1..5273c21 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -170,13 +170,13 @@ func (v *Dump) Root(n *ast.Root) { func (v *Dump) Nullable(n *ast.Nullable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Nullable{\n") - v.printNode(n.GetNode()) } func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent - 1) v.print("&ast.Parameter{\n") + v.printNode(n.GetNode()) if n.ByRef { v.printIndent(v.indent) @@ -187,30 +187,27 @@ func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent) v.print("Variadic: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) Identifier(n *ast.Identifier) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Identifier{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) ArgumentList(n *ast.ArgumentList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ArgumentList{\n") - v.printNode(n.GetNode()) } func (v *Dump) Argument(n *ast.Argument) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Argument{\n") + v.printNode(n.GetNode()) if n.Variadic { v.printIndent(v.indent) @@ -221,477 +218,413 @@ func (v *Dump) Argument(n *ast.Argument) { v.printIndent(v.indent) v.print("IsReference: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) StmtAltElse(n *ast.StmtAltElse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltElse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltElseIf(n *ast.StmtAltElseIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltElseIf{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltFor(n *ast.StmtAltFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltFor{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltForeach{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltIf(n *ast.StmtAltIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltIf{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltSwitch(n *ast.StmtAltSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltSwitch{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtAltWhile(n *ast.StmtAltWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltWhile{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtCase(n *ast.StmtCase) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCase{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtCaseList(n *ast.StmtCaseList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCaseList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtCatch(n *ast.StmtCatch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCatch{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClass(n *ast.StmtClass) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClass{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassConstList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassExtends{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassImplements{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassMethod{\n") + v.printNode(n.GetNode()) if n.ReturnsRef { v.printIndent(v.indent) v.print("ReturnsRef: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) StmtConstList(n *ast.StmtConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtConstant(n *ast.StmtConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstant{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtContinue(n *ast.StmtContinue) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtContinue{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDeclare{\n") + v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) v.print("Alt: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) StmtDefault(n *ast.StmtDefault) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDefault{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtDo(n *ast.StmtDo) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDo{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtEcho(n *ast.StmtEcho) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtEcho{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtElse(n *ast.StmtElse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElseIf{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtExpression(n *ast.StmtExpression) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtExpression{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFinally(n *ast.StmtFinally) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFinally{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFor(n *ast.StmtFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFor{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtForeach(n *ast.StmtForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtForeach{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFunction(n *ast.StmtFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFunction{\n") + v.printNode(n.GetNode()) if n.ReturnsRef { v.printIndent(v.indent) v.print("ReturnsRef: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGlobal{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtGoto(n *ast.StmtGoto) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGoto{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGroupUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtHaltCompiler{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtIf(n *ast.StmtIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtIf{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInlineHtml{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) StmtInterface(n *ast.StmtInterface) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterface{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterfaceExtends{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtLabel(n *ast.StmtLabel) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtLabel{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNamespace{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtNop(n *ast.StmtNop) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNop{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtProperty(n *ast.StmtProperty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtProperty{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtPropertyList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtReturn(n *ast.StmtReturn) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtReturn{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStatic(n *ast.StmtStatic) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStatic{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStaticVar{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStmtList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtSwitch{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtThrow(n *ast.StmtThrow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtThrow{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTrait(n *ast.StmtTrait) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTrait{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitAdaptationList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitMethodRef{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUseAlias{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUsePrecedence{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTry(n *ast.StmtTry) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTry{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtUnset(n *ast.StmtUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUnset{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtUse(n *ast.StmtUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtUseList(n *ast.StmtUseList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUseList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtWhile{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArray(n *ast.ExprArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArray{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayDimFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayItem{\n") + v.printNode(n.GetNode()) if n.Unpack { v.printIndent(v.indent) v.print("Unpack: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrowFunction{\n") + v.printNode(n.GetNode()) if n.ReturnsRef { v.printIndent(v.indent) @@ -702,41 +635,36 @@ func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.printIndent(v.indent) v.print("Static: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBitwiseNot{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBooleanNot{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClassConstFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClone(n *ast.ExprClone) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClone{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosure{\n") + v.printNode(n.GetNode()) if n.ReturnsRef { v.printIndent(v.indent) @@ -747,690 +675,594 @@ func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.printIndent(v.indent) v.print("Static: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosureUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprConstFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEmpty{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprErrorSuppress{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprEval(n *ast.ExprEval) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEval{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprExit(n *ast.ExprExit) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprExit{\n") + v.printNode(n.GetNode()) if n.Die { v.printIndent(v.indent) v.print("Die: true,\n") } - - v.printNode(n.GetNode()) } func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprFunctionCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprInclude(n *ast.ExprInclude) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInclude{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIncludeOnce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInstanceOf{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprIsset(n *ast.ExprIsset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIsset{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprList(n *ast.ExprList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprList{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprMethodCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprNew(n *ast.ExprNew) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprNew{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostDec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostInc{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreDec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreInc{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPrint(n *ast.ExprPrint) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPrint{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPropertyFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprReference(n *ast.ExprReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprReference{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprRequire(n *ast.ExprRequire) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequire{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequireOnce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShellExec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprShortArray(n *ast.ExprShortArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShortArray{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprShortList(n *ast.ExprShortList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShortList{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticPropertyFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprTernary(n *ast.ExprTernary) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprTernary{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprVariable(n *ast.ExprVariable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprVariable{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprYield(n *ast.ExprYield) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYield{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYieldFrom{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssign(n *ast.ExprAssign) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssign{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignReference{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignCoalesce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignConcat{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignDiv{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMod{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMul{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPow{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftLeft{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftRight{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryCoalesce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryConcat{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryDiv{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreater{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreaterOrEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryIdentical{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMod{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMul{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotIdentical{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPow{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftLeft{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftRight{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmaller{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmallerOrEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySpaceship{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastArray{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastBool{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastDouble{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastInt{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastObject{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastString(n *ast.ExprCastString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastString{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastUnset{\n") - v.printNode(n.GetNode()) } func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarDnumber{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsed{\n") - v.printNode(n.GetNode()) } func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsedStringPart{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarHeredoc{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Label: %q,\n", n.Label)) - - v.printNode(n.GetNode()) } func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarLnumber{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarMagicConstant{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) ScalarString(n *ast.ScalarString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarString{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } func (v *Dump) NameName(n *ast.NameName) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameName{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameFullyQualified{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameRelative(n *ast.NameRelative) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameRelative{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameNamePart{\n") + v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) - - v.printNode(n.GetNode()) } From b5e29fc9f5ebe7ec6b1f89a0cf82aade9cb3858b Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 5 Jul 2020 18:27:34 +0300 Subject: [PATCH 034/140] [refactoring] fix dfs traverser --- pkg/ast/traverser/dfs.go | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 2bba30c..7a13184 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -337,6 +337,21 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Modifiers", false) } + if nn.ArgumentList != nil { + t.visitor.Enter("ArgumentList", true) + t.Traverse(nn.ArgumentList) + t.visitor.Leave("ArgumentList", true) + } + if nn.Extends != nil { + t.visitor.Enter("Extends", true) + t.Traverse(nn.Extends) + t.visitor.Leave("Extends", true) + } + if nn.Implements != nil { + t.visitor.Enter("Implements", true) + t.Traverse(nn.Implements) + t.visitor.Leave("Implements", true) + } if nn.Stmts != nil { t.visitor.Enter("Stmts", false) for _, c := range nn.Stmts { @@ -785,6 +800,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.InterfaceName) t.visitor.Leave("InterfaceName", true) } + if nn.Extends != nil { + t.visitor.Enter("Extends", true) + t.Traverse(nn.Extends) + t.visitor.Leave("Extends", true) + } if nn.Stmts != nil { t.visitor.Enter("Stmts", false) for _, c := range nn.Stmts { @@ -845,6 +865,12 @@ func (t *DFS) Traverse(n ast.Vertex) { return } case *ast.StmtProperty: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } if nn.Var != nil { t.visitor.Enter("Var", true) t.Traverse(nn.Var) @@ -950,6 +976,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Cond) t.visitor.Leave("Cond", true) } + if nn.CaseList != nil { + t.visitor.Enter("CaseList", true) + t.Traverse(nn.CaseList) + t.visitor.Leave("CaseList", true) + } case *ast.StmtThrow: if nn == nil { return @@ -1503,6 +1534,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Method) t.visitor.Leave("Method", true) } + if nn.ArgumentList != nil { + t.visitor.Enter("ArgumentList", true) + t.Traverse(nn.ArgumentList) + t.visitor.Leave("ArgumentList", true) + } case *ast.ExprNew: if nn == nil { return @@ -1515,6 +1551,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Class) t.visitor.Leave("Class", true) } + if nn.ArgumentList != nil { + t.visitor.Enter("ArgumentList", true) + t.Traverse(nn.ArgumentList) + t.visitor.Leave("ArgumentList", true) + } case *ast.ExprPostDec: if nn == nil { return From ce18c23597f361b92408b2c61a7626168587bf6d Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 5 Jul 2020 22:47:46 +0300 Subject: [PATCH 035/140] [refactoring] parameters: new node structure --- internal/php5/parser_test.go | 414 +- internal/php5/php5.go | Bin 334300 -> 333216 bytes internal/php5/php5.y | 94 +- internal/php5/php5_test.go | 8743 ++++++++++---------- internal/php5/test.php | 381 + internal/php7/parser_test.go | 430 +- internal/php7/php7.go | Bin 274859 -> 273775 bytes internal/php7/php7.y | 96 +- internal/php7/php7_test.go | 7725 +++++++++-------- internal/php7/test.php | 350 + pkg/ast/ast.go | 2 + pkg/ast/node.go | 22 +- pkg/ast/traverser/dfs.go | 24 + pkg/ast/visitor/dump.go | 30 +- pkg/ast/visitor/dump_test.go | 4 +- pkg/ast/visitor/namespace_resolver_test.go | 18 +- pkg/ast/visitor/null.go | 8 + pkg/printer/pretty_printer.go | 26 +- pkg/printer/pretty_printer_test.go | 36 +- pkg/printer/printer.go | 36 +- pkg/printer/printer_parsed_php7_test.go | 12 + pkg/printer/printer_test.go | 68 +- 22 files changed, 9359 insertions(+), 9160 deletions(-) create mode 100644 internal/php5/test.php create mode 100644 internal/php7/test.php diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 2102e1c..7930f17 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -849,7 +849,7 @@ func TestPhp5ArgumentNode(t *testing.T) { } func TestPhp5ParameterNode(t *testing.T) { - src := `Ygm=lwtnVifru!IiUP_~k(2ke7O-H67fb;!nUIj?B_TBhHPLORnRm<56i8*5 zcPq^9tPAUC(bJ{&oHlWL;%%6((GaJoF zKF4}! z`xX}Bol4K*$s)?*q|8V*nS8Ucz~NM>*<5huB=)%oRXJ1nZN^=(YVvb@6X(%x`l_1E zrk7@5ZH$Xj|AWU;%4l|kN@wzcxKM8*Y-&LFU*G|%Vis@9Xyh!O#9}Ek^pD@hGZsyb zCL*kU3t@||nlhW`Fc^CAaM_aVf8rsk(Hx%3xHIN~E7!k>D_zvCnsuPRye`vd~1 zeQA+XBvIuR*@aT>Nm7+N<&%tBFVUKe(_XlodcDHk%D$Ap!9|P*@5h|NTwlSQ1?9Y# z79)s;m2;0-Nm$u}0^73yHD(28oJYAVXMSi|Uz)~*pX$DfFXwm(9@vtqX0R?)d5%3w zo;;)J>KAzjy8kyefG%T#KFZ~Rls8=Z>Jajy-6wei^;AB8jKe5_&r3U1y^BE0>CHY- zYu0kcgxdp)XuIEEr|lkPX$?WuNxfIV*VCAmN_Z0We8;*NGn46>9yq-h z?B1aV=7J?O=Uoh3M%d0YZYNJFC=rs}@A2Pwlr^g`JAgq`#*F6uM(X45^XrVhO67Bb zU_6=fpWwgK>^(e5#Kk?}B~-bewLY+A5V`lvp8`A){;JlbjCD+|PMN-ffo#?siv zwlVdOD&EHza_(}g#rt^;r-l0gY(v(HW_2t2sET4<#Arq_52l3ykl@V6#@(7eFT-iu zeKD9;e_|9@YDZ{jZK;Lj?0H604)7%If(ZHCuI9hQ-exrWke0!v^*5OwIm`zJIO2fx z^EBE|n?8YZmhkS{+q$W55AzI0Ifo%m=V}(9mAx9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foo; - new $foo[1]; - new $foo{$bar}; - new $foo->bar; - new $foo::$bar; - new static::$bar; - - function foo(?bar $bar=null, baz &...$baz) {} - class foo {public function foo(?bar $bar=null, baz &...$baz) {}} - function(?bar $bar=null, baz &...$baz) {}; - static function(?bar $bar=null, baz &...$baz) {}; - - 1234567890123456789; - 12345678901234567890; - 0.; - 0b0111111111111111111111111111111111111111111111111111111111111111; - 0b1111111111111111111111111111111111111111111111111111111111111111; - 0x007111111111111111; - 0x8111111111111111; - __CLASS__; - __DIR__; - __FILE__; - __FUNCTION__; - __LINE__; - __NAMESPACE__; - __METHOD__; - __TRAIT__; - - "test $var"; - "test $var[1]"; - "test $var[-1]"; - "test $var[1234567890123456789012345678901234567890]"; - "test $var[-1234567890123456789012345678901234567890]"; - "test $var[bar]"; - "test $var[$bar]"; - "$foo $bar"; - "test $foo->bar()"; - "test ${foo}"; - "test ${foo[0]}"; - "test ${$foo}"; - "test {$foo->bar()}"; - - if ($a) : - endif; - if ($a) : - elseif ($b): - endif; - if ($a) : - else: - endif; - if ($a) : - elseif ($b): - elseif ($c): - else: - endif; - - while (1) { break; } - while (1) { break 2; } - while (1) : break(3); endwhile; - class foo{ public const FOO = 1, BAR = 2; } - class foo{ const FOO = 1, BAR = 2; } - class foo{ function bar() {} } - class foo{ public static function &bar() {} } - class foo{ public static function &bar(): void {} } - abstract class foo{ } - final class foo extends bar { } - final class foo implements bar { } - final class foo implements bar, baz { } - new class() extends foo implements bar, baz { }; - - const FOO = 1, BAR = 2; - while (1) { continue; } - while (1) { continue 2; } - while (1) { continue(3); } - declare(ticks=1); - declare(ticks=1) {} - declare(ticks=1): enddeclare; - do {} while(1); - echo $a, 1; - echo($a); - for($i = 0; $i < 10; $i++, $i++) {} - for(; $i < 10; $i++, $i++) : endfor; - foreach ($a as $v) {} - foreach ($a as $v) : endforeach; - foreach ($a as $k => $v) {} - foreach ($a as $k => &$v) {} - foreach ($a as $k => list($v)) {} - foreach ($a as $k => [$v]) {} - function foo() {} - function foo() {return;} - function &foo() {return 1;} - function &foo(): void {} - global $a, $b; - a: - goto a; - if ($a) {} - if ($a) {} elseif ($b) {} - if ($a) {} else {} - if ($a) {} elseif ($b) {} elseif ($c) {} else {} - if ($a) {} elseif ($b) {} else if ($c) {} else {} - ?>
1, &$b,); - ~$a; - !$a; - - Foo::Bar; - $foo::Bar; - clone($a); - clone $a; - function(){}; - function($a, $b) use ($c, &$d) {}; - function(): void {}; - foo; - namespace\foo; - \foo; - - empty($a); - @$a; - eval($a); - exit; - exit($a); - die; - die($a); - foo(); - namespace\foo(); - \foo(); - $foo(); - - $a--; - $a++; - --$a; - ++$a; - - include $a; - include_once $a; - require $a; - require_once $a; - - $a instanceof Foo; - $a instanceof namespace\Foo; - $a instanceof \Foo; - - isset($a, $b); - list($a) = $b; - list($a[]) = $b; - list(list($a)) = $b; - - $a->foo(); - new Foo(); - new namespace\Foo(); - new \Foo(); - new class ($a, ...$b) {}; - print($a); - $a->foo; - ` + "`cmd $a`;" + ` - ` + "`cmd`;" + ` - ` + "``;" + ` - []; - [1]; - [1=>1, &$b,]; - - [$a] = $b; - [$a[]] = $b; - [list($a)] = $b; - Foo::bar(); - namespace\Foo::bar(); - \Foo::bar(); - Foo::$bar; - $foo::$bar; - namespace\Foo::$bar; - \Foo::$bar; - $a ? $b : $c; - $a ? : $c; - $a ? $b ? $c : $d : $e; - $a ? $b : $c ? $d : $e; - -$a; - +$a; - $$a; - yield; - yield $a; - yield $a => $b; - yield from $a; - - (array)$a; - (boolean)$a; - (bool)$a; - (double)$a; - (float)$a; - (integer)$a; - (int)$a; - (object)$a; - (string)$a; - (unset)$a; - - $a & $b; - $a | $b; - $a ^ $b; - $a && $b; - $a || $b; - $a ?? $b; - $a . $b; - $a / $b; - $a == $b; - $a >= $b; - $a > $b; - $a === $b; - $a and $b; - $a or $b; - $a xor $b; - $a - $b; - $a % $b; - $a * $b; - $a != $b; - $a !== $b; - $a + $b; - $a ** $b; - $a << $b; - $a >> $b; - $a <= $b; - $a < $b; - $a <=> $b; - - $a =& $b; - $a = $b; - $a &= $b; - $a |= $b; - $a ^= $b; - $a .= $b; - $a /= $b; - $a -= $b; - $a %= $b; - $a *= $b; - $a += $b; - $a **= $b; - $a <<= $b; - $a >>= $b; - - class foo {public function class() {} } - \foo\bar(); - - function foo(&$a, ...$b) { - - function bar() {} - class Baz {} - trait Quux{} - interface Quuux {} - } - - function foo(&$a = 1, ...$b = 1, $c = 1) {} - function foo(array $a, callable $b) {} - abstract final class foo { abstract protected static function bar(); final private function baz() {} } - - (new Foo)->bar; - (new Foo)(); - [$foo][0](); - foo[1](); - "foo"(); - [1]{$foo}(); - ${foo()}; - - Foo::$bar(); - Foo::{$bar[0]}(); - - $foo->$bar; - $foo->{$bar[0]}; - - [1=>&$a, 2=>list($b)]; - - __halt_compiler(); - - parsing process must be terminated - ` + src, err := ioutil.ReadFile("test.php") + assert.NilError(t, err) expected := &ast.Root{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 348, - StartPos: 5, - EndPos: 6319, + StartPos: 3, + EndPos: 5706, }, }, Stmts: []ast.Vertex{ @@ -380,8 +32,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 5, - EndPos: 20, + StartPos: 3, + EndPos: 18, }, }, Expr: &ast.ExprFunctionCall{ @@ -389,8 +41,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 5, - EndPos: 19, + StartPos: 3, + EndPos: 17, }, }, Function: &ast.NameName{ @@ -398,8 +50,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 5, - EndPos: 8, + StartPos: 3, + EndPos: 6, }, }, Parts: []ast.Vertex{ @@ -408,8 +60,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 5, - EndPos: 8, + StartPos: 3, + EndPos: 6, }, }, Value: []byte("foo"), @@ -421,8 +73,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 8, - EndPos: 19, + StartPos: 6, + EndPos: 17, }, }, Arguments: []ast.Vertex{ @@ -431,19 +83,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 9, - EndPos: 11, + StartPos: 7, + EndPos: 9, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 9, - EndPos: 11, + StartPos: 7, + EndPos: 9, }, }, VarName: &ast.Identifier{ @@ -451,8 +101,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 9, - EndPos: 11, + StartPos: 7, + EndPos: 9, }, }, Value: []byte("$a"), @@ -464,19 +114,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 13, - EndPos: 18, + StartPos: 11, + EndPos: 16, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 16, - EndPos: 18, + StartPos: 14, + EndPos: 16, }, }, VarName: &ast.Identifier{ @@ -484,8 +133,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 16, - EndPos: 18, + StartPos: 14, + EndPos: 16, }, }, Value: []byte("$b"), @@ -501,8 +150,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 23, - EndPos: 39, + StartPos: 19, + EndPos: 35, }, }, Expr: &ast.ExprFunctionCall{ @@ -510,8 +159,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 23, - EndPos: 38, + StartPos: 19, + EndPos: 34, }, }, Function: &ast.ExprVariable{ @@ -519,8 +168,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 23, - EndPos: 27, + StartPos: 19, + EndPos: 23, }, }, VarName: &ast.Identifier{ @@ -528,8 +177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 23, - EndPos: 27, + StartPos: 19, + EndPos: 23, }, }, Value: []byte("$foo"), @@ -540,8 +189,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 27, - EndPos: 38, + StartPos: 23, + EndPos: 34, }, }, Arguments: []ast.Vertex{ @@ -550,19 +199,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 30, + StartPos: 24, + EndPos: 26, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 30, + StartPos: 24, + EndPos: 26, }, }, VarName: &ast.Identifier{ @@ -570,8 +217,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 30, + StartPos: 24, + EndPos: 26, }, }, Value: []byte("$a"), @@ -583,19 +230,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 32, - EndPos: 37, + StartPos: 28, + EndPos: 33, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 35, - EndPos: 37, + StartPos: 31, + EndPos: 33, }, }, VarName: &ast.Identifier{ @@ -603,8 +249,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 35, - EndPos: 37, + StartPos: 31, + EndPos: 33, }, }, Value: []byte("$b"), @@ -620,8 +266,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 42, - EndPos: 63, + StartPos: 36, + EndPos: 57, }, }, Expr: &ast.ExprMethodCall{ @@ -629,8 +275,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 42, - EndPos: 62, + StartPos: 36, + EndPos: 56, }, }, Var: &ast.ExprVariable{ @@ -638,8 +284,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 42, - EndPos: 46, + StartPos: 36, + EndPos: 40, }, }, VarName: &ast.Identifier{ @@ -647,8 +293,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 42, - EndPos: 46, + StartPos: 36, + EndPos: 40, }, }, Value: []byte("$foo"), @@ -659,8 +305,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 48, - EndPos: 51, + StartPos: 42, + EndPos: 45, }, }, Value: []byte("bar"), @@ -670,8 +316,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 51, - EndPos: 62, + StartPos: 45, + EndPos: 56, }, }, Arguments: []ast.Vertex{ @@ -680,19 +326,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 52, - EndPos: 54, + StartPos: 46, + EndPos: 48, }, }, - IsReference: false, - Variadic: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 52, - EndPos: 54, + StartPos: 46, + EndPos: 48, }, }, VarName: &ast.Identifier{ @@ -700,8 +344,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 52, - EndPos: 54, + StartPos: 46, + EndPos: 48, }, }, Value: []byte("$a"), @@ -713,19 +357,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 56, - EndPos: 61, + StartPos: 50, + EndPos: 55, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 59, - EndPos: 61, + StartPos: 53, + EndPos: 55, }, }, VarName: &ast.Identifier{ @@ -733,8 +376,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 59, - EndPos: 61, + StartPos: 53, + EndPos: 55, }, }, Value: []byte("$b"), @@ -750,8 +393,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 66, - EndPos: 86, + StartPos: 58, + EndPos: 78, }, }, Expr: &ast.ExprStaticCall{ @@ -759,8 +402,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 66, - EndPos: 85, + StartPos: 58, + EndPos: 77, }, }, Class: &ast.NameName{ @@ -768,8 +411,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 66, - EndPos: 69, + StartPos: 58, + EndPos: 61, }, }, Parts: []ast.Vertex{ @@ -778,8 +421,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 66, - EndPos: 69, + StartPos: 58, + EndPos: 61, }, }, Value: []byte("foo"), @@ -791,8 +434,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 71, - EndPos: 74, + StartPos: 63, + EndPos: 66, }, }, Value: []byte("bar"), @@ -802,8 +445,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 74, - EndPos: 85, + StartPos: 66, + EndPos: 77, }, }, Arguments: []ast.Vertex{ @@ -812,19 +455,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 75, - EndPos: 77, + StartPos: 67, + EndPos: 69, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 75, - EndPos: 77, + StartPos: 67, + EndPos: 69, }, }, VarName: &ast.Identifier{ @@ -832,8 +473,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 75, - EndPos: 77, + StartPos: 67, + EndPos: 69, }, }, Value: []byte("$a"), @@ -845,19 +486,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 79, - EndPos: 84, + StartPos: 71, + EndPos: 76, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 82, - EndPos: 84, + StartPos: 74, + EndPos: 76, }, }, VarName: &ast.Identifier{ @@ -865,8 +505,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 82, - EndPos: 84, + StartPos: 74, + EndPos: 76, }, }, Value: []byte("$b"), @@ -882,8 +522,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 89, - EndPos: 110, + StartPos: 79, + EndPos: 100, }, }, Expr: &ast.ExprStaticCall{ @@ -891,8 +531,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 89, - EndPos: 109, + StartPos: 79, + EndPos: 99, }, }, Class: &ast.ExprVariable{ @@ -900,8 +540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 89, - EndPos: 93, + StartPos: 79, + EndPos: 83, }, }, VarName: &ast.Identifier{ @@ -909,8 +549,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 89, - EndPos: 93, + StartPos: 79, + EndPos: 83, }, }, Value: []byte("$foo"), @@ -921,8 +561,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 95, - EndPos: 98, + StartPos: 85, + EndPos: 88, }, }, Value: []byte("bar"), @@ -932,8 +572,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 98, - EndPos: 109, + StartPos: 88, + EndPos: 99, }, }, Arguments: []ast.Vertex{ @@ -942,19 +582,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 99, - EndPos: 101, + StartPos: 89, + EndPos: 91, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 99, - EndPos: 101, + StartPos: 89, + EndPos: 91, }, }, VarName: &ast.Identifier{ @@ -962,8 +600,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 99, - EndPos: 101, + StartPos: 89, + EndPos: 91, }, }, Value: []byte("$a"), @@ -975,19 +613,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 103, - EndPos: 108, + StartPos: 93, + EndPos: 98, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 106, - EndPos: 108, + StartPos: 96, + EndPos: 98, }, }, VarName: &ast.Identifier{ @@ -995,8 +632,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 106, - EndPos: 108, + StartPos: 96, + EndPos: 98, }, }, Value: []byte("$b"), @@ -1012,8 +649,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 113, - EndPos: 132, + StartPos: 101, + EndPos: 120, }, }, Expr: &ast.ExprNew{ @@ -1021,8 +658,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 113, - EndPos: 131, + StartPos: 101, + EndPos: 119, }, }, Class: &ast.NameName{ @@ -1030,8 +667,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 117, - EndPos: 120, + StartPos: 105, + EndPos: 108, }, }, Parts: []ast.Vertex{ @@ -1040,8 +677,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 117, - EndPos: 120, + StartPos: 105, + EndPos: 108, }, }, Value: []byte("foo"), @@ -1053,8 +690,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 120, - EndPos: 131, + StartPos: 108, + EndPos: 119, }, }, Arguments: []ast.Vertex{ @@ -1063,19 +700,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 121, - EndPos: 123, + StartPos: 109, + EndPos: 111, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 121, - EndPos: 123, + StartPos: 109, + EndPos: 111, }, }, VarName: &ast.Identifier{ @@ -1083,8 +718,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 121, - EndPos: 123, + StartPos: 109, + EndPos: 111, }, }, Value: []byte("$a"), @@ -1096,19 +731,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 125, - EndPos: 130, + StartPos: 113, + EndPos: 118, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 128, - EndPos: 130, + StartPos: 116, + EndPos: 118, }, }, VarName: &ast.Identifier{ @@ -1116,8 +750,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 128, - EndPos: 130, + StartPos: 116, + EndPos: 118, }, }, Value: []byte("$b"), @@ -1133,8 +767,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 160, - EndPos: 185, + StartPos: 144, + EndPos: 169, }, }, Expr: &ast.ExprNew{ @@ -1142,8 +776,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 160, - EndPos: 184, + StartPos: 144, + EndPos: 168, }, }, Class: &ast.StmtClass{ @@ -1151,8 +785,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 164, - EndPos: 184, + StartPos: 148, + EndPos: 168, }, }, ArgumentList: &ast.ArgumentList{ @@ -1160,8 +794,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 170, - EndPos: 181, + StartPos: 154, + EndPos: 165, }, }, Arguments: []ast.Vertex{ @@ -1170,19 +804,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 171, - EndPos: 173, + StartPos: 155, + EndPos: 157, }, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 171, - EndPos: 173, + StartPos: 155, + EndPos: 157, }, }, VarName: &ast.Identifier{ @@ -1190,8 +822,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 171, - EndPos: 173, + StartPos: 155, + EndPos: 157, }, }, Value: []byte("$a"), @@ -1203,19 +835,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 175, - EndPos: 180, + StartPos: 159, + EndPos: 164, }, }, - Variadic: true, - IsReference: false, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 178, - EndPos: 180, + StartPos: 162, + EndPos: 164, }, }, VarName: &ast.Identifier{ @@ -1223,8 +854,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 178, - EndPos: 180, + StartPos: 162, + EndPos: 164, }, }, Value: []byte("$b"), @@ -1242,8 +873,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 188, - EndPos: 201, + StartPos: 170, + EndPos: 183, }, }, Expr: &ast.ExprNew{ @@ -1251,8 +882,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 188, - EndPos: 200, + StartPos: 170, + EndPos: 182, }, }, Class: &ast.StmtClass{ @@ -1260,8 +891,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 10, EndLine: 10, - StartPos: 192, - EndPos: 200, + StartPos: 174, + EndPos: 182, }, }, Stmts: []ast.Vertex{}, @@ -1273,8 +904,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 11, EndLine: 11, - StartPos: 204, - EndPos: 213, + StartPos: 184, + EndPos: 193, }, }, Expr: &ast.ExprNew{ @@ -1282,8 +913,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 11, EndLine: 11, - StartPos: 204, - EndPos: 212, + StartPos: 184, + EndPos: 192, }, }, Class: &ast.ExprVariable{ @@ -1291,8 +922,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 11, EndLine: 11, - StartPos: 208, - EndPos: 212, + StartPos: 188, + EndPos: 192, }, }, VarName: &ast.Identifier{ @@ -1300,8 +931,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 11, EndLine: 11, - StartPos: 208, - EndPos: 212, + StartPos: 188, + EndPos: 192, }, }, Value: []byte("$foo"), @@ -1314,8 +945,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 216, - EndPos: 228, + StartPos: 194, + EndPos: 206, }, }, Expr: &ast.ExprNew{ @@ -1323,8 +954,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 216, - EndPos: 227, + StartPos: 194, + EndPos: 205, }, }, Class: &ast.ExprArrayDimFetch{ @@ -1332,8 +963,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 220, - EndPos: 227, + StartPos: 198, + EndPos: 205, }, }, Var: &ast.ExprVariable{ @@ -1341,8 +972,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 220, - EndPos: 224, + StartPos: 198, + EndPos: 202, }, }, VarName: &ast.Identifier{ @@ -1350,8 +981,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 220, - EndPos: 224, + StartPos: 198, + EndPos: 202, }, }, Value: []byte("$foo"), @@ -1362,8 +993,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 12, EndLine: 12, - StartPos: 225, - EndPos: 226, + StartPos: 203, + EndPos: 204, }, }, Value: []byte("1"), @@ -1376,8 +1007,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 231, - EndPos: 246, + StartPos: 207, + EndPos: 222, }, }, Expr: &ast.ExprNew{ @@ -1385,8 +1016,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 231, - EndPos: 245, + StartPos: 207, + EndPos: 221, }, }, Class: &ast.ExprArrayDimFetch{ @@ -1394,8 +1025,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 235, - EndPos: 245, + StartPos: 211, + EndPos: 221, }, }, Var: &ast.ExprVariable{ @@ -1403,8 +1034,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 235, - EndPos: 239, + StartPos: 211, + EndPos: 215, }, }, VarName: &ast.Identifier{ @@ -1412,8 +1043,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 235, - EndPos: 239, + StartPos: 211, + EndPos: 215, }, }, Value: []byte("$foo"), @@ -1424,8 +1055,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 240, - EndPos: 244, + StartPos: 216, + EndPos: 220, }, }, VarName: &ast.Identifier{ @@ -1433,8 +1064,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 13, EndLine: 13, - StartPos: 240, - EndPos: 244, + StartPos: 216, + EndPos: 220, }, }, Value: []byte("$bar"), @@ -1448,8 +1079,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 249, - EndPos: 263, + StartPos: 223, + EndPos: 237, }, }, Expr: &ast.ExprNew{ @@ -1457,8 +1088,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 249, - EndPos: 262, + StartPos: 223, + EndPos: 236, }, }, Class: &ast.ExprPropertyFetch{ @@ -1466,8 +1097,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 253, - EndPos: 262, + StartPos: 227, + EndPos: 236, }, }, Var: &ast.ExprVariable{ @@ -1475,8 +1106,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 253, - EndPos: 257, + StartPos: 227, + EndPos: 231, }, }, VarName: &ast.Identifier{ @@ -1484,8 +1115,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 253, - EndPos: 257, + StartPos: 227, + EndPos: 231, }, }, Value: []byte("$foo"), @@ -1496,8 +1127,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 14, EndLine: 14, - StartPos: 259, - EndPos: 262, + StartPos: 233, + EndPos: 236, }, }, Value: []byte("bar"), @@ -1510,8 +1141,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 266, - EndPos: 281, + StartPos: 238, + EndPos: 253, }, }, Expr: &ast.ExprNew{ @@ -1519,8 +1150,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 266, - EndPos: 280, + StartPos: 238, + EndPos: 252, }, }, Class: &ast.ExprStaticPropertyFetch{ @@ -1528,8 +1159,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 270, - EndPos: 280, + StartPos: 242, + EndPos: 252, }, }, Class: &ast.ExprVariable{ @@ -1537,8 +1168,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 270, - EndPos: 274, + StartPos: 242, + EndPos: 246, }, }, VarName: &ast.Identifier{ @@ -1546,8 +1177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 270, - EndPos: 274, + StartPos: 242, + EndPos: 246, }, }, Value: []byte("$foo"), @@ -1558,8 +1189,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 276, - EndPos: 280, + StartPos: 248, + EndPos: 252, }, }, VarName: &ast.Identifier{ @@ -1567,8 +1198,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 15, EndLine: 15, - StartPos: 276, - EndPos: 280, + StartPos: 248, + EndPos: 252, }, }, Value: []byte("$bar"), @@ -1582,8 +1213,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 284, - EndPos: 301, + StartPos: 254, + EndPos: 271, }, }, Expr: &ast.ExprNew{ @@ -1591,8 +1222,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 284, - EndPos: 300, + StartPos: 254, + EndPos: 270, }, }, Class: &ast.ExprStaticPropertyFetch{ @@ -1600,8 +1231,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 288, - EndPos: 300, + StartPos: 258, + EndPos: 270, }, }, Class: &ast.Identifier{ @@ -1609,8 +1240,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 288, - EndPos: 294, + StartPos: 258, + EndPos: 264, }, }, Value: []byte("static"), @@ -1620,8 +1251,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 296, - EndPos: 300, + StartPos: 266, + EndPos: 270, }, }, VarName: &ast.Identifier{ @@ -1629,8 +1260,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 16, EndLine: 16, - StartPos: 296, - EndPos: 300, + StartPos: 266, + EndPos: 270, }, }, Value: []byte("$bar"), @@ -1644,18 +1275,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 305, - EndPos: 350, + StartPos: 273, + EndPos: 318, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 314, - EndPos: 317, + StartPos: 282, + EndPos: 285, }, }, Value: []byte("foo"), @@ -1666,19 +1296,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 318, - EndPos: 332, + StartPos: 286, + EndPos: 300, }, }, - ByRef: false, - Variadic: false, Type: &ast.Nullable{ Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 318, - EndPos: 322, + StartPos: 286, + EndPos: 290, }, }, Expr: &ast.NameName{ @@ -1686,8 +1314,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 319, - EndPos: 322, + StartPos: 287, + EndPos: 290, }, }, Parts: []ast.Vertex{ @@ -1696,8 +1324,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 319, - EndPos: 322, + StartPos: 287, + EndPos: 290, }, }, Value: []byte("bar"), @@ -1710,8 +1338,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 323, - EndPos: 327, + StartPos: 291, + EndPos: 295, }, }, VarName: &ast.Identifier{ @@ -1719,8 +1347,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 323, - EndPos: 327, + StartPos: 291, + EndPos: 295, }, }, Value: []byte("$bar"), @@ -1731,8 +1359,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 328, - EndPos: 332, + StartPos: 296, + EndPos: 300, }, }, Const: &ast.NameName{ @@ -1740,8 +1368,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 328, - EndPos: 332, + StartPos: 296, + EndPos: 300, }, }, Parts: []ast.Vertex{ @@ -1750,8 +1378,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 328, - EndPos: 332, + StartPos: 296, + EndPos: 300, }, }, Value: []byte("null"), @@ -1765,19 +1393,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 334, - EndPos: 346, + StartPos: 302, + EndPos: 314, }, }, - Variadic: true, - ByRef: true, Type: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 334, - EndPos: 337, + StartPos: 302, + EndPos: 305, }, }, Parts: []ast.Vertex{ @@ -1786,33 +1412,53 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 334, - EndPos: 337, + StartPos: 302, + EndPos: 305, }, }, Value: []byte("baz"), }, }, }, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 342, - EndPos: 346, + StartPos: 306, + EndPos: 314, }, }, - VarName: &ast.Identifier{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 18, EndLine: 18, - StartPos: 342, - EndPos: 346, + StartPos: 307, + EndPos: 314, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 310, + EndPos: 314, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 18, + EndLine: 18, + StartPos: 310, + EndPos: 314, + }, + }, + Value: []byte("$baz"), }, }, - Value: []byte("$baz"), }, }, }, @@ -1824,8 +1470,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 353, - EndPos: 417, + StartPos: 319, + EndPos: 383, }, }, ClassName: &ast.Identifier{ @@ -1833,8 +1479,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 359, - EndPos: 362, + StartPos: 325, + EndPos: 328, }, }, Value: []byte("foo"), @@ -1845,18 +1491,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 364, - EndPos: 416, + StartPos: 330, + EndPos: 382, }, }, - ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 380, - EndPos: 383, + StartPos: 346, + EndPos: 349, }, }, Value: []byte("foo"), @@ -1867,8 +1512,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 364, - EndPos: 370, + StartPos: 330, + EndPos: 336, }, }, Value: []byte("public"), @@ -1880,19 +1525,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 384, - EndPos: 398, + StartPos: 350, + EndPos: 364, }, }, - ByRef: false, - Variadic: false, Type: &ast.Nullable{ Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 384, - EndPos: 388, + StartPos: 350, + EndPos: 354, }, }, Expr: &ast.NameName{ @@ -1900,8 +1543,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 385, - EndPos: 388, + StartPos: 351, + EndPos: 354, }, }, Parts: []ast.Vertex{ @@ -1910,8 +1553,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 385, - EndPos: 388, + StartPos: 351, + EndPos: 354, }, }, Value: []byte("bar"), @@ -1924,8 +1567,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 389, - EndPos: 393, + StartPos: 355, + EndPos: 359, }, }, VarName: &ast.Identifier{ @@ -1933,8 +1576,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 389, - EndPos: 393, + StartPos: 355, + EndPos: 359, }, }, Value: []byte("$bar"), @@ -1945,8 +1588,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 394, - EndPos: 398, + StartPos: 360, + EndPos: 364, }, }, Const: &ast.NameName{ @@ -1954,8 +1597,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 394, - EndPos: 398, + StartPos: 360, + EndPos: 364, }, }, Parts: []ast.Vertex{ @@ -1964,8 +1607,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 394, - EndPos: 398, + StartPos: 360, + EndPos: 364, }, }, Value: []byte("null"), @@ -1979,19 +1622,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 400, - EndPos: 412, + StartPos: 366, + EndPos: 378, }, }, - ByRef: true, - Variadic: true, Type: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 400, - EndPos: 403, + StartPos: 366, + EndPos: 369, }, }, Parts: []ast.Vertex{ @@ -2000,33 +1641,53 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 400, - EndPos: 403, + StartPos: 366, + EndPos: 369, }, }, Value: []byte("baz"), }, }, }, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 408, - EndPos: 412, + StartPos: 370, + EndPos: 378, }, }, - VarName: &ast.Identifier{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 408, - EndPos: 412, + StartPos: 371, + EndPos: 378, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 374, + EndPos: 378, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 19, + EndLine: 19, + StartPos: 374, + EndPos: 378, + }, + }, + Value: []byte("$baz"), }, }, - Value: []byte("$baz"), }, }, }, @@ -2036,8 +1697,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 19, EndLine: 19, - StartPos: 414, - EndPos: 416, + StartPos: 380, + EndPos: 382, }, }, Stmts: []ast.Vertex{}, @@ -2050,8 +1711,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 420, - EndPos: 462, + StartPos: 384, + EndPos: 426, }, }, Expr: &ast.ExprClosure{ @@ -2059,31 +1720,27 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 420, - EndPos: 461, + StartPos: 384, + EndPos: 425, }, }, - ReturnsRef: false, - Static: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 429, - EndPos: 443, + StartPos: 393, + EndPos: 407, }, }, - ByRef: false, - Variadic: false, Type: &ast.Nullable{ Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 429, - EndPos: 433, + StartPos: 393, + EndPos: 397, }, }, Expr: &ast.NameName{ @@ -2091,8 +1748,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 430, - EndPos: 433, + StartPos: 394, + EndPos: 397, }, }, Parts: []ast.Vertex{ @@ -2101,8 +1758,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 430, - EndPos: 433, + StartPos: 394, + EndPos: 397, }, }, Value: []byte("bar"), @@ -2115,8 +1772,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 434, - EndPos: 438, + StartPos: 398, + EndPos: 402, }, }, VarName: &ast.Identifier{ @@ -2124,8 +1781,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 434, - EndPos: 438, + StartPos: 398, + EndPos: 402, }, }, Value: []byte("$bar"), @@ -2136,8 +1793,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 439, - EndPos: 443, + StartPos: 403, + EndPos: 407, }, }, Const: &ast.NameName{ @@ -2145,8 +1802,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 439, - EndPos: 443, + StartPos: 403, + EndPos: 407, }, }, Parts: []ast.Vertex{ @@ -2155,8 +1812,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 439, - EndPos: 443, + StartPos: 403, + EndPos: 407, }, }, Value: []byte("null"), @@ -2170,19 +1827,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 445, - EndPos: 457, + StartPos: 409, + EndPos: 421, }, }, - ByRef: true, - Variadic: true, Type: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 445, - EndPos: 448, + StartPos: 409, + EndPos: 412, }, }, Parts: []ast.Vertex{ @@ -2191,33 +1846,53 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 445, - EndPos: 448, + StartPos: 409, + EndPos: 412, }, }, Value: []byte("baz"), }, }, }, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 453, - EndPos: 457, + StartPos: 413, + EndPos: 421, }, }, - VarName: &ast.Identifier{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 20, EndLine: 20, - StartPos: 453, - EndPos: 457, + StartPos: 414, + EndPos: 421, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 417, + EndPos: 421, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 20, + EndLine: 20, + StartPos: 417, + EndPos: 421, + }, + }, + Value: []byte("$baz"), }, }, - Value: []byte("$baz"), }, }, }, @@ -2230,8 +1905,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 465, - EndPos: 514, + StartPos: 427, + EndPos: 476, }, }, Expr: &ast.ExprClosure{ @@ -2239,31 +1914,28 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 465, - EndPos: 513, + StartPos: 427, + EndPos: 475, }, }, - ReturnsRef: false, - Static: true, + Static: true, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 481, - EndPos: 495, + StartPos: 443, + EndPos: 457, }, }, - ByRef: false, - Variadic: false, Type: &ast.Nullable{ Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 481, - EndPos: 485, + StartPos: 443, + EndPos: 447, }, }, Expr: &ast.NameName{ @@ -2271,8 +1943,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 482, - EndPos: 485, + StartPos: 444, + EndPos: 447, }, }, Parts: []ast.Vertex{ @@ -2281,8 +1953,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 482, - EndPos: 485, + StartPos: 444, + EndPos: 447, }, }, Value: []byte("bar"), @@ -2295,8 +1967,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 486, - EndPos: 490, + StartPos: 448, + EndPos: 452, }, }, VarName: &ast.Identifier{ @@ -2304,8 +1976,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 486, - EndPos: 490, + StartPos: 448, + EndPos: 452, }, }, Value: []byte("$bar"), @@ -2316,8 +1988,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 491, - EndPos: 495, + StartPos: 453, + EndPos: 457, }, }, Const: &ast.NameName{ @@ -2325,8 +1997,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 491, - EndPos: 495, + StartPos: 453, + EndPos: 457, }, }, Parts: []ast.Vertex{ @@ -2335,8 +2007,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 491, - EndPos: 495, + StartPos: 453, + EndPos: 457, }, }, Value: []byte("null"), @@ -2350,19 +2022,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 497, - EndPos: 509, + StartPos: 459, + EndPos: 471, }, }, - ByRef: true, - Variadic: true, Type: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 497, - EndPos: 500, + StartPos: 459, + EndPos: 462, }, }, Parts: []ast.Vertex{ @@ -2371,33 +2041,53 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 497, - EndPos: 500, + StartPos: 459, + EndPos: 462, }, }, Value: []byte("baz"), }, }, }, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 505, - EndPos: 509, + StartPos: 463, + EndPos: 471, }, }, - VarName: &ast.Identifier{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 21, EndLine: 21, - StartPos: 505, - EndPos: 509, + StartPos: 464, + EndPos: 471, + }, + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 467, + EndPos: 471, + }, + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 21, + EndLine: 21, + StartPos: 467, + EndPos: 471, + }, + }, + Value: []byte("$baz"), }, }, - Value: []byte("$baz"), }, }, }, @@ -2410,8 +2100,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 23, EndLine: 23, - StartPos: 518, - EndPos: 538, + StartPos: 478, + EndPos: 498, }, }, Expr: &ast.ScalarLnumber{ @@ -2419,8 +2109,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 23, EndLine: 23, - StartPos: 518, - EndPos: 537, + StartPos: 478, + EndPos: 497, }, }, Value: []byte("1234567890123456789"), @@ -2431,8 +2121,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 24, EndLine: 24, - StartPos: 541, - EndPos: 562, + StartPos: 499, + EndPos: 520, }, }, Expr: &ast.ScalarDnumber{ @@ -2440,8 +2130,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 24, EndLine: 24, - StartPos: 541, - EndPos: 561, + StartPos: 499, + EndPos: 519, }, }, Value: []byte("12345678901234567890"), @@ -2452,8 +2142,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 25, EndLine: 25, - StartPos: 565, - EndPos: 568, + StartPos: 521, + EndPos: 524, }, }, Expr: &ast.ScalarDnumber{ @@ -2461,8 +2151,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 25, EndLine: 25, - StartPos: 565, - EndPos: 567, + StartPos: 521, + EndPos: 523, }, }, Value: []byte("0."), @@ -2473,8 +2163,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 26, EndLine: 26, - StartPos: 571, - EndPos: 638, + StartPos: 525, + EndPos: 592, }, }, Expr: &ast.ScalarLnumber{ @@ -2482,8 +2172,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 26, EndLine: 26, - StartPos: 571, - EndPos: 637, + StartPos: 525, + EndPos: 591, }, }, Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), @@ -2494,8 +2184,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 27, EndLine: 27, - StartPos: 641, - EndPos: 708, + StartPos: 593, + EndPos: 660, }, }, Expr: &ast.ScalarDnumber{ @@ -2503,8 +2193,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 27, EndLine: 27, - StartPos: 641, - EndPos: 707, + StartPos: 593, + EndPos: 659, }, }, Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), @@ -2515,8 +2205,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 28, EndLine: 28, - StartPos: 711, - EndPos: 732, + StartPos: 661, + EndPos: 682, }, }, Expr: &ast.ScalarLnumber{ @@ -2524,8 +2214,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 28, EndLine: 28, - StartPos: 711, - EndPos: 731, + StartPos: 661, + EndPos: 681, }, }, Value: []byte("0x007111111111111111"), @@ -2536,8 +2226,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 29, EndLine: 29, - StartPos: 735, - EndPos: 754, + StartPos: 683, + EndPos: 702, }, }, Expr: &ast.ScalarDnumber{ @@ -2545,8 +2235,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 29, EndLine: 29, - StartPos: 735, - EndPos: 753, + StartPos: 683, + EndPos: 701, }, }, Value: []byte("0x8111111111111111"), @@ -2557,8 +2247,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 30, EndLine: 30, - StartPos: 757, - EndPos: 767, + StartPos: 703, + EndPos: 713, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2566,8 +2256,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 30, EndLine: 30, - StartPos: 757, - EndPos: 766, + StartPos: 703, + EndPos: 712, }, }, Value: []byte("__CLASS__"), @@ -2578,8 +2268,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 31, EndLine: 31, - StartPos: 770, - EndPos: 778, + StartPos: 714, + EndPos: 722, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2587,8 +2277,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 31, EndLine: 31, - StartPos: 770, - EndPos: 777, + StartPos: 714, + EndPos: 721, }, }, Value: []byte("__DIR__"), @@ -2599,8 +2289,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 32, EndLine: 32, - StartPos: 781, - EndPos: 790, + StartPos: 723, + EndPos: 732, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2608,8 +2298,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 32, EndLine: 32, - StartPos: 781, - EndPos: 789, + StartPos: 723, + EndPos: 731, }, }, Value: []byte("__FILE__"), @@ -2620,8 +2310,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 33, EndLine: 33, - StartPos: 793, - EndPos: 806, + StartPos: 733, + EndPos: 746, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2629,8 +2319,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 33, EndLine: 33, - StartPos: 793, - EndPos: 805, + StartPos: 733, + EndPos: 745, }, }, Value: []byte("__FUNCTION__"), @@ -2641,8 +2331,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 34, EndLine: 34, - StartPos: 809, - EndPos: 818, + StartPos: 747, + EndPos: 756, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2650,8 +2340,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 34, EndLine: 34, - StartPos: 809, - EndPos: 817, + StartPos: 747, + EndPos: 755, }, }, Value: []byte("__LINE__"), @@ -2662,8 +2352,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 35, EndLine: 35, - StartPos: 821, - EndPos: 835, + StartPos: 757, + EndPos: 771, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2671,8 +2361,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 35, EndLine: 35, - StartPos: 821, - EndPos: 834, + StartPos: 757, + EndPos: 770, }, }, Value: []byte("__NAMESPACE__"), @@ -2683,8 +2373,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 36, EndLine: 36, - StartPos: 838, - EndPos: 849, + StartPos: 772, + EndPos: 783, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2692,8 +2382,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 36, EndLine: 36, - StartPos: 838, - EndPos: 848, + StartPos: 772, + EndPos: 782, }, }, Value: []byte("__METHOD__"), @@ -2704,8 +2394,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 37, EndLine: 37, - StartPos: 852, - EndPos: 862, + StartPos: 784, + EndPos: 794, }, }, Expr: &ast.ScalarMagicConstant{ @@ -2713,8 +2403,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 37, EndLine: 37, - StartPos: 852, - EndPos: 861, + StartPos: 784, + EndPos: 793, }, }, Value: []byte("__TRAIT__"), @@ -2725,8 +2415,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 39, EndLine: 39, - StartPos: 866, - EndPos: 878, + StartPos: 796, + EndPos: 808, }, }, Expr: &ast.ScalarEncapsed{ @@ -2734,8 +2424,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 39, EndLine: 39, - StartPos: 866, - EndPos: 877, + StartPos: 796, + EndPos: 807, }, }, Parts: []ast.Vertex{ @@ -2744,8 +2434,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 39, EndLine: 39, - StartPos: 867, - EndPos: 872, + StartPos: 797, + EndPos: 802, }, }, Value: []byte("test "), @@ -2755,8 +2445,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 39, EndLine: 39, - StartPos: 872, - EndPos: 876, + StartPos: 802, + EndPos: 806, }, }, VarName: &ast.Identifier{ @@ -2764,8 +2454,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 39, EndLine: 39, - StartPos: 872, - EndPos: 876, + StartPos: 802, + EndPos: 806, }, }, Value: []byte("$var"), @@ -2779,8 +2469,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 881, - EndPos: 896, + StartPos: 809, + EndPos: 824, }, }, Expr: &ast.ScalarEncapsed{ @@ -2788,8 +2478,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 881, - EndPos: 895, + StartPos: 809, + EndPos: 823, }, }, Parts: []ast.Vertex{ @@ -2798,8 +2488,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 882, - EndPos: 887, + StartPos: 810, + EndPos: 815, }, }, Value: []byte("test "), @@ -2809,8 +2499,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 887, - EndPos: 894, + StartPos: 815, + EndPos: 822, }, }, Var: &ast.ExprVariable{ @@ -2818,8 +2508,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 887, - EndPos: 891, + StartPos: 815, + EndPos: 819, }, }, VarName: &ast.Identifier{ @@ -2827,8 +2517,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 887, - EndPos: 891, + StartPos: 815, + EndPos: 819, }, }, Value: []byte("$var"), @@ -2839,8 +2529,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 40, EndLine: 40, - StartPos: 892, - EndPos: 893, + StartPos: 820, + EndPos: 821, }, }, Value: []byte("1"), @@ -2854,8 +2544,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 899, - EndPos: 915, + StartPos: 825, + EndPos: 841, }, }, Expr: &ast.ScalarEncapsed{ @@ -2863,8 +2553,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 899, - EndPos: 914, + StartPos: 825, + EndPos: 840, }, }, Parts: []ast.Vertex{ @@ -2873,8 +2563,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 900, - EndPos: 905, + StartPos: 826, + EndPos: 831, }, }, Value: []byte("test "), @@ -2884,8 +2574,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 905, - EndPos: 913, + StartPos: 831, + EndPos: 839, }, }, Var: &ast.ExprVariable{ @@ -2893,8 +2583,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 905, - EndPos: 909, + StartPos: 831, + EndPos: 835, }, }, VarName: &ast.Identifier{ @@ -2902,8 +2592,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 905, - EndPos: 909, + StartPos: 831, + EndPos: 835, }, }, Value: []byte("$var"), @@ -2914,8 +2604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 910, - EndPos: 912, + StartPos: 836, + EndPos: 838, }, }, Expr: &ast.ScalarLnumber{ @@ -2923,8 +2613,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 41, EndLine: 41, - StartPos: 910, - EndPos: 912, + StartPos: 836, + EndPos: 838, }, }, Value: []byte("1"), @@ -2939,8 +2629,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 918, - EndPos: 972, + StartPos: 842, + EndPos: 896, }, }, Expr: &ast.ScalarEncapsed{ @@ -2948,8 +2638,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 918, - EndPos: 971, + StartPos: 842, + EndPos: 895, }, }, Parts: []ast.Vertex{ @@ -2958,8 +2648,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 919, - EndPos: 924, + StartPos: 843, + EndPos: 848, }, }, Value: []byte("test "), @@ -2969,8 +2659,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 924, - EndPos: 970, + StartPos: 848, + EndPos: 894, }, }, Var: &ast.ExprVariable{ @@ -2978,8 +2668,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 924, - EndPos: 928, + StartPos: 848, + EndPos: 852, }, }, VarName: &ast.Identifier{ @@ -2987,8 +2677,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 924, - EndPos: 928, + StartPos: 848, + EndPos: 852, }, }, Value: []byte("$var"), @@ -2999,8 +2689,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 42, EndLine: 42, - StartPos: 929, - EndPos: 969, + StartPos: 853, + EndPos: 893, }, }, Value: []byte("1234567890123456789012345678901234567890"), @@ -3014,8 +2704,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 975, - EndPos: 1030, + StartPos: 897, + EndPos: 952, }, }, Expr: &ast.ScalarEncapsed{ @@ -3023,8 +2713,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 975, - EndPos: 1029, + StartPos: 897, + EndPos: 951, }, }, Parts: []ast.Vertex{ @@ -3033,8 +2723,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 976, - EndPos: 981, + StartPos: 898, + EndPos: 903, }, }, Value: []byte("test "), @@ -3044,8 +2734,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 981, - EndPos: 1028, + StartPos: 903, + EndPos: 950, }, }, Var: &ast.ExprVariable{ @@ -3053,8 +2743,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 981, - EndPos: 985, + StartPos: 903, + EndPos: 907, }, }, VarName: &ast.Identifier{ @@ -3062,8 +2752,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 981, - EndPos: 985, + StartPos: 903, + EndPos: 907, }, }, Value: []byte("$var"), @@ -3074,8 +2764,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 43, EndLine: 43, - StartPos: 986, - EndPos: 1027, + StartPos: 908, + EndPos: 949, }, }, Value: []byte("-1234567890123456789012345678901234567890"), @@ -3089,8 +2779,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1033, - EndPos: 1050, + StartPos: 953, + EndPos: 970, }, }, Expr: &ast.ScalarEncapsed{ @@ -3098,8 +2788,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1033, - EndPos: 1049, + StartPos: 953, + EndPos: 969, }, }, Parts: []ast.Vertex{ @@ -3108,8 +2798,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1034, - EndPos: 1039, + StartPos: 954, + EndPos: 959, }, }, Value: []byte("test "), @@ -3119,8 +2809,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1039, - EndPos: 1048, + StartPos: 959, + EndPos: 968, }, }, Var: &ast.ExprVariable{ @@ -3128,8 +2818,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1039, - EndPos: 1043, + StartPos: 959, + EndPos: 963, }, }, VarName: &ast.Identifier{ @@ -3137,8 +2827,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1039, - EndPos: 1043, + StartPos: 959, + EndPos: 963, }, }, Value: []byte("$var"), @@ -3149,8 +2839,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 44, EndLine: 44, - StartPos: 1044, - EndPos: 1047, + StartPos: 964, + EndPos: 967, }, }, Value: []byte("bar"), @@ -3164,8 +2854,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1053, - EndPos: 1071, + StartPos: 971, + EndPos: 989, }, }, Expr: &ast.ScalarEncapsed{ @@ -3173,8 +2863,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1053, - EndPos: 1070, + StartPos: 971, + EndPos: 988, }, }, Parts: []ast.Vertex{ @@ -3183,8 +2873,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1054, - EndPos: 1059, + StartPos: 972, + EndPos: 977, }, }, Value: []byte("test "), @@ -3194,8 +2884,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1059, - EndPos: 1069, + StartPos: 977, + EndPos: 987, }, }, Var: &ast.ExprVariable{ @@ -3203,8 +2893,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1059, - EndPos: 1063, + StartPos: 977, + EndPos: 981, }, }, VarName: &ast.Identifier{ @@ -3212,8 +2902,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1059, - EndPos: 1063, + StartPos: 977, + EndPos: 981, }, }, Value: []byte("$var"), @@ -3224,8 +2914,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1064, - EndPos: 1068, + StartPos: 982, + EndPos: 986, }, }, VarName: &ast.Identifier{ @@ -3233,8 +2923,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 45, EndLine: 45, - StartPos: 1064, - EndPos: 1068, + StartPos: 982, + EndPos: 986, }, }, Value: []byte("$bar"), @@ -3249,8 +2939,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1074, - EndPos: 1086, + StartPos: 990, + EndPos: 1002, }, }, Expr: &ast.ScalarEncapsed{ @@ -3258,8 +2948,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1074, - EndPos: 1085, + StartPos: 990, + EndPos: 1001, }, }, Parts: []ast.Vertex{ @@ -3268,8 +2958,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1075, - EndPos: 1079, + StartPos: 991, + EndPos: 995, }, }, VarName: &ast.Identifier{ @@ -3277,8 +2967,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1075, - EndPos: 1079, + StartPos: 991, + EndPos: 995, }, }, Value: []byte("$foo"), @@ -3289,8 +2979,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1079, - EndPos: 1080, + StartPos: 995, + EndPos: 996, }, }, Value: []byte(" "), @@ -3300,8 +2990,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1080, - EndPos: 1084, + StartPos: 996, + EndPos: 1000, }, }, VarName: &ast.Identifier{ @@ -3309,8 +2999,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 46, EndLine: 46, - StartPos: 1080, - EndPos: 1084, + StartPos: 996, + EndPos: 1000, }, }, Value: []byte("$bar"), @@ -3324,8 +3014,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1089, - EndPos: 1108, + StartPos: 1003, + EndPos: 1022, }, }, Expr: &ast.ScalarEncapsed{ @@ -3333,8 +3023,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1089, - EndPos: 1107, + StartPos: 1003, + EndPos: 1021, }, }, Parts: []ast.Vertex{ @@ -3343,8 +3033,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1090, - EndPos: 1095, + StartPos: 1004, + EndPos: 1009, }, }, Value: []byte("test "), @@ -3354,8 +3044,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1095, - EndPos: 1104, + StartPos: 1009, + EndPos: 1018, }, }, Var: &ast.ExprVariable{ @@ -3363,8 +3053,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1095, - EndPos: 1099, + StartPos: 1009, + EndPos: 1013, }, }, VarName: &ast.Identifier{ @@ -3372,8 +3062,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1095, - EndPos: 1099, + StartPos: 1009, + EndPos: 1013, }, }, Value: []byte("$foo"), @@ -3384,8 +3074,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1101, - EndPos: 1104, + StartPos: 1015, + EndPos: 1018, }, }, Value: []byte("bar"), @@ -3396,8 +3086,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 47, EndLine: 47, - StartPos: 1104, - EndPos: 1106, + StartPos: 1018, + EndPos: 1020, }, }, Value: []byte("()"), @@ -3410,8 +3100,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 48, EndLine: 48, - StartPos: 1111, - EndPos: 1125, + StartPos: 1023, + EndPos: 1037, }, }, Expr: &ast.ScalarEncapsed{ @@ -3419,8 +3109,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 48, EndLine: 48, - StartPos: 1111, - EndPos: 1124, + StartPos: 1023, + EndPos: 1036, }, }, Parts: []ast.Vertex{ @@ -3429,8 +3119,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 48, EndLine: 48, - StartPos: 1112, - EndPos: 1117, + StartPos: 1024, + EndPos: 1029, }, }, Value: []byte("test "), @@ -3440,8 +3130,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 48, EndLine: 48, - StartPos: 1117, - EndPos: 1123, + StartPos: 1029, + EndPos: 1035, }, }, VarName: &ast.Identifier{ @@ -3449,8 +3139,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 48, EndLine: 48, - StartPos: 1119, - EndPos: 1122, + StartPos: 1031, + EndPos: 1034, }, }, Value: []byte("foo"), @@ -3464,8 +3154,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1128, - EndPos: 1145, + StartPos: 1038, + EndPos: 1055, }, }, Expr: &ast.ScalarEncapsed{ @@ -3473,8 +3163,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1128, - EndPos: 1144, + StartPos: 1038, + EndPos: 1054, }, }, Parts: []ast.Vertex{ @@ -3483,8 +3173,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1129, - EndPos: 1134, + StartPos: 1039, + EndPos: 1044, }, }, Value: []byte("test "), @@ -3494,8 +3184,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1134, - EndPos: 1143, + StartPos: 1044, + EndPos: 1053, }, }, Var: &ast.ExprVariable{ @@ -3503,8 +3193,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1136, - EndPos: 1139, + StartPos: 1046, + EndPos: 1049, }, }, VarName: &ast.Identifier{ @@ -3512,8 +3202,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1136, - EndPos: 1139, + StartPos: 1046, + EndPos: 1049, }, }, Value: []byte("foo"), @@ -3524,8 +3214,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 49, EndLine: 49, - StartPos: 1140, - EndPos: 1141, + StartPos: 1050, + EndPos: 1051, }, }, Value: []byte("0"), @@ -3539,8 +3229,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1148, - EndPos: 1163, + StartPos: 1056, + EndPos: 1071, }, }, Expr: &ast.ScalarEncapsed{ @@ -3548,8 +3238,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1148, - EndPos: 1162, + StartPos: 1056, + EndPos: 1070, }, }, Parts: []ast.Vertex{ @@ -3558,8 +3248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1149, - EndPos: 1154, + StartPos: 1057, + EndPos: 1062, }, }, Value: []byte("test "), @@ -3569,8 +3259,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1154, - EndPos: 1161, + StartPos: 1062, + EndPos: 1069, }, }, VarName: &ast.ExprVariable{ @@ -3578,8 +3268,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1156, - EndPos: 1160, + StartPos: 1064, + EndPos: 1068, }, }, VarName: &ast.Identifier{ @@ -3587,8 +3277,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 50, EndLine: 50, - StartPos: 1156, - EndPos: 1160, + StartPos: 1064, + EndPos: 1068, }, }, Value: []byte("$foo"), @@ -3603,8 +3293,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1166, - EndPos: 1187, + StartPos: 1072, + EndPos: 1093, }, }, Expr: &ast.ScalarEncapsed{ @@ -3612,8 +3302,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1166, - EndPos: 1186, + StartPos: 1072, + EndPos: 1092, }, }, Parts: []ast.Vertex{ @@ -3622,8 +3312,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1167, - EndPos: 1172, + StartPos: 1073, + EndPos: 1078, }, }, Value: []byte("test "), @@ -3633,8 +3323,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1173, - EndPos: 1184, + StartPos: 1079, + EndPos: 1090, }, }, Var: &ast.ExprVariable{ @@ -3642,8 +3332,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1173, - EndPos: 1177, + StartPos: 1079, + EndPos: 1083, }, }, VarName: &ast.Identifier{ @@ -3651,8 +3341,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1173, - EndPos: 1177, + StartPos: 1079, + EndPos: 1083, }, }, Value: []byte("$foo"), @@ -3663,8 +3353,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1179, - EndPos: 1182, + StartPos: 1085, + EndPos: 1088, }, }, Value: []byte("bar"), @@ -3674,8 +3364,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 51, EndLine: 51, - StartPos: 1182, - EndPos: 1184, + StartPos: 1088, + EndPos: 1090, }, }, }, @@ -3688,8 +3378,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 53, EndLine: 54, - StartPos: 1191, - EndPos: 1209, + StartPos: 1095, + EndPos: 1111, }, }, Cond: &ast.ExprVariable{ @@ -3697,8 +3387,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 53, EndLine: 53, - StartPos: 1195, - EndPos: 1197, + StartPos: 1099, + EndPos: 1101, }, }, VarName: &ast.Identifier{ @@ -3706,8 +3396,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 53, EndLine: 53, - StartPos: 1195, - EndPos: 1197, + StartPos: 1099, + EndPos: 1101, }, }, Value: []byte("$a"), @@ -3730,8 +3420,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 55, EndLine: 57, - StartPos: 1212, - EndPos: 1245, + StartPos: 1112, + EndPos: 1141, }, }, Cond: &ast.ExprVariable{ @@ -3739,8 +3429,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 55, EndLine: 55, - StartPos: 1216, - EndPos: 1218, + StartPos: 1116, + EndPos: 1118, }, }, VarName: &ast.Identifier{ @@ -3748,8 +3438,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 55, EndLine: 55, - StartPos: 1216, - EndPos: 1218, + StartPos: 1116, + EndPos: 1118, }, }, Value: []byte("$a"), @@ -3772,7 +3462,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 56, EndLine: -1, - StartPos: 1224, + StartPos: 1122, EndPos: -1, }, }, @@ -3781,8 +3471,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1232, - EndPos: 1234, + StartPos: 1130, + EndPos: 1132, }, }, VarName: &ast.Identifier{ @@ -3790,8 +3480,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 56, EndLine: 56, - StartPos: 1232, - EndPos: 1234, + StartPos: 1130, + EndPos: 1132, }, }, Value: []byte("$b"), @@ -3816,8 +3506,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 58, EndLine: 60, - StartPos: 1248, - EndPos: 1274, + StartPos: 1142, + EndPos: 1164, }, }, Cond: &ast.ExprVariable{ @@ -3825,8 +3515,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1252, - EndPos: 1254, + StartPos: 1146, + EndPos: 1148, }, }, VarName: &ast.Identifier{ @@ -3834,8 +3524,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 58, EndLine: 58, - StartPos: 1252, - EndPos: 1254, + StartPos: 1146, + EndPos: 1148, }, }, Value: []byte("$a"), @@ -3857,7 +3547,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 59, EndLine: -1, - StartPos: 1260, + StartPos: 1152, EndPos: -1, }, }, @@ -3879,8 +3569,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 61, EndLine: 65, - StartPos: 1277, - EndPos: 1333, + StartPos: 1165, + EndPos: 1213, }, }, Cond: &ast.ExprVariable{ @@ -3888,8 +3578,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1281, - EndPos: 1283, + StartPos: 1169, + EndPos: 1171, }, }, VarName: &ast.Identifier{ @@ -3897,8 +3587,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 61, EndLine: 61, - StartPos: 1281, - EndPos: 1283, + StartPos: 1169, + EndPos: 1171, }, }, Value: []byte("$a"), @@ -3921,7 +3611,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 62, EndLine: -1, - StartPos: 1289, + StartPos: 1175, EndPos: -1, }, }, @@ -3930,8 +3620,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1297, - EndPos: 1299, + StartPos: 1183, + EndPos: 1185, }, }, VarName: &ast.Identifier{ @@ -3939,8 +3629,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 62, EndLine: 62, - StartPos: 1297, - EndPos: 1299, + StartPos: 1183, + EndPos: 1185, }, }, Value: []byte("$b"), @@ -3963,7 +3653,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 63, EndLine: -1, - StartPos: 1304, + StartPos: 1188, EndPos: -1, }, }, @@ -3972,8 +3662,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 63, EndLine: 63, - StartPos: 1312, - EndPos: 1314, + StartPos: 1196, + EndPos: 1198, }, }, VarName: &ast.Identifier{ @@ -3981,8 +3671,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 63, EndLine: 63, - StartPos: 1312, - EndPos: 1314, + StartPos: 1196, + EndPos: 1198, }, }, Value: []byte("$c"), @@ -4006,7 +3696,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 64, EndLine: -1, - StartPos: 1319, + StartPos: 1201, EndPos: -1, }, }, @@ -4028,8 +3718,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 67, EndLine: 67, - StartPos: 1337, - EndPos: 1357, + StartPos: 1215, + EndPos: 1235, }, }, Cond: &ast.ScalarLnumber{ @@ -4037,8 +3727,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 67, EndLine: 67, - StartPos: 1344, - EndPos: 1345, + StartPos: 1222, + EndPos: 1223, }, }, Value: []byte("1"), @@ -4048,8 +3738,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 67, EndLine: 67, - StartPos: 1347, - EndPos: 1357, + StartPos: 1225, + EndPos: 1235, }, }, Stmts: []ast.Vertex{ @@ -4058,8 +3748,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 67, EndLine: 67, - StartPos: 1349, - EndPos: 1355, + StartPos: 1227, + EndPos: 1233, }, }, }, @@ -4071,8 +3761,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1360, - EndPos: 1382, + StartPos: 1236, + EndPos: 1258, }, }, Cond: &ast.ScalarLnumber{ @@ -4080,8 +3770,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1367, - EndPos: 1368, + StartPos: 1243, + EndPos: 1244, }, }, Value: []byte("1"), @@ -4091,8 +3781,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1370, - EndPos: 1382, + StartPos: 1246, + EndPos: 1258, }, }, Stmts: []ast.Vertex{ @@ -4101,8 +3791,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1372, - EndPos: 1380, + StartPos: 1248, + EndPos: 1256, }, }, Expr: &ast.ScalarLnumber{ @@ -4110,8 +3800,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 68, EndLine: 68, - StartPos: 1378, - EndPos: 1379, + StartPos: 1254, + EndPos: 1255, }, }, Value: []byte("2"), @@ -4125,8 +3815,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1385, - EndPos: 1416, + StartPos: 1259, + EndPos: 1290, }, }, Cond: &ast.ScalarLnumber{ @@ -4134,8 +3824,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1392, - EndPos: 1393, + StartPos: 1266, + EndPos: 1267, }, }, Value: []byte("1"), @@ -4145,8 +3835,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1397, - EndPos: 1406, + StartPos: 1271, + EndPos: 1280, }, }, Stmts: []ast.Vertex{ @@ -4155,8 +3845,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1397, - EndPos: 1406, + StartPos: 1271, + EndPos: 1280, }, }, Expr: &ast.ScalarLnumber{ @@ -4164,8 +3854,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 69, EndLine: 69, - StartPos: 1403, - EndPos: 1404, + StartPos: 1277, + EndPos: 1278, }, }, Value: []byte("3"), @@ -4179,8 +3869,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1419, - EndPos: 1462, + StartPos: 1291, + EndPos: 1334, }, }, ClassName: &ast.Identifier{ @@ -4188,8 +3878,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1425, - EndPos: 1428, + StartPos: 1297, + EndPos: 1300, }, }, Value: []byte("foo"), @@ -4200,8 +3890,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1430, - EndPos: 1460, + StartPos: 1302, + EndPos: 1332, }, }, Modifiers: []ast.Vertex{ @@ -4210,8 +3900,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1430, - EndPos: 1436, + StartPos: 1302, + EndPos: 1308, }, }, Value: []byte("public"), @@ -4223,8 +3913,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1443, - EndPos: 1450, + StartPos: 1315, + EndPos: 1322, }, }, ConstantName: &ast.Identifier{ @@ -4232,8 +3922,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1443, - EndPos: 1446, + StartPos: 1315, + EndPos: 1318, }, }, Value: []byte("FOO"), @@ -4243,8 +3933,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1449, - EndPos: 1450, + StartPos: 1321, + EndPos: 1322, }, }, Value: []byte("1"), @@ -4255,8 +3945,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1452, - EndPos: 1459, + StartPos: 1324, + EndPos: 1331, }, }, ConstantName: &ast.Identifier{ @@ -4264,8 +3954,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1452, - EndPos: 1455, + StartPos: 1324, + EndPos: 1327, }, }, Value: []byte("BAR"), @@ -4275,8 +3965,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 70, EndLine: 70, - StartPos: 1458, - EndPos: 1459, + StartPos: 1330, + EndPos: 1331, }, }, Value: []byte("2"), @@ -4291,8 +3981,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1465, - EndPos: 1501, + StartPos: 1335, + EndPos: 1371, }, }, ClassName: &ast.Identifier{ @@ -4300,8 +3990,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1471, - EndPos: 1474, + StartPos: 1341, + EndPos: 1344, }, }, Value: []byte("foo"), @@ -4312,8 +4002,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1476, - EndPos: 1499, + StartPos: 1346, + EndPos: 1369, }, }, Consts: []ast.Vertex{ @@ -4322,8 +4012,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1482, - EndPos: 1489, + StartPos: 1352, + EndPos: 1359, }, }, ConstantName: &ast.Identifier{ @@ -4331,8 +4021,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1482, - EndPos: 1485, + StartPos: 1352, + EndPos: 1355, }, }, Value: []byte("FOO"), @@ -4342,8 +4032,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1488, - EndPos: 1489, + StartPos: 1358, + EndPos: 1359, }, }, Value: []byte("1"), @@ -4354,8 +4044,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1491, - EndPos: 1498, + StartPos: 1361, + EndPos: 1368, }, }, ConstantName: &ast.Identifier{ @@ -4363,8 +4053,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1491, - EndPos: 1494, + StartPos: 1361, + EndPos: 1364, }, }, Value: []byte("BAR"), @@ -4374,8 +4064,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 71, EndLine: 71, - StartPos: 1497, - EndPos: 1498, + StartPos: 1367, + EndPos: 1368, }, }, Value: []byte("2"), @@ -4390,8 +4080,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 72, EndLine: 72, - StartPos: 1504, - EndPos: 1534, + StartPos: 1372, + EndPos: 1402, }, }, ClassName: &ast.Identifier{ @@ -4399,8 +4089,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 72, EndLine: 72, - StartPos: 1510, - EndPos: 1513, + StartPos: 1378, + EndPos: 1381, }, }, Value: []byte("foo"), @@ -4411,18 +4101,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 72, EndLine: 72, - StartPos: 1515, - EndPos: 1532, + StartPos: 1383, + EndPos: 1400, }, }, - ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 72, EndLine: 72, - StartPos: 1524, - EndPos: 1527, + StartPos: 1392, + EndPos: 1395, }, }, Value: []byte("bar"), @@ -4432,8 +4121,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 72, EndLine: 72, - StartPos: 1530, - EndPos: 1532, + StartPos: 1398, + EndPos: 1400, }, }, Stmts: []ast.Vertex{}, @@ -4446,8 +4135,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1537, - EndPos: 1582, + StartPos: 1403, + EndPos: 1448, }, }, ClassName: &ast.Identifier{ @@ -4455,8 +4144,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1543, - EndPos: 1546, + StartPos: 1409, + EndPos: 1412, }, }, Value: []byte("foo"), @@ -4467,8 +4156,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1548, - EndPos: 1580, + StartPos: 1414, + EndPos: 1446, }, }, ReturnsRef: true, @@ -4477,8 +4166,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1572, - EndPos: 1575, + StartPos: 1438, + EndPos: 1441, }, }, Value: []byte("bar"), @@ -4489,8 +4178,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1548, - EndPos: 1554, + StartPos: 1414, + EndPos: 1420, }, }, Value: []byte("public"), @@ -4500,8 +4189,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1555, - EndPos: 1561, + StartPos: 1421, + EndPos: 1427, }, }, Value: []byte("static"), @@ -4512,8 +4201,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 73, EndLine: 73, - StartPos: 1578, - EndPos: 1580, + StartPos: 1444, + EndPos: 1446, }, }, Stmts: []ast.Vertex{}, @@ -4526,8 +4215,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1585, - EndPos: 1636, + StartPos: 1449, + EndPos: 1500, }, }, ClassName: &ast.Identifier{ @@ -4535,8 +4224,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1591, - EndPos: 1594, + StartPos: 1455, + EndPos: 1458, }, }, Value: []byte("foo"), @@ -4547,8 +4236,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1596, - EndPos: 1634, + StartPos: 1460, + EndPos: 1498, }, }, ReturnsRef: true, @@ -4557,8 +4246,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1620, - EndPos: 1623, + StartPos: 1484, + EndPos: 1487, }, }, Value: []byte("bar"), @@ -4569,8 +4258,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1596, - EndPos: 1602, + StartPos: 1460, + EndPos: 1466, }, }, Value: []byte("public"), @@ -4580,8 +4269,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1603, - EndPos: 1609, + StartPos: 1467, + EndPos: 1473, }, }, Value: []byte("static"), @@ -4592,8 +4281,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1627, - EndPos: 1631, + StartPos: 1491, + EndPos: 1495, }, }, Parts: []ast.Vertex{ @@ -4602,8 +4291,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1627, - EndPos: 1631, + StartPos: 1491, + EndPos: 1495, }, }, Value: []byte("void"), @@ -4615,8 +4304,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 74, EndLine: 74, - StartPos: 1632, - EndPos: 1634, + StartPos: 1496, + EndPos: 1498, }, }, Stmts: []ast.Vertex{}, @@ -4629,8 +4318,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 75, EndLine: 75, - StartPos: 1639, - EndPos: 1660, + StartPos: 1501, + EndPos: 1522, }, }, ClassName: &ast.Identifier{ @@ -4638,8 +4327,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 75, EndLine: 75, - StartPos: 1654, - EndPos: 1657, + StartPos: 1516, + EndPos: 1519, }, }, Value: []byte("foo"), @@ -4650,8 +4339,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 75, EndLine: 75, - StartPos: 1639, - EndPos: 1647, + StartPos: 1501, + EndPos: 1509, }, }, Value: []byte("abstract"), @@ -4664,8 +4353,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1663, - EndPos: 1694, + StartPos: 1523, + EndPos: 1554, }, }, ClassName: &ast.Identifier{ @@ -4673,8 +4362,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1675, - EndPos: 1678, + StartPos: 1535, + EndPos: 1538, }, }, Value: []byte("foo"), @@ -4685,8 +4374,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1663, - EndPos: 1668, + StartPos: 1523, + EndPos: 1528, }, }, Value: []byte("final"), @@ -4697,8 +4386,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1679, - EndPos: 1690, + StartPos: 1539, + EndPos: 1550, }, }, ClassName: &ast.NameName{ @@ -4706,8 +4395,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1687, - EndPos: 1690, + StartPos: 1547, + EndPos: 1550, }, }, Parts: []ast.Vertex{ @@ -4716,8 +4405,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 76, EndLine: 76, - StartPos: 1687, - EndPos: 1690, + StartPos: 1547, + EndPos: 1550, }, }, Value: []byte("bar"), @@ -4732,8 +4421,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1697, - EndPos: 1731, + StartPos: 1555, + EndPos: 1589, }, }, ClassName: &ast.Identifier{ @@ -4741,8 +4430,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1709, - EndPos: 1712, + StartPos: 1567, + EndPos: 1570, }, }, Value: []byte("foo"), @@ -4753,8 +4442,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1697, - EndPos: 1702, + StartPos: 1555, + EndPos: 1560, }, }, Value: []byte("final"), @@ -4765,8 +4454,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1713, - EndPos: 1727, + StartPos: 1571, + EndPos: 1585, }, }, InterfaceNames: []ast.Vertex{ @@ -4775,8 +4464,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1724, - EndPos: 1727, + StartPos: 1582, + EndPos: 1585, }, }, Parts: []ast.Vertex{ @@ -4785,8 +4474,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 77, EndLine: 77, - StartPos: 1724, - EndPos: 1727, + StartPos: 1582, + EndPos: 1585, }, }, Value: []byte("bar"), @@ -4802,8 +4491,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1734, - EndPos: 1773, + StartPos: 1590, + EndPos: 1629, }, }, ClassName: &ast.Identifier{ @@ -4811,8 +4500,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1746, - EndPos: 1749, + StartPos: 1602, + EndPos: 1605, }, }, Value: []byte("foo"), @@ -4823,8 +4512,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1734, - EndPos: 1739, + StartPos: 1590, + EndPos: 1595, }, }, Value: []byte("final"), @@ -4835,8 +4524,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1750, - EndPos: 1769, + StartPos: 1606, + EndPos: 1625, }, }, InterfaceNames: []ast.Vertex{ @@ -4845,8 +4534,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1761, - EndPos: 1764, + StartPos: 1617, + EndPos: 1620, }, }, Parts: []ast.Vertex{ @@ -4855,8 +4544,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1761, - EndPos: 1764, + StartPos: 1617, + EndPos: 1620, }, }, Value: []byte("bar"), @@ -4868,8 +4557,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1766, - EndPos: 1769, + StartPos: 1622, + EndPos: 1625, }, }, Parts: []ast.Vertex{ @@ -4878,8 +4567,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 78, EndLine: 78, - StartPos: 1766, - EndPos: 1769, + StartPos: 1622, + EndPos: 1625, }, }, Value: []byte("baz"), @@ -4895,8 +4584,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1776, - EndPos: 1824, + StartPos: 1630, + EndPos: 1678, }, }, Expr: &ast.ExprNew{ @@ -4904,8 +4593,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1776, - EndPos: 1823, + StartPos: 1630, + EndPos: 1677, }, }, Class: &ast.StmtClass{ @@ -4913,8 +4602,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1780, - EndPos: 1823, + StartPos: 1634, + EndPos: 1677, }, }, ArgumentList: &ast.ArgumentList{ @@ -4922,8 +4611,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1785, - EndPos: 1787, + StartPos: 1639, + EndPos: 1641, }, }, }, @@ -4932,8 +4621,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1788, - EndPos: 1799, + StartPos: 1642, + EndPos: 1653, }, }, ClassName: &ast.NameName{ @@ -4941,8 +4630,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1796, - EndPos: 1799, + StartPos: 1650, + EndPos: 1653, }, }, Parts: []ast.Vertex{ @@ -4951,8 +4640,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1796, - EndPos: 1799, + StartPos: 1650, + EndPos: 1653, }, }, Value: []byte("foo"), @@ -4965,8 +4654,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1800, - EndPos: 1819, + StartPos: 1654, + EndPos: 1673, }, }, InterfaceNames: []ast.Vertex{ @@ -4975,8 +4664,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1811, - EndPos: 1814, + StartPos: 1665, + EndPos: 1668, }, }, Parts: []ast.Vertex{ @@ -4985,8 +4674,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1811, - EndPos: 1814, + StartPos: 1665, + EndPos: 1668, }, }, Value: []byte("bar"), @@ -4998,8 +4687,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1816, - EndPos: 1819, + StartPos: 1670, + EndPos: 1673, }, }, Parts: []ast.Vertex{ @@ -5008,8 +4697,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 79, EndLine: 79, - StartPos: 1816, - EndPos: 1819, + StartPos: 1670, + EndPos: 1673, }, }, Value: []byte("baz"), @@ -5027,8 +4716,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1828, - EndPos: 1851, + StartPos: 1680, + EndPos: 1703, }, }, Consts: []ast.Vertex{ @@ -5037,8 +4726,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1834, - EndPos: 1841, + StartPos: 1686, + EndPos: 1693, }, }, ConstantName: &ast.Identifier{ @@ -5046,8 +4735,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1834, - EndPos: 1837, + StartPos: 1686, + EndPos: 1689, }, }, Value: []byte("FOO"), @@ -5057,8 +4746,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1840, - EndPos: 1841, + StartPos: 1692, + EndPos: 1693, }, }, Value: []byte("1"), @@ -5069,8 +4758,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1843, - EndPos: 1850, + StartPos: 1695, + EndPos: 1702, }, }, ConstantName: &ast.Identifier{ @@ -5078,8 +4767,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1843, - EndPos: 1846, + StartPos: 1695, + EndPos: 1698, }, }, Value: []byte("BAR"), @@ -5089,8 +4778,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 81, EndLine: 81, - StartPos: 1849, - EndPos: 1850, + StartPos: 1701, + EndPos: 1702, }, }, Value: []byte("2"), @@ -5103,8 +4792,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1854, - EndPos: 1877, + StartPos: 1704, + EndPos: 1727, }, }, Cond: &ast.ScalarLnumber{ @@ -5112,8 +4801,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1861, - EndPos: 1862, + StartPos: 1711, + EndPos: 1712, }, }, Value: []byte("1"), @@ -5123,8 +4812,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1864, - EndPos: 1877, + StartPos: 1714, + EndPos: 1727, }, }, Stmts: []ast.Vertex{ @@ -5133,8 +4822,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 82, EndLine: 82, - StartPos: 1866, - EndPos: 1875, + StartPos: 1716, + EndPos: 1725, }, }, }, @@ -5146,8 +4835,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1880, - EndPos: 1905, + StartPos: 1728, + EndPos: 1753, }, }, Cond: &ast.ScalarLnumber{ @@ -5155,8 +4844,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1887, - EndPos: 1888, + StartPos: 1735, + EndPos: 1736, }, }, Value: []byte("1"), @@ -5166,8 +4855,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1890, - EndPos: 1905, + StartPos: 1738, + EndPos: 1753, }, }, Stmts: []ast.Vertex{ @@ -5176,8 +4865,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1892, - EndPos: 1903, + StartPos: 1740, + EndPos: 1751, }, }, Expr: &ast.ScalarLnumber{ @@ -5185,8 +4874,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 83, EndLine: 83, - StartPos: 1901, - EndPos: 1902, + StartPos: 1749, + EndPos: 1750, }, }, Value: []byte("2"), @@ -5200,8 +4889,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1908, - EndPos: 1934, + StartPos: 1754, + EndPos: 1780, }, }, Cond: &ast.ScalarLnumber{ @@ -5209,8 +4898,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1915, - EndPos: 1916, + StartPos: 1761, + EndPos: 1762, }, }, Value: []byte("1"), @@ -5220,8 +4909,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1918, - EndPos: 1934, + StartPos: 1764, + EndPos: 1780, }, }, Stmts: []ast.Vertex{ @@ -5230,8 +4919,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1920, - EndPos: 1932, + StartPos: 1766, + EndPos: 1778, }, }, Expr: &ast.ScalarLnumber{ @@ -5239,8 +4928,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 84, EndLine: 84, - StartPos: 1929, - EndPos: 1930, + StartPos: 1775, + EndPos: 1776, }, }, Value: []byte("3"), @@ -5254,19 +4943,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 1937, - EndPos: 1954, + StartPos: 1781, + EndPos: 1798, }, }, - Alt: false, Consts: []ast.Vertex{ &ast.StmtConstant{ Node: ast.Node{ Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 1945, - EndPos: 1952, + StartPos: 1789, + EndPos: 1796, }, }, ConstantName: &ast.Identifier{ @@ -5274,8 +4962,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 1945, - EndPos: 1950, + StartPos: 1789, + EndPos: 1794, }, }, Value: []byte("ticks"), @@ -5285,8 +4973,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 1951, - EndPos: 1952, + StartPos: 1795, + EndPos: 1796, }, }, Value: []byte("1"), @@ -5298,8 +4986,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 85, EndLine: 85, - StartPos: 1953, - EndPos: 1954, + StartPos: 1797, + EndPos: 1798, }, }, }, @@ -5309,19 +4997,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 1957, - EndPos: 1976, + StartPos: 1799, + EndPos: 1818, }, }, - Alt: false, Consts: []ast.Vertex{ &ast.StmtConstant{ Node: ast.Node{ Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 1965, - EndPos: 1972, + StartPos: 1807, + EndPos: 1814, }, }, ConstantName: &ast.Identifier{ @@ -5329,8 +5016,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 1965, - EndPos: 1970, + StartPos: 1807, + EndPos: 1812, }, }, Value: []byte("ticks"), @@ -5340,8 +5027,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 1971, - EndPos: 1972, + StartPos: 1813, + EndPos: 1814, }, }, Value: []byte("1"), @@ -5353,8 +5040,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 86, EndLine: 86, - StartPos: 1974, - EndPos: 1976, + StartPos: 1816, + EndPos: 1818, }, }, Stmts: []ast.Vertex{}, @@ -5365,8 +5052,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 87, EndLine: 87, - StartPos: 1979, - EndPos: 2008, + StartPos: 1819, + EndPos: 1848, }, }, Alt: true, @@ -5376,8 +5063,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 87, EndLine: 87, - StartPos: 1987, - EndPos: 1994, + StartPos: 1827, + EndPos: 1834, }, }, ConstantName: &ast.Identifier{ @@ -5385,8 +5072,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 87, EndLine: 87, - StartPos: 1987, - EndPos: 1992, + StartPos: 1827, + EndPos: 1832, }, }, Value: []byte("ticks"), @@ -5396,8 +5083,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 87, EndLine: 87, - StartPos: 1993, - EndPos: 1994, + StartPos: 1833, + EndPos: 1834, }, }, Value: []byte("1"), @@ -5421,8 +5108,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 88, EndLine: 88, - StartPos: 2011, - EndPos: 2026, + StartPos: 1849, + EndPos: 1864, }, }, Stmt: &ast.StmtStmtList{ @@ -5430,8 +5117,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 88, EndLine: 88, - StartPos: 2014, - EndPos: 2016, + StartPos: 1852, + EndPos: 1854, }, }, Stmts: []ast.Vertex{}, @@ -5441,8 +5128,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 88, EndLine: 88, - StartPos: 2023, - EndPos: 2024, + StartPos: 1861, + EndPos: 1862, }, }, Value: []byte("1"), @@ -5453,8 +5140,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2029, - EndPos: 2040, + StartPos: 1865, + EndPos: 1876, }, }, Exprs: []ast.Vertex{ @@ -5463,8 +5150,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2034, - EndPos: 2036, + StartPos: 1870, + EndPos: 1872, }, }, VarName: &ast.Identifier{ @@ -5472,8 +5159,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2034, - EndPos: 2036, + StartPos: 1870, + EndPos: 1872, }, }, Value: []byte("$a"), @@ -5484,8 +5171,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 89, EndLine: 89, - StartPos: 2038, - EndPos: 2039, + StartPos: 1874, + EndPos: 1875, }, }, Value: []byte("1"), @@ -5497,8 +5184,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 90, EndLine: 90, - StartPos: 2043, - EndPos: 2052, + StartPos: 1877, + EndPos: 1886, }, }, Exprs: []ast.Vertex{ @@ -5507,8 +5194,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 90, EndLine: 90, - StartPos: 2048, - EndPos: 2050, + StartPos: 1882, + EndPos: 1884, }, }, VarName: &ast.Identifier{ @@ -5516,8 +5203,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 90, EndLine: 90, - StartPos: 2048, - EndPos: 2050, + StartPos: 1882, + EndPos: 1884, }, }, Value: []byte("$a"), @@ -5530,8 +5217,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2055, - EndPos: 2090, + StartPos: 1887, + EndPos: 1922, }, }, Init: []ast.Vertex{ @@ -5540,8 +5227,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2059, - EndPos: 2065, + StartPos: 1891, + EndPos: 1897, }, }, Var: &ast.ExprVariable{ @@ -5549,8 +5236,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2059, - EndPos: 2061, + StartPos: 1891, + EndPos: 1893, }, }, VarName: &ast.Identifier{ @@ -5558,8 +5245,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2059, - EndPos: 2061, + StartPos: 1891, + EndPos: 1893, }, }, Value: []byte("$i"), @@ -5570,8 +5257,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2064, - EndPos: 2065, + StartPos: 1896, + EndPos: 1897, }, }, Value: []byte("0"), @@ -5584,8 +5271,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2067, - EndPos: 2074, + StartPos: 1899, + EndPos: 1906, }, }, Left: &ast.ExprVariable{ @@ -5593,8 +5280,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2067, - EndPos: 2069, + StartPos: 1899, + EndPos: 1901, }, }, VarName: &ast.Identifier{ @@ -5602,8 +5289,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2067, - EndPos: 2069, + StartPos: 1899, + EndPos: 1901, }, }, Value: []byte("$i"), @@ -5614,8 +5301,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2072, - EndPos: 2074, + StartPos: 1904, + EndPos: 1906, }, }, Value: []byte("10"), @@ -5628,8 +5315,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2076, - EndPos: 2080, + StartPos: 1908, + EndPos: 1912, }, }, Var: &ast.ExprVariable{ @@ -5637,8 +5324,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2076, - EndPos: 2078, + StartPos: 1908, + EndPos: 1910, }, }, VarName: &ast.Identifier{ @@ -5646,8 +5333,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2076, - EndPos: 2078, + StartPos: 1908, + EndPos: 1910, }, }, Value: []byte("$i"), @@ -5659,8 +5346,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2082, - EndPos: 2086, + StartPos: 1914, + EndPos: 1918, }, }, Var: &ast.ExprVariable{ @@ -5668,8 +5355,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2082, - EndPos: 2084, + StartPos: 1914, + EndPos: 1916, }, }, VarName: &ast.Identifier{ @@ -5677,8 +5364,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2082, - EndPos: 2084, + StartPos: 1914, + EndPos: 1916, }, }, Value: []byte("$i"), @@ -5691,8 +5378,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 91, EndLine: 91, - StartPos: 2088, - EndPos: 2090, + StartPos: 1920, + EndPos: 1922, }, }, Stmts: []ast.Vertex{}, @@ -5703,8 +5390,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2093, - EndPos: 2129, + StartPos: 1923, + EndPos: 1959, }, }, Cond: []ast.Vertex{ @@ -5713,8 +5400,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2099, - EndPos: 2106, + StartPos: 1929, + EndPos: 1936, }, }, Left: &ast.ExprVariable{ @@ -5722,8 +5409,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2099, - EndPos: 2101, + StartPos: 1929, + EndPos: 1931, }, }, VarName: &ast.Identifier{ @@ -5731,8 +5418,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2099, - EndPos: 2101, + StartPos: 1929, + EndPos: 1931, }, }, Value: []byte("$i"), @@ -5743,8 +5430,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2104, - EndPos: 2106, + StartPos: 1934, + EndPos: 1936, }, }, Value: []byte("10"), @@ -5757,8 +5444,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2108, - EndPos: 2112, + StartPos: 1938, + EndPos: 1942, }, }, Var: &ast.ExprVariable{ @@ -5766,8 +5453,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2108, - EndPos: 2110, + StartPos: 1938, + EndPos: 1940, }, }, VarName: &ast.Identifier{ @@ -5775,8 +5462,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2108, - EndPos: 2110, + StartPos: 1938, + EndPos: 1940, }, }, Value: []byte("$i"), @@ -5788,8 +5475,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2114, - EndPos: 2118, + StartPos: 1944, + EndPos: 1948, }, }, Var: &ast.ExprVariable{ @@ -5797,8 +5484,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2114, - EndPos: 2116, + StartPos: 1944, + EndPos: 1946, }, }, VarName: &ast.Identifier{ @@ -5806,8 +5493,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 92, EndLine: 92, - StartPos: 2114, - EndPos: 2116, + StartPos: 1944, + EndPos: 1946, }, }, Value: []byte("$i"), @@ -5832,8 +5519,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2132, - EndPos: 2153, + StartPos: 1960, + EndPos: 1981, }, }, Expr: &ast.ExprVariable{ @@ -5841,8 +5528,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2141, - EndPos: 2143, + StartPos: 1969, + EndPos: 1971, }, }, VarName: &ast.Identifier{ @@ -5850,8 +5537,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2141, - EndPos: 2143, + StartPos: 1969, + EndPos: 1971, }, }, Value: []byte("$a"), @@ -5862,8 +5549,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2147, - EndPos: 2149, + StartPos: 1975, + EndPos: 1977, }, }, VarName: &ast.Identifier{ @@ -5871,8 +5558,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2147, - EndPos: 2149, + StartPos: 1975, + EndPos: 1977, }, }, Value: []byte("$v"), @@ -5883,8 +5570,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 93, EndLine: 93, - StartPos: 2151, - EndPos: 2153, + StartPos: 1979, + EndPos: 1981, }, }, Stmts: []ast.Vertex{}, @@ -5895,8 +5582,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2156, - EndPos: 2188, + StartPos: 1982, + EndPos: 2014, }, }, Expr: &ast.ExprVariable{ @@ -5904,8 +5591,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2165, - EndPos: 2167, + StartPos: 1991, + EndPos: 1993, }, }, VarName: &ast.Identifier{ @@ -5913,8 +5600,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2165, - EndPos: 2167, + StartPos: 1991, + EndPos: 1993, }, }, Value: []byte("$a"), @@ -5925,8 +5612,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2171, - EndPos: 2173, + StartPos: 1997, + EndPos: 1999, }, }, VarName: &ast.Identifier{ @@ -5934,8 +5621,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 94, EndLine: 94, - StartPos: 2171, - EndPos: 2173, + StartPos: 1997, + EndPos: 1999, }, }, Value: []byte("$v"), @@ -5958,8 +5645,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2191, - EndPos: 2218, + StartPos: 2015, + EndPos: 2042, }, }, Expr: &ast.ExprVariable{ @@ -5967,8 +5654,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2200, - EndPos: 2202, + StartPos: 2024, + EndPos: 2026, }, }, VarName: &ast.Identifier{ @@ -5976,8 +5663,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2200, - EndPos: 2202, + StartPos: 2024, + EndPos: 2026, }, }, Value: []byte("$a"), @@ -5988,8 +5675,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2206, - EndPos: 2208, + StartPos: 2030, + EndPos: 2032, }, }, VarName: &ast.Identifier{ @@ -5997,8 +5684,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2206, - EndPos: 2208, + StartPos: 2030, + EndPos: 2032, }, }, Value: []byte("$k"), @@ -6009,8 +5696,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2212, - EndPos: 2214, + StartPos: 2036, + EndPos: 2038, }, }, VarName: &ast.Identifier{ @@ -6018,8 +5705,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2212, - EndPos: 2214, + StartPos: 2036, + EndPos: 2038, }, }, Value: []byte("$v"), @@ -6030,8 +5717,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 95, EndLine: 95, - StartPos: 2216, - EndPos: 2218, + StartPos: 2040, + EndPos: 2042, }, }, Stmts: []ast.Vertex{}, @@ -6042,8 +5729,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2221, - EndPos: 2249, + StartPos: 2043, + EndPos: 2071, }, }, Expr: &ast.ExprVariable{ @@ -6051,8 +5738,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2230, - EndPos: 2232, + StartPos: 2052, + EndPos: 2054, }, }, VarName: &ast.Identifier{ @@ -6060,8 +5747,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2230, - EndPos: 2232, + StartPos: 2052, + EndPos: 2054, }, }, Value: []byte("$a"), @@ -6072,8 +5759,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2236, - EndPos: 2238, + StartPos: 2058, + EndPos: 2060, }, }, VarName: &ast.Identifier{ @@ -6081,8 +5768,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2236, - EndPos: 2238, + StartPos: 2058, + EndPos: 2060, }, }, Value: []byte("$k"), @@ -6093,8 +5780,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2242, - EndPos: 2245, + StartPos: 2064, + EndPos: 2067, }, }, Var: &ast.ExprVariable{ @@ -6102,8 +5789,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2243, - EndPos: 2245, + StartPos: 2065, + EndPos: 2067, }, }, VarName: &ast.Identifier{ @@ -6111,8 +5798,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2243, - EndPos: 2245, + StartPos: 2065, + EndPos: 2067, }, }, Value: []byte("$v"), @@ -6124,8 +5811,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 96, EndLine: 96, - StartPos: 2247, - EndPos: 2249, + StartPos: 2069, + EndPos: 2071, }, }, Stmts: []ast.Vertex{}, @@ -6136,8 +5823,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2252, - EndPos: 2285, + StartPos: 2072, + EndPos: 2105, }, }, Expr: &ast.ExprVariable{ @@ -6145,8 +5832,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2261, - EndPos: 2263, + StartPos: 2081, + EndPos: 2083, }, }, VarName: &ast.Identifier{ @@ -6154,8 +5841,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2261, - EndPos: 2263, + StartPos: 2081, + EndPos: 2083, }, }, Value: []byte("$a"), @@ -6166,8 +5853,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2267, - EndPos: 2269, + StartPos: 2087, + EndPos: 2089, }, }, VarName: &ast.Identifier{ @@ -6175,8 +5862,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2267, - EndPos: 2269, + StartPos: 2087, + EndPos: 2089, }, }, Value: []byte("$k"), @@ -6187,8 +5874,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2273, - EndPos: 2281, + StartPos: 2093, + EndPos: 2101, }, }, Items: []ast.Vertex{ @@ -6197,8 +5884,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2278, - EndPos: 2280, + StartPos: 2098, + EndPos: 2100, }, }, Val: &ast.ExprVariable{ @@ -6206,8 +5893,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2278, - EndPos: 2280, + StartPos: 2098, + EndPos: 2100, }, }, VarName: &ast.Identifier{ @@ -6215,8 +5902,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2278, - EndPos: 2280, + StartPos: 2098, + EndPos: 2100, }, }, Value: []byte("$v"), @@ -6230,8 +5917,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 97, EndLine: 97, - StartPos: 2283, - EndPos: 2285, + StartPos: 2103, + EndPos: 2105, }, }, Stmts: []ast.Vertex{}, @@ -6242,8 +5929,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2288, - EndPos: 2317, + StartPos: 2106, + EndPos: 2135, }, }, Expr: &ast.ExprVariable{ @@ -6251,8 +5938,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2297, - EndPos: 2299, + StartPos: 2115, + EndPos: 2117, }, }, VarName: &ast.Identifier{ @@ -6260,8 +5947,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2297, - EndPos: 2299, + StartPos: 2115, + EndPos: 2117, }, }, Value: []byte("$a"), @@ -6272,8 +5959,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2303, - EndPos: 2305, + StartPos: 2121, + EndPos: 2123, }, }, VarName: &ast.Identifier{ @@ -6281,8 +5968,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2303, - EndPos: 2305, + StartPos: 2121, + EndPos: 2123, }, }, Value: []byte("$k"), @@ -6293,8 +5980,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2309, - EndPos: 2313, + StartPos: 2127, + EndPos: 2131, }, }, Items: []ast.Vertex{ @@ -6303,8 +5990,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2310, - EndPos: 2312, + StartPos: 2128, + EndPos: 2130, }, }, Val: &ast.ExprVariable{ @@ -6312,8 +5999,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2310, - EndPos: 2312, + StartPos: 2128, + EndPos: 2130, }, }, VarName: &ast.Identifier{ @@ -6321,8 +6008,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2310, - EndPos: 2312, + StartPos: 2128, + EndPos: 2130, }, }, Value: []byte("$v"), @@ -6336,8 +6023,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 98, EndLine: 98, - StartPos: 2315, - EndPos: 2317, + StartPos: 2133, + EndPos: 2135, }, }, Stmts: []ast.Vertex{}, @@ -6348,18 +6035,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 99, EndLine: 99, - StartPos: 2320, - EndPos: 2337, + StartPos: 2136, + EndPos: 2153, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 99, EndLine: 99, - StartPos: 2329, - EndPos: 2332, + StartPos: 2145, + EndPos: 2148, }, }, Value: []byte("foo"), @@ -6371,18 +6057,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 100, EndLine: 100, - StartPos: 2340, - EndPos: 2364, + StartPos: 2154, + EndPos: 2178, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 100, EndLine: 100, - StartPos: 2349, - EndPos: 2352, + StartPos: 2163, + EndPos: 2166, }, }, Value: []byte("foo"), @@ -6393,8 +6078,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 100, EndLine: 100, - StartPos: 2356, - EndPos: 2363, + StartPos: 2170, + EndPos: 2177, }, }, }, @@ -6405,8 +6090,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2367, - EndPos: 2394, + StartPos: 2179, + EndPos: 2206, }, }, ReturnsRef: true, @@ -6415,8 +6100,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2377, - EndPos: 2380, + StartPos: 2189, + EndPos: 2192, }, }, Value: []byte("foo"), @@ -6427,8 +6112,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2384, - EndPos: 2393, + StartPos: 2196, + EndPos: 2205, }, }, Expr: &ast.ScalarLnumber{ @@ -6436,8 +6121,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 101, EndLine: 101, - StartPos: 2391, - EndPos: 2392, + StartPos: 2203, + EndPos: 2204, }, }, Value: []byte("1"), @@ -6450,8 +6135,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2397, - EndPos: 2421, + StartPos: 2207, + EndPos: 2231, }, }, ReturnsRef: true, @@ -6460,8 +6145,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2407, - EndPos: 2410, + StartPos: 2217, + EndPos: 2220, }, }, Value: []byte("foo"), @@ -6471,8 +6156,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2414, - EndPos: 2418, + StartPos: 2224, + EndPos: 2228, }, }, Parts: []ast.Vertex{ @@ -6481,8 +6166,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 102, EndLine: 102, - StartPos: 2414, - EndPos: 2418, + StartPos: 2224, + EndPos: 2228, }, }, Value: []byte("void"), @@ -6496,8 +6181,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2424, - EndPos: 2438, + StartPos: 2232, + EndPos: 2246, }, }, Vars: []ast.Vertex{ @@ -6506,8 +6191,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2431, - EndPos: 2433, + StartPos: 2239, + EndPos: 2241, }, }, VarName: &ast.Identifier{ @@ -6515,8 +6200,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2431, - EndPos: 2433, + StartPos: 2239, + EndPos: 2241, }, }, Value: []byte("$a"), @@ -6527,8 +6212,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2435, - EndPos: 2437, + StartPos: 2243, + EndPos: 2245, }, }, VarName: &ast.Identifier{ @@ -6536,8 +6221,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 103, EndLine: 103, - StartPos: 2435, - EndPos: 2437, + StartPos: 2243, + EndPos: 2245, }, }, Value: []byte("$b"), @@ -6550,8 +6235,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2441, - EndPos: 2443, + StartPos: 2247, + EndPos: 2249, }, }, LabelName: &ast.Identifier{ @@ -6559,8 +6244,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 104, EndLine: 104, - StartPos: 2441, - EndPos: 2442, + StartPos: 2247, + EndPos: 2248, }, }, Value: []byte("a"), @@ -6571,8 +6256,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 105, EndLine: 105, - StartPos: 2447, - EndPos: 2454, + StartPos: 2250, + EndPos: 2257, }, }, Label: &ast.Identifier{ @@ -6580,8 +6265,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 105, EndLine: 105, - StartPos: 2452, - EndPos: 2453, + StartPos: 2255, + EndPos: 2256, }, }, Value: []byte("a"), @@ -6592,8 +6277,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2457, - EndPos: 2467, + StartPos: 2258, + EndPos: 2268, }, }, Cond: &ast.ExprVariable{ @@ -6601,8 +6286,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2461, - EndPos: 2463, + StartPos: 2262, + EndPos: 2264, }, }, VarName: &ast.Identifier{ @@ -6610,8 +6295,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2461, - EndPos: 2463, + StartPos: 2262, + EndPos: 2264, }, }, Value: []byte("$a"), @@ -6622,8 +6307,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 106, EndLine: 106, - StartPos: 2465, - EndPos: 2467, + StartPos: 2266, + EndPos: 2268, }, }, Stmts: []ast.Vertex{}, @@ -6634,8 +6319,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2470, - EndPos: 2495, + StartPos: 2269, + EndPos: 2294, }, }, Cond: &ast.ExprVariable{ @@ -6643,8 +6328,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2474, - EndPos: 2476, + StartPos: 2273, + EndPos: 2275, }, }, VarName: &ast.Identifier{ @@ -6652,8 +6337,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2474, - EndPos: 2476, + StartPos: 2273, + EndPos: 2275, }, }, Value: []byte("$a"), @@ -6664,8 +6349,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2478, - EndPos: 2480, + StartPos: 2277, + EndPos: 2279, }, }, Stmts: []ast.Vertex{}, @@ -6676,8 +6361,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2481, - EndPos: 2495, + StartPos: 2280, + EndPos: 2294, }, }, Cond: &ast.ExprVariable{ @@ -6685,8 +6370,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2489, - EndPos: 2491, + StartPos: 2288, + EndPos: 2290, }, }, VarName: &ast.Identifier{ @@ -6694,8 +6379,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2489, - EndPos: 2491, + StartPos: 2288, + EndPos: 2290, }, }, Value: []byte("$b"), @@ -6706,8 +6391,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 107, EndLine: 107, - StartPos: 2493, - EndPos: 2495, + StartPos: 2292, + EndPos: 2294, }, }, Stmts: []ast.Vertex{}, @@ -6720,8 +6405,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2498, - EndPos: 2516, + StartPos: 2295, + EndPos: 2313, }, }, Cond: &ast.ExprVariable{ @@ -6729,8 +6414,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2502, - EndPos: 2504, + StartPos: 2299, + EndPos: 2301, }, }, VarName: &ast.Identifier{ @@ -6738,8 +6423,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2502, - EndPos: 2504, + StartPos: 2299, + EndPos: 2301, }, }, Value: []byte("$a"), @@ -6750,8 +6435,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2506, - EndPos: 2508, + StartPos: 2303, + EndPos: 2305, }, }, Stmts: []ast.Vertex{}, @@ -6761,8 +6446,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2509, - EndPos: 2516, + StartPos: 2306, + EndPos: 2313, }, }, Stmt: &ast.StmtStmtList{ @@ -6770,8 +6455,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 108, EndLine: 108, - StartPos: 2514, - EndPos: 2516, + StartPos: 2311, + EndPos: 2313, }, }, Stmts: []ast.Vertex{}, @@ -6783,8 +6468,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2519, - EndPos: 2567, + StartPos: 2314, + EndPos: 2362, }, }, Cond: &ast.ExprVariable{ @@ -6792,8 +6477,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2523, - EndPos: 2525, + StartPos: 2318, + EndPos: 2320, }, }, VarName: &ast.Identifier{ @@ -6801,8 +6486,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2523, - EndPos: 2525, + StartPos: 2318, + EndPos: 2320, }, }, Value: []byte("$a"), @@ -6813,8 +6498,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2527, - EndPos: 2529, + StartPos: 2322, + EndPos: 2324, }, }, Stmts: []ast.Vertex{}, @@ -6825,8 +6510,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2530, - EndPos: 2544, + StartPos: 2325, + EndPos: 2339, }, }, Cond: &ast.ExprVariable{ @@ -6834,8 +6519,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2538, - EndPos: 2540, + StartPos: 2333, + EndPos: 2335, }, }, VarName: &ast.Identifier{ @@ -6843,8 +6528,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2538, - EndPos: 2540, + StartPos: 2333, + EndPos: 2335, }, }, Value: []byte("$b"), @@ -6855,8 +6540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2542, - EndPos: 2544, + StartPos: 2337, + EndPos: 2339, }, }, Stmts: []ast.Vertex{}, @@ -6867,8 +6552,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2545, - EndPos: 2559, + StartPos: 2340, + EndPos: 2354, }, }, Cond: &ast.ExprVariable{ @@ -6876,8 +6561,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2553, - EndPos: 2555, + StartPos: 2348, + EndPos: 2350, }, }, VarName: &ast.Identifier{ @@ -6885,8 +6570,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2553, - EndPos: 2555, + StartPos: 2348, + EndPos: 2350, }, }, Value: []byte("$c"), @@ -6897,8 +6582,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2557, - EndPos: 2559, + StartPos: 2352, + EndPos: 2354, }, }, Stmts: []ast.Vertex{}, @@ -6910,8 +6595,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2560, - EndPos: 2567, + StartPos: 2355, + EndPos: 2362, }, }, Stmt: &ast.StmtStmtList{ @@ -6919,8 +6604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 109, EndLine: 109, - StartPos: 2565, - EndPos: 2567, + StartPos: 2360, + EndPos: 2362, }, }, Stmts: []ast.Vertex{}, @@ -6932,8 +6617,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2570, - EndPos: 2619, + StartPos: 2363, + EndPos: 2412, }, }, Cond: &ast.ExprVariable{ @@ -6941,8 +6626,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2574, - EndPos: 2576, + StartPos: 2367, + EndPos: 2369, }, }, VarName: &ast.Identifier{ @@ -6950,8 +6635,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2574, - EndPos: 2576, + StartPos: 2367, + EndPos: 2369, }, }, Value: []byte("$a"), @@ -6962,8 +6647,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2578, - EndPos: 2580, + StartPos: 2371, + EndPos: 2373, }, }, Stmts: []ast.Vertex{}, @@ -6974,8 +6659,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2581, - EndPos: 2595, + StartPos: 2374, + EndPos: 2388, }, }, Cond: &ast.ExprVariable{ @@ -6983,8 +6668,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2589, - EndPos: 2591, + StartPos: 2382, + EndPos: 2384, }, }, VarName: &ast.Identifier{ @@ -6992,8 +6677,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2589, - EndPos: 2591, + StartPos: 2382, + EndPos: 2384, }, }, Value: []byte("$b"), @@ -7004,8 +6689,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2593, - EndPos: 2595, + StartPos: 2386, + EndPos: 2388, }, }, Stmts: []ast.Vertex{}, @@ -7017,8 +6702,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2596, - EndPos: 2619, + StartPos: 2389, + EndPos: 2412, }, }, Stmt: &ast.StmtIf{ @@ -7026,8 +6711,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2601, - EndPos: 2619, + StartPos: 2394, + EndPos: 2412, }, }, Cond: &ast.ExprVariable{ @@ -7035,8 +6720,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2605, - EndPos: 2607, + StartPos: 2398, + EndPos: 2400, }, }, VarName: &ast.Identifier{ @@ -7044,8 +6729,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2605, - EndPos: 2607, + StartPos: 2398, + EndPos: 2400, }, }, Value: []byte("$c"), @@ -7056,8 +6741,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2609, - EndPos: 2611, + StartPos: 2402, + EndPos: 2404, }, }, Stmts: []ast.Vertex{}, @@ -7067,8 +6752,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2612, - EndPos: 2619, + StartPos: 2405, + EndPos: 2412, }, }, Stmt: &ast.StmtStmtList{ @@ -7076,8 +6761,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 110, EndLine: 110, - StartPos: 2617, - EndPos: 2619, + StartPos: 2410, + EndPos: 2412, }, }, Stmts: []ast.Vertex{}, @@ -7091,8 +6776,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 111, EndLine: 111, - StartPos: 2622, - EndPos: 2624, + StartPos: 2413, + EndPos: 2415, }, }, }, @@ -7101,8 +6786,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 111, EndLine: 111, - StartPos: 2624, - EndPos: 2637, + StartPos: 2415, + EndPos: 2428, }, }, Value: []byte("
"), @@ -7112,8 +6797,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2642, - EndPos: 2658, + StartPos: 2431, + EndPos: 2447, }, }, InterfaceName: &ast.Identifier{ @@ -7121,8 +6806,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 112, EndLine: 112, - StartPos: 2652, - EndPos: 2655, + StartPos: 2441, + EndPos: 2444, }, }, Value: []byte("Foo"), @@ -7134,8 +6819,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2661, - EndPos: 2689, + StartPos: 2448, + EndPos: 2476, }, }, InterfaceName: &ast.Identifier{ @@ -7143,8 +6828,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2671, - EndPos: 2674, + StartPos: 2458, + EndPos: 2461, }, }, Value: []byte("Foo"), @@ -7154,8 +6839,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2675, - EndPos: 2686, + StartPos: 2462, + EndPos: 2473, }, }, InterfaceNames: []ast.Vertex{ @@ -7164,8 +6849,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2683, - EndPos: 2686, + StartPos: 2470, + EndPos: 2473, }, }, Parts: []ast.Vertex{ @@ -7174,8 +6859,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 113, EndLine: 113, - StartPos: 2683, - EndPos: 2686, + StartPos: 2470, + EndPos: 2473, }, }, Value: []byte("Bar"), @@ -7191,8 +6876,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2692, - EndPos: 2725, + StartPos: 2477, + EndPos: 2510, }, }, InterfaceName: &ast.Identifier{ @@ -7200,8 +6885,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2702, - EndPos: 2705, + StartPos: 2487, + EndPos: 2490, }, }, Value: []byte("Foo"), @@ -7211,8 +6896,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2706, - EndPos: 2722, + StartPos: 2491, + EndPos: 2507, }, }, InterfaceNames: []ast.Vertex{ @@ -7221,8 +6906,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2714, - EndPos: 2717, + StartPos: 2499, + EndPos: 2502, }, }, Parts: []ast.Vertex{ @@ -7231,8 +6916,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2714, - EndPos: 2717, + StartPos: 2499, + EndPos: 2502, }, }, Value: []byte("Bar"), @@ -7244,8 +6929,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2719, - EndPos: 2722, + StartPos: 2504, + EndPos: 2507, }, }, Parts: []ast.Vertex{ @@ -7254,8 +6939,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 114, EndLine: 114, - StartPos: 2719, - EndPos: 2722, + StartPos: 2504, + EndPos: 2507, }, }, Value: []byte("Baz"), @@ -7271,8 +6956,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 115, EndLine: 115, - StartPos: 2728, - EndPos: 2742, + StartPos: 2511, + EndPos: 2525, }, }, NamespaceName: &ast.NameName{ @@ -7280,8 +6965,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 115, EndLine: 115, - StartPos: 2738, - EndPos: 2741, + StartPos: 2521, + EndPos: 2524, }, }, Parts: []ast.Vertex{ @@ -7290,8 +6975,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 115, EndLine: 115, - StartPos: 2738, - EndPos: 2741, + StartPos: 2521, + EndPos: 2524, }, }, Value: []byte("Foo"), @@ -7304,8 +6989,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 116, EndLine: 116, - StartPos: 2745, - EndPos: 2761, + StartPos: 2526, + EndPos: 2542, }, }, NamespaceName: &ast.NameName{ @@ -7313,8 +6998,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 116, EndLine: 116, - StartPos: 2755, - EndPos: 2758, + StartPos: 2536, + EndPos: 2539, }, }, Parts: []ast.Vertex{ @@ -7323,8 +7008,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 116, EndLine: 116, - StartPos: 2755, - EndPos: 2758, + StartPos: 2536, + EndPos: 2539, }, }, Value: []byte("Foo"), @@ -7338,8 +7023,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 117, EndLine: 117, - StartPos: 2764, - EndPos: 2776, + StartPos: 2543, + EndPos: 2555, }, }, Stmts: []ast.Vertex{}, @@ -7349,8 +7034,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2779, - EndPos: 2798, + StartPos: 2556, + EndPos: 2575, }, }, ClassName: &ast.Identifier{ @@ -7358,8 +7043,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2785, - EndPos: 2788, + StartPos: 2562, + EndPos: 2565, }, }, Value: []byte("foo"), @@ -7370,8 +7055,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2790, - EndPos: 2797, + StartPos: 2567, + EndPos: 2574, }, }, Modifiers: []ast.Vertex{ @@ -7380,8 +7065,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2790, - EndPos: 2793, + StartPos: 2567, + EndPos: 2570, }, }, Value: []byte("var"), @@ -7393,8 +7078,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2794, - EndPos: 2796, + StartPos: 2571, + EndPos: 2573, }, }, Var: &ast.ExprVariable{ @@ -7402,8 +7087,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2794, - EndPos: 2796, + StartPos: 2571, + EndPos: 2573, }, }, VarName: &ast.Identifier{ @@ -7411,8 +7096,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 118, EndLine: 118, - StartPos: 2794, - EndPos: 2796, + StartPos: 2571, + EndPos: 2573, }, }, Value: []byte("$a"), @@ -7428,8 +7113,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2801, - EndPos: 2838, + StartPos: 2576, + EndPos: 2613, }, }, ClassName: &ast.Identifier{ @@ -7437,8 +7122,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2807, - EndPos: 2810, + StartPos: 2582, + EndPos: 2585, }, }, Value: []byte("foo"), @@ -7449,8 +7134,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2812, - EndPos: 2837, + StartPos: 2587, + EndPos: 2612, }, }, Modifiers: []ast.Vertex{ @@ -7459,8 +7144,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2812, - EndPos: 2818, + StartPos: 2587, + EndPos: 2593, }, }, Value: []byte("public"), @@ -7470,8 +7155,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2819, - EndPos: 2825, + StartPos: 2594, + EndPos: 2600, }, }, Value: []byte("static"), @@ -7483,8 +7168,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2826, - EndPos: 2828, + StartPos: 2601, + EndPos: 2603, }, }, Var: &ast.ExprVariable{ @@ -7492,8 +7177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2826, - EndPos: 2828, + StartPos: 2601, + EndPos: 2603, }, }, VarName: &ast.Identifier{ @@ -7501,8 +7186,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2826, - EndPos: 2828, + StartPos: 2601, + EndPos: 2603, }, }, Value: []byte("$a"), @@ -7514,8 +7199,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2830, - EndPos: 2836, + StartPos: 2605, + EndPos: 2611, }, }, Var: &ast.ExprVariable{ @@ -7523,8 +7208,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2830, - EndPos: 2832, + StartPos: 2605, + EndPos: 2607, }, }, VarName: &ast.Identifier{ @@ -7532,8 +7217,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2830, - EndPos: 2832, + StartPos: 2605, + EndPos: 2607, }, }, Value: []byte("$b"), @@ -7544,8 +7229,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 119, EndLine: 119, - StartPos: 2835, - EndPos: 2836, + StartPos: 2610, + EndPos: 2611, }, }, Value: []byte("1"), @@ -7560,8 +7245,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2841, - EndPos: 2859, + StartPos: 2614, + EndPos: 2632, }, }, Vars: []ast.Vertex{ @@ -7570,8 +7255,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2848, - EndPos: 2850, + StartPos: 2621, + EndPos: 2623, }, }, Var: &ast.ExprVariable{ @@ -7579,8 +7264,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2848, - EndPos: 2850, + StartPos: 2621, + EndPos: 2623, }, }, VarName: &ast.Identifier{ @@ -7588,8 +7273,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2848, - EndPos: 2850, + StartPos: 2621, + EndPos: 2623, }, }, Value: []byte("$a"), @@ -7601,8 +7286,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2852, - EndPos: 2858, + StartPos: 2625, + EndPos: 2631, }, }, Var: &ast.ExprVariable{ @@ -7610,8 +7295,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2852, - EndPos: 2854, + StartPos: 2625, + EndPos: 2627, }, }, VarName: &ast.Identifier{ @@ -7619,8 +7304,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2852, - EndPos: 2854, + StartPos: 2625, + EndPos: 2627, }, }, Value: []byte("$b"), @@ -7631,8 +7316,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 120, EndLine: 120, - StartPos: 2857, - EndPos: 2858, + StartPos: 2630, + EndPos: 2631, }, }, Value: []byte("1"), @@ -7645,8 +7330,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 122, EndLine: 126, - StartPos: 2863, - EndPos: 2922, + StartPos: 2634, + EndPos: 2694, }, }, Cond: &ast.ScalarLnumber{ @@ -7654,8 +7339,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 122, EndLine: 122, - StartPos: 2871, - EndPos: 2872, + StartPos: 2642, + EndPos: 2643, }, }, Value: []byte("1"), @@ -7665,7 +7350,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 123, EndLine: -1, - StartPos: 2879, + StartPos: 2651, EndPos: -1, }, }, @@ -7675,7 +7360,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 123, EndLine: -1, - StartPos: 2879, + StartPos: 2651, EndPos: -1, }, }, @@ -7684,8 +7369,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 123, EndLine: 123, - StartPos: 2884, - EndPos: 2885, + StartPos: 2656, + EndPos: 2657, }, }, Value: []byte("1"), @@ -7697,7 +7382,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 124, EndLine: -1, - StartPos: 2890, + StartPos: 2663, EndPos: -1, }, }, @@ -7708,7 +7393,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 125, EndLine: -1, - StartPos: 2902, + StartPos: 2676, EndPos: -1, }, }, @@ -7717,8 +7402,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 125, EndLine: 125, - StartPos: 2907, - EndPos: 2908, + StartPos: 2681, + EndPos: 2682, }, }, Value: []byte("2"), @@ -7733,8 +7418,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 128, EndLine: 131, - StartPos: 2926, - EndPos: 2974, + StartPos: 2696, + EndPos: 2744, }, }, Cond: &ast.ScalarLnumber{ @@ -7742,8 +7427,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 128, EndLine: 128, - StartPos: 2934, - EndPos: 2935, + StartPos: 2704, + EndPos: 2705, }, }, Value: []byte("1"), @@ -7753,7 +7438,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 129, EndLine: -1, - StartPos: 2943, + StartPos: 2714, EndPos: -1, }, }, @@ -7763,7 +7448,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 129, EndLine: -1, - StartPos: 2943, + StartPos: 2714, EndPos: -1, }, }, @@ -7772,8 +7457,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 129, EndLine: 129, - StartPos: 2948, - EndPos: 2949, + StartPos: 2719, + EndPos: 2720, }, }, Value: []byte("1"), @@ -7785,7 +7470,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 130, EndLine: -1, - StartPos: 2954, + StartPos: 2726, EndPos: -1, }, }, @@ -7794,8 +7479,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 130, EndLine: 130, - StartPos: 2959, - EndPos: 2960, + StartPos: 2731, + EndPos: 2732, }, }, Value: []byte("2"), @@ -7810,8 +7495,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 133, EndLine: 136, - StartPos: 2980, - EndPos: 3032, + StartPos: 2746, + EndPos: 2798, }, }, Cond: &ast.ScalarLnumber{ @@ -7819,8 +7504,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 133, EndLine: 133, - StartPos: 2988, - EndPos: 2989, + StartPos: 2754, + EndPos: 2755, }, }, Value: []byte("1"), @@ -7830,8 +7515,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 133, EndLine: 136, - StartPos: 2991, - EndPos: 3032, + StartPos: 2757, + EndPos: 2798, }, }, Cases: []ast.Vertex{ @@ -7840,8 +7525,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 134, EndLine: 134, - StartPos: 2996, - EndPos: 3010, + StartPos: 2763, + EndPos: 2777, }, }, Cond: &ast.ScalarLnumber{ @@ -7849,8 +7534,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 134, EndLine: 134, - StartPos: 3001, - EndPos: 3002, + StartPos: 2768, + EndPos: 2769, }, }, Value: []byte("1"), @@ -7861,8 +7546,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 134, EndLine: 134, - StartPos: 3004, - EndPos: 3010, + StartPos: 2771, + EndPos: 2777, }, }, }, @@ -7873,8 +7558,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 3014, - EndPos: 3028, + StartPos: 2782, + EndPos: 2796, }, }, Cond: &ast.ScalarLnumber{ @@ -7882,8 +7567,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 3019, - EndPos: 3020, + StartPos: 2787, + EndPos: 2788, }, }, Value: []byte("2"), @@ -7894,8 +7579,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 135, EndLine: 135, - StartPos: 3022, - EndPos: 3028, + StartPos: 2790, + EndPos: 2796, }, }, }, @@ -7909,8 +7594,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 138, EndLine: 141, - StartPos: 3038, - EndPos: 3091, + StartPos: 2800, + EndPos: 2853, }, }, Cond: &ast.ScalarLnumber{ @@ -7918,8 +7603,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 138, EndLine: 138, - StartPos: 3046, - EndPos: 3047, + StartPos: 2808, + EndPos: 2809, }, }, Value: []byte("1"), @@ -7929,8 +7614,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 138, EndLine: 141, - StartPos: 3049, - EndPos: 3091, + StartPos: 2811, + EndPos: 2853, }, }, Cases: []ast.Vertex{ @@ -7939,8 +7624,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 139, EndLine: 139, - StartPos: 3055, - EndPos: 3069, + StartPos: 2818, + EndPos: 2832, }, }, Cond: &ast.ScalarLnumber{ @@ -7948,8 +7633,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 139, EndLine: 139, - StartPos: 3060, - EndPos: 3061, + StartPos: 2823, + EndPos: 2824, }, }, Value: []byte("1"), @@ -7960,8 +7645,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 139, EndLine: 139, - StartPos: 3063, - EndPos: 3069, + StartPos: 2826, + EndPos: 2832, }, }, }, @@ -7972,8 +7657,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3073, - EndPos: 3087, + StartPos: 2837, + EndPos: 2851, }, }, Cond: &ast.ScalarLnumber{ @@ -7981,8 +7666,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3078, - EndPos: 3079, + StartPos: 2842, + EndPos: 2843, }, }, Value: []byte("2"), @@ -7993,8 +7678,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 140, EndLine: 140, - StartPos: 3081, - EndPos: 3087, + StartPos: 2845, + EndPos: 2851, }, }, }, @@ -8008,8 +7693,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3095, - EndPos: 3104, + StartPos: 2855, + EndPos: 2864, }, }, Expr: &ast.ExprVariable{ @@ -8017,8 +7702,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3101, - EndPos: 3103, + StartPos: 2861, + EndPos: 2863, }, }, VarName: &ast.Identifier{ @@ -8026,8 +7711,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 143, EndLine: 143, - StartPos: 3101, - EndPos: 3103, + StartPos: 2861, + EndPos: 2863, }, }, Value: []byte("$e"), @@ -8039,8 +7724,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 145, EndLine: 145, - StartPos: 3108, - EndPos: 3120, + StartPos: 2866, + EndPos: 2878, }, }, TraitName: &ast.Identifier{ @@ -8048,8 +7733,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 145, EndLine: 145, - StartPos: 3114, - EndPos: 3117, + StartPos: 2872, + EndPos: 2875, }, }, Value: []byte("Foo"), @@ -8061,8 +7746,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3123, - EndPos: 3145, + StartPos: 2879, + EndPos: 2901, }, }, ClassName: &ast.Identifier{ @@ -8070,8 +7755,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3129, - EndPos: 3132, + StartPos: 2885, + EndPos: 2888, }, }, Value: []byte("Foo"), @@ -8082,8 +7767,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3135, - EndPos: 3143, + StartPos: 2891, + EndPos: 2899, }, }, Traits: []ast.Vertex{ @@ -8092,8 +7777,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3139, - EndPos: 3142, + StartPos: 2895, + EndPos: 2898, }, }, Parts: []ast.Vertex{ @@ -8102,8 +7787,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3139, - EndPos: 3142, + StartPos: 2895, + EndPos: 2898, }, }, Value: []byte("Bar"), @@ -8116,8 +7801,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 146, EndLine: 146, - StartPos: 3142, - EndPos: 3143, + StartPos: 2898, + EndPos: 2899, }, }, }, @@ -8129,8 +7814,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3148, - EndPos: 3177, + StartPos: 2902, + EndPos: 2931, }, }, ClassName: &ast.Identifier{ @@ -8138,8 +7823,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3154, - EndPos: 3157, + StartPos: 2908, + EndPos: 2911, }, }, Value: []byte("Foo"), @@ -8150,8 +7835,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3160, - EndPos: 3175, + StartPos: 2914, + EndPos: 2929, }, }, Traits: []ast.Vertex{ @@ -8160,8 +7845,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3164, - EndPos: 3167, + StartPos: 2918, + EndPos: 2921, }, }, Parts: []ast.Vertex{ @@ -8170,8 +7855,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3164, - EndPos: 3167, + StartPos: 2918, + EndPos: 2921, }, }, Value: []byte("Bar"), @@ -8183,8 +7868,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3169, - EndPos: 3172, + StartPos: 2923, + EndPos: 2926, }, }, Parts: []ast.Vertex{ @@ -8193,8 +7878,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3169, - EndPos: 3172, + StartPos: 2923, + EndPos: 2926, }, }, Value: []byte("Baz"), @@ -8207,8 +7892,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 147, EndLine: 147, - StartPos: 3173, - EndPos: 3175, + StartPos: 2927, + EndPos: 2929, }, }, }, @@ -8220,8 +7905,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3180, - EndPos: 3226, + StartPos: 2932, + EndPos: 2978, }, }, ClassName: &ast.Identifier{ @@ -8229,8 +7914,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3186, - EndPos: 3189, + StartPos: 2938, + EndPos: 2941, }, }, Value: []byte("Foo"), @@ -8241,8 +7926,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3192, - EndPos: 3224, + StartPos: 2944, + EndPos: 2976, }, }, Traits: []ast.Vertex{ @@ -8251,8 +7936,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3196, - EndPos: 3199, + StartPos: 2948, + EndPos: 2951, }, }, Parts: []ast.Vertex{ @@ -8261,8 +7946,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3196, - EndPos: 3199, + StartPos: 2948, + EndPos: 2951, }, }, Value: []byte("Bar"), @@ -8274,8 +7959,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3201, - EndPos: 3204, + StartPos: 2953, + EndPos: 2956, }, }, Parts: []ast.Vertex{ @@ -8284,8 +7969,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3201, - EndPos: 3204, + StartPos: 2953, + EndPos: 2956, }, }, Value: []byte("Baz"), @@ -8298,8 +7983,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3205, - EndPos: 3224, + StartPos: 2957, + EndPos: 2976, }, }, Adaptations: []ast.Vertex{ @@ -8308,8 +7993,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3207, - EndPos: 3221, + StartPos: 2959, + EndPos: 2973, }, }, Ref: &ast.StmtTraitMethodRef{ @@ -8317,8 +8002,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3207, - EndPos: 3210, + StartPos: 2959, + EndPos: 2962, }, }, Method: &ast.Identifier{ @@ -8326,8 +8011,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3207, - EndPos: 3210, + StartPos: 2959, + EndPos: 2962, }, }, Value: []byte("one"), @@ -8338,8 +8023,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 148, EndLine: 148, - StartPos: 3214, - EndPos: 3221, + StartPos: 2966, + EndPos: 2973, }, }, Value: []byte("include"), @@ -8355,8 +8040,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3229, - EndPos: 3274, + StartPos: 2979, + EndPos: 3024, }, }, ClassName: &ast.Identifier{ @@ -8364,8 +8049,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3235, - EndPos: 3238, + StartPos: 2985, + EndPos: 2988, }, }, Value: []byte("Foo"), @@ -8376,8 +8061,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3241, - EndPos: 3272, + StartPos: 2991, + EndPos: 3022, }, }, Traits: []ast.Vertex{ @@ -8386,8 +8071,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3245, - EndPos: 3248, + StartPos: 2995, + EndPos: 2998, }, }, Parts: []ast.Vertex{ @@ -8396,8 +8081,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3245, - EndPos: 3248, + StartPos: 2995, + EndPos: 2998, }, }, Value: []byte("Bar"), @@ -8409,8 +8094,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3250, - EndPos: 3253, + StartPos: 3000, + EndPos: 3003, }, }, Parts: []ast.Vertex{ @@ -8419,8 +8104,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3250, - EndPos: 3253, + StartPos: 3000, + EndPos: 3003, }, }, Value: []byte("Baz"), @@ -8433,8 +8118,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3254, - EndPos: 3272, + StartPos: 3004, + EndPos: 3022, }, }, Adaptations: []ast.Vertex{ @@ -8443,8 +8128,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3256, - EndPos: 3269, + StartPos: 3006, + EndPos: 3019, }, }, Ref: &ast.StmtTraitMethodRef{ @@ -8452,8 +8137,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3256, - EndPos: 3259, + StartPos: 3006, + EndPos: 3009, }, }, Method: &ast.Identifier{ @@ -8461,8 +8146,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3256, - EndPos: 3259, + StartPos: 3006, + EndPos: 3009, }, }, Value: []byte("one"), @@ -8473,8 +8158,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 149, EndLine: 149, - StartPos: 3263, - EndPos: 3269, + StartPos: 3013, + EndPos: 3019, }, }, Value: []byte("public"), @@ -8490,8 +8175,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3277, - EndPos: 3326, + StartPos: 3025, + EndPos: 3074, }, }, ClassName: &ast.Identifier{ @@ -8499,8 +8184,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3283, - EndPos: 3286, + StartPos: 3031, + EndPos: 3034, }, }, Value: []byte("Foo"), @@ -8511,8 +8196,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3289, - EndPos: 3324, + StartPos: 3037, + EndPos: 3072, }, }, Traits: []ast.Vertex{ @@ -8521,8 +8206,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3293, - EndPos: 3296, + StartPos: 3041, + EndPos: 3044, }, }, Parts: []ast.Vertex{ @@ -8531,8 +8216,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3293, - EndPos: 3296, + StartPos: 3041, + EndPos: 3044, }, }, Value: []byte("Bar"), @@ -8544,8 +8229,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3298, - EndPos: 3301, + StartPos: 3046, + EndPos: 3049, }, }, Parts: []ast.Vertex{ @@ -8554,8 +8239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3298, - EndPos: 3301, + StartPos: 3046, + EndPos: 3049, }, }, Value: []byte("Baz"), @@ -8568,8 +8253,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3302, - EndPos: 3324, + StartPos: 3050, + EndPos: 3072, }, }, Adaptations: []ast.Vertex{ @@ -8578,8 +8263,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3304, - EndPos: 3321, + StartPos: 3052, + EndPos: 3069, }, }, Ref: &ast.StmtTraitMethodRef{ @@ -8587,8 +8272,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3304, - EndPos: 3307, + StartPos: 3052, + EndPos: 3055, }, }, Method: &ast.Identifier{ @@ -8596,8 +8281,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3304, - EndPos: 3307, + StartPos: 3052, + EndPos: 3055, }, }, Value: []byte("one"), @@ -8608,8 +8293,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3311, - EndPos: 3317, + StartPos: 3059, + EndPos: 3065, }, }, Value: []byte("public"), @@ -8619,8 +8304,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 150, EndLine: 150, - StartPos: 3318, - EndPos: 3321, + StartPos: 3066, + EndPos: 3069, }, }, Value: []byte("two"), @@ -8636,8 +8321,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3329, - EndPos: 3406, + StartPos: 3075, + EndPos: 3152, }, }, ClassName: &ast.Identifier{ @@ -8645,8 +8330,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3335, - EndPos: 3338, + StartPos: 3081, + EndPos: 3084, }, }, Value: []byte("Foo"), @@ -8657,8 +8342,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3341, - EndPos: 3404, + StartPos: 3087, + EndPos: 3150, }, }, Traits: []ast.Vertex{ @@ -8667,8 +8352,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3345, - EndPos: 3348, + StartPos: 3091, + EndPos: 3094, }, }, Parts: []ast.Vertex{ @@ -8677,8 +8362,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3345, - EndPos: 3348, + StartPos: 3091, + EndPos: 3094, }, }, Value: []byte("Bar"), @@ -8690,8 +8375,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3350, - EndPos: 3353, + StartPos: 3096, + EndPos: 3099, }, }, Parts: []ast.Vertex{ @@ -8700,8 +8385,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3350, - EndPos: 3353, + StartPos: 3096, + EndPos: 3099, }, }, Value: []byte("Baz"), @@ -8714,8 +8399,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3354, - EndPos: 3404, + StartPos: 3100, + EndPos: 3150, }, }, Adaptations: []ast.Vertex{ @@ -8724,8 +8409,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3356, - EndPos: 3384, + StartPos: 3102, + EndPos: 3130, }, }, Ref: &ast.StmtTraitMethodRef{ @@ -8733,8 +8418,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3356, - EndPos: 3364, + StartPos: 3102, + EndPos: 3110, }, }, Trait: &ast.NameName{ @@ -8742,8 +8427,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3356, - EndPos: 3359, + StartPos: 3102, + EndPos: 3105, }, }, Parts: []ast.Vertex{ @@ -8752,8 +8437,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3356, - EndPos: 3359, + StartPos: 3102, + EndPos: 3105, }, }, Value: []byte("Bar"), @@ -8765,8 +8450,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3361, - EndPos: 3364, + StartPos: 3107, + EndPos: 3110, }, }, Value: []byte("one"), @@ -8778,8 +8463,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3375, - EndPos: 3378, + StartPos: 3121, + EndPos: 3124, }, }, Parts: []ast.Vertex{ @@ -8788,8 +8473,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3375, - EndPos: 3378, + StartPos: 3121, + EndPos: 3124, }, }, Value: []byte("Baz"), @@ -8801,8 +8486,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3380, - EndPos: 3384, + StartPos: 3126, + EndPos: 3130, }, }, Parts: []ast.Vertex{ @@ -8811,8 +8496,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3380, - EndPos: 3384, + StartPos: 3126, + EndPos: 3130, }, }, Value: []byte("Quux"), @@ -8826,8 +8511,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3386, - EndPos: 3401, + StartPos: 3132, + EndPos: 3147, }, }, Ref: &ast.StmtTraitMethodRef{ @@ -8835,8 +8520,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3386, - EndPos: 3394, + StartPos: 3132, + EndPos: 3140, }, }, Trait: &ast.NameName{ @@ -8844,8 +8529,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3386, - EndPos: 3389, + StartPos: 3132, + EndPos: 3135, }, }, Parts: []ast.Vertex{ @@ -8854,8 +8539,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3386, - EndPos: 3389, + StartPos: 3132, + EndPos: 3135, }, }, Value: []byte("Baz"), @@ -8867,8 +8552,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3391, - EndPos: 3394, + StartPos: 3137, + EndPos: 3140, }, }, Value: []byte("one"), @@ -8879,8 +8564,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 151, EndLine: 151, - StartPos: 3398, - EndPos: 3401, + StartPos: 3144, + EndPos: 3147, }, }, Value: []byte("two"), @@ -8896,7 +8581,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 153, EndLine: -1, - StartPos: 3410, + StartPos: 3154, EndPos: -1, }, }, @@ -8908,8 +8593,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3419, - EndPos: 3449, + StartPos: 3161, + EndPos: 3191, }, }, Stmts: []ast.Vertex{}, @@ -8919,8 +8604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3426, - EndPos: 3449, + StartPos: 3168, + EndPos: 3191, }, }, Types: []ast.Vertex{ @@ -8929,8 +8614,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3433, - EndPos: 3442, + StartPos: 3175, + EndPos: 3184, }, }, Parts: []ast.Vertex{ @@ -8939,8 +8624,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3433, - EndPos: 3442, + StartPos: 3175, + EndPos: 3184, }, }, Value: []byte("Exception"), @@ -8953,8 +8638,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3443, - EndPos: 3445, + StartPos: 3185, + EndPos: 3187, }, }, VarName: &ast.Identifier{ @@ -8962,8 +8647,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 154, EndLine: 154, - StartPos: 3443, - EndPos: 3445, + StartPos: 3185, + EndPos: 3187, }, }, Value: []byte("$e"), @@ -8978,8 +8663,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3452, - EndPos: 3499, + StartPos: 3192, + EndPos: 3239, }, }, Stmts: []ast.Vertex{}, @@ -8989,8 +8674,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3459, - EndPos: 3499, + StartPos: 3199, + EndPos: 3239, }, }, Types: []ast.Vertex{ @@ -8999,8 +8684,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3466, - EndPos: 3475, + StartPos: 3206, + EndPos: 3215, }, }, Parts: []ast.Vertex{ @@ -9009,8 +8694,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3466, - EndPos: 3475, + StartPos: 3206, + EndPos: 3215, }, }, Value: []byte("Exception"), @@ -9022,8 +8707,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3476, - EndPos: 3492, + StartPos: 3216, + EndPos: 3232, }, }, Parts: []ast.Vertex{ @@ -9032,8 +8717,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3476, - EndPos: 3492, + StartPos: 3216, + EndPos: 3232, }, }, Value: []byte("RuntimeException"), @@ -9046,8 +8731,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3493, - EndPos: 3495, + StartPos: 3233, + EndPos: 3235, }, }, VarName: &ast.Identifier{ @@ -9055,8 +8740,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 155, EndLine: 155, - StartPos: 3493, - EndPos: 3495, + StartPos: 3233, + EndPos: 3235, }, }, Value: []byte("$e"), @@ -9071,8 +8756,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3502, - EndPos: 3563, + StartPos: 3240, + EndPos: 3301, }, }, Stmts: []ast.Vertex{}, @@ -9082,8 +8767,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3509, - EndPos: 3532, + StartPos: 3247, + EndPos: 3270, }, }, Types: []ast.Vertex{ @@ -9092,8 +8777,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3516, - EndPos: 3525, + StartPos: 3254, + EndPos: 3263, }, }, Parts: []ast.Vertex{ @@ -9102,8 +8787,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3516, - EndPos: 3525, + StartPos: 3254, + EndPos: 3263, }, }, Value: []byte("Exception"), @@ -9116,8 +8801,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3526, - EndPos: 3528, + StartPos: 3264, + EndPos: 3266, }, }, VarName: &ast.Identifier{ @@ -9125,8 +8810,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3526, - EndPos: 3528, + StartPos: 3264, + EndPos: 3266, }, }, Value: []byte("$e"), @@ -9139,8 +8824,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3533, - EndPos: 3563, + StartPos: 3271, + EndPos: 3301, }, }, Types: []ast.Vertex{ @@ -9149,8 +8834,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3540, - EndPos: 3556, + StartPos: 3278, + EndPos: 3294, }, }, Parts: []ast.Vertex{ @@ -9159,8 +8844,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3540, - EndPos: 3556, + StartPos: 3278, + EndPos: 3294, }, }, Value: []byte("RuntimeException"), @@ -9173,8 +8858,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3557, - EndPos: 3559, + StartPos: 3295, + EndPos: 3297, }, }, VarName: &ast.Identifier{ @@ -9182,8 +8867,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 156, EndLine: 156, - StartPos: 3557, - EndPos: 3559, + StartPos: 3295, + EndPos: 3297, }, }, Value: []byte("$e"), @@ -9198,8 +8883,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3566, - EndPos: 3607, + StartPos: 3302, + EndPos: 3343, }, }, Stmts: []ast.Vertex{}, @@ -9209,8 +8894,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3573, - EndPos: 3596, + StartPos: 3309, + EndPos: 3332, }, }, Types: []ast.Vertex{ @@ -9219,8 +8904,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3580, - EndPos: 3589, + StartPos: 3316, + EndPos: 3325, }, }, Parts: []ast.Vertex{ @@ -9229,8 +8914,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3580, - EndPos: 3589, + StartPos: 3316, + EndPos: 3325, }, }, Value: []byte("Exception"), @@ -9243,8 +8928,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3590, - EndPos: 3592, + StartPos: 3326, + EndPos: 3328, }, }, VarName: &ast.Identifier{ @@ -9252,8 +8937,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3590, - EndPos: 3592, + StartPos: 3326, + EndPos: 3328, }, }, Value: []byte("$e"), @@ -9267,8 +8952,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 157, EndLine: 157, - StartPos: 3597, - EndPos: 3607, + StartPos: 3333, + EndPos: 3343, }, }, Stmts: []ast.Vertex{}, @@ -9279,8 +8964,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3611, - EndPos: 3626, + StartPos: 3345, + EndPos: 3360, }, }, Vars: []ast.Vertex{ @@ -9289,8 +8974,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3617, - EndPos: 3619, + StartPos: 3351, + EndPos: 3353, }, }, VarName: &ast.Identifier{ @@ -9298,8 +8983,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3617, - EndPos: 3619, + StartPos: 3351, + EndPos: 3353, }, }, Value: []byte("$a"), @@ -9310,8 +8995,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3621, - EndPos: 3623, + StartPos: 3355, + EndPos: 3357, }, }, VarName: &ast.Identifier{ @@ -9319,8 +9004,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 159, EndLine: 159, - StartPos: 3621, - EndPos: 3623, + StartPos: 3355, + EndPos: 3357, }, }, Value: []byte("$b"), @@ -9333,8 +9018,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3630, - EndPos: 3638, + StartPos: 3362, + EndPos: 3370, }, }, Uses: []ast.Vertex{ @@ -9343,8 +9028,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3634, - EndPos: 3637, + StartPos: 3366, + EndPos: 3369, }, }, Use: &ast.NameName{ @@ -9352,8 +9037,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3634, - EndPos: 3637, + StartPos: 3366, + EndPos: 3369, }, }, Parts: []ast.Vertex{ @@ -9362,8 +9047,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 161, EndLine: 161, - StartPos: 3634, - EndPos: 3637, + StartPos: 3366, + EndPos: 3369, }, }, Value: []byte("Foo"), @@ -9378,8 +9063,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3641, - EndPos: 3650, + StartPos: 3371, + EndPos: 3380, }, }, Uses: []ast.Vertex{ @@ -9388,8 +9073,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3646, - EndPos: 3649, + StartPos: 3376, + EndPos: 3379, }, }, Use: &ast.NameName{ @@ -9397,8 +9082,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3646, - EndPos: 3649, + StartPos: 3376, + EndPos: 3379, }, }, Parts: []ast.Vertex{ @@ -9407,8 +9092,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3646, - EndPos: 3649, + StartPos: 3376, + EndPos: 3379, }, }, Value: []byte("Foo"), @@ -9423,8 +9108,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3653, - EndPos: 3669, + StartPos: 3381, + EndPos: 3397, }, }, Uses: []ast.Vertex{ @@ -9433,8 +9118,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3658, - EndPos: 3668, + StartPos: 3386, + EndPos: 3396, }, }, Use: &ast.NameName{ @@ -9442,8 +9127,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3658, - EndPos: 3661, + StartPos: 3386, + EndPos: 3389, }, }, Parts: []ast.Vertex{ @@ -9452,8 +9137,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3658, - EndPos: 3661, + StartPos: 3386, + EndPos: 3389, }, }, Value: []byte("Foo"), @@ -9465,8 +9150,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3665, - EndPos: 3668, + StartPos: 3393, + EndPos: 3396, }, }, Value: []byte("Bar"), @@ -9479,8 +9164,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3672, - EndPos: 3685, + StartPos: 3398, + EndPos: 3411, }, }, Uses: []ast.Vertex{ @@ -9489,8 +9174,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3676, - EndPos: 3679, + StartPos: 3402, + EndPos: 3405, }, }, Use: &ast.NameName{ @@ -9498,8 +9183,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3676, - EndPos: 3679, + StartPos: 3402, + EndPos: 3405, }, }, Parts: []ast.Vertex{ @@ -9508,8 +9193,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3676, - EndPos: 3679, + StartPos: 3402, + EndPos: 3405, }, }, Value: []byte("Foo"), @@ -9522,8 +9207,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3681, - EndPos: 3684, + StartPos: 3407, + EndPos: 3410, }, }, Use: &ast.NameName{ @@ -9531,8 +9216,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3681, - EndPos: 3684, + StartPos: 3407, + EndPos: 3410, }, }, Parts: []ast.Vertex{ @@ -9541,8 +9226,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 164, EndLine: 164, - StartPos: 3681, - EndPos: 3684, + StartPos: 3407, + EndPos: 3410, }, }, Value: []byte("Bar"), @@ -9557,8 +9242,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3688, - EndPos: 3708, + StartPos: 3412, + EndPos: 3432, }, }, Uses: []ast.Vertex{ @@ -9567,8 +9252,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3692, - EndPos: 3695, + StartPos: 3416, + EndPos: 3419, }, }, Use: &ast.NameName{ @@ -9576,8 +9261,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3692, - EndPos: 3695, + StartPos: 3416, + EndPos: 3419, }, }, Parts: []ast.Vertex{ @@ -9586,8 +9271,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3692, - EndPos: 3695, + StartPos: 3416, + EndPos: 3419, }, }, Value: []byte("Foo"), @@ -9600,8 +9285,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3697, - EndPos: 3707, + StartPos: 3421, + EndPos: 3431, }, }, Use: &ast.NameName{ @@ -9609,8 +9294,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3697, - EndPos: 3700, + StartPos: 3421, + EndPos: 3424, }, }, Parts: []ast.Vertex{ @@ -9619,8 +9304,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3697, - EndPos: 3700, + StartPos: 3421, + EndPos: 3424, }, }, Value: []byte("Bar"), @@ -9632,8 +9317,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 165, EndLine: 165, - StartPos: 3704, - EndPos: 3707, + StartPos: 3428, + EndPos: 3431, }, }, Value: []byte("Baz"), @@ -9646,8 +9331,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3711, - EndPos: 3734, + StartPos: 3433, + EndPos: 3456, }, }, UseType: &ast.Identifier{ @@ -9655,8 +9340,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3715, - EndPos: 3723, + StartPos: 3437, + EndPos: 3445, }, }, Value: []byte("function"), @@ -9667,8 +9352,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3724, - EndPos: 3727, + StartPos: 3446, + EndPos: 3449, }, }, Use: &ast.NameName{ @@ -9676,8 +9361,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3724, - EndPos: 3727, + StartPos: 3446, + EndPos: 3449, }, }, Parts: []ast.Vertex{ @@ -9686,8 +9371,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3724, - EndPos: 3727, + StartPos: 3446, + EndPos: 3449, }, }, Value: []byte("Foo"), @@ -9700,8 +9385,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3730, - EndPos: 3733, + StartPos: 3452, + EndPos: 3455, }, }, Use: &ast.NameName{ @@ -9709,8 +9394,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3730, - EndPos: 3733, + StartPos: 3452, + EndPos: 3455, }, }, Parts: []ast.Vertex{ @@ -9719,8 +9404,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 166, EndLine: 166, - StartPos: 3730, - EndPos: 3733, + StartPos: 3452, + EndPos: 3455, }, }, Value: []byte("Bar"), @@ -9735,8 +9420,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3737, - EndPos: 3774, + StartPos: 3457, + EndPos: 3494, }, }, UseType: &ast.Identifier{ @@ -9744,8 +9429,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3741, - EndPos: 3749, + StartPos: 3461, + EndPos: 3469, }, }, Value: []byte("function"), @@ -9756,8 +9441,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3750, - EndPos: 3760, + StartPos: 3470, + EndPos: 3480, }, }, Use: &ast.NameName{ @@ -9765,8 +9450,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3750, - EndPos: 3753, + StartPos: 3470, + EndPos: 3473, }, }, Parts: []ast.Vertex{ @@ -9775,8 +9460,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3750, - EndPos: 3753, + StartPos: 3470, + EndPos: 3473, }, }, Value: []byte("Foo"), @@ -9788,8 +9473,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3757, - EndPos: 3760, + StartPos: 3477, + EndPos: 3480, }, }, Value: []byte("foo"), @@ -9800,8 +9485,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3763, - EndPos: 3773, + StartPos: 3483, + EndPos: 3493, }, }, Use: &ast.NameName{ @@ -9809,8 +9494,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3763, - EndPos: 3766, + StartPos: 3483, + EndPos: 3486, }, }, Parts: []ast.Vertex{ @@ -9819,8 +9504,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3763, - EndPos: 3766, + StartPos: 3483, + EndPos: 3486, }, }, Value: []byte("Bar"), @@ -9832,8 +9517,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 167, EndLine: 167, - StartPos: 3770, - EndPos: 3773, + StartPos: 3490, + EndPos: 3493, }, }, Value: []byte("bar"), @@ -9846,8 +9531,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3777, - EndPos: 3797, + StartPos: 3495, + EndPos: 3515, }, }, UseType: &ast.Identifier{ @@ -9855,8 +9540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3781, - EndPos: 3786, + StartPos: 3499, + EndPos: 3504, }, }, Value: []byte("const"), @@ -9867,8 +9552,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3787, - EndPos: 3790, + StartPos: 3505, + EndPos: 3508, }, }, Use: &ast.NameName{ @@ -9876,8 +9561,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3787, - EndPos: 3790, + StartPos: 3505, + EndPos: 3508, }, }, Parts: []ast.Vertex{ @@ -9886,8 +9571,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3787, - EndPos: 3790, + StartPos: 3505, + EndPos: 3508, }, }, Value: []byte("Foo"), @@ -9900,8 +9585,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3793, - EndPos: 3796, + StartPos: 3511, + EndPos: 3514, }, }, Use: &ast.NameName{ @@ -9909,8 +9594,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3793, - EndPos: 3796, + StartPos: 3511, + EndPos: 3514, }, }, Parts: []ast.Vertex{ @@ -9919,8 +9604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 168, EndLine: 168, - StartPos: 3793, - EndPos: 3796, + StartPos: 3511, + EndPos: 3514, }, }, Value: []byte("Bar"), @@ -9935,8 +9620,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3800, - EndPos: 3834, + StartPos: 3516, + EndPos: 3550, }, }, UseType: &ast.Identifier{ @@ -9944,8 +9629,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3804, - EndPos: 3809, + StartPos: 3520, + EndPos: 3525, }, }, Value: []byte("const"), @@ -9956,8 +9641,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3810, - EndPos: 3820, + StartPos: 3526, + EndPos: 3536, }, }, Use: &ast.NameName{ @@ -9965,8 +9650,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3810, - EndPos: 3813, + StartPos: 3526, + EndPos: 3529, }, }, Parts: []ast.Vertex{ @@ -9975,8 +9660,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3810, - EndPos: 3813, + StartPos: 3526, + EndPos: 3529, }, }, Value: []byte("Foo"), @@ -9988,8 +9673,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3817, - EndPos: 3820, + StartPos: 3533, + EndPos: 3536, }, }, Value: []byte("foo"), @@ -10000,8 +9685,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3823, - EndPos: 3833, + StartPos: 3539, + EndPos: 3549, }, }, Use: &ast.NameName{ @@ -10009,8 +9694,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3823, - EndPos: 3826, + StartPos: 3539, + EndPos: 3542, }, }, Parts: []ast.Vertex{ @@ -10019,8 +9704,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3823, - EndPos: 3826, + StartPos: 3539, + EndPos: 3542, }, }, Value: []byte("Bar"), @@ -10032,8 +9717,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 169, EndLine: 169, - StartPos: 3830, - EndPos: 3833, + StartPos: 3546, + EndPos: 3549, }, }, Value: []byte("bar"), @@ -10046,8 +9731,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3838, - EndPos: 3858, + StartPos: 3552, + EndPos: 3572, }, }, Prefix: &ast.NameName{ @@ -10055,8 +9740,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3843, - EndPos: 3846, + StartPos: 3557, + EndPos: 3560, }, }, Parts: []ast.Vertex{ @@ -10065,8 +9750,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3843, - EndPos: 3846, + StartPos: 3557, + EndPos: 3560, }, }, Value: []byte("Foo"), @@ -10079,8 +9764,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3848, - EndPos: 3851, + StartPos: 3562, + EndPos: 3565, }, }, Use: &ast.NameName{ @@ -10088,8 +9773,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3848, - EndPos: 3851, + StartPos: 3562, + EndPos: 3565, }, }, Parts: []ast.Vertex{ @@ -10098,8 +9783,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3848, - EndPos: 3851, + StartPos: 3562, + EndPos: 3565, }, }, Value: []byte("Bar"), @@ -10112,8 +9797,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3853, - EndPos: 3856, + StartPos: 3567, + EndPos: 3570, }, }, Use: &ast.NameName{ @@ -10121,8 +9806,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3853, - EndPos: 3856, + StartPos: 3567, + EndPos: 3570, }, }, Parts: []ast.Vertex{ @@ -10131,8 +9816,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3853, - EndPos: 3856, + StartPos: 3567, + EndPos: 3570, }, }, Value: []byte("Baz"), @@ -10147,8 +9832,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3861, - EndPos: 3888, + StartPos: 3573, + EndPos: 3600, }, }, Prefix: &ast.NameName{ @@ -10156,8 +9841,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3865, - EndPos: 3868, + StartPos: 3577, + EndPos: 3580, }, }, Parts: []ast.Vertex{ @@ -10166,8 +9851,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3865, - EndPos: 3868, + StartPos: 3577, + EndPos: 3580, }, }, Value: []byte("Foo"), @@ -10180,8 +9865,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3870, - EndPos: 3873, + StartPos: 3582, + EndPos: 3585, }, }, Use: &ast.NameName{ @@ -10189,8 +9874,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3870, - EndPos: 3873, + StartPos: 3582, + EndPos: 3585, }, }, Parts: []ast.Vertex{ @@ -10199,8 +9884,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3870, - EndPos: 3873, + StartPos: 3582, + EndPos: 3585, }, }, Value: []byte("Bar"), @@ -10213,8 +9898,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3875, - EndPos: 3886, + StartPos: 3587, + EndPos: 3598, }, }, Use: &ast.NameName{ @@ -10222,8 +9907,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3875, - EndPos: 3878, + StartPos: 3587, + EndPos: 3590, }, }, Parts: []ast.Vertex{ @@ -10232,8 +9917,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3875, - EndPos: 3878, + StartPos: 3587, + EndPos: 3590, }, }, Value: []byte("Baz"), @@ -10245,8 +9930,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 172, EndLine: 172, - StartPos: 3882, - EndPos: 3886, + StartPos: 3594, + EndPos: 3598, }, }, Value: []byte("quux"), @@ -10259,8 +9944,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3891, - EndPos: 3919, + StartPos: 3601, + EndPos: 3629, }, }, UseType: &ast.Identifier{ @@ -10268,8 +9953,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3895, - EndPos: 3903, + StartPos: 3605, + EndPos: 3613, }, }, Value: []byte("function"), @@ -10279,8 +9964,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3904, - EndPos: 3907, + StartPos: 3614, + EndPos: 3617, }, }, Parts: []ast.Vertex{ @@ -10289,8 +9974,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3904, - EndPos: 3907, + StartPos: 3614, + EndPos: 3617, }, }, Value: []byte("Foo"), @@ -10303,8 +9988,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3909, - EndPos: 3912, + StartPos: 3619, + EndPos: 3622, }, }, Use: &ast.NameName{ @@ -10312,8 +9997,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3909, - EndPos: 3912, + StartPos: 3619, + EndPos: 3622, }, }, Parts: []ast.Vertex{ @@ -10322,8 +10007,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3909, - EndPos: 3912, + StartPos: 3619, + EndPos: 3622, }, }, Value: []byte("Bar"), @@ -10336,8 +10021,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3914, - EndPos: 3917, + StartPos: 3624, + EndPos: 3627, }, }, Use: &ast.NameName{ @@ -10345,8 +10030,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3914, - EndPos: 3917, + StartPos: 3624, + EndPos: 3627, }, }, Parts: []ast.Vertex{ @@ -10355,8 +10040,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 173, EndLine: 173, - StartPos: 3914, - EndPos: 3917, + StartPos: 3624, + EndPos: 3627, }, }, Value: []byte("Baz"), @@ -10371,8 +10056,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3922, - EndPos: 3948, + StartPos: 3630, + EndPos: 3656, }, }, UseType: &ast.Identifier{ @@ -10380,8 +10065,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3926, - EndPos: 3931, + StartPos: 3634, + EndPos: 3639, }, }, Value: []byte("const"), @@ -10391,8 +10076,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3933, - EndPos: 3936, + StartPos: 3641, + EndPos: 3644, }, }, Parts: []ast.Vertex{ @@ -10401,8 +10086,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3933, - EndPos: 3936, + StartPos: 3641, + EndPos: 3644, }, }, Value: []byte("Foo"), @@ -10415,8 +10100,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3938, - EndPos: 3941, + StartPos: 3646, + EndPos: 3649, }, }, Use: &ast.NameName{ @@ -10424,8 +10109,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3938, - EndPos: 3941, + StartPos: 3646, + EndPos: 3649, }, }, Parts: []ast.Vertex{ @@ -10434,8 +10119,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3938, - EndPos: 3941, + StartPos: 3646, + EndPos: 3649, }, }, Value: []byte("Bar"), @@ -10448,8 +10133,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3943, - EndPos: 3946, + StartPos: 3651, + EndPos: 3654, }, }, Use: &ast.NameName{ @@ -10457,8 +10142,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3943, - EndPos: 3946, + StartPos: 3651, + EndPos: 3654, }, }, Parts: []ast.Vertex{ @@ -10467,8 +10152,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 174, EndLine: 174, - StartPos: 3943, - EndPos: 3946, + StartPos: 3651, + EndPos: 3654, }, }, Value: []byte("Baz"), @@ -10483,8 +10168,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3951, - EndPos: 3985, + StartPos: 3657, + EndPos: 3691, }, }, Prefix: &ast.NameName{ @@ -10492,8 +10177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3955, - EndPos: 3958, + StartPos: 3661, + EndPos: 3664, }, }, Parts: []ast.Vertex{ @@ -10502,8 +10187,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3955, - EndPos: 3958, + StartPos: 3661, + EndPos: 3664, }, }, Value: []byte("Foo"), @@ -10516,8 +10201,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3966, - EndPos: 3969, + StartPos: 3672, + EndPos: 3675, }, }, UseType: &ast.Identifier{ @@ -10525,8 +10210,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3960, - EndPos: 3965, + StartPos: 3666, + EndPos: 3671, }, }, Value: []byte("const"), @@ -10536,8 +10221,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3966, - EndPos: 3969, + StartPos: 3672, + EndPos: 3675, }, }, Parts: []ast.Vertex{ @@ -10546,8 +10231,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3966, - EndPos: 3969, + StartPos: 3672, + EndPos: 3675, }, }, Value: []byte("Bar"), @@ -10560,8 +10245,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3980, - EndPos: 3983, + StartPos: 3686, + EndPos: 3689, }, }, UseType: &ast.Identifier{ @@ -10569,8 +10254,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3971, - EndPos: 3979, + StartPos: 3677, + EndPos: 3685, }, }, Value: []byte("function"), @@ -10580,8 +10265,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3980, - EndPos: 3983, + StartPos: 3686, + EndPos: 3689, }, }, Parts: []ast.Vertex{ @@ -10590,8 +10275,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 175, EndLine: 175, - StartPos: 3980, - EndPos: 3983, + StartPos: 3686, + EndPos: 3689, }, }, Value: []byte("Baz"), @@ -10606,8 +10291,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 177, EndLine: 177, - StartPos: 3989, - EndPos: 3995, + StartPos: 3693, + EndPos: 3699, }, }, Expr: &ast.ExprArrayDimFetch{ @@ -10615,8 +10300,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 177, EndLine: 177, - StartPos: 3989, - EndPos: 3994, + StartPos: 3693, + EndPos: 3698, }, }, Var: &ast.ExprVariable{ @@ -10624,8 +10309,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 177, EndLine: 177, - StartPos: 3989, - EndPos: 3991, + StartPos: 3693, + EndPos: 3695, }, }, VarName: &ast.Identifier{ @@ -10633,8 +10318,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 177, EndLine: 177, - StartPos: 3989, - EndPos: 3991, + StartPos: 3693, + EndPos: 3695, }, }, Value: []byte("$a"), @@ -10645,8 +10330,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 177, EndLine: 177, - StartPos: 3992, - EndPos: 3993, + StartPos: 3696, + EndPos: 3697, }, }, Value: []byte("1"), @@ -10658,8 +10343,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3998, - EndPos: 4007, + StartPos: 3700, + EndPos: 3709, }, }, Expr: &ast.ExprArrayDimFetch{ @@ -10667,8 +10352,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3998, - EndPos: 4006, + StartPos: 3700, + EndPos: 3708, }, }, Var: &ast.ExprArrayDimFetch{ @@ -10676,8 +10361,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3998, - EndPos: 4003, + StartPos: 3700, + EndPos: 3705, }, }, Var: &ast.ExprVariable{ @@ -10685,8 +10370,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3998, - EndPos: 4000, + StartPos: 3700, + EndPos: 3702, }, }, VarName: &ast.Identifier{ @@ -10694,8 +10379,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 3998, - EndPos: 4000, + StartPos: 3700, + EndPos: 3702, }, }, Value: []byte("$a"), @@ -10706,8 +10391,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 4001, - EndPos: 4002, + StartPos: 3703, + EndPos: 3704, }, }, Value: []byte("1"), @@ -10718,8 +10403,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 178, EndLine: 178, - StartPos: 4004, - EndPos: 4005, + StartPos: 3706, + EndPos: 3707, }, }, Value: []byte("2"), @@ -10731,8 +10416,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 179, EndLine: 179, - StartPos: 4010, - EndPos: 4018, + StartPos: 3710, + EndPos: 3718, }, }, Expr: &ast.ExprArray{ @@ -10740,8 +10425,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 179, EndLine: 179, - StartPos: 4010, - EndPos: 4017, + StartPos: 3710, + EndPos: 3717, }, }, Items: []ast.Vertex{}, @@ -10752,8 +10437,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 180, EndLine: 180, - StartPos: 4021, - EndPos: 4030, + StartPos: 3719, + EndPos: 3728, }, }, Expr: &ast.ExprArray{ @@ -10761,8 +10446,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 180, EndLine: 180, - StartPos: 4021, - EndPos: 4029, + StartPos: 3719, + EndPos: 3727, }, }, Items: []ast.Vertex{ @@ -10771,8 +10456,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 180, EndLine: 180, - StartPos: 4027, - EndPos: 4028, + StartPos: 3725, + EndPos: 3726, }, }, Val: &ast.ScalarLnumber{ @@ -10780,8 +10465,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 180, EndLine: 180, - StartPos: 4027, - EndPos: 4028, + StartPos: 3725, + EndPos: 3726, }, }, Value: []byte("1"), @@ -10795,8 +10480,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4033, - EndPos: 4051, + StartPos: 3729, + EndPos: 3747, }, }, Expr: &ast.ExprArray{ @@ -10804,8 +10489,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4033, - EndPos: 4050, + StartPos: 3729, + EndPos: 3746, }, }, Items: []ast.Vertex{ @@ -10814,8 +10499,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4039, - EndPos: 4043, + StartPos: 3735, + EndPos: 3739, }, }, Key: &ast.ScalarLnumber{ @@ -10823,8 +10508,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4039, - EndPos: 4040, + StartPos: 3735, + EndPos: 3736, }, }, Value: []byte("1"), @@ -10834,8 +10519,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4042, - EndPos: 4043, + StartPos: 3738, + EndPos: 3739, }, }, Value: []byte("1"), @@ -10846,8 +10531,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4045, - EndPos: 4048, + StartPos: 3741, + EndPos: 3744, }, }, Val: &ast.ExprReference{ @@ -10855,8 +10540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4045, - EndPos: 4048, + StartPos: 3741, + EndPos: 3744, }, }, Var: &ast.ExprVariable{ @@ -10864,8 +10549,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4046, - EndPos: 4048, + StartPos: 3742, + EndPos: 3744, }, }, VarName: &ast.Identifier{ @@ -10873,8 +10558,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 181, EndLine: 181, - StartPos: 4046, - EndPos: 4048, + StartPos: 3742, + EndPos: 3744, }, }, Value: []byte("$b"), @@ -10891,8 +10576,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 182, EndLine: 182, - StartPos: 4054, - EndPos: 4058, + StartPos: 3748, + EndPos: 3752, }, }, Expr: &ast.ExprBitwiseNot{ @@ -10900,8 +10585,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 182, EndLine: 182, - StartPos: 4054, - EndPos: 4057, + StartPos: 3748, + EndPos: 3751, }, }, Expr: &ast.ExprVariable{ @@ -10909,8 +10594,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 182, EndLine: 182, - StartPos: 4055, - EndPos: 4057, + StartPos: 3749, + EndPos: 3751, }, }, VarName: &ast.Identifier{ @@ -10918,8 +10603,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 182, EndLine: 182, - StartPos: 4055, - EndPos: 4057, + StartPos: 3749, + EndPos: 3751, }, }, Value: []byte("$a"), @@ -10932,8 +10617,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 183, EndLine: 183, - StartPos: 4061, - EndPos: 4065, + StartPos: 3753, + EndPos: 3757, }, }, Expr: &ast.ExprBooleanNot{ @@ -10941,8 +10626,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 183, EndLine: 183, - StartPos: 4061, - EndPos: 4064, + StartPos: 3753, + EndPos: 3756, }, }, Expr: &ast.ExprVariable{ @@ -10950,8 +10635,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 183, EndLine: 183, - StartPos: 4062, - EndPos: 4064, + StartPos: 3754, + EndPos: 3756, }, }, VarName: &ast.Identifier{ @@ -10959,8 +10644,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 183, EndLine: 183, - StartPos: 4062, - EndPos: 4064, + StartPos: 3754, + EndPos: 3756, }, }, Value: []byte("$a"), @@ -10973,8 +10658,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4069, - EndPos: 4078, + StartPos: 3759, + EndPos: 3768, }, }, Expr: &ast.ExprClassConstFetch{ @@ -10982,8 +10667,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4069, - EndPos: 4077, + StartPos: 3759, + EndPos: 3767, }, }, Class: &ast.NameName{ @@ -10991,8 +10676,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4069, - EndPos: 4072, + StartPos: 3759, + EndPos: 3762, }, }, Parts: []ast.Vertex{ @@ -11001,8 +10686,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4069, - EndPos: 4072, + StartPos: 3759, + EndPos: 3762, }, }, Value: []byte("Foo"), @@ -11014,8 +10699,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 185, EndLine: 185, - StartPos: 4074, - EndPos: 4077, + StartPos: 3764, + EndPos: 3767, }, }, Value: []byte("Bar"), @@ -11027,8 +10712,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4081, - EndPos: 4091, + StartPos: 3769, + EndPos: 3779, }, }, Expr: &ast.ExprClassConstFetch{ @@ -11036,8 +10721,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4081, - EndPos: 4090, + StartPos: 3769, + EndPos: 3778, }, }, Class: &ast.ExprVariable{ @@ -11045,8 +10730,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4081, - EndPos: 4085, + StartPos: 3769, + EndPos: 3773, }, }, VarName: &ast.Identifier{ @@ -11054,8 +10739,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4081, - EndPos: 4085, + StartPos: 3769, + EndPos: 3773, }, }, Value: []byte("$foo"), @@ -11066,8 +10751,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 186, EndLine: 186, - StartPos: 4087, - EndPos: 4090, + StartPos: 3775, + EndPos: 3778, }, }, Value: []byte("Bar"), @@ -11079,8 +10764,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4094, - EndPos: 4104, + StartPos: 3780, + EndPos: 3790, }, }, Expr: &ast.ExprClone{ @@ -11088,8 +10773,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4094, - EndPos: 4102, + StartPos: 3780, + EndPos: 3788, }, }, Expr: &ast.ExprVariable{ @@ -11097,8 +10782,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4100, - EndPos: 4102, + StartPos: 3786, + EndPos: 3788, }, }, VarName: &ast.Identifier{ @@ -11106,8 +10791,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 187, EndLine: 187, - StartPos: 4100, - EndPos: 4102, + StartPos: 3786, + EndPos: 3788, }, }, Value: []byte("$a"), @@ -11120,8 +10805,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4107, - EndPos: 4116, + StartPos: 3791, + EndPos: 3800, }, }, Expr: &ast.ExprClone{ @@ -11129,8 +10814,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4107, - EndPos: 4115, + StartPos: 3791, + EndPos: 3799, }, }, Expr: &ast.ExprVariable{ @@ -11138,8 +10823,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4113, - EndPos: 4115, + StartPos: 3797, + EndPos: 3799, }, }, VarName: &ast.Identifier{ @@ -11147,8 +10832,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 188, EndLine: 188, - StartPos: 4113, - EndPos: 4115, + StartPos: 3797, + EndPos: 3799, }, }, Value: []byte("$a"), @@ -11161,8 +10846,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 189, EndLine: 189, - StartPos: 4119, - EndPos: 4132, + StartPos: 3801, + EndPos: 3814, }, }, Expr: &ast.ExprClosure{ @@ -11170,13 +10855,11 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 189, EndLine: 189, - StartPos: 4119, - EndPos: 4131, + StartPos: 3801, + EndPos: 3813, }, }, - ReturnsRef: false, - Static: false, - Stmts: []ast.Vertex{}, + Stmts: []ast.Vertex{}, }, }, &ast.StmtExpression{ @@ -11184,8 +10867,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4135, - EndPos: 4169, + StartPos: 3815, + EndPos: 3849, }, }, Expr: &ast.ExprClosure{ @@ -11193,31 +10876,27 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4135, - EndPos: 4168, + StartPos: 3815, + EndPos: 3848, }, }, - Static: false, - ReturnsRef: false, Params: []ast.Vertex{ &ast.Parameter{ Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4144, - EndPos: 4146, + StartPos: 3824, + EndPos: 3826, }, }, - ByRef: false, - Variadic: false, Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4144, - EndPos: 4146, + StartPos: 3824, + EndPos: 3826, }, }, VarName: &ast.Identifier{ @@ -11225,8 +10904,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4144, - EndPos: 4146, + StartPos: 3824, + EndPos: 3826, }, }, Value: []byte("$a"), @@ -11238,19 +10917,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4148, - EndPos: 4150, + StartPos: 3828, + EndPos: 3830, }, }, - ByRef: false, - Variadic: false, Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4148, - EndPos: 4150, + StartPos: 3828, + EndPos: 3830, }, }, VarName: &ast.Identifier{ @@ -11258,8 +10935,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4148, - EndPos: 4150, + StartPos: 3828, + EndPos: 3830, }, }, Value: []byte("$b"), @@ -11272,8 +10949,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4152, - EndPos: 4165, + StartPos: 3832, + EndPos: 3845, }, }, Uses: []ast.Vertex{ @@ -11282,8 +10959,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4157, - EndPos: 4159, + StartPos: 3837, + EndPos: 3839, }, }, VarName: &ast.Identifier{ @@ -11291,8 +10968,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4157, - EndPos: 4159, + StartPos: 3837, + EndPos: 3839, }, }, Value: []byte("$c"), @@ -11303,8 +10980,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4161, - EndPos: 4164, + StartPos: 3841, + EndPos: 3844, }, }, Var: &ast.ExprVariable{ @@ -11312,8 +10989,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4162, - EndPos: 4164, + StartPos: 3842, + EndPos: 3844, }, }, VarName: &ast.Identifier{ @@ -11321,8 +10998,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 190, EndLine: 190, - StartPos: 4162, - EndPos: 4164, + StartPos: 3842, + EndPos: 3844, }, }, Value: []byte("$d"), @@ -11339,8 +11016,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 191, EndLine: 191, - StartPos: 4172, - EndPos: 4192, + StartPos: 3850, + EndPos: 3870, }, }, Expr: &ast.ExprClosure{ @@ -11348,19 +11025,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 191, EndLine: 191, - StartPos: 4172, - EndPos: 4191, + StartPos: 3850, + EndPos: 3869, }, }, - ReturnsRef: false, - Static: false, ReturnType: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 191, EndLine: 191, - StartPos: 4184, - EndPos: 4188, + StartPos: 3862, + EndPos: 3866, }, }, Parts: []ast.Vertex{ @@ -11369,8 +11044,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 191, EndLine: 191, - StartPos: 4184, - EndPos: 4188, + StartPos: 3862, + EndPos: 3866, }, }, Value: []byte("void"), @@ -11385,8 +11060,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4195, - EndPos: 4199, + StartPos: 3871, + EndPos: 3875, }, }, Expr: &ast.ExprConstFetch{ @@ -11394,8 +11069,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4195, - EndPos: 4198, + StartPos: 3871, + EndPos: 3874, }, }, Const: &ast.NameName{ @@ -11403,8 +11078,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4195, - EndPos: 4198, + StartPos: 3871, + EndPos: 3874, }, }, Parts: []ast.Vertex{ @@ -11413,8 +11088,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 192, EndLine: 192, - StartPos: 4195, - EndPos: 4198, + StartPos: 3871, + EndPos: 3874, }, }, Value: []byte("foo"), @@ -11428,8 +11103,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 193, EndLine: 193, - StartPos: 4202, - EndPos: 4216, + StartPos: 3876, + EndPos: 3890, }, }, Expr: &ast.ExprConstFetch{ @@ -11437,8 +11112,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 193, EndLine: 193, - StartPos: 4202, - EndPos: 4215, + StartPos: 3876, + EndPos: 3889, }, }, Const: &ast.NameRelative{ @@ -11446,8 +11121,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 193, EndLine: 193, - StartPos: 4202, - EndPos: 4215, + StartPos: 3876, + EndPos: 3889, }, }, Parts: []ast.Vertex{ @@ -11456,8 +11131,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 193, EndLine: 193, - StartPos: 4212, - EndPos: 4215, + StartPos: 3886, + EndPos: 3889, }, }, Value: []byte("foo"), @@ -11471,8 +11146,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 194, EndLine: 194, - StartPos: 4219, - EndPos: 4224, + StartPos: 3891, + EndPos: 3896, }, }, Expr: &ast.ExprConstFetch{ @@ -11480,8 +11155,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 194, EndLine: 194, - StartPos: 4219, - EndPos: 4223, + StartPos: 3891, + EndPos: 3895, }, }, Const: &ast.NameFullyQualified{ @@ -11489,8 +11164,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 194, EndLine: 194, - StartPos: 4219, - EndPos: 4223, + StartPos: 3891, + EndPos: 3895, }, }, Parts: []ast.Vertex{ @@ -11499,8 +11174,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 194, EndLine: 194, - StartPos: 4220, - EndPos: 4223, + StartPos: 3892, + EndPos: 3895, }, }, Value: []byte("foo"), @@ -11514,8 +11189,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4228, - EndPos: 4238, + StartPos: 3898, + EndPos: 3908, }, }, Expr: &ast.ExprEmpty{ @@ -11523,8 +11198,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4228, - EndPos: 4237, + StartPos: 3898, + EndPos: 3907, }, }, Expr: &ast.ExprVariable{ @@ -11532,8 +11207,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4234, - EndPos: 4236, + StartPos: 3904, + EndPos: 3906, }, }, VarName: &ast.Identifier{ @@ -11541,8 +11216,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 196, EndLine: 196, - StartPos: 4234, - EndPos: 4236, + StartPos: 3904, + EndPos: 3906, }, }, Value: []byte("$a"), @@ -11555,8 +11230,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 197, EndLine: 197, - StartPos: 4241, - EndPos: 4245, + StartPos: 3909, + EndPos: 3913, }, }, Expr: &ast.ExprErrorSuppress{ @@ -11564,8 +11239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 197, EndLine: 197, - StartPos: 4241, - EndPos: 4244, + StartPos: 3909, + EndPos: 3912, }, }, Expr: &ast.ExprVariable{ @@ -11573,8 +11248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 197, EndLine: 197, - StartPos: 4242, - EndPos: 4244, + StartPos: 3910, + EndPos: 3912, }, }, VarName: &ast.Identifier{ @@ -11582,8 +11257,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 197, EndLine: 197, - StartPos: 4242, - EndPos: 4244, + StartPos: 3910, + EndPos: 3912, }, }, Value: []byte("$a"), @@ -11596,8 +11271,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 198, EndLine: 198, - StartPos: 4248, - EndPos: 4257, + StartPos: 3914, + EndPos: 3923, }, }, Expr: &ast.ExprEval{ @@ -11605,8 +11280,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 198, EndLine: 198, - StartPos: 4248, - EndPos: 4256, + StartPos: 3914, + EndPos: 3922, }, }, Expr: &ast.ExprVariable{ @@ -11614,8 +11289,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 198, EndLine: 198, - StartPos: 4253, - EndPos: 4255, + StartPos: 3919, + EndPos: 3921, }, }, VarName: &ast.Identifier{ @@ -11623,8 +11298,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 198, EndLine: 198, - StartPos: 4253, - EndPos: 4255, + StartPos: 3919, + EndPos: 3921, }, }, Value: []byte("$a"), @@ -11637,8 +11312,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 199, EndLine: 199, - StartPos: 4260, - EndPos: 4265, + StartPos: 3924, + EndPos: 3929, }, }, Expr: &ast.ExprExit{ @@ -11646,11 +11321,10 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 199, EndLine: 199, - StartPos: 4260, - EndPos: 4264, + StartPos: 3924, + EndPos: 3928, }, }, - Die: false, }, }, &ast.StmtExpression{ @@ -11658,8 +11332,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4268, - EndPos: 4277, + StartPos: 3930, + EndPos: 3939, }, }, Expr: &ast.ExprExit{ @@ -11667,18 +11341,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4268, - EndPos: 4276, + StartPos: 3930, + EndPos: 3938, }, }, - Die: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4273, - EndPos: 4275, + StartPos: 3935, + EndPos: 3937, }, }, VarName: &ast.Identifier{ @@ -11686,8 +11359,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 200, EndLine: 200, - StartPos: 4273, - EndPos: 4275, + StartPos: 3935, + EndPos: 3937, }, }, Value: []byte("$a"), @@ -11700,8 +11373,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 201, EndLine: 201, - StartPos: 4280, - EndPos: 4284, + StartPos: 3940, + EndPos: 3944, }, }, Expr: &ast.ExprExit{ @@ -11709,8 +11382,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 201, EndLine: 201, - StartPos: 4280, - EndPos: 4283, + StartPos: 3940, + EndPos: 3943, }, }, Die: true, @@ -11721,8 +11394,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 202, EndLine: 202, - StartPos: 4287, - EndPos: 4295, + StartPos: 3945, + EndPos: 3953, }, }, Expr: &ast.ExprExit{ @@ -11730,8 +11403,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 202, EndLine: 202, - StartPos: 4287, - EndPos: 4294, + StartPos: 3945, + EndPos: 3952, }, }, Die: true, @@ -11740,8 +11413,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 202, EndLine: 202, - StartPos: 4291, - EndPos: 4293, + StartPos: 3949, + EndPos: 3951, }, }, VarName: &ast.Identifier{ @@ -11749,8 +11422,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 202, EndLine: 202, - StartPos: 4291, - EndPos: 4293, + StartPos: 3949, + EndPos: 3951, }, }, Value: []byte("$a"), @@ -11763,8 +11436,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4298, - EndPos: 4304, + StartPos: 3954, + EndPos: 3960, }, }, Expr: &ast.ExprFunctionCall{ @@ -11772,8 +11445,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4298, - EndPos: 4303, + StartPos: 3954, + EndPos: 3959, }, }, Function: &ast.NameName{ @@ -11781,8 +11454,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4298, - EndPos: 4301, + StartPos: 3954, + EndPos: 3957, }, }, Parts: []ast.Vertex{ @@ -11791,8 +11464,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4298, - EndPos: 4301, + StartPos: 3954, + EndPos: 3957, }, }, Value: []byte("foo"), @@ -11804,8 +11477,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 203, EndLine: 203, - StartPos: 4301, - EndPos: 4303, + StartPos: 3957, + EndPos: 3959, }, }, }, @@ -11816,8 +11489,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4307, - EndPos: 4323, + StartPos: 3961, + EndPos: 3977, }, }, Expr: &ast.ExprFunctionCall{ @@ -11825,8 +11498,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4307, - EndPos: 4322, + StartPos: 3961, + EndPos: 3976, }, }, Function: &ast.NameRelative{ @@ -11834,8 +11507,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4307, - EndPos: 4320, + StartPos: 3961, + EndPos: 3974, }, }, Parts: []ast.Vertex{ @@ -11844,8 +11517,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4317, - EndPos: 4320, + StartPos: 3971, + EndPos: 3974, }, }, Value: []byte("foo"), @@ -11857,8 +11530,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 204, EndLine: 204, - StartPos: 4320, - EndPos: 4322, + StartPos: 3974, + EndPos: 3976, }, }, }, @@ -11869,8 +11542,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4326, - EndPos: 4333, + StartPos: 3978, + EndPos: 3985, }, }, Expr: &ast.ExprFunctionCall{ @@ -11878,8 +11551,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4326, - EndPos: 4332, + StartPos: 3978, + EndPos: 3984, }, }, Function: &ast.NameFullyQualified{ @@ -11887,8 +11560,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4326, - EndPos: 4330, + StartPos: 3978, + EndPos: 3982, }, }, Parts: []ast.Vertex{ @@ -11897,8 +11570,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4327, - EndPos: 4330, + StartPos: 3979, + EndPos: 3982, }, }, Value: []byte("foo"), @@ -11910,8 +11583,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 205, EndLine: 205, - StartPos: 4330, - EndPos: 4332, + StartPos: 3982, + EndPos: 3984, }, }, }, @@ -11922,8 +11595,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4336, - EndPos: 4343, + StartPos: 3986, + EndPos: 3993, }, }, Expr: &ast.ExprFunctionCall{ @@ -11931,8 +11604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4336, - EndPos: 4342, + StartPos: 3986, + EndPos: 3992, }, }, Function: &ast.ExprVariable{ @@ -11940,8 +11613,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4336, - EndPos: 4340, + StartPos: 3986, + EndPos: 3990, }, }, VarName: &ast.Identifier{ @@ -11949,8 +11622,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4336, - EndPos: 4340, + StartPos: 3986, + EndPos: 3990, }, }, Value: []byte("$foo"), @@ -11961,8 +11634,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 206, EndLine: 206, - StartPos: 4340, - EndPos: 4342, + StartPos: 3990, + EndPos: 3992, }, }, }, @@ -11973,8 +11646,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4347, - EndPos: 4352, + StartPos: 3995, + EndPos: 4000, }, }, Expr: &ast.ExprPostDec{ @@ -11982,8 +11655,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4347, - EndPos: 4351, + StartPos: 3995, + EndPos: 3999, }, }, Var: &ast.ExprVariable{ @@ -11991,8 +11664,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4347, - EndPos: 4349, + StartPos: 3995, + EndPos: 3997, }, }, VarName: &ast.Identifier{ @@ -12000,8 +11673,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 208, EndLine: 208, - StartPos: 4347, - EndPos: 4349, + StartPos: 3995, + EndPos: 3997, }, }, Value: []byte("$a"), @@ -12014,8 +11687,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4355, - EndPos: 4360, + StartPos: 4001, + EndPos: 4006, }, }, Expr: &ast.ExprPostInc{ @@ -12023,8 +11696,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4355, - EndPos: 4359, + StartPos: 4001, + EndPos: 4005, }, }, Var: &ast.ExprVariable{ @@ -12032,8 +11705,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4355, - EndPos: 4357, + StartPos: 4001, + EndPos: 4003, }, }, VarName: &ast.Identifier{ @@ -12041,8 +11714,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 209, EndLine: 209, - StartPos: 4355, - EndPos: 4357, + StartPos: 4001, + EndPos: 4003, }, }, Value: []byte("$a"), @@ -12055,8 +11728,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4363, - EndPos: 4368, + StartPos: 4007, + EndPos: 4012, }, }, Expr: &ast.ExprPreDec{ @@ -12064,8 +11737,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4363, - EndPos: 4367, + StartPos: 4007, + EndPos: 4011, }, }, Var: &ast.ExprVariable{ @@ -12073,8 +11746,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4365, - EndPos: 4367, + StartPos: 4009, + EndPos: 4011, }, }, VarName: &ast.Identifier{ @@ -12082,8 +11755,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 210, EndLine: 210, - StartPos: 4365, - EndPos: 4367, + StartPos: 4009, + EndPos: 4011, }, }, Value: []byte("$a"), @@ -12096,8 +11769,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 211, EndLine: 211, - StartPos: 4371, - EndPos: 4376, + StartPos: 4013, + EndPos: 4018, }, }, Expr: &ast.ExprPreInc{ @@ -12105,8 +11778,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 211, EndLine: 211, - StartPos: 4371, - EndPos: 4375, + StartPos: 4013, + EndPos: 4017, }, }, Var: &ast.ExprVariable{ @@ -12114,8 +11787,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 211, EndLine: 211, - StartPos: 4373, - EndPos: 4375, + StartPos: 4015, + EndPos: 4017, }, }, VarName: &ast.Identifier{ @@ -12123,8 +11796,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 211, EndLine: 211, - StartPos: 4373, - EndPos: 4375, + StartPos: 4015, + EndPos: 4017, }, }, Value: []byte("$a"), @@ -12137,8 +11810,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 213, EndLine: 213, - StartPos: 4380, - EndPos: 4391, + StartPos: 4020, + EndPos: 4031, }, }, Expr: &ast.ExprInclude{ @@ -12146,8 +11819,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 213, EndLine: 213, - StartPos: 4380, - EndPos: 4390, + StartPos: 4020, + EndPos: 4030, }, }, Expr: &ast.ExprVariable{ @@ -12155,8 +11828,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 213, EndLine: 213, - StartPos: 4388, - EndPos: 4390, + StartPos: 4028, + EndPos: 4030, }, }, VarName: &ast.Identifier{ @@ -12164,8 +11837,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 213, EndLine: 213, - StartPos: 4388, - EndPos: 4390, + StartPos: 4028, + EndPos: 4030, }, }, Value: []byte("$a"), @@ -12178,8 +11851,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 214, EndLine: 214, - StartPos: 4394, - EndPos: 4410, + StartPos: 4032, + EndPos: 4048, }, }, Expr: &ast.ExprIncludeOnce{ @@ -12187,8 +11860,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 214, EndLine: 214, - StartPos: 4394, - EndPos: 4409, + StartPos: 4032, + EndPos: 4047, }, }, Expr: &ast.ExprVariable{ @@ -12196,8 +11869,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 214, EndLine: 214, - StartPos: 4407, - EndPos: 4409, + StartPos: 4045, + EndPos: 4047, }, }, VarName: &ast.Identifier{ @@ -12205,8 +11878,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 214, EndLine: 214, - StartPos: 4407, - EndPos: 4409, + StartPos: 4045, + EndPos: 4047, }, }, Value: []byte("$a"), @@ -12219,8 +11892,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 215, EndLine: 215, - StartPos: 4413, - EndPos: 4424, + StartPos: 4049, + EndPos: 4060, }, }, Expr: &ast.ExprRequire{ @@ -12228,8 +11901,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 215, EndLine: 215, - StartPos: 4413, - EndPos: 4423, + StartPos: 4049, + EndPos: 4059, }, }, Expr: &ast.ExprVariable{ @@ -12237,8 +11910,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 215, EndLine: 215, - StartPos: 4421, - EndPos: 4423, + StartPos: 4057, + EndPos: 4059, }, }, VarName: &ast.Identifier{ @@ -12246,8 +11919,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 215, EndLine: 215, - StartPos: 4421, - EndPos: 4423, + StartPos: 4057, + EndPos: 4059, }, }, Value: []byte("$a"), @@ -12260,8 +11933,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 216, EndLine: 216, - StartPos: 4427, - EndPos: 4443, + StartPos: 4061, + EndPos: 4077, }, }, Expr: &ast.ExprRequireOnce{ @@ -12269,8 +11942,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 216, EndLine: 216, - StartPos: 4427, - EndPos: 4442, + StartPos: 4061, + EndPos: 4076, }, }, Expr: &ast.ExprVariable{ @@ -12278,8 +11951,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 216, EndLine: 216, - StartPos: 4440, - EndPos: 4442, + StartPos: 4074, + EndPos: 4076, }, }, VarName: &ast.Identifier{ @@ -12287,8 +11960,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 216, EndLine: 216, - StartPos: 4440, - EndPos: 4442, + StartPos: 4074, + EndPos: 4076, }, }, Value: []byte("$a"), @@ -12301,8 +11974,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4447, - EndPos: 4465, + StartPos: 4079, + EndPos: 4097, }, }, Expr: &ast.ExprInstanceOf{ @@ -12310,8 +11983,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4447, - EndPos: 4464, + StartPos: 4079, + EndPos: 4096, }, }, Expr: &ast.ExprVariable{ @@ -12319,8 +11992,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4447, - EndPos: 4449, + StartPos: 4079, + EndPos: 4081, }, }, VarName: &ast.Identifier{ @@ -12328,8 +12001,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4447, - EndPos: 4449, + StartPos: 4079, + EndPos: 4081, }, }, Value: []byte("$a"), @@ -12340,8 +12013,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4461, - EndPos: 4464, + StartPos: 4093, + EndPos: 4096, }, }, Parts: []ast.Vertex{ @@ -12350,8 +12023,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 218, EndLine: 218, - StartPos: 4461, - EndPos: 4464, + StartPos: 4093, + EndPos: 4096, }, }, Value: []byte("Foo"), @@ -12365,8 +12038,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4468, - EndPos: 4496, + StartPos: 4098, + EndPos: 4126, }, }, Expr: &ast.ExprInstanceOf{ @@ -12374,8 +12047,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4468, - EndPos: 4495, + StartPos: 4098, + EndPos: 4125, }, }, Expr: &ast.ExprVariable{ @@ -12383,8 +12056,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4468, - EndPos: 4470, + StartPos: 4098, + EndPos: 4100, }, }, VarName: &ast.Identifier{ @@ -12392,8 +12065,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4468, - EndPos: 4470, + StartPos: 4098, + EndPos: 4100, }, }, Value: []byte("$a"), @@ -12404,8 +12077,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4482, - EndPos: 4495, + StartPos: 4112, + EndPos: 4125, }, }, Parts: []ast.Vertex{ @@ -12414,8 +12087,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 219, EndLine: 219, - StartPos: 4492, - EndPos: 4495, + StartPos: 4122, + EndPos: 4125, }, }, Value: []byte("Foo"), @@ -12429,8 +12102,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4499, - EndPos: 4518, + StartPos: 4127, + EndPos: 4146, }, }, Expr: &ast.ExprInstanceOf{ @@ -12438,8 +12111,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4499, - EndPos: 4517, + StartPos: 4127, + EndPos: 4145, }, }, Expr: &ast.ExprVariable{ @@ -12447,8 +12120,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4499, - EndPos: 4501, + StartPos: 4127, + EndPos: 4129, }, }, VarName: &ast.Identifier{ @@ -12456,8 +12129,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4499, - EndPos: 4501, + StartPos: 4127, + EndPos: 4129, }, }, Value: []byte("$a"), @@ -12468,8 +12141,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4513, - EndPos: 4517, + StartPos: 4141, + EndPos: 4145, }, }, Parts: []ast.Vertex{ @@ -12478,8 +12151,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 220, EndLine: 220, - StartPos: 4514, - EndPos: 4517, + StartPos: 4142, + EndPos: 4145, }, }, Value: []byte("Foo"), @@ -12493,8 +12166,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4522, - EndPos: 4536, + StartPos: 4148, + EndPos: 4162, }, }, Expr: &ast.ExprIsset{ @@ -12502,8 +12175,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4522, - EndPos: 4535, + StartPos: 4148, + EndPos: 4161, }, }, Vars: []ast.Vertex{ @@ -12512,8 +12185,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4528, - EndPos: 4530, + StartPos: 4154, + EndPos: 4156, }, }, VarName: &ast.Identifier{ @@ -12521,8 +12194,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4528, - EndPos: 4530, + StartPos: 4154, + EndPos: 4156, }, }, Value: []byte("$a"), @@ -12533,8 +12206,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4532, - EndPos: 4534, + StartPos: 4158, + EndPos: 4160, }, }, VarName: &ast.Identifier{ @@ -12542,8 +12215,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 222, EndLine: 222, - StartPos: 4532, - EndPos: 4534, + StartPos: 4158, + EndPos: 4160, }, }, Value: []byte("$b"), @@ -12557,8 +12230,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4539, - EndPos: 4553, + StartPos: 4163, + EndPos: 4177, }, }, Expr: &ast.ExprAssign{ @@ -12566,8 +12239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4539, - EndPos: 4552, + StartPos: 4163, + EndPos: 4176, }, }, Var: &ast.ExprList{ @@ -12575,8 +12248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4539, - EndPos: 4547, + StartPos: 4163, + EndPos: 4171, }, }, Items: []ast.Vertex{ @@ -12585,8 +12258,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4544, - EndPos: 4546, + StartPos: 4168, + EndPos: 4170, }, }, Val: &ast.ExprVariable{ @@ -12594,8 +12267,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4544, - EndPos: 4546, + StartPos: 4168, + EndPos: 4170, }, }, VarName: &ast.Identifier{ @@ -12603,8 +12276,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4544, - EndPos: 4546, + StartPos: 4168, + EndPos: 4170, }, }, Value: []byte("$a"), @@ -12618,8 +12291,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4550, - EndPos: 4552, + StartPos: 4174, + EndPos: 4176, }, }, VarName: &ast.Identifier{ @@ -12627,8 +12300,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 223, EndLine: 223, - StartPos: 4550, - EndPos: 4552, + StartPos: 4174, + EndPos: 4176, }, }, Value: []byte("$b"), @@ -12641,8 +12314,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4556, - EndPos: 4572, + StartPos: 4178, + EndPos: 4194, }, }, Expr: &ast.ExprAssign{ @@ -12650,8 +12323,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4556, - EndPos: 4571, + StartPos: 4178, + EndPos: 4193, }, }, Var: &ast.ExprList{ @@ -12659,8 +12332,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4556, - EndPos: 4566, + StartPos: 4178, + EndPos: 4188, }, }, Items: []ast.Vertex{ @@ -12669,8 +12342,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4561, - EndPos: 4565, + StartPos: 4183, + EndPos: 4187, }, }, Val: &ast.ExprArrayDimFetch{ @@ -12678,8 +12351,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4561, - EndPos: 4565, + StartPos: 4183, + EndPos: 4187, }, }, Var: &ast.ExprVariable{ @@ -12687,8 +12360,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4561, - EndPos: 4563, + StartPos: 4183, + EndPos: 4185, }, }, VarName: &ast.Identifier{ @@ -12696,8 +12369,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4561, - EndPos: 4563, + StartPos: 4183, + EndPos: 4185, }, }, Value: []byte("$a"), @@ -12712,8 +12385,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4569, - EndPos: 4571, + StartPos: 4191, + EndPos: 4193, }, }, VarName: &ast.Identifier{ @@ -12721,8 +12394,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 224, EndLine: 224, - StartPos: 4569, - EndPos: 4571, + StartPos: 4191, + EndPos: 4193, }, }, Value: []byte("$b"), @@ -12735,8 +12408,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4575, - EndPos: 4595, + StartPos: 4195, + EndPos: 4215, }, }, Expr: &ast.ExprAssign{ @@ -12744,8 +12417,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4575, - EndPos: 4594, + StartPos: 4195, + EndPos: 4214, }, }, Var: &ast.ExprList{ @@ -12753,8 +12426,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4575, - EndPos: 4589, + StartPos: 4195, + EndPos: 4209, }, }, Items: []ast.Vertex{ @@ -12763,8 +12436,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4580, - EndPos: 4588, + StartPos: 4200, + EndPos: 4208, }, }, Val: &ast.ExprList{ @@ -12772,8 +12445,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4580, - EndPos: 4588, + StartPos: 4200, + EndPos: 4208, }, }, Items: []ast.Vertex{ @@ -12782,8 +12455,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4585, - EndPos: 4587, + StartPos: 4205, + EndPos: 4207, }, }, Val: &ast.ExprVariable{ @@ -12791,8 +12464,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4585, - EndPos: 4587, + StartPos: 4205, + EndPos: 4207, }, }, VarName: &ast.Identifier{ @@ -12800,8 +12473,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4585, - EndPos: 4587, + StartPos: 4205, + EndPos: 4207, }, }, Value: []byte("$a"), @@ -12818,8 +12491,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4592, - EndPos: 4594, + StartPos: 4212, + EndPos: 4214, }, }, VarName: &ast.Identifier{ @@ -12827,8 +12500,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 225, EndLine: 225, - StartPos: 4592, - EndPos: 4594, + StartPos: 4212, + EndPos: 4214, }, }, Value: []byte("$b"), @@ -12841,8 +12514,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4599, - EndPos: 4609, + StartPos: 4217, + EndPos: 4227, }, }, Expr: &ast.ExprMethodCall{ @@ -12850,8 +12523,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4599, - EndPos: 4608, + StartPos: 4217, + EndPos: 4226, }, }, Var: &ast.ExprVariable{ @@ -12859,8 +12532,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4599, - EndPos: 4601, + StartPos: 4217, + EndPos: 4219, }, }, VarName: &ast.Identifier{ @@ -12868,8 +12541,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4599, - EndPos: 4601, + StartPos: 4217, + EndPos: 4219, }, }, Value: []byte("$a"), @@ -12880,8 +12553,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4603, - EndPos: 4606, + StartPos: 4221, + EndPos: 4224, }, }, Value: []byte("foo"), @@ -12891,8 +12564,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 227, EndLine: 227, - StartPos: 4606, - EndPos: 4608, + StartPos: 4224, + EndPos: 4226, }, }, }, @@ -12903,8 +12576,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 228, EndLine: 228, - StartPos: 4612, - EndPos: 4622, + StartPos: 4228, + EndPos: 4238, }, }, Expr: &ast.ExprNew{ @@ -12912,8 +12585,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 228, EndLine: 228, - StartPos: 4612, - EndPos: 4621, + StartPos: 4228, + EndPos: 4237, }, }, Class: &ast.NameName{ @@ -12921,8 +12594,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 228, EndLine: 228, - StartPos: 4616, - EndPos: 4619, + StartPos: 4232, + EndPos: 4235, }, }, Parts: []ast.Vertex{ @@ -12931,8 +12604,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 228, EndLine: 228, - StartPos: 4616, - EndPos: 4619, + StartPos: 4232, + EndPos: 4235, }, }, Value: []byte("Foo"), @@ -12944,8 +12617,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 228, EndLine: 228, - StartPos: 4619, - EndPos: 4621, + StartPos: 4235, + EndPos: 4237, }, }, }, @@ -12956,8 +12629,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 229, EndLine: 229, - StartPos: 4625, - EndPos: 4645, + StartPos: 4239, + EndPos: 4259, }, }, Expr: &ast.ExprNew{ @@ -12965,8 +12638,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 229, EndLine: 229, - StartPos: 4625, - EndPos: 4644, + StartPos: 4239, + EndPos: 4258, }, }, Class: &ast.NameRelative{ @@ -12974,8 +12647,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 229, EndLine: 229, - StartPos: 4629, - EndPos: 4642, + StartPos: 4243, + EndPos: 4256, }, }, Parts: []ast.Vertex{ @@ -12984,8 +12657,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 229, EndLine: 229, - StartPos: 4639, - EndPos: 4642, + StartPos: 4253, + EndPos: 4256, }, }, Value: []byte("Foo"), @@ -12997,8 +12670,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 229, EndLine: 229, - StartPos: 4642, - EndPos: 4644, + StartPos: 4256, + EndPos: 4258, }, }, }, @@ -13009,8 +12682,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 230, EndLine: 230, - StartPos: 4648, - EndPos: 4659, + StartPos: 4260, + EndPos: 4271, }, }, Expr: &ast.ExprNew{ @@ -13018,8 +12691,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 230, EndLine: 230, - StartPos: 4648, - EndPos: 4658, + StartPos: 4260, + EndPos: 4270, }, }, Class: &ast.NameFullyQualified{ @@ -13027,8 +12700,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 230, EndLine: 230, - StartPos: 4652, - EndPos: 4656, + StartPos: 4264, + EndPos: 4268, }, }, Parts: []ast.Vertex{ @@ -13037,8 +12710,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 230, EndLine: 230, - StartPos: 4653, - EndPos: 4656, + StartPos: 4265, + EndPos: 4268, }, }, Value: []byte("Foo"), @@ -13050,8 +12723,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 230, EndLine: 230, - StartPos: 4656, - EndPos: 4658, + StartPos: 4268, + EndPos: 4270, }, }, }, @@ -13062,8 +12735,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4662, - EndPos: 4687, + StartPos: 4272, + EndPos: 4297, }, }, Expr: &ast.ExprNew{ @@ -13071,8 +12744,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4662, - EndPos: 4686, + StartPos: 4272, + EndPos: 4296, }, }, Class: &ast.StmtClass{ @@ -13080,8 +12753,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4666, - EndPos: 4686, + StartPos: 4276, + EndPos: 4296, }, }, ArgumentList: &ast.ArgumentList{ @@ -13089,8 +12762,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4672, - EndPos: 4683, + StartPos: 4282, + EndPos: 4293, }, }, Arguments: []ast.Vertex{ @@ -13099,19 +12772,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4673, - EndPos: 4675, + StartPos: 4283, + EndPos: 4285, }, }, - IsReference: false, - Variadic: false, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4673, - EndPos: 4675, + StartPos: 4283, + EndPos: 4285, }, }, VarName: &ast.Identifier{ @@ -13119,8 +12790,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4673, - EndPos: 4675, + StartPos: 4283, + EndPos: 4285, }, }, Value: []byte("$a"), @@ -13132,19 +12803,18 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4677, - EndPos: 4682, + StartPos: 4287, + EndPos: 4292, }, }, - IsReference: false, - Variadic: true, + Variadic: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4680, - EndPos: 4682, + StartPos: 4290, + EndPos: 4292, }, }, VarName: &ast.Identifier{ @@ -13152,8 +12822,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 231, EndLine: 231, - StartPos: 4680, - EndPos: 4682, + StartPos: 4290, + EndPos: 4292, }, }, Value: []byte("$b"), @@ -13171,8 +12841,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 232, EndLine: 232, - StartPos: 4690, - EndPos: 4700, + StartPos: 4298, + EndPos: 4308, }, }, Expr: &ast.ExprPrint{ @@ -13180,8 +12850,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 232, EndLine: 232, - StartPos: 4690, - EndPos: 4698, + StartPos: 4298, + EndPos: 4306, }, }, Expr: &ast.ExprVariable{ @@ -13189,8 +12859,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 232, EndLine: 232, - StartPos: 4696, - EndPos: 4698, + StartPos: 4304, + EndPos: 4306, }, }, VarName: &ast.Identifier{ @@ -13198,8 +12868,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 232, EndLine: 232, - StartPos: 4696, - EndPos: 4698, + StartPos: 4304, + EndPos: 4306, }, }, Value: []byte("$a"), @@ -13212,8 +12882,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4703, - EndPos: 4711, + StartPos: 4309, + EndPos: 4317, }, }, Expr: &ast.ExprPropertyFetch{ @@ -13221,8 +12891,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4703, - EndPos: 4710, + StartPos: 4309, + EndPos: 4316, }, }, Var: &ast.ExprVariable{ @@ -13230,8 +12900,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4703, - EndPos: 4705, + StartPos: 4309, + EndPos: 4311, }, }, VarName: &ast.Identifier{ @@ -13239,8 +12909,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4703, - EndPos: 4705, + StartPos: 4309, + EndPos: 4311, }, }, Value: []byte("$a"), @@ -13251,8 +12921,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 233, EndLine: 233, - StartPos: 4707, - EndPos: 4710, + StartPos: 4313, + EndPos: 4316, }, }, Value: []byte("foo"), @@ -13264,8 +12934,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 234, EndLine: 234, - StartPos: 4714, - EndPos: 4723, + StartPos: 4318, + EndPos: 4327, }, }, Expr: &ast.ExprShellExec{ @@ -13273,8 +12943,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 234, EndLine: 234, - StartPos: 4714, - EndPos: 4722, + StartPos: 4318, + EndPos: 4326, }, }, Parts: []ast.Vertex{ @@ -13283,8 +12953,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 234, EndLine: 234, - StartPos: 4715, - EndPos: 4719, + StartPos: 4319, + EndPos: 4323, }, }, Value: []byte("cmd "), @@ -13294,8 +12964,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 234, EndLine: 234, - StartPos: 4719, - EndPos: 4721, + StartPos: 4323, + EndPos: 4325, }, }, VarName: &ast.Identifier{ @@ -13303,8 +12973,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 234, EndLine: 234, - StartPos: 4719, - EndPos: 4721, + StartPos: 4323, + EndPos: 4325, }, }, Value: []byte("$a"), @@ -13318,8 +12988,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 235, EndLine: 235, - StartPos: 4726, - EndPos: 4732, + StartPos: 4328, + EndPos: 4334, }, }, Expr: &ast.ExprShellExec{ @@ -13327,8 +12997,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 235, EndLine: 235, - StartPos: 4726, - EndPos: 4731, + StartPos: 4328, + EndPos: 4333, }, }, Parts: []ast.Vertex{ @@ -13337,8 +13007,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 235, EndLine: 235, - StartPos: 4727, - EndPos: 4730, + StartPos: 4329, + EndPos: 4332, }, }, Value: []byte("cmd"), @@ -13351,8 +13021,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 236, EndLine: 236, - StartPos: 4735, - EndPos: 4738, + StartPos: 4335, + EndPos: 4338, }, }, Expr: &ast.ExprShellExec{ @@ -13360,8 +13030,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 236, EndLine: 236, - StartPos: 4735, - EndPos: 4737, + StartPos: 4335, + EndPos: 4337, }, }, Parts: []ast.Vertex{}, @@ -13372,8 +13042,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 237, EndLine: 237, - StartPos: 4741, - EndPos: 4744, + StartPos: 4339, + EndPos: 4342, }, }, Expr: &ast.ExprShortArray{ @@ -13381,8 +13051,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 237, EndLine: 237, - StartPos: 4741, - EndPos: 4743, + StartPos: 4339, + EndPos: 4341, }, }, Items: []ast.Vertex{}, @@ -13393,8 +13063,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 238, EndLine: 238, - StartPos: 4747, - EndPos: 4751, + StartPos: 4343, + EndPos: 4347, }, }, Expr: &ast.ExprShortArray{ @@ -13402,8 +13072,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 238, EndLine: 238, - StartPos: 4747, - EndPos: 4750, + StartPos: 4343, + EndPos: 4346, }, }, Items: []ast.Vertex{ @@ -13412,8 +13082,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 238, EndLine: 238, - StartPos: 4748, - EndPos: 4749, + StartPos: 4344, + EndPos: 4345, }, }, Val: &ast.ScalarLnumber{ @@ -13421,8 +13091,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 238, EndLine: 238, - StartPos: 4748, - EndPos: 4749, + StartPos: 4344, + EndPos: 4345, }, }, Value: []byte("1"), @@ -13436,8 +13106,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4754, - EndPos: 4767, + StartPos: 4348, + EndPos: 4361, }, }, Expr: &ast.ExprShortArray{ @@ -13445,8 +13115,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4754, - EndPos: 4766, + StartPos: 4348, + EndPos: 4360, }, }, Items: []ast.Vertex{ @@ -13455,8 +13125,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4755, - EndPos: 4759, + StartPos: 4349, + EndPos: 4353, }, }, Key: &ast.ScalarLnumber{ @@ -13464,8 +13134,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4755, - EndPos: 4756, + StartPos: 4349, + EndPos: 4350, }, }, Value: []byte("1"), @@ -13475,8 +13145,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4758, - EndPos: 4759, + StartPos: 4352, + EndPos: 4353, }, }, Value: []byte("1"), @@ -13487,8 +13157,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4761, - EndPos: 4764, + StartPos: 4355, + EndPos: 4358, }, }, Val: &ast.ExprReference{ @@ -13496,8 +13166,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4761, - EndPos: 4764, + StartPos: 4355, + EndPos: 4358, }, }, Var: &ast.ExprVariable{ @@ -13505,8 +13175,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4762, - EndPos: 4764, + StartPos: 4356, + EndPos: 4358, }, }, VarName: &ast.Identifier{ @@ -13514,8 +13184,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 239, EndLine: 239, - StartPos: 4762, - EndPos: 4764, + StartPos: 4356, + EndPos: 4358, }, }, Value: []byte("$b"), @@ -13532,8 +13202,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4771, - EndPos: 4781, + StartPos: 4363, + EndPos: 4373, }, }, Expr: &ast.ExprAssign{ @@ -13541,8 +13211,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4771, - EndPos: 4780, + StartPos: 4363, + EndPos: 4372, }, }, Var: &ast.ExprShortList{ @@ -13550,8 +13220,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4771, - EndPos: 4775, + StartPos: 4363, + EndPos: 4367, }, }, Items: []ast.Vertex{ @@ -13560,8 +13230,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4772, - EndPos: 4774, + StartPos: 4364, + EndPos: 4366, }, }, Val: &ast.ExprVariable{ @@ -13569,8 +13239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4772, - EndPos: 4774, + StartPos: 4364, + EndPos: 4366, }, }, VarName: &ast.Identifier{ @@ -13578,8 +13248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4772, - EndPos: 4774, + StartPos: 4364, + EndPos: 4366, }, }, Value: []byte("$a"), @@ -13593,8 +13263,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4778, - EndPos: 4780, + StartPos: 4370, + EndPos: 4372, }, }, VarName: &ast.Identifier{ @@ -13602,8 +13272,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 241, EndLine: 241, - StartPos: 4778, - EndPos: 4780, + StartPos: 4370, + EndPos: 4372, }, }, Value: []byte("$b"), @@ -13616,8 +13286,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4784, - EndPos: 4796, + StartPos: 4374, + EndPos: 4386, }, }, Expr: &ast.ExprAssign{ @@ -13625,8 +13295,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4784, - EndPos: 4795, + StartPos: 4374, + EndPos: 4385, }, }, Var: &ast.ExprShortList{ @@ -13634,8 +13304,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4784, - EndPos: 4790, + StartPos: 4374, + EndPos: 4380, }, }, Items: []ast.Vertex{ @@ -13644,8 +13314,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4785, - EndPos: 4789, + StartPos: 4375, + EndPos: 4379, }, }, Val: &ast.ExprArrayDimFetch{ @@ -13653,8 +13323,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4785, - EndPos: 4789, + StartPos: 4375, + EndPos: 4379, }, }, Var: &ast.ExprVariable{ @@ -13662,8 +13332,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4785, - EndPos: 4787, + StartPos: 4375, + EndPos: 4377, }, }, VarName: &ast.Identifier{ @@ -13671,8 +13341,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4785, - EndPos: 4787, + StartPos: 4375, + EndPos: 4377, }, }, Value: []byte("$a"), @@ -13687,8 +13357,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4793, - EndPos: 4795, + StartPos: 4383, + EndPos: 4385, }, }, VarName: &ast.Identifier{ @@ -13696,8 +13366,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 242, EndLine: 242, - StartPos: 4793, - EndPos: 4795, + StartPos: 4383, + EndPos: 4385, }, }, Value: []byte("$b"), @@ -13710,8 +13380,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4799, - EndPos: 4815, + StartPos: 4387, + EndPos: 4403, }, }, Expr: &ast.ExprAssign{ @@ -13719,8 +13389,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4799, - EndPos: 4814, + StartPos: 4387, + EndPos: 4402, }, }, Var: &ast.ExprShortList{ @@ -13728,8 +13398,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4799, - EndPos: 4809, + StartPos: 4387, + EndPos: 4397, }, }, Items: []ast.Vertex{ @@ -13738,8 +13408,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4800, - EndPos: 4808, + StartPos: 4388, + EndPos: 4396, }, }, Val: &ast.ExprList{ @@ -13747,8 +13417,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4800, - EndPos: 4808, + StartPos: 4388, + EndPos: 4396, }, }, Items: []ast.Vertex{ @@ -13757,8 +13427,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4805, - EndPos: 4807, + StartPos: 4393, + EndPos: 4395, }, }, Val: &ast.ExprVariable{ @@ -13766,8 +13436,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4805, - EndPos: 4807, + StartPos: 4393, + EndPos: 4395, }, }, VarName: &ast.Identifier{ @@ -13775,8 +13445,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4805, - EndPos: 4807, + StartPos: 4393, + EndPos: 4395, }, }, Value: []byte("$a"), @@ -13793,8 +13463,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4812, - EndPos: 4814, + StartPos: 4400, + EndPos: 4402, }, }, VarName: &ast.Identifier{ @@ -13802,8 +13472,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 243, EndLine: 243, - StartPos: 4812, - EndPos: 4814, + StartPos: 4400, + EndPos: 4402, }, }, Value: []byte("$b"), @@ -13816,8 +13486,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4818, - EndPos: 4829, + StartPos: 4404, + EndPos: 4415, }, }, Expr: &ast.ExprStaticCall{ @@ -13825,8 +13495,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4818, - EndPos: 4828, + StartPos: 4404, + EndPos: 4414, }, }, Class: &ast.NameName{ @@ -13834,8 +13504,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4818, - EndPos: 4821, + StartPos: 4404, + EndPos: 4407, }, }, Parts: []ast.Vertex{ @@ -13844,8 +13514,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4818, - EndPos: 4821, + StartPos: 4404, + EndPos: 4407, }, }, Value: []byte("Foo"), @@ -13857,8 +13527,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4823, - EndPos: 4826, + StartPos: 4409, + EndPos: 4412, }, }, Value: []byte("bar"), @@ -13868,8 +13538,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 244, EndLine: 244, - StartPos: 4826, - EndPos: 4828, + StartPos: 4412, + EndPos: 4414, }, }, }, @@ -13880,8 +13550,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4832, - EndPos: 4853, + StartPos: 4416, + EndPos: 4437, }, }, Expr: &ast.ExprStaticCall{ @@ -13889,8 +13559,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4832, - EndPos: 4852, + StartPos: 4416, + EndPos: 4436, }, }, Class: &ast.NameRelative{ @@ -13898,8 +13568,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4832, - EndPos: 4845, + StartPos: 4416, + EndPos: 4429, }, }, Parts: []ast.Vertex{ @@ -13908,8 +13578,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4842, - EndPos: 4845, + StartPos: 4426, + EndPos: 4429, }, }, Value: []byte("Foo"), @@ -13921,8 +13591,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4847, - EndPos: 4850, + StartPos: 4431, + EndPos: 4434, }, }, Value: []byte("bar"), @@ -13932,8 +13602,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 245, EndLine: 245, - StartPos: 4850, - EndPos: 4852, + StartPos: 4434, + EndPos: 4436, }, }, }, @@ -13944,8 +13614,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4856, - EndPos: 4868, + StartPos: 4438, + EndPos: 4450, }, }, Expr: &ast.ExprStaticCall{ @@ -13953,8 +13623,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4856, - EndPos: 4867, + StartPos: 4438, + EndPos: 4449, }, }, Class: &ast.NameFullyQualified{ @@ -13962,8 +13632,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4856, - EndPos: 4860, + StartPos: 4438, + EndPos: 4442, }, }, Parts: []ast.Vertex{ @@ -13972,8 +13642,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4857, - EndPos: 4860, + StartPos: 4439, + EndPos: 4442, }, }, Value: []byte("Foo"), @@ -13985,8 +13655,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4862, - EndPos: 4865, + StartPos: 4444, + EndPos: 4447, }, }, Value: []byte("bar"), @@ -13996,8 +13666,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 246, EndLine: 246, - StartPos: 4865, - EndPos: 4867, + StartPos: 4447, + EndPos: 4449, }, }, }, @@ -14008,8 +13678,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4871, - EndPos: 4881, + StartPos: 4451, + EndPos: 4461, }, }, Expr: &ast.ExprStaticPropertyFetch{ @@ -14017,8 +13687,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4871, - EndPos: 4880, + StartPos: 4451, + EndPos: 4460, }, }, Class: &ast.NameName{ @@ -14026,8 +13696,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4871, - EndPos: 4874, + StartPos: 4451, + EndPos: 4454, }, }, Parts: []ast.Vertex{ @@ -14036,8 +13706,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4871, - EndPos: 4874, + StartPos: 4451, + EndPos: 4454, }, }, Value: []byte("Foo"), @@ -14049,8 +13719,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4876, - EndPos: 4880, + StartPos: 4456, + EndPos: 4460, }, }, VarName: &ast.Identifier{ @@ -14058,8 +13728,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 247, EndLine: 247, - StartPos: 4876, - EndPos: 4880, + StartPos: 4456, + EndPos: 4460, }, }, Value: []byte("$bar"), @@ -14072,8 +13742,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4884, - EndPos: 4895, + StartPos: 4462, + EndPos: 4473, }, }, Expr: &ast.ExprStaticPropertyFetch{ @@ -14081,8 +13751,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4884, - EndPos: 4894, + StartPos: 4462, + EndPos: 4472, }, }, Class: &ast.ExprVariable{ @@ -14090,8 +13760,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4884, - EndPos: 4888, + StartPos: 4462, + EndPos: 4466, }, }, VarName: &ast.Identifier{ @@ -14099,8 +13769,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4884, - EndPos: 4888, + StartPos: 4462, + EndPos: 4466, }, }, Value: []byte("$foo"), @@ -14111,8 +13781,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4890, - EndPos: 4894, + StartPos: 4468, + EndPos: 4472, }, }, VarName: &ast.Identifier{ @@ -14120,8 +13790,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 248, EndLine: 248, - StartPos: 4890, - EndPos: 4894, + StartPos: 4468, + EndPos: 4472, }, }, Value: []byte("$bar"), @@ -14134,8 +13804,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4898, - EndPos: 4918, + StartPos: 4474, + EndPos: 4494, }, }, Expr: &ast.ExprStaticPropertyFetch{ @@ -14143,8 +13813,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4898, - EndPos: 4917, + StartPos: 4474, + EndPos: 4493, }, }, Class: &ast.NameRelative{ @@ -14152,8 +13822,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4898, - EndPos: 4911, + StartPos: 4474, + EndPos: 4487, }, }, Parts: []ast.Vertex{ @@ -14162,8 +13832,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4908, - EndPos: 4911, + StartPos: 4484, + EndPos: 4487, }, }, Value: []byte("Foo"), @@ -14175,8 +13845,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4913, - EndPos: 4917, + StartPos: 4489, + EndPos: 4493, }, }, VarName: &ast.Identifier{ @@ -14184,8 +13854,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 249, EndLine: 249, - StartPos: 4913, - EndPos: 4917, + StartPos: 4489, + EndPos: 4493, }, }, Value: []byte("$bar"), @@ -14198,8 +13868,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4921, - EndPos: 4932, + StartPos: 4495, + EndPos: 4506, }, }, Expr: &ast.ExprStaticPropertyFetch{ @@ -14207,8 +13877,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4921, - EndPos: 4931, + StartPos: 4495, + EndPos: 4505, }, }, Class: &ast.NameFullyQualified{ @@ -14216,8 +13886,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4921, - EndPos: 4925, + StartPos: 4495, + EndPos: 4499, }, }, Parts: []ast.Vertex{ @@ -14226,8 +13896,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4922, - EndPos: 4925, + StartPos: 4496, + EndPos: 4499, }, }, Value: []byte("Foo"), @@ -14239,8 +13909,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4927, - EndPos: 4931, + StartPos: 4501, + EndPos: 4505, }, }, VarName: &ast.Identifier{ @@ -14248,8 +13918,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 250, EndLine: 250, - StartPos: 4927, - EndPos: 4931, + StartPos: 4501, + EndPos: 4505, }, }, Value: []byte("$bar"), @@ -14262,8 +13932,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4935, - EndPos: 4948, + StartPos: 4507, + EndPos: 4520, }, }, Expr: &ast.ExprTernary{ @@ -14271,8 +13941,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4935, - EndPos: 4947, + StartPos: 4507, + EndPos: 4519, }, }, Condition: &ast.ExprVariable{ @@ -14280,8 +13950,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4935, - EndPos: 4937, + StartPos: 4507, + EndPos: 4509, }, }, VarName: &ast.Identifier{ @@ -14289,8 +13959,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4935, - EndPos: 4937, + StartPos: 4507, + EndPos: 4509, }, }, Value: []byte("$a"), @@ -14301,8 +13971,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4940, - EndPos: 4942, + StartPos: 4512, + EndPos: 4514, }, }, VarName: &ast.Identifier{ @@ -14310,8 +13980,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4940, - EndPos: 4942, + StartPos: 4512, + EndPos: 4514, }, }, Value: []byte("$b"), @@ -14322,8 +13992,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4945, - EndPos: 4947, + StartPos: 4517, + EndPos: 4519, }, }, VarName: &ast.Identifier{ @@ -14331,8 +14001,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 251, EndLine: 251, - StartPos: 4945, - EndPos: 4947, + StartPos: 4517, + EndPos: 4519, }, }, Value: []byte("$c"), @@ -14345,8 +14015,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4951, - EndPos: 4961, + StartPos: 4521, + EndPos: 4531, }, }, Expr: &ast.ExprTernary{ @@ -14354,8 +14024,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4951, - EndPos: 4960, + StartPos: 4521, + EndPos: 4530, }, }, Condition: &ast.ExprVariable{ @@ -14363,8 +14033,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4951, - EndPos: 4953, + StartPos: 4521, + EndPos: 4523, }, }, VarName: &ast.Identifier{ @@ -14372,8 +14042,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4951, - EndPos: 4953, + StartPos: 4521, + EndPos: 4523, }, }, Value: []byte("$a"), @@ -14384,8 +14054,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4958, - EndPos: 4960, + StartPos: 4528, + EndPos: 4530, }, }, VarName: &ast.Identifier{ @@ -14393,8 +14063,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 252, EndLine: 252, - StartPos: 4958, - EndPos: 4960, + StartPos: 4528, + EndPos: 4530, }, }, Value: []byte("$c"), @@ -14407,8 +14077,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4964, - EndPos: 4987, + StartPos: 4532, + EndPos: 4555, }, }, Expr: &ast.ExprTernary{ @@ -14416,8 +14086,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4964, - EndPos: 4986, + StartPos: 4532, + EndPos: 4554, }, }, Condition: &ast.ExprVariable{ @@ -14425,8 +14095,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4964, - EndPos: 4966, + StartPos: 4532, + EndPos: 4534, }, }, VarName: &ast.Identifier{ @@ -14434,8 +14104,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4964, - EndPos: 4966, + StartPos: 4532, + EndPos: 4534, }, }, Value: []byte("$a"), @@ -14446,8 +14116,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4969, - EndPos: 4981, + StartPos: 4537, + EndPos: 4549, }, }, Condition: &ast.ExprVariable{ @@ -14455,8 +14125,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4969, - EndPos: 4971, + StartPos: 4537, + EndPos: 4539, }, }, VarName: &ast.Identifier{ @@ -14464,8 +14134,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4969, - EndPos: 4971, + StartPos: 4537, + EndPos: 4539, }, }, Value: []byte("$b"), @@ -14476,8 +14146,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4974, - EndPos: 4976, + StartPos: 4542, + EndPos: 4544, }, }, VarName: &ast.Identifier{ @@ -14485,8 +14155,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4974, - EndPos: 4976, + StartPos: 4542, + EndPos: 4544, }, }, Value: []byte("$c"), @@ -14497,8 +14167,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4979, - EndPos: 4981, + StartPos: 4547, + EndPos: 4549, }, }, VarName: &ast.Identifier{ @@ -14506,8 +14176,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4979, - EndPos: 4981, + StartPos: 4547, + EndPos: 4549, }, }, Value: []byte("$d"), @@ -14519,8 +14189,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4984, - EndPos: 4986, + StartPos: 4552, + EndPos: 4554, }, }, VarName: &ast.Identifier{ @@ -14528,8 +14198,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 253, EndLine: 253, - StartPos: 4984, - EndPos: 4986, + StartPos: 4552, + EndPos: 4554, }, }, Value: []byte("$e"), @@ -14542,8 +14212,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4990, - EndPos: 5013, + StartPos: 4556, + EndPos: 4579, }, }, Expr: &ast.ExprTernary{ @@ -14551,8 +14221,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4990, - EndPos: 5012, + StartPos: 4556, + EndPos: 4578, }, }, Condition: &ast.ExprTernary{ @@ -14560,8 +14230,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4990, - EndPos: 5002, + StartPos: 4556, + EndPos: 4568, }, }, Condition: &ast.ExprVariable{ @@ -14569,8 +14239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4990, - EndPos: 4992, + StartPos: 4556, + EndPos: 4558, }, }, VarName: &ast.Identifier{ @@ -14578,8 +14248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4990, - EndPos: 4992, + StartPos: 4556, + EndPos: 4558, }, }, Value: []byte("$a"), @@ -14590,8 +14260,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4995, - EndPos: 4997, + StartPos: 4561, + EndPos: 4563, }, }, VarName: &ast.Identifier{ @@ -14599,8 +14269,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 4995, - EndPos: 4997, + StartPos: 4561, + EndPos: 4563, }, }, Value: []byte("$b"), @@ -14611,8 +14281,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5000, - EndPos: 5002, + StartPos: 4566, + EndPos: 4568, }, }, VarName: &ast.Identifier{ @@ -14620,8 +14290,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5000, - EndPos: 5002, + StartPos: 4566, + EndPos: 4568, }, }, Value: []byte("$c"), @@ -14633,8 +14303,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5005, - EndPos: 5007, + StartPos: 4571, + EndPos: 4573, }, }, VarName: &ast.Identifier{ @@ -14642,8 +14312,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5005, - EndPos: 5007, + StartPos: 4571, + EndPos: 4573, }, }, Value: []byte("$d"), @@ -14654,8 +14324,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5010, - EndPos: 5012, + StartPos: 4576, + EndPos: 4578, }, }, VarName: &ast.Identifier{ @@ -14663,8 +14333,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 254, EndLine: 254, - StartPos: 5010, - EndPos: 5012, + StartPos: 4576, + EndPos: 4578, }, }, Value: []byte("$e"), @@ -14677,8 +14347,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 5016, - EndPos: 5020, + StartPos: 4580, + EndPos: 4584, }, }, Expr: &ast.ExprUnaryMinus{ @@ -14686,8 +14356,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 5016, - EndPos: 5019, + StartPos: 4580, + EndPos: 4583, }, }, Expr: &ast.ExprVariable{ @@ -14695,8 +14365,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 5017, - EndPos: 5019, + StartPos: 4581, + EndPos: 4583, }, }, VarName: &ast.Identifier{ @@ -14704,8 +14374,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 255, EndLine: 255, - StartPos: 5017, - EndPos: 5019, + StartPos: 4581, + EndPos: 4583, }, }, Value: []byte("$a"), @@ -14718,8 +14388,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 256, EndLine: 256, - StartPos: 5023, - EndPos: 5027, + StartPos: 4585, + EndPos: 4589, }, }, Expr: &ast.ExprUnaryPlus{ @@ -14727,8 +14397,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 256, EndLine: 256, - StartPos: 5023, - EndPos: 5026, + StartPos: 4585, + EndPos: 4588, }, }, Expr: &ast.ExprVariable{ @@ -14736,8 +14406,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 256, EndLine: 256, - StartPos: 5024, - EndPos: 5026, + StartPos: 4586, + EndPos: 4588, }, }, VarName: &ast.Identifier{ @@ -14745,8 +14415,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 256, EndLine: 256, - StartPos: 5024, - EndPos: 5026, + StartPos: 4586, + EndPos: 4588, }, }, Value: []byte("$a"), @@ -14759,8 +14429,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5030, - EndPos: 5034, + StartPos: 4590, + EndPos: 4594, }, }, Expr: &ast.ExprVariable{ @@ -14768,8 +14438,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5030, - EndPos: 5033, + StartPos: 4590, + EndPos: 4593, }, }, VarName: &ast.ExprVariable{ @@ -14777,8 +14447,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5031, - EndPos: 5033, + StartPos: 4591, + EndPos: 4593, }, }, VarName: &ast.Identifier{ @@ -14786,8 +14456,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 257, EndLine: 257, - StartPos: 5031, - EndPos: 5033, + StartPos: 4591, + EndPos: 4593, }, }, Value: []byte("$a"), @@ -14800,8 +14470,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 258, EndLine: 258, - StartPos: 5037, - EndPos: 5043, + StartPos: 4595, + EndPos: 4601, }, }, Expr: &ast.ExprYield{ @@ -14809,8 +14479,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 258, EndLine: 258, - StartPos: 5037, - EndPos: 5042, + StartPos: 4595, + EndPos: 4600, }, }, }, @@ -14820,8 +14490,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5046, - EndPos: 5055, + StartPos: 4602, + EndPos: 4611, }, }, Expr: &ast.ExprYield{ @@ -14829,8 +14499,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5046, - EndPos: 5054, + StartPos: 4602, + EndPos: 4610, }, }, Value: &ast.ExprVariable{ @@ -14838,8 +14508,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5052, - EndPos: 5054, + StartPos: 4608, + EndPos: 4610, }, }, VarName: &ast.Identifier{ @@ -14847,8 +14517,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 259, EndLine: 259, - StartPos: 5052, - EndPos: 5054, + StartPos: 4608, + EndPos: 4610, }, }, Value: []byte("$a"), @@ -14861,8 +14531,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5058, - EndPos: 5073, + StartPos: 4612, + EndPos: 4627, }, }, Expr: &ast.ExprYield{ @@ -14870,8 +14540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5058, - EndPos: 5072, + StartPos: 4612, + EndPos: 4626, }, }, Key: &ast.ExprVariable{ @@ -14879,8 +14549,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5064, - EndPos: 5066, + StartPos: 4618, + EndPos: 4620, }, }, VarName: &ast.Identifier{ @@ -14888,8 +14558,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5064, - EndPos: 5066, + StartPos: 4618, + EndPos: 4620, }, }, Value: []byte("$a"), @@ -14900,8 +14570,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5070, - EndPos: 5072, + StartPos: 4624, + EndPos: 4626, }, }, VarName: &ast.Identifier{ @@ -14909,8 +14579,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 260, EndLine: 260, - StartPos: 5070, - EndPos: 5072, + StartPos: 4624, + EndPos: 4626, }, }, Value: []byte("$b"), @@ -14923,8 +14593,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5076, - EndPos: 5090, + StartPos: 4628, + EndPos: 4642, }, }, Expr: &ast.ExprYieldFrom{ @@ -14932,8 +14602,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5076, - EndPos: 5089, + StartPos: 4628, + EndPos: 4641, }, }, Expr: &ast.ExprVariable{ @@ -14941,8 +14611,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5087, - EndPos: 5089, + StartPos: 4639, + EndPos: 4641, }, }, VarName: &ast.Identifier{ @@ -14950,8 +14620,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 261, EndLine: 261, - StartPos: 5087, - EndPos: 5089, + StartPos: 4639, + EndPos: 4641, }, }, Value: []byte("$a"), @@ -14964,8 +14634,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5096, - EndPos: 5106, + StartPos: 4644, + EndPos: 4654, }, }, Expr: &ast.ExprCastArray{ @@ -14973,8 +14643,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5096, - EndPos: 5105, + StartPos: 4644, + EndPos: 4653, }, }, Expr: &ast.ExprVariable{ @@ -14982,8 +14652,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5103, - EndPos: 5105, + StartPos: 4651, + EndPos: 4653, }, }, VarName: &ast.Identifier{ @@ -14991,8 +14661,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 263, EndLine: 263, - StartPos: 5103, - EndPos: 5105, + StartPos: 4651, + EndPos: 4653, }, }, Value: []byte("$a"), @@ -15005,8 +14675,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5109, - EndPos: 5121, + StartPos: 4655, + EndPos: 4667, }, }, Expr: &ast.ExprCastBool{ @@ -15014,8 +14684,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5109, - EndPos: 5120, + StartPos: 4655, + EndPos: 4666, }, }, Expr: &ast.ExprVariable{ @@ -15023,8 +14693,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5118, - EndPos: 5120, + StartPos: 4664, + EndPos: 4666, }, }, VarName: &ast.Identifier{ @@ -15032,8 +14702,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 264, EndLine: 264, - StartPos: 5118, - EndPos: 5120, + StartPos: 4664, + EndPos: 4666, }, }, Value: []byte("$a"), @@ -15046,8 +14716,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5124, - EndPos: 5133, + StartPos: 4668, + EndPos: 4677, }, }, Expr: &ast.ExprCastBool{ @@ -15055,8 +14725,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5124, - EndPos: 5132, + StartPos: 4668, + EndPos: 4676, }, }, Expr: &ast.ExprVariable{ @@ -15064,8 +14734,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5130, - EndPos: 5132, + StartPos: 4674, + EndPos: 4676, }, }, VarName: &ast.Identifier{ @@ -15073,8 +14743,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 265, EndLine: 265, - StartPos: 5130, - EndPos: 5132, + StartPos: 4674, + EndPos: 4676, }, }, Value: []byte("$a"), @@ -15087,8 +14757,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5136, - EndPos: 5147, + StartPos: 4678, + EndPos: 4689, }, }, Expr: &ast.ExprCastDouble{ @@ -15096,8 +14766,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5136, - EndPos: 5146, + StartPos: 4678, + EndPos: 4688, }, }, Expr: &ast.ExprVariable{ @@ -15105,8 +14775,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5144, - EndPos: 5146, + StartPos: 4686, + EndPos: 4688, }, }, VarName: &ast.Identifier{ @@ -15114,8 +14784,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 266, EndLine: 266, - StartPos: 5144, - EndPos: 5146, + StartPos: 4686, + EndPos: 4688, }, }, Value: []byte("$a"), @@ -15128,8 +14798,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 267, EndLine: 267, - StartPos: 5150, - EndPos: 5160, + StartPos: 4690, + EndPos: 4700, }, }, Expr: &ast.ExprCastDouble{ @@ -15137,8 +14807,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 267, EndLine: 267, - StartPos: 5150, - EndPos: 5159, + StartPos: 4690, + EndPos: 4699, }, }, Expr: &ast.ExprVariable{ @@ -15146,8 +14816,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 267, EndLine: 267, - StartPos: 5157, - EndPos: 5159, + StartPos: 4697, + EndPos: 4699, }, }, VarName: &ast.Identifier{ @@ -15155,8 +14825,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 267, EndLine: 267, - StartPos: 5157, - EndPos: 5159, + StartPos: 4697, + EndPos: 4699, }, }, Value: []byte("$a"), @@ -15169,8 +14839,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 268, EndLine: 268, - StartPos: 5163, - EndPos: 5175, + StartPos: 4701, + EndPos: 4713, }, }, Expr: &ast.ExprCastInt{ @@ -15178,8 +14848,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 268, EndLine: 268, - StartPos: 5163, - EndPos: 5174, + StartPos: 4701, + EndPos: 4712, }, }, Expr: &ast.ExprVariable{ @@ -15187,8 +14857,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 268, EndLine: 268, - StartPos: 5172, - EndPos: 5174, + StartPos: 4710, + EndPos: 4712, }, }, VarName: &ast.Identifier{ @@ -15196,8 +14866,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 268, EndLine: 268, - StartPos: 5172, - EndPos: 5174, + StartPos: 4710, + EndPos: 4712, }, }, Value: []byte("$a"), @@ -15210,8 +14880,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 269, EndLine: 269, - StartPos: 5178, - EndPos: 5186, + StartPos: 4714, + EndPos: 4722, }, }, Expr: &ast.ExprCastInt{ @@ -15219,8 +14889,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 269, EndLine: 269, - StartPos: 5178, - EndPos: 5185, + StartPos: 4714, + EndPos: 4721, }, }, Expr: &ast.ExprVariable{ @@ -15228,8 +14898,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 269, EndLine: 269, - StartPos: 5183, - EndPos: 5185, + StartPos: 4719, + EndPos: 4721, }, }, VarName: &ast.Identifier{ @@ -15237,8 +14907,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 269, EndLine: 269, - StartPos: 5183, - EndPos: 5185, + StartPos: 4719, + EndPos: 4721, }, }, Value: []byte("$a"), @@ -15251,8 +14921,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 270, EndLine: 270, - StartPos: 5189, - EndPos: 5200, + StartPos: 4723, + EndPos: 4734, }, }, Expr: &ast.ExprCastObject{ @@ -15260,8 +14930,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 270, EndLine: 270, - StartPos: 5189, - EndPos: 5199, + StartPos: 4723, + EndPos: 4733, }, }, Expr: &ast.ExprVariable{ @@ -15269,8 +14939,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 270, EndLine: 270, - StartPos: 5197, - EndPos: 5199, + StartPos: 4731, + EndPos: 4733, }, }, VarName: &ast.Identifier{ @@ -15278,8 +14948,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 270, EndLine: 270, - StartPos: 5197, - EndPos: 5199, + StartPos: 4731, + EndPos: 4733, }, }, Value: []byte("$a"), @@ -15292,8 +14962,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 271, EndLine: 271, - StartPos: 5203, - EndPos: 5214, + StartPos: 4735, + EndPos: 4746, }, }, Expr: &ast.ExprCastString{ @@ -15301,8 +14971,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 271, EndLine: 271, - StartPos: 5203, - EndPos: 5213, + StartPos: 4735, + EndPos: 4745, }, }, Expr: &ast.ExprVariable{ @@ -15310,8 +14980,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 271, EndLine: 271, - StartPos: 5211, - EndPos: 5213, + StartPos: 4743, + EndPos: 4745, }, }, VarName: &ast.Identifier{ @@ -15319,8 +14989,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 271, EndLine: 271, - StartPos: 5211, - EndPos: 5213, + StartPos: 4743, + EndPos: 4745, }, }, Value: []byte("$a"), @@ -15333,8 +15003,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 272, EndLine: 272, - StartPos: 5217, - EndPos: 5227, + StartPos: 4747, + EndPos: 4757, }, }, Expr: &ast.ExprCastUnset{ @@ -15342,8 +15012,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 272, EndLine: 272, - StartPos: 5217, - EndPos: 5226, + StartPos: 4747, + EndPos: 4756, }, }, Expr: &ast.ExprVariable{ @@ -15351,8 +15021,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 272, EndLine: 272, - StartPos: 5224, - EndPos: 5226, + StartPos: 4754, + EndPos: 4756, }, }, VarName: &ast.Identifier{ @@ -15360,8 +15030,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 272, EndLine: 272, - StartPos: 5224, - EndPos: 5226, + StartPos: 4754, + EndPos: 4756, }, }, Value: []byte("$a"), @@ -15374,8 +15044,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5231, - EndPos: 5239, + StartPos: 4759, + EndPos: 4767, }, }, Expr: &ast.ExprBinaryBitwiseAnd{ @@ -15383,8 +15053,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5231, - EndPos: 5238, + StartPos: 4759, + EndPos: 4766, }, }, Left: &ast.ExprVariable{ @@ -15392,8 +15062,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5231, - EndPos: 5233, + StartPos: 4759, + EndPos: 4761, }, }, VarName: &ast.Identifier{ @@ -15401,8 +15071,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5231, - EndPos: 5233, + StartPos: 4759, + EndPos: 4761, }, }, Value: []byte("$a"), @@ -15413,8 +15083,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5236, - EndPos: 5238, + StartPos: 4764, + EndPos: 4766, }, }, VarName: &ast.Identifier{ @@ -15422,8 +15092,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 274, EndLine: 274, - StartPos: 5236, - EndPos: 5238, + StartPos: 4764, + EndPos: 4766, }, }, Value: []byte("$b"), @@ -15436,8 +15106,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5242, - EndPos: 5250, + StartPos: 4768, + EndPos: 4776, }, }, Expr: &ast.ExprBinaryBitwiseOr{ @@ -15445,8 +15115,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5242, - EndPos: 5249, + StartPos: 4768, + EndPos: 4775, }, }, Left: &ast.ExprVariable{ @@ -15454,8 +15124,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5242, - EndPos: 5244, + StartPos: 4768, + EndPos: 4770, }, }, VarName: &ast.Identifier{ @@ -15463,8 +15133,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5242, - EndPos: 5244, + StartPos: 4768, + EndPos: 4770, }, }, Value: []byte("$a"), @@ -15475,8 +15145,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5247, - EndPos: 5249, + StartPos: 4773, + EndPos: 4775, }, }, VarName: &ast.Identifier{ @@ -15484,8 +15154,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 275, EndLine: 275, - StartPos: 5247, - EndPos: 5249, + StartPos: 4773, + EndPos: 4775, }, }, Value: []byte("$b"), @@ -15498,8 +15168,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5253, - EndPos: 5261, + StartPos: 4777, + EndPos: 4785, }, }, Expr: &ast.ExprBinaryBitwiseXor{ @@ -15507,8 +15177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5253, - EndPos: 5260, + StartPos: 4777, + EndPos: 4784, }, }, Left: &ast.ExprVariable{ @@ -15516,8 +15186,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5253, - EndPos: 5255, + StartPos: 4777, + EndPos: 4779, }, }, VarName: &ast.Identifier{ @@ -15525,8 +15195,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5253, - EndPos: 5255, + StartPos: 4777, + EndPos: 4779, }, }, Value: []byte("$a"), @@ -15537,8 +15207,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5258, - EndPos: 5260, + StartPos: 4782, + EndPos: 4784, }, }, VarName: &ast.Identifier{ @@ -15546,8 +15216,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 276, EndLine: 276, - StartPos: 5258, - EndPos: 5260, + StartPos: 4782, + EndPos: 4784, }, }, Value: []byte("$b"), @@ -15560,8 +15230,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5264, - EndPos: 5273, + StartPos: 4786, + EndPos: 4795, }, }, Expr: &ast.ExprBinaryBooleanAnd{ @@ -15569,8 +15239,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5264, - EndPos: 5272, + StartPos: 4786, + EndPos: 4794, }, }, Left: &ast.ExprVariable{ @@ -15578,8 +15248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5264, - EndPos: 5266, + StartPos: 4786, + EndPos: 4788, }, }, VarName: &ast.Identifier{ @@ -15587,8 +15257,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5264, - EndPos: 5266, + StartPos: 4786, + EndPos: 4788, }, }, Value: []byte("$a"), @@ -15599,8 +15269,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5270, - EndPos: 5272, + StartPos: 4792, + EndPos: 4794, }, }, VarName: &ast.Identifier{ @@ -15608,8 +15278,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 277, EndLine: 277, - StartPos: 5270, - EndPos: 5272, + StartPos: 4792, + EndPos: 4794, }, }, Value: []byte("$b"), @@ -15622,8 +15292,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5276, - EndPos: 5285, + StartPos: 4796, + EndPos: 4805, }, }, Expr: &ast.ExprBinaryBooleanOr{ @@ -15631,8 +15301,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5276, - EndPos: 5284, + StartPos: 4796, + EndPos: 4804, }, }, Left: &ast.ExprVariable{ @@ -15640,8 +15310,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5276, - EndPos: 5278, + StartPos: 4796, + EndPos: 4798, }, }, VarName: &ast.Identifier{ @@ -15649,8 +15319,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5276, - EndPos: 5278, + StartPos: 4796, + EndPos: 4798, }, }, Value: []byte("$a"), @@ -15661,8 +15331,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5282, - EndPos: 5284, + StartPos: 4802, + EndPos: 4804, }, }, VarName: &ast.Identifier{ @@ -15670,8 +15340,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 278, EndLine: 278, - StartPos: 5282, - EndPos: 5284, + StartPos: 4802, + EndPos: 4804, }, }, Value: []byte("$b"), @@ -15684,8 +15354,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5288, - EndPos: 5297, + StartPos: 4806, + EndPos: 4815, }, }, Expr: &ast.ExprBinaryCoalesce{ @@ -15693,8 +15363,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5288, - EndPos: 5296, + StartPos: 4806, + EndPos: 4814, }, }, Left: &ast.ExprVariable{ @@ -15702,8 +15372,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5288, - EndPos: 5290, + StartPos: 4806, + EndPos: 4808, }, }, VarName: &ast.Identifier{ @@ -15711,8 +15381,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5288, - EndPos: 5290, + StartPos: 4806, + EndPos: 4808, }, }, Value: []byte("$a"), @@ -15723,8 +15393,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5294, - EndPos: 5296, + StartPos: 4812, + EndPos: 4814, }, }, VarName: &ast.Identifier{ @@ -15732,8 +15402,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 279, EndLine: 279, - StartPos: 5294, - EndPos: 5296, + StartPos: 4812, + EndPos: 4814, }, }, Value: []byte("$b"), @@ -15746,8 +15416,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5300, - EndPos: 5308, + StartPos: 4816, + EndPos: 4824, }, }, Expr: &ast.ExprBinaryConcat{ @@ -15755,8 +15425,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5300, - EndPos: 5307, + StartPos: 4816, + EndPos: 4823, }, }, Left: &ast.ExprVariable{ @@ -15764,8 +15434,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5300, - EndPos: 5302, + StartPos: 4816, + EndPos: 4818, }, }, VarName: &ast.Identifier{ @@ -15773,8 +15443,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5300, - EndPos: 5302, + StartPos: 4816, + EndPos: 4818, }, }, Value: []byte("$a"), @@ -15785,8 +15455,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5305, - EndPos: 5307, + StartPos: 4821, + EndPos: 4823, }, }, VarName: &ast.Identifier{ @@ -15794,8 +15464,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 280, EndLine: 280, - StartPos: 5305, - EndPos: 5307, + StartPos: 4821, + EndPos: 4823, }, }, Value: []byte("$b"), @@ -15808,8 +15478,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5311, - EndPos: 5319, + StartPos: 4825, + EndPos: 4833, }, }, Expr: &ast.ExprBinaryDiv{ @@ -15817,8 +15487,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5311, - EndPos: 5318, + StartPos: 4825, + EndPos: 4832, }, }, Left: &ast.ExprVariable{ @@ -15826,8 +15496,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5311, - EndPos: 5313, + StartPos: 4825, + EndPos: 4827, }, }, VarName: &ast.Identifier{ @@ -15835,8 +15505,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5311, - EndPos: 5313, + StartPos: 4825, + EndPos: 4827, }, }, Value: []byte("$a"), @@ -15847,8 +15517,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5316, - EndPos: 5318, + StartPos: 4830, + EndPos: 4832, }, }, VarName: &ast.Identifier{ @@ -15856,8 +15526,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 281, EndLine: 281, - StartPos: 5316, - EndPos: 5318, + StartPos: 4830, + EndPos: 4832, }, }, Value: []byte("$b"), @@ -15870,8 +15540,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5322, - EndPos: 5331, + StartPos: 4834, + EndPos: 4843, }, }, Expr: &ast.ExprBinaryEqual{ @@ -15879,8 +15549,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5322, - EndPos: 5330, + StartPos: 4834, + EndPos: 4842, }, }, Left: &ast.ExprVariable{ @@ -15888,8 +15558,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5322, - EndPos: 5324, + StartPos: 4834, + EndPos: 4836, }, }, VarName: &ast.Identifier{ @@ -15897,8 +15567,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5322, - EndPos: 5324, + StartPos: 4834, + EndPos: 4836, }, }, Value: []byte("$a"), @@ -15909,8 +15579,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5328, - EndPos: 5330, + StartPos: 4840, + EndPos: 4842, }, }, VarName: &ast.Identifier{ @@ -15918,8 +15588,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 282, EndLine: 282, - StartPos: 5328, - EndPos: 5330, + StartPos: 4840, + EndPos: 4842, }, }, Value: []byte("$b"), @@ -15932,8 +15602,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5334, - EndPos: 5343, + StartPos: 4844, + EndPos: 4853, }, }, Expr: &ast.ExprBinaryGreaterOrEqual{ @@ -15941,8 +15611,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5334, - EndPos: 5342, + StartPos: 4844, + EndPos: 4852, }, }, Left: &ast.ExprVariable{ @@ -15950,8 +15620,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5334, - EndPos: 5336, + StartPos: 4844, + EndPos: 4846, }, }, VarName: &ast.Identifier{ @@ -15959,8 +15629,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5334, - EndPos: 5336, + StartPos: 4844, + EndPos: 4846, }, }, Value: []byte("$a"), @@ -15971,8 +15641,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5340, - EndPos: 5342, + StartPos: 4850, + EndPos: 4852, }, }, VarName: &ast.Identifier{ @@ -15980,8 +15650,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 283, EndLine: 283, - StartPos: 5340, - EndPos: 5342, + StartPos: 4850, + EndPos: 4852, }, }, Value: []byte("$b"), @@ -15994,8 +15664,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5346, - EndPos: 5354, + StartPos: 4854, + EndPos: 4862, }, }, Expr: &ast.ExprBinaryGreater{ @@ -16003,8 +15673,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5346, - EndPos: 5353, + StartPos: 4854, + EndPos: 4861, }, }, Left: &ast.ExprVariable{ @@ -16012,8 +15682,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5346, - EndPos: 5348, + StartPos: 4854, + EndPos: 4856, }, }, VarName: &ast.Identifier{ @@ -16021,8 +15691,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5346, - EndPos: 5348, + StartPos: 4854, + EndPos: 4856, }, }, Value: []byte("$a"), @@ -16033,8 +15703,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5351, - EndPos: 5353, + StartPos: 4859, + EndPos: 4861, }, }, VarName: &ast.Identifier{ @@ -16042,8 +15712,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 284, EndLine: 284, - StartPos: 5351, - EndPos: 5353, + StartPos: 4859, + EndPos: 4861, }, }, Value: []byte("$b"), @@ -16056,8 +15726,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5357, - EndPos: 5367, + StartPos: 4863, + EndPos: 4873, }, }, Expr: &ast.ExprBinaryIdentical{ @@ -16065,8 +15735,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5357, - EndPos: 5366, + StartPos: 4863, + EndPos: 4872, }, }, Left: &ast.ExprVariable{ @@ -16074,8 +15744,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5357, - EndPos: 5359, + StartPos: 4863, + EndPos: 4865, }, }, VarName: &ast.Identifier{ @@ -16083,8 +15753,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5357, - EndPos: 5359, + StartPos: 4863, + EndPos: 4865, }, }, Value: []byte("$a"), @@ -16095,8 +15765,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5364, - EndPos: 5366, + StartPos: 4870, + EndPos: 4872, }, }, VarName: &ast.Identifier{ @@ -16104,8 +15774,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 285, EndLine: 285, - StartPos: 5364, - EndPos: 5366, + StartPos: 4870, + EndPos: 4872, }, }, Value: []byte("$b"), @@ -16118,8 +15788,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5370, - EndPos: 5380, + StartPos: 4874, + EndPos: 4884, }, }, Expr: &ast.ExprBinaryLogicalAnd{ @@ -16127,8 +15797,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5370, - EndPos: 5379, + StartPos: 4874, + EndPos: 4883, }, }, Left: &ast.ExprVariable{ @@ -16136,8 +15806,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5370, - EndPos: 5372, + StartPos: 4874, + EndPos: 4876, }, }, VarName: &ast.Identifier{ @@ -16145,8 +15815,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5370, - EndPos: 5372, + StartPos: 4874, + EndPos: 4876, }, }, Value: []byte("$a"), @@ -16157,8 +15827,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5377, - EndPos: 5379, + StartPos: 4881, + EndPos: 4883, }, }, VarName: &ast.Identifier{ @@ -16166,8 +15836,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 286, EndLine: 286, - StartPos: 5377, - EndPos: 5379, + StartPos: 4881, + EndPos: 4883, }, }, Value: []byte("$b"), @@ -16180,8 +15850,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5383, - EndPos: 5392, + StartPos: 4885, + EndPos: 4894, }, }, Expr: &ast.ExprBinaryLogicalOr{ @@ -16189,8 +15859,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5383, - EndPos: 5391, + StartPos: 4885, + EndPos: 4893, }, }, Left: &ast.ExprVariable{ @@ -16198,8 +15868,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5383, - EndPos: 5385, + StartPos: 4885, + EndPos: 4887, }, }, VarName: &ast.Identifier{ @@ -16207,8 +15877,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5383, - EndPos: 5385, + StartPos: 4885, + EndPos: 4887, }, }, Value: []byte("$a"), @@ -16219,8 +15889,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5389, - EndPos: 5391, + StartPos: 4891, + EndPos: 4893, }, }, VarName: &ast.Identifier{ @@ -16228,8 +15898,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 287, EndLine: 287, - StartPos: 5389, - EndPos: 5391, + StartPos: 4891, + EndPos: 4893, }, }, Value: []byte("$b"), @@ -16242,8 +15912,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5395, - EndPos: 5405, + StartPos: 4895, + EndPos: 4905, }, }, Expr: &ast.ExprBinaryLogicalXor{ @@ -16251,8 +15921,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5395, - EndPos: 5404, + StartPos: 4895, + EndPos: 4904, }, }, Left: &ast.ExprVariable{ @@ -16260,8 +15930,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5395, - EndPos: 5397, + StartPos: 4895, + EndPos: 4897, }, }, VarName: &ast.Identifier{ @@ -16269,8 +15939,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5395, - EndPos: 5397, + StartPos: 4895, + EndPos: 4897, }, }, Value: []byte("$a"), @@ -16281,8 +15951,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5402, - EndPos: 5404, + StartPos: 4902, + EndPos: 4904, }, }, VarName: &ast.Identifier{ @@ -16290,8 +15960,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 288, EndLine: 288, - StartPos: 5402, - EndPos: 5404, + StartPos: 4902, + EndPos: 4904, }, }, Value: []byte("$b"), @@ -16304,8 +15974,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5408, - EndPos: 5416, + StartPos: 4906, + EndPos: 4914, }, }, Expr: &ast.ExprBinaryMinus{ @@ -16313,8 +15983,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5408, - EndPos: 5415, + StartPos: 4906, + EndPos: 4913, }, }, Left: &ast.ExprVariable{ @@ -16322,8 +15992,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5408, - EndPos: 5410, + StartPos: 4906, + EndPos: 4908, }, }, VarName: &ast.Identifier{ @@ -16331,8 +16001,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5408, - EndPos: 5410, + StartPos: 4906, + EndPos: 4908, }, }, Value: []byte("$a"), @@ -16343,8 +16013,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5413, - EndPos: 5415, + StartPos: 4911, + EndPos: 4913, }, }, VarName: &ast.Identifier{ @@ -16352,8 +16022,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 289, EndLine: 289, - StartPos: 5413, - EndPos: 5415, + StartPos: 4911, + EndPos: 4913, }, }, Value: []byte("$b"), @@ -16366,8 +16036,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5419, - EndPos: 5427, + StartPos: 4915, + EndPos: 4923, }, }, Expr: &ast.ExprBinaryMod{ @@ -16375,8 +16045,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5419, - EndPos: 5426, + StartPos: 4915, + EndPos: 4922, }, }, Left: &ast.ExprVariable{ @@ -16384,8 +16054,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5419, - EndPos: 5421, + StartPos: 4915, + EndPos: 4917, }, }, VarName: &ast.Identifier{ @@ -16393,8 +16063,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5419, - EndPos: 5421, + StartPos: 4915, + EndPos: 4917, }, }, Value: []byte("$a"), @@ -16405,8 +16075,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5424, - EndPos: 5426, + StartPos: 4920, + EndPos: 4922, }, }, VarName: &ast.Identifier{ @@ -16414,8 +16084,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 290, EndLine: 290, - StartPos: 5424, - EndPos: 5426, + StartPos: 4920, + EndPos: 4922, }, }, Value: []byte("$b"), @@ -16428,8 +16098,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5430, - EndPos: 5438, + StartPos: 4924, + EndPos: 4932, }, }, Expr: &ast.ExprBinaryMul{ @@ -16437,8 +16107,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5430, - EndPos: 5437, + StartPos: 4924, + EndPos: 4931, }, }, Left: &ast.ExprVariable{ @@ -16446,8 +16116,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5430, - EndPos: 5432, + StartPos: 4924, + EndPos: 4926, }, }, VarName: &ast.Identifier{ @@ -16455,8 +16125,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5430, - EndPos: 5432, + StartPos: 4924, + EndPos: 4926, }, }, Value: []byte("$a"), @@ -16467,8 +16137,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5435, - EndPos: 5437, + StartPos: 4929, + EndPos: 4931, }, }, VarName: &ast.Identifier{ @@ -16476,8 +16146,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 291, EndLine: 291, - StartPos: 5435, - EndPos: 5437, + StartPos: 4929, + EndPos: 4931, }, }, Value: []byte("$b"), @@ -16490,8 +16160,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5441, - EndPos: 5450, + StartPos: 4933, + EndPos: 4942, }, }, Expr: &ast.ExprBinaryNotEqual{ @@ -16499,8 +16169,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5441, - EndPos: 5449, + StartPos: 4933, + EndPos: 4941, }, }, Left: &ast.ExprVariable{ @@ -16508,8 +16178,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5441, - EndPos: 5443, + StartPos: 4933, + EndPos: 4935, }, }, VarName: &ast.Identifier{ @@ -16517,8 +16187,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5441, - EndPos: 5443, + StartPos: 4933, + EndPos: 4935, }, }, Value: []byte("$a"), @@ -16529,8 +16199,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5447, - EndPos: 5449, + StartPos: 4939, + EndPos: 4941, }, }, VarName: &ast.Identifier{ @@ -16538,8 +16208,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 292, EndLine: 292, - StartPos: 5447, - EndPos: 5449, + StartPos: 4939, + EndPos: 4941, }, }, Value: []byte("$b"), @@ -16552,8 +16222,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5453, - EndPos: 5463, + StartPos: 4943, + EndPos: 4953, }, }, Expr: &ast.ExprBinaryNotIdentical{ @@ -16561,8 +16231,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5453, - EndPos: 5462, + StartPos: 4943, + EndPos: 4952, }, }, Left: &ast.ExprVariable{ @@ -16570,8 +16240,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5453, - EndPos: 5455, + StartPos: 4943, + EndPos: 4945, }, }, VarName: &ast.Identifier{ @@ -16579,8 +16249,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5453, - EndPos: 5455, + StartPos: 4943, + EndPos: 4945, }, }, Value: []byte("$a"), @@ -16591,8 +16261,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5460, - EndPos: 5462, + StartPos: 4950, + EndPos: 4952, }, }, VarName: &ast.Identifier{ @@ -16600,8 +16270,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 293, EndLine: 293, - StartPos: 5460, - EndPos: 5462, + StartPos: 4950, + EndPos: 4952, }, }, Value: []byte("$b"), @@ -16614,8 +16284,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5466, - EndPos: 5474, + StartPos: 4954, + EndPos: 4962, }, }, Expr: &ast.ExprBinaryPlus{ @@ -16623,8 +16293,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5466, - EndPos: 5473, + StartPos: 4954, + EndPos: 4961, }, }, Left: &ast.ExprVariable{ @@ -16632,8 +16302,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5466, - EndPos: 5468, + StartPos: 4954, + EndPos: 4956, }, }, VarName: &ast.Identifier{ @@ -16641,8 +16311,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5466, - EndPos: 5468, + StartPos: 4954, + EndPos: 4956, }, }, Value: []byte("$a"), @@ -16653,8 +16323,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5471, - EndPos: 5473, + StartPos: 4959, + EndPos: 4961, }, }, VarName: &ast.Identifier{ @@ -16662,8 +16332,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 294, EndLine: 294, - StartPos: 5471, - EndPos: 5473, + StartPos: 4959, + EndPos: 4961, }, }, Value: []byte("$b"), @@ -16676,8 +16346,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5477, - EndPos: 5486, + StartPos: 4963, + EndPos: 4972, }, }, Expr: &ast.ExprBinaryPow{ @@ -16685,8 +16355,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5477, - EndPos: 5485, + StartPos: 4963, + EndPos: 4971, }, }, Left: &ast.ExprVariable{ @@ -16694,8 +16364,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5477, - EndPos: 5479, + StartPos: 4963, + EndPos: 4965, }, }, VarName: &ast.Identifier{ @@ -16703,8 +16373,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5477, - EndPos: 5479, + StartPos: 4963, + EndPos: 4965, }, }, Value: []byte("$a"), @@ -16715,8 +16385,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5483, - EndPos: 5485, + StartPos: 4969, + EndPos: 4971, }, }, VarName: &ast.Identifier{ @@ -16724,8 +16394,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 295, EndLine: 295, - StartPos: 5483, - EndPos: 5485, + StartPos: 4969, + EndPos: 4971, }, }, Value: []byte("$b"), @@ -16738,8 +16408,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5489, - EndPos: 5498, + StartPos: 4973, + EndPos: 4982, }, }, Expr: &ast.ExprBinaryShiftLeft{ @@ -16747,8 +16417,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5489, - EndPos: 5497, + StartPos: 4973, + EndPos: 4981, }, }, Left: &ast.ExprVariable{ @@ -16756,8 +16426,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5489, - EndPos: 5491, + StartPos: 4973, + EndPos: 4975, }, }, VarName: &ast.Identifier{ @@ -16765,8 +16435,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5489, - EndPos: 5491, + StartPos: 4973, + EndPos: 4975, }, }, Value: []byte("$a"), @@ -16777,8 +16447,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5495, - EndPos: 5497, + StartPos: 4979, + EndPos: 4981, }, }, VarName: &ast.Identifier{ @@ -16786,8 +16456,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 296, EndLine: 296, - StartPos: 5495, - EndPos: 5497, + StartPos: 4979, + EndPos: 4981, }, }, Value: []byte("$b"), @@ -16800,8 +16470,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5501, - EndPos: 5510, + StartPos: 4983, + EndPos: 4992, }, }, Expr: &ast.ExprBinaryShiftRight{ @@ -16809,8 +16479,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5501, - EndPos: 5509, + StartPos: 4983, + EndPos: 4991, }, }, Left: &ast.ExprVariable{ @@ -16818,8 +16488,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5501, - EndPos: 5503, + StartPos: 4983, + EndPos: 4985, }, }, VarName: &ast.Identifier{ @@ -16827,8 +16497,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5501, - EndPos: 5503, + StartPos: 4983, + EndPos: 4985, }, }, Value: []byte("$a"), @@ -16839,8 +16509,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5507, - EndPos: 5509, + StartPos: 4989, + EndPos: 4991, }, }, VarName: &ast.Identifier{ @@ -16848,8 +16518,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 297, EndLine: 297, - StartPos: 5507, - EndPos: 5509, + StartPos: 4989, + EndPos: 4991, }, }, Value: []byte("$b"), @@ -16862,8 +16532,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5513, - EndPos: 5522, + StartPos: 4993, + EndPos: 5002, }, }, Expr: &ast.ExprBinarySmallerOrEqual{ @@ -16871,8 +16541,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5513, - EndPos: 5521, + StartPos: 4993, + EndPos: 5001, }, }, Left: &ast.ExprVariable{ @@ -16880,8 +16550,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5513, - EndPos: 5515, + StartPos: 4993, + EndPos: 4995, }, }, VarName: &ast.Identifier{ @@ -16889,8 +16559,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5513, - EndPos: 5515, + StartPos: 4993, + EndPos: 4995, }, }, Value: []byte("$a"), @@ -16901,8 +16571,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5519, - EndPos: 5521, + StartPos: 4999, + EndPos: 5001, }, }, VarName: &ast.Identifier{ @@ -16910,8 +16580,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 298, EndLine: 298, - StartPos: 5519, - EndPos: 5521, + StartPos: 4999, + EndPos: 5001, }, }, Value: []byte("$b"), @@ -16924,8 +16594,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5525, - EndPos: 5533, + StartPos: 5003, + EndPos: 5011, }, }, Expr: &ast.ExprBinarySmaller{ @@ -16933,8 +16603,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5525, - EndPos: 5532, + StartPos: 5003, + EndPos: 5010, }, }, Left: &ast.ExprVariable{ @@ -16942,8 +16612,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5525, - EndPos: 5527, + StartPos: 5003, + EndPos: 5005, }, }, VarName: &ast.Identifier{ @@ -16951,8 +16621,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5525, - EndPos: 5527, + StartPos: 5003, + EndPos: 5005, }, }, Value: []byte("$a"), @@ -16963,8 +16633,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5530, - EndPos: 5532, + StartPos: 5008, + EndPos: 5010, }, }, VarName: &ast.Identifier{ @@ -16972,8 +16642,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 299, EndLine: 299, - StartPos: 5530, - EndPos: 5532, + StartPos: 5008, + EndPos: 5010, }, }, Value: []byte("$b"), @@ -16986,8 +16656,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5536, - EndPos: 5546, + StartPos: 5012, + EndPos: 5022, }, }, Expr: &ast.ExprBinarySpaceship{ @@ -16995,8 +16665,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5536, - EndPos: 5545, + StartPos: 5012, + EndPos: 5021, }, }, Left: &ast.ExprVariable{ @@ -17004,8 +16674,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5536, - EndPos: 5538, + StartPos: 5012, + EndPos: 5014, }, }, VarName: &ast.Identifier{ @@ -17013,8 +16683,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5536, - EndPos: 5538, + StartPos: 5012, + EndPos: 5014, }, }, Value: []byte("$a"), @@ -17025,8 +16695,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5543, - EndPos: 5545, + StartPos: 5019, + EndPos: 5021, }, }, VarName: &ast.Identifier{ @@ -17034,8 +16704,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 300, EndLine: 300, - StartPos: 5543, - EndPos: 5545, + StartPos: 5019, + EndPos: 5021, }, }, Value: []byte("$b"), @@ -17048,8 +16718,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5550, - EndPos: 5559, + StartPos: 5024, + EndPos: 5033, }, }, Expr: &ast.ExprAssignReference{ @@ -17057,8 +16727,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5550, - EndPos: 5558, + StartPos: 5024, + EndPos: 5032, }, }, Var: &ast.ExprVariable{ @@ -17066,8 +16736,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5550, - EndPos: 5552, + StartPos: 5024, + EndPos: 5026, }, }, VarName: &ast.Identifier{ @@ -17075,8 +16745,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5550, - EndPos: 5552, + StartPos: 5024, + EndPos: 5026, }, }, Value: []byte("$a"), @@ -17087,8 +16757,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5556, - EndPos: 5558, + StartPos: 5030, + EndPos: 5032, }, }, VarName: &ast.Identifier{ @@ -17096,8 +16766,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 302, EndLine: 302, - StartPos: 5556, - EndPos: 5558, + StartPos: 5030, + EndPos: 5032, }, }, Value: []byte("$b"), @@ -17110,8 +16780,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5562, - EndPos: 5570, + StartPos: 5034, + EndPos: 5042, }, }, Expr: &ast.ExprAssign{ @@ -17119,8 +16789,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5562, - EndPos: 5569, + StartPos: 5034, + EndPos: 5041, }, }, Var: &ast.ExprVariable{ @@ -17128,8 +16798,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5562, - EndPos: 5564, + StartPos: 5034, + EndPos: 5036, }, }, VarName: &ast.Identifier{ @@ -17137,8 +16807,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5562, - EndPos: 5564, + StartPos: 5034, + EndPos: 5036, }, }, Value: []byte("$a"), @@ -17149,8 +16819,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5567, - EndPos: 5569, + StartPos: 5039, + EndPos: 5041, }, }, VarName: &ast.Identifier{ @@ -17158,8 +16828,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 303, EndLine: 303, - StartPos: 5567, - EndPos: 5569, + StartPos: 5039, + EndPos: 5041, }, }, Value: []byte("$b"), @@ -17172,8 +16842,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5573, - EndPos: 5582, + StartPos: 5043, + EndPos: 5052, }, }, Expr: &ast.ExprAssignBitwiseAnd{ @@ -17181,8 +16851,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5573, - EndPos: 5581, + StartPos: 5043, + EndPos: 5051, }, }, Var: &ast.ExprVariable{ @@ -17190,8 +16860,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5573, - EndPos: 5575, + StartPos: 5043, + EndPos: 5045, }, }, VarName: &ast.Identifier{ @@ -17199,8 +16869,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5573, - EndPos: 5575, + StartPos: 5043, + EndPos: 5045, }, }, Value: []byte("$a"), @@ -17211,8 +16881,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5579, - EndPos: 5581, + StartPos: 5049, + EndPos: 5051, }, }, VarName: &ast.Identifier{ @@ -17220,8 +16890,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 304, EndLine: 304, - StartPos: 5579, - EndPos: 5581, + StartPos: 5049, + EndPos: 5051, }, }, Value: []byte("$b"), @@ -17234,8 +16904,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5585, - EndPos: 5594, + StartPos: 5053, + EndPos: 5062, }, }, Expr: &ast.ExprAssignBitwiseOr{ @@ -17243,8 +16913,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5585, - EndPos: 5593, + StartPos: 5053, + EndPos: 5061, }, }, Var: &ast.ExprVariable{ @@ -17252,8 +16922,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5585, - EndPos: 5587, + StartPos: 5053, + EndPos: 5055, }, }, VarName: &ast.Identifier{ @@ -17261,8 +16931,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5585, - EndPos: 5587, + StartPos: 5053, + EndPos: 5055, }, }, Value: []byte("$a"), @@ -17273,8 +16943,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5591, - EndPos: 5593, + StartPos: 5059, + EndPos: 5061, }, }, VarName: &ast.Identifier{ @@ -17282,8 +16952,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 305, EndLine: 305, - StartPos: 5591, - EndPos: 5593, + StartPos: 5059, + EndPos: 5061, }, }, Value: []byte("$b"), @@ -17296,8 +16966,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5597, - EndPos: 5606, + StartPos: 5063, + EndPos: 5072, }, }, Expr: &ast.ExprAssignBitwiseXor{ @@ -17305,8 +16975,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5597, - EndPos: 5605, + StartPos: 5063, + EndPos: 5071, }, }, Var: &ast.ExprVariable{ @@ -17314,8 +16984,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5597, - EndPos: 5599, + StartPos: 5063, + EndPos: 5065, }, }, VarName: &ast.Identifier{ @@ -17323,8 +16993,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5597, - EndPos: 5599, + StartPos: 5063, + EndPos: 5065, }, }, Value: []byte("$a"), @@ -17335,8 +17005,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5603, - EndPos: 5605, + StartPos: 5069, + EndPos: 5071, }, }, VarName: &ast.Identifier{ @@ -17344,8 +17014,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 306, EndLine: 306, - StartPos: 5603, - EndPos: 5605, + StartPos: 5069, + EndPos: 5071, }, }, Value: []byte("$b"), @@ -17358,8 +17028,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5609, - EndPos: 5618, + StartPos: 5073, + EndPos: 5082, }, }, Expr: &ast.ExprAssignConcat{ @@ -17367,8 +17037,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5609, - EndPos: 5617, + StartPos: 5073, + EndPos: 5081, }, }, Var: &ast.ExprVariable{ @@ -17376,8 +17046,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5609, - EndPos: 5611, + StartPos: 5073, + EndPos: 5075, }, }, VarName: &ast.Identifier{ @@ -17385,8 +17055,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5609, - EndPos: 5611, + StartPos: 5073, + EndPos: 5075, }, }, Value: []byte("$a"), @@ -17397,8 +17067,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5615, - EndPos: 5617, + StartPos: 5079, + EndPos: 5081, }, }, VarName: &ast.Identifier{ @@ -17406,8 +17076,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 307, EndLine: 307, - StartPos: 5615, - EndPos: 5617, + StartPos: 5079, + EndPos: 5081, }, }, Value: []byte("$b"), @@ -17420,8 +17090,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5621, - EndPos: 5630, + StartPos: 5083, + EndPos: 5092, }, }, Expr: &ast.ExprAssignDiv{ @@ -17429,8 +17099,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5621, - EndPos: 5629, + StartPos: 5083, + EndPos: 5091, }, }, Var: &ast.ExprVariable{ @@ -17438,8 +17108,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5621, - EndPos: 5623, + StartPos: 5083, + EndPos: 5085, }, }, VarName: &ast.Identifier{ @@ -17447,8 +17117,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5621, - EndPos: 5623, + StartPos: 5083, + EndPos: 5085, }, }, Value: []byte("$a"), @@ -17459,8 +17129,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5627, - EndPos: 5629, + StartPos: 5089, + EndPos: 5091, }, }, VarName: &ast.Identifier{ @@ -17468,8 +17138,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 308, EndLine: 308, - StartPos: 5627, - EndPos: 5629, + StartPos: 5089, + EndPos: 5091, }, }, Value: []byte("$b"), @@ -17482,8 +17152,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5633, - EndPos: 5642, + StartPos: 5093, + EndPos: 5102, }, }, Expr: &ast.ExprAssignMinus{ @@ -17491,8 +17161,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5633, - EndPos: 5641, + StartPos: 5093, + EndPos: 5101, }, }, Var: &ast.ExprVariable{ @@ -17500,8 +17170,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5633, - EndPos: 5635, + StartPos: 5093, + EndPos: 5095, }, }, VarName: &ast.Identifier{ @@ -17509,8 +17179,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5633, - EndPos: 5635, + StartPos: 5093, + EndPos: 5095, }, }, Value: []byte("$a"), @@ -17521,8 +17191,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5639, - EndPos: 5641, + StartPos: 5099, + EndPos: 5101, }, }, VarName: &ast.Identifier{ @@ -17530,8 +17200,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 309, EndLine: 309, - StartPos: 5639, - EndPos: 5641, + StartPos: 5099, + EndPos: 5101, }, }, Value: []byte("$b"), @@ -17544,8 +17214,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5645, - EndPos: 5654, + StartPos: 5103, + EndPos: 5112, }, }, Expr: &ast.ExprAssignMod{ @@ -17553,8 +17223,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5645, - EndPos: 5653, + StartPos: 5103, + EndPos: 5111, }, }, Var: &ast.ExprVariable{ @@ -17562,8 +17232,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5645, - EndPos: 5647, + StartPos: 5103, + EndPos: 5105, }, }, VarName: &ast.Identifier{ @@ -17571,8 +17241,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5645, - EndPos: 5647, + StartPos: 5103, + EndPos: 5105, }, }, Value: []byte("$a"), @@ -17583,8 +17253,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5651, - EndPos: 5653, + StartPos: 5109, + EndPos: 5111, }, }, VarName: &ast.Identifier{ @@ -17592,8 +17262,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 310, EndLine: 310, - StartPos: 5651, - EndPos: 5653, + StartPos: 5109, + EndPos: 5111, }, }, Value: []byte("$b"), @@ -17606,8 +17276,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5657, - EndPos: 5666, + StartPos: 5113, + EndPos: 5122, }, }, Expr: &ast.ExprAssignMul{ @@ -17615,8 +17285,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5657, - EndPos: 5665, + StartPos: 5113, + EndPos: 5121, }, }, Var: &ast.ExprVariable{ @@ -17624,8 +17294,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5657, - EndPos: 5659, + StartPos: 5113, + EndPos: 5115, }, }, VarName: &ast.Identifier{ @@ -17633,8 +17303,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5657, - EndPos: 5659, + StartPos: 5113, + EndPos: 5115, }, }, Value: []byte("$a"), @@ -17645,8 +17315,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5663, - EndPos: 5665, + StartPos: 5119, + EndPos: 5121, }, }, VarName: &ast.Identifier{ @@ -17654,8 +17324,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 311, EndLine: 311, - StartPos: 5663, - EndPos: 5665, + StartPos: 5119, + EndPos: 5121, }, }, Value: []byte("$b"), @@ -17668,8 +17338,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5669, - EndPos: 5678, + StartPos: 5123, + EndPos: 5132, }, }, Expr: &ast.ExprAssignPlus{ @@ -17677,8 +17347,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5669, - EndPos: 5677, + StartPos: 5123, + EndPos: 5131, }, }, Var: &ast.ExprVariable{ @@ -17686,8 +17356,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5669, - EndPos: 5671, + StartPos: 5123, + EndPos: 5125, }, }, VarName: &ast.Identifier{ @@ -17695,8 +17365,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5669, - EndPos: 5671, + StartPos: 5123, + EndPos: 5125, }, }, Value: []byte("$a"), @@ -17707,8 +17377,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5675, - EndPos: 5677, + StartPos: 5129, + EndPos: 5131, }, }, VarName: &ast.Identifier{ @@ -17716,8 +17386,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 312, EndLine: 312, - StartPos: 5675, - EndPos: 5677, + StartPos: 5129, + EndPos: 5131, }, }, Value: []byte("$b"), @@ -17730,8 +17400,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5681, - EndPos: 5691, + StartPos: 5133, + EndPos: 5143, }, }, Expr: &ast.ExprAssignPow{ @@ -17739,8 +17409,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5681, - EndPos: 5690, + StartPos: 5133, + EndPos: 5142, }, }, Var: &ast.ExprVariable{ @@ -17748,8 +17418,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5681, - EndPos: 5683, + StartPos: 5133, + EndPos: 5135, }, }, VarName: &ast.Identifier{ @@ -17757,8 +17427,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5681, - EndPos: 5683, + StartPos: 5133, + EndPos: 5135, }, }, Value: []byte("$a"), @@ -17769,8 +17439,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5688, - EndPos: 5690, + StartPos: 5140, + EndPos: 5142, }, }, VarName: &ast.Identifier{ @@ -17778,8 +17448,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 313, EndLine: 313, - StartPos: 5688, - EndPos: 5690, + StartPos: 5140, + EndPos: 5142, }, }, Value: []byte("$b"), @@ -17792,8 +17462,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5694, - EndPos: 5704, + StartPos: 5144, + EndPos: 5154, }, }, Expr: &ast.ExprAssignShiftLeft{ @@ -17801,8 +17471,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5694, - EndPos: 5703, + StartPos: 5144, + EndPos: 5153, }, }, Var: &ast.ExprVariable{ @@ -17810,8 +17480,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5694, - EndPos: 5696, + StartPos: 5144, + EndPos: 5146, }, }, VarName: &ast.Identifier{ @@ -17819,8 +17489,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5694, - EndPos: 5696, + StartPos: 5144, + EndPos: 5146, }, }, Value: []byte("$a"), @@ -17831,8 +17501,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5701, - EndPos: 5703, + StartPos: 5151, + EndPos: 5153, }, }, VarName: &ast.Identifier{ @@ -17840,8 +17510,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 314, EndLine: 314, - StartPos: 5701, - EndPos: 5703, + StartPos: 5151, + EndPos: 5153, }, }, Value: []byte("$b"), @@ -17854,8 +17524,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5707, - EndPos: 5717, + StartPos: 5155, + EndPos: 5165, }, }, Expr: &ast.ExprAssignShiftRight{ @@ -17863,8 +17533,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5707, - EndPos: 5716, + StartPos: 5155, + EndPos: 5164, }, }, Var: &ast.ExprVariable{ @@ -17872,8 +17542,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5707, - EndPos: 5709, + StartPos: 5155, + EndPos: 5157, }, }, VarName: &ast.Identifier{ @@ -17881,8 +17551,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5707, - EndPos: 5709, + StartPos: 5155, + EndPos: 5157, }, }, Value: []byte("$a"), @@ -17893,8 +17563,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5714, - EndPos: 5716, + StartPos: 5162, + EndPos: 5164, }, }, VarName: &ast.Identifier{ @@ -17902,8 +17572,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 315, EndLine: 315, - StartPos: 5714, - EndPos: 5716, + StartPos: 5162, + EndPos: 5164, }, }, Value: []byte("$b"), @@ -17916,8 +17586,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5721, - EndPos: 5760, + StartPos: 5167, + EndPos: 5206, }, }, ClassName: &ast.Identifier{ @@ -17925,8 +17595,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5727, - EndPos: 5730, + StartPos: 5173, + EndPos: 5176, }, }, Value: []byte("foo"), @@ -17937,18 +17607,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5732, - EndPos: 5758, + StartPos: 5178, + EndPos: 5204, }, }, - ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5748, - EndPos: 5753, + StartPos: 5194, + EndPos: 5199, }, }, Value: []byte("class"), @@ -17959,8 +17628,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5732, - EndPos: 5738, + StartPos: 5178, + EndPos: 5184, }, }, Value: []byte("public"), @@ -17971,8 +17640,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 317, EndLine: 317, - StartPos: 5756, - EndPos: 5758, + StartPos: 5202, + EndPos: 5204, }, }, Stmts: []ast.Vertex{}, @@ -17985,8 +17654,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5763, - EndPos: 5774, + StartPos: 5207, + EndPos: 5218, }, }, Expr: &ast.ExprFunctionCall{ @@ -17994,8 +17663,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5763, - EndPos: 5773, + StartPos: 5207, + EndPos: 5217, }, }, Function: &ast.NameFullyQualified{ @@ -18003,8 +17672,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5763, - EndPos: 5771, + StartPos: 5207, + EndPos: 5215, }, }, Parts: []ast.Vertex{ @@ -18013,8 +17682,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5764, - EndPos: 5767, + StartPos: 5208, + EndPos: 5211, }, }, Value: []byte("foo"), @@ -18024,8 +17693,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5768, - EndPos: 5771, + StartPos: 5212, + EndPos: 5215, }, }, Value: []byte("bar"), @@ -18037,8 +17706,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5771, - EndPos: 5773, + StartPos: 5215, + EndPos: 5217, }, }, }, @@ -18049,18 +17718,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 320, EndLine: 326, - StartPos: 5778, - EndPos: 5905, + StartPos: 5220, + EndPos: 5328, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5787, - EndPos: 5790, + StartPos: 5229, + EndPos: 5232, }, }, Value: []byte("foo"), @@ -18071,31 +17739,39 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5791, - EndPos: 5794, + StartPos: 5233, + EndPos: 5236, }, }, - ByRef: true, - Variadic: false, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5792, - EndPos: 5794, + StartPos: 5233, + EndPos: 5236, }, }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5792, - EndPos: 5794, + StartPos: 5234, + EndPos: 5236, }, }, - Value: []byte("$a"), + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5234, + EndPos: 5236, + }, + }, + Value: []byte("$a"), + }, }, }, }, @@ -18104,31 +17780,39 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5796, - EndPos: 5801, + StartPos: 5238, + EndPos: 5243, }, }, - ByRef: false, - Variadic: true, - Var: &ast.ExprVariable{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5799, - EndPos: 5801, + StartPos: 5238, + EndPos: 5243, }, }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 320, EndLine: 320, - StartPos: 5799, - EndPos: 5801, + StartPos: 5241, + EndPos: 5243, }, }, - Value: []byte("$b"), + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 320, + EndLine: 320, + StartPos: 5241, + EndPos: 5243, + }, + }, + Value: []byte("$b"), + }, }, }, }, @@ -18139,18 +17823,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 322, EndLine: 322, - StartPos: 5830, - EndPos: 5847, + StartPos: 5252, + EndPos: 5269, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 322, EndLine: 322, - StartPos: 5839, - EndPos: 5842, + StartPos: 5261, + EndPos: 5264, }, }, Value: []byte("bar"), @@ -18162,8 +17845,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 323, EndLine: 323, - StartPos: 5851, - EndPos: 5863, + StartPos: 5274, + EndPos: 5286, }, }, ClassName: &ast.Identifier{ @@ -18171,8 +17854,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 323, EndLine: 323, - StartPos: 5857, - EndPos: 5860, + StartPos: 5280, + EndPos: 5283, }, }, Value: []byte("Baz"), @@ -18184,8 +17867,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 324, EndLine: 324, - StartPos: 5867, - EndPos: 5879, + StartPos: 5291, + EndPos: 5303, }, }, TraitName: &ast.Identifier{ @@ -18193,8 +17876,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 324, EndLine: 324, - StartPos: 5873, - EndPos: 5877, + StartPos: 5297, + EndPos: 5301, }, }, Value: []byte("Quux"), @@ -18206,8 +17889,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 325, EndLine: 325, - StartPos: 5883, - EndPos: 5901, + StartPos: 5308, + EndPos: 5326, }, }, InterfaceName: &ast.Identifier{ @@ -18215,8 +17898,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 325, EndLine: 325, - StartPos: 5893, - EndPos: 5898, + StartPos: 5318, + EndPos: 5323, }, }, Value: []byte("Quuux"), @@ -18230,18 +17913,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5911, - EndPos: 5954, + StartPos: 5330, + EndPos: 5373, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5920, - EndPos: 5923, + StartPos: 5339, + EndPos: 5342, }, }, Value: []byte("foo"), @@ -18252,31 +17934,39 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5924, - EndPos: 5931, + StartPos: 5343, + EndPos: 5350, }, }, - ByRef: true, - Variadic: false, - Var: &ast.ExprVariable{ + Var: &ast.Reference{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5925, - EndPos: 5927, + StartPos: 5343, + EndPos: 5346, }, }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5925, - EndPos: 5927, + StartPos: 5344, + EndPos: 5346, }, }, - Value: []byte("$a"), + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5344, + EndPos: 5346, + }, + }, + Value: []byte("$a"), + }, }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18284,8 +17974,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5930, - EndPos: 5931, + StartPos: 5349, + EndPos: 5350, }, }, Value: []byte("1"), @@ -18296,31 +17986,39 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5933, - EndPos: 5942, + StartPos: 5352, + EndPos: 5361, }, }, - ByRef: false, - Variadic: true, - Var: &ast.ExprVariable{ + Var: &ast.Variadic{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5936, - EndPos: 5938, + StartPos: 5352, + EndPos: 5357, }, }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5936, - EndPos: 5938, + StartPos: 5355, + EndPos: 5357, }, }, - Value: []byte("$b"), + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 328, + EndLine: 328, + StartPos: 5355, + EndPos: 5357, + }, + }, + Value: []byte("$b"), + }, }, }, DefaultValue: &ast.ScalarLnumber{ @@ -18328,8 +18026,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5941, - EndPos: 5942, + StartPos: 5360, + EndPos: 5361, }, }, Value: []byte("1"), @@ -18340,19 +18038,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5944, - EndPos: 5950, + StartPos: 5363, + EndPos: 5369, }, }, - ByRef: false, - Variadic: false, Var: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5944, - EndPos: 5946, + StartPos: 5363, + EndPos: 5365, }, }, VarName: &ast.Identifier{ @@ -18360,8 +18056,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5944, - EndPos: 5946, + StartPos: 5363, + EndPos: 5365, }, }, Value: []byte("$c"), @@ -18372,8 +18068,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 328, EndLine: 328, - StartPos: 5949, - EndPos: 5950, + StartPos: 5368, + EndPos: 5369, }, }, Value: []byte("1"), @@ -18387,18 +18083,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5957, - EndPos: 5995, + StartPos: 5374, + EndPos: 5412, }, }, - ReturnsRef: false, FunctionName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5966, - EndPos: 5969, + StartPos: 5383, + EndPos: 5386, }, }, Value: []byte("foo"), @@ -18409,19 +18104,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5970, - EndPos: 5978, + StartPos: 5387, + EndPos: 5395, }, }, - ByRef: false, - Variadic: false, Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5970, - EndPos: 5975, + StartPos: 5387, + EndPos: 5392, }, }, Value: []byte("array"), @@ -18431,8 +18124,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5976, - EndPos: 5978, + StartPos: 5393, + EndPos: 5395, }, }, VarName: &ast.Identifier{ @@ -18440,8 +18133,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5976, - EndPos: 5978, + StartPos: 5393, + EndPos: 5395, }, }, Value: []byte("$a"), @@ -18453,19 +18146,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5980, - EndPos: 5991, + StartPos: 5397, + EndPos: 5408, }, }, - Variadic: false, - ByRef: false, Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5980, - EndPos: 5988, + StartPos: 5397, + EndPos: 5405, }, }, Value: []byte("callable"), @@ -18475,8 +18166,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5989, - EndPos: 5991, + StartPos: 5406, + EndPos: 5408, }, }, VarName: &ast.Identifier{ @@ -18484,8 +18175,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 329, EndLine: 329, - StartPos: 5989, - EndPos: 5991, + StartPos: 5406, + EndPos: 5408, }, }, Value: []byte("$b"), @@ -18500,8 +18191,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 5998, - EndPos: 6100, + StartPos: 5413, + EndPos: 5515, }, }, ClassName: &ast.Identifier{ @@ -18509,8 +18200,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6019, - EndPos: 6022, + StartPos: 5434, + EndPos: 5437, }, }, Value: []byte("foo"), @@ -18521,8 +18212,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 5998, - EndPos: 6006, + StartPos: 5413, + EndPos: 5421, }, }, Value: []byte("abstract"), @@ -18532,8 +18223,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6007, - EndPos: 6012, + StartPos: 5422, + EndPos: 5427, }, }, Value: []byte("final"), @@ -18545,18 +18236,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6025, - EndPos: 6066, + StartPos: 5440, + EndPos: 5481, }, }, - ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6060, - EndPos: 6063, + StartPos: 5475, + EndPos: 5478, }, }, Value: []byte("bar"), @@ -18567,8 +18257,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6025, - EndPos: 6033, + StartPos: 5440, + EndPos: 5448, }, }, Value: []byte("abstract"), @@ -18578,8 +18268,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6034, - EndPos: 6043, + StartPos: 5449, + EndPos: 5458, }, }, Value: []byte("protected"), @@ -18589,8 +18279,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6044, - EndPos: 6050, + StartPos: 5459, + EndPos: 5465, }, }, Value: []byte("static"), @@ -18601,8 +18291,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6065, - EndPos: 6066, + StartPos: 5480, + EndPos: 5481, }, }, }, @@ -18612,18 +18302,17 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6067, - EndPos: 6098, + StartPos: 5482, + EndPos: 5513, }, }, - ReturnsRef: false, MethodName: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6090, - EndPos: 6093, + StartPos: 5505, + EndPos: 5508, }, }, Value: []byte("baz"), @@ -18634,8 +18323,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6067, - EndPos: 6072, + StartPos: 5482, + EndPos: 5487, }, }, Value: []byte("final"), @@ -18645,8 +18334,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6073, - EndPos: 6080, + StartPos: 5488, + EndPos: 5495, }, }, Value: []byte("private"), @@ -18657,8 +18346,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 330, EndLine: 330, - StartPos: 6096, - EndPos: 6098, + StartPos: 5511, + EndPos: 5513, }, }, Stmts: []ast.Vertex{}, @@ -18671,8 +18360,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6105, - EndPos: 6119, + StartPos: 5518, + EndPos: 5532, }, }, Expr: &ast.ExprPropertyFetch{ @@ -18680,8 +18369,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6105, - EndPos: 6118, + StartPos: 5518, + EndPos: 5531, }, }, Var: &ast.ExprNew{ @@ -18689,8 +18378,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6105, - EndPos: 6112, + StartPos: 5518, + EndPos: 5525, }, }, Class: &ast.NameName{ @@ -18698,8 +18387,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6109, - EndPos: 6112, + StartPos: 5522, + EndPos: 5525, }, }, Parts: []ast.Vertex{ @@ -18708,8 +18397,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6109, - EndPos: 6112, + StartPos: 5522, + EndPos: 5525, }, }, Value: []byte("Foo"), @@ -18722,8 +18411,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 6115, - EndPos: 6118, + StartPos: 5528, + EndPos: 5531, }, }, Value: []byte("bar"), @@ -18735,8 +18424,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6123, - EndPos: 6134, + StartPos: 5534, + EndPos: 5545, }, }, Expr: &ast.ExprFunctionCall{ @@ -18744,8 +18433,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6123, - EndPos: 6133, + StartPos: 5534, + EndPos: 5544, }, }, Function: &ast.ExprNew{ @@ -18753,8 +18442,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6123, - EndPos: 6130, + StartPos: 5534, + EndPos: 5541, }, }, Class: &ast.NameName{ @@ -18762,8 +18451,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6127, - EndPos: 6130, + StartPos: 5538, + EndPos: 5541, }, }, Parts: []ast.Vertex{ @@ -18772,8 +18461,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6127, - EndPos: 6130, + StartPos: 5538, + EndPos: 5541, }, }, Value: []byte("Foo"), @@ -18786,8 +18475,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 6131, - EndPos: 6133, + StartPos: 5542, + EndPos: 5544, }, }, }, @@ -18798,8 +18487,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6137, - EndPos: 6149, + StartPos: 5546, + EndPos: 5558, }, }, Expr: &ast.ExprFunctionCall{ @@ -18807,8 +18496,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6137, - EndPos: 6148, + StartPos: 5546, + EndPos: 5557, }, }, Function: &ast.ExprArrayDimFetch{ @@ -18816,8 +18505,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6137, - EndPos: 6146, + StartPos: 5546, + EndPos: 5555, }, }, Var: &ast.ExprShortArray{ @@ -18825,8 +18514,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6137, - EndPos: 6143, + StartPos: 5546, + EndPos: 5552, }, }, Items: []ast.Vertex{ @@ -18835,8 +18524,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6138, - EndPos: 6142, + StartPos: 5547, + EndPos: 5551, }, }, Val: &ast.ExprVariable{ @@ -18844,8 +18533,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6138, - EndPos: 6142, + StartPos: 5547, + EndPos: 5551, }, }, VarName: &ast.Identifier{ @@ -18853,8 +18542,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6138, - EndPos: 6142, + StartPos: 5547, + EndPos: 5551, }, }, Value: []byte("$foo"), @@ -18868,8 +18557,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6144, - EndPos: 6145, + StartPos: 5553, + EndPos: 5554, }, }, Value: []byte("0"), @@ -18880,8 +18569,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 334, EndLine: 334, - StartPos: 6146, - EndPos: 6148, + StartPos: 5555, + EndPos: 5557, }, }, }, @@ -18892,8 +18581,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6161, + StartPos: 5559, + EndPos: 5568, }, }, Expr: &ast.ExprFunctionCall{ @@ -18901,8 +18590,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6160, + StartPos: 5559, + EndPos: 5567, }, }, Function: &ast.ExprArrayDimFetch{ @@ -18910,8 +18599,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6158, + StartPos: 5559, + EndPos: 5565, }, }, Var: &ast.ExprConstFetch{ @@ -18919,8 +18608,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6155, + StartPos: 5559, + EndPos: 5562, }, }, Const: &ast.NameName{ @@ -18928,8 +18617,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6155, + StartPos: 5559, + EndPos: 5562, }, }, Parts: []ast.Vertex{ @@ -18938,8 +18627,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6152, - EndPos: 6155, + StartPos: 5559, + EndPos: 5562, }, }, Value: []byte("foo"), @@ -18952,8 +18641,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6156, - EndPos: 6157, + StartPos: 5563, + EndPos: 5564, }, }, Value: []byte("1"), @@ -18964,8 +18653,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 335, EndLine: 335, - StartPos: 6158, - EndPos: 6160, + StartPos: 5565, + EndPos: 5567, }, }, }, @@ -18976,8 +18665,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 336, EndLine: 336, - StartPos: 6164, - EndPos: 6172, + StartPos: 5569, + EndPos: 5577, }, }, Expr: &ast.ExprFunctionCall{ @@ -18985,8 +18674,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 336, EndLine: 336, - StartPos: 6164, - EndPos: 6171, + StartPos: 5569, + EndPos: 5576, }, }, Function: &ast.ScalarString{ @@ -18994,8 +18683,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 336, EndLine: 336, - StartPos: 6164, - EndPos: 6169, + StartPos: 5569, + EndPos: 5574, }, }, Value: []byte("\"foo\""), @@ -19005,8 +18694,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 336, EndLine: 336, - StartPos: 6169, - EndPos: 6171, + StartPos: 5574, + EndPos: 5576, }, }, }, @@ -19017,8 +18706,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6175, - EndPos: 6187, + StartPos: 5578, + EndPos: 5590, }, }, Expr: &ast.ExprFunctionCall{ @@ -19026,8 +18715,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6175, - EndPos: 6186, + StartPos: 5578, + EndPos: 5589, }, }, Function: &ast.ExprArrayDimFetch{ @@ -19035,8 +18724,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6175, - EndPos: 6184, + StartPos: 5578, + EndPos: 5587, }, }, Var: &ast.ExprShortArray{ @@ -19044,8 +18733,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6175, - EndPos: 6178, + StartPos: 5578, + EndPos: 5581, }, }, Items: []ast.Vertex{ @@ -19054,8 +18743,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6176, - EndPos: 6177, + StartPos: 5579, + EndPos: 5580, }, }, Val: &ast.ScalarLnumber{ @@ -19063,8 +18752,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6176, - EndPos: 6177, + StartPos: 5579, + EndPos: 5580, }, }, Value: []byte("1"), @@ -19077,8 +18766,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6179, - EndPos: 6183, + StartPos: 5582, + EndPos: 5586, }, }, VarName: &ast.Identifier{ @@ -19086,8 +18775,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6179, - EndPos: 6183, + StartPos: 5582, + EndPos: 5586, }, }, Value: []byte("$foo"), @@ -19099,8 +18788,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 337, EndLine: 337, - StartPos: 6184, - EndPos: 6186, + StartPos: 5587, + EndPos: 5589, }, }, }, @@ -19111,8 +18800,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6190, - EndPos: 6199, + StartPos: 5591, + EndPos: 5600, }, }, Expr: &ast.ExprVariable{ @@ -19120,8 +18809,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6190, - EndPos: 6198, + StartPos: 5591, + EndPos: 5599, }, }, VarName: &ast.ExprFunctionCall{ @@ -19129,8 +18818,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6192, - EndPos: 6197, + StartPos: 5593, + EndPos: 5598, }, }, Function: &ast.NameName{ @@ -19138,8 +18827,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6192, - EndPos: 6195, + StartPos: 5593, + EndPos: 5596, }, }, Parts: []ast.Vertex{ @@ -19148,8 +18837,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6192, - EndPos: 6195, + StartPos: 5593, + EndPos: 5596, }, }, Value: []byte("foo"), @@ -19161,8 +18850,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 338, EndLine: 338, - StartPos: 6195, - EndPos: 6197, + StartPos: 5596, + EndPos: 5598, }, }, }, @@ -19174,8 +18863,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6203, - EndPos: 6215, + StartPos: 5602, + EndPos: 5614, }, }, Expr: &ast.ExprStaticCall{ @@ -19183,8 +18872,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6203, - EndPos: 6214, + StartPos: 5602, + EndPos: 5613, }, }, Class: &ast.NameName{ @@ -19192,8 +18881,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6203, - EndPos: 6206, + StartPos: 5602, + EndPos: 5605, }, }, Parts: []ast.Vertex{ @@ -19202,8 +18891,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6203, - EndPos: 6206, + StartPos: 5602, + EndPos: 5605, }, }, Value: []byte("Foo"), @@ -19215,8 +18904,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6208, - EndPos: 6212, + StartPos: 5607, + EndPos: 5611, }, }, VarName: &ast.Identifier{ @@ -19224,8 +18913,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6208, - EndPos: 6212, + StartPos: 5607, + EndPos: 5611, }, }, Value: []byte("$bar"), @@ -19236,8 +18925,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 340, EndLine: 340, - StartPos: 6212, - EndPos: 6214, + StartPos: 5611, + EndPos: 5613, }, }, }, @@ -19248,8 +18937,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6218, - EndPos: 6235, + StartPos: 5615, + EndPos: 5632, }, }, Expr: &ast.ExprStaticCall{ @@ -19257,8 +18946,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6218, - EndPos: 6234, + StartPos: 5615, + EndPos: 5631, }, }, Class: &ast.NameName{ @@ -19266,8 +18955,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6218, - EndPos: 6221, + StartPos: 5615, + EndPos: 5618, }, }, Parts: []ast.Vertex{ @@ -19276,8 +18965,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6218, - EndPos: 6221, + StartPos: 5615, + EndPos: 5618, }, }, Value: []byte("Foo"), @@ -19289,8 +18978,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6224, - EndPos: 6231, + StartPos: 5621, + EndPos: 5628, }, }, Var: &ast.ExprVariable{ @@ -19298,8 +18987,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6224, - EndPos: 6228, + StartPos: 5621, + EndPos: 5625, }, }, VarName: &ast.Identifier{ @@ -19307,8 +18996,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6224, - EndPos: 6228, + StartPos: 5621, + EndPos: 5625, }, }, Value: []byte("$bar"), @@ -19319,8 +19008,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6229, - EndPos: 6230, + StartPos: 5626, + EndPos: 5627, }, }, Value: []byte("0"), @@ -19331,8 +19020,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 341, EndLine: 341, - StartPos: 6232, - EndPos: 6234, + StartPos: 5629, + EndPos: 5631, }, }, }, @@ -19343,8 +19032,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6241, - EndPos: 6252, + StartPos: 5634, + EndPos: 5645, }, }, Expr: &ast.ExprPropertyFetch{ @@ -19352,8 +19041,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6241, - EndPos: 6251, + StartPos: 5634, + EndPos: 5644, }, }, Var: &ast.ExprVariable{ @@ -19361,8 +19050,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6241, - EndPos: 6245, + StartPos: 5634, + EndPos: 5638, }, }, VarName: &ast.Identifier{ @@ -19370,8 +19059,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6241, - EndPos: 6245, + StartPos: 5634, + EndPos: 5638, }, }, Value: []byte("$foo"), @@ -19382,8 +19071,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6247, - EndPos: 6251, + StartPos: 5640, + EndPos: 5644, }, }, VarName: &ast.Identifier{ @@ -19391,8 +19080,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 343, EndLine: 343, - StartPos: 6247, - EndPos: 6251, + StartPos: 5640, + EndPos: 5644, }, }, Value: []byte("$bar"), @@ -19405,8 +19094,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6255, - EndPos: 6271, + StartPos: 5646, + EndPos: 5662, }, }, Expr: &ast.ExprPropertyFetch{ @@ -19414,8 +19103,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6255, - EndPos: 6269, + StartPos: 5646, + EndPos: 5660, }, }, Var: &ast.ExprVariable{ @@ -19423,8 +19112,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6255, - EndPos: 6259, + StartPos: 5646, + EndPos: 5650, }, }, VarName: &ast.Identifier{ @@ -19432,8 +19121,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6255, - EndPos: 6259, + StartPos: 5646, + EndPos: 5650, }, }, Value: []byte("$foo"), @@ -19444,8 +19133,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6262, - EndPos: 6269, + StartPos: 5653, + EndPos: 5660, }, }, Var: &ast.ExprVariable{ @@ -19453,8 +19142,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6262, - EndPos: 6266, + StartPos: 5653, + EndPos: 5657, }, }, VarName: &ast.Identifier{ @@ -19462,8 +19151,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6262, - EndPos: 6266, + StartPos: 5653, + EndPos: 5657, }, }, Value: []byte("$bar"), @@ -19474,8 +19163,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 344, EndLine: 344, - StartPos: 6267, - EndPos: 6268, + StartPos: 5658, + EndPos: 5659, }, }, Value: []byte("0"), @@ -19488,8 +19177,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6275, - EndPos: 6297, + StartPos: 5664, + EndPos: 5686, }, }, Expr: &ast.ExprShortArray{ @@ -19497,8 +19186,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6275, - EndPos: 6296, + StartPos: 5664, + EndPos: 5685, }, }, Items: []ast.Vertex{ @@ -19507,8 +19196,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6276, - EndPos: 6282, + StartPos: 5665, + EndPos: 5671, }, }, Key: &ast.ScalarLnumber{ @@ -19516,8 +19205,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6276, - EndPos: 6277, + StartPos: 5665, + EndPos: 5666, }, }, Value: []byte("1"), @@ -19527,8 +19216,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6279, - EndPos: 6282, + StartPos: 5668, + EndPos: 5671, }, }, Var: &ast.ExprVariable{ @@ -19536,8 +19225,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6280, - EndPos: 6282, + StartPos: 5669, + EndPos: 5671, }, }, VarName: &ast.Identifier{ @@ -19545,8 +19234,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6280, - EndPos: 6282, + StartPos: 5669, + EndPos: 5671, }, }, Value: []byte("$a"), @@ -19559,8 +19248,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6284, - EndPos: 6295, + StartPos: 5673, + EndPos: 5684, }, }, Key: &ast.ScalarLnumber{ @@ -19568,8 +19257,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6284, - EndPos: 6285, + StartPos: 5673, + EndPos: 5674, }, }, Value: []byte("2"), @@ -19579,8 +19268,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6287, - EndPos: 6295, + StartPos: 5676, + EndPos: 5684, }, }, Items: []ast.Vertex{ @@ -19589,8 +19278,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6292, - EndPos: 6294, + StartPos: 5681, + EndPos: 5683, }, }, Val: &ast.ExprVariable{ @@ -19598,8 +19287,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6292, - EndPos: 6294, + StartPos: 5681, + EndPos: 5683, }, }, VarName: &ast.Identifier{ @@ -19607,8 +19296,8 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 346, EndLine: 346, - StartPos: 6292, - EndPos: 6294, + StartPos: 5681, + EndPos: 5683, }, }, Value: []byte("$b"), @@ -19626,15 +19315,15 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 348, EndLine: 348, - StartPos: 6301, - EndPos: 6319, + StartPos: 5688, + EndPos: 5706, }, }, }, }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer(src, "7.4", false, nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() diff --git a/internal/php7/test.php b/internal/php7/test.php new file mode 100644 index 0000000..1260892 --- /dev/null +++ b/internal/php7/test.php @@ -0,0 +1,350 @@ +bar($a, ...$b); +foo::bar($a, ...$b); +$foo::bar($a, ...$b); +new foo($a, ...$b); +/** anonymous class */ +new class ($a, ...$b) {}; +new class {}; +new $foo; +new $foo[1]; +new $foo{$bar}; +new $foo->bar; +new $foo::$bar; +new static::$bar; + +function foo(?bar $bar=null, baz &...$baz) {} +class foo {public function foo(?bar $bar=null, baz &...$baz) {}} +function(?bar $bar=null, baz &...$baz) {}; +static function(?bar $bar=null, baz &...$baz) {}; + +1234567890123456789; +12345678901234567890; +0.; +0b0111111111111111111111111111111111111111111111111111111111111111; +0b1111111111111111111111111111111111111111111111111111111111111111; +0x007111111111111111; +0x8111111111111111; +__CLASS__; +__DIR__; +__FILE__; +__FUNCTION__; +__LINE__; +__NAMESPACE__; +__METHOD__; +__TRAIT__; + +"test $var"; +"test $var[1]"; +"test $var[-1]"; +"test $var[1234567890123456789012345678901234567890]"; +"test $var[-1234567890123456789012345678901234567890]"; +"test $var[bar]"; +"test $var[$bar]"; +"$foo $bar"; +"test $foo->bar()"; +"test ${foo}"; +"test ${foo[0]}"; +"test ${$foo}"; +"test {$foo->bar()}"; + +if ($a) : +endif; +if ($a) : +elseif ($b): +endif; +if ($a) : +else: +endif; +if ($a) : +elseif ($b): +elseif ($c): +else: +endif; + +while (1) { break; } +while (1) { break 2; } +while (1) : break(3); endwhile; +class foo{ public const FOO = 1, BAR = 2; } +class foo{ const FOO = 1, BAR = 2; } +class foo{ function bar() {} } +class foo{ public static function &bar() {} } +class foo{ public static function &bar(): void {} } +abstract class foo{ } +final class foo extends bar { } +final class foo implements bar { } +final class foo implements bar, baz { } +new class() extends foo implements bar, baz { }; + +const FOO = 1, BAR = 2; +while (1) { continue; } +while (1) { continue 2; } +while (1) { continue(3); } +declare(ticks=1); +declare(ticks=1) {} +declare(ticks=1): enddeclare; +do {} while(1); +echo $a, 1; +echo($a); +for($i = 0; $i < 10; $i++, $i++) {} +for(; $i < 10; $i++, $i++) : endfor; +foreach ($a as $v) {} +foreach ($a as $v) : endforeach; +foreach ($a as $k => $v) {} +foreach ($a as $k => &$v) {} +foreach ($a as $k => list($v)) {} +foreach ($a as $k => [$v]) {} +function foo() {} +function foo() {return;} +function &foo() {return 1;} +function &foo(): void {} +global $a, $b; +a: +goto a; +if ($a) {} +if ($a) {} elseif ($b) {} +if ($a) {} else {} +if ($a) {} elseif ($b) {} elseif ($c) {} else {} +if ($a) {} elseif ($b) {} else if ($c) {} else {} +?>
1, &$b,); +~$a; +!$a; + +Foo::Bar; +$foo::Bar; +clone($a); +clone $a; +function(){}; +function($a, $b) use ($c, &$d) {}; +function(): void {}; +foo; +namespace\foo; +\foo; + +empty($a); +@$a; +eval($a); +exit; +exit($a); +die; +die($a); +foo(); +namespace\foo(); +\foo(); +$foo(); + +$a--; +$a++; +--$a; +++$a; + +include $a; +include_once $a; +require $a; +require_once $a; + +$a instanceof Foo; +$a instanceof namespace\Foo; +$a instanceof \Foo; + +isset($a, $b); +list($a) = $b; +list($a[]) = $b; +list(list($a)) = $b; + +$a->foo(); +new Foo(); +new namespace\Foo(); +new \Foo(); +new class ($a, ...$b) {}; +print($a); +$a->foo; +`cmd $a`; +`cmd`; +``; +[]; +[1]; +[1=>1, &$b,]; + +[$a] = $b; +[$a[]] = $b; +[list($a)] = $b; +Foo::bar(); +namespace\Foo::bar(); +\Foo::bar(); +Foo::$bar; +$foo::$bar; +namespace\Foo::$bar; +\Foo::$bar; +$a ? $b : $c; +$a ? : $c; +$a ? $b ? $c : $d : $e; +$a ? $b : $c ? $d : $e; +-$a; ++$a; +$$a; +yield; +yield $a; +yield $a => $b; +yield from $a; + +(array)$a; +(boolean)$a; +(bool)$a; +(double)$a; +(float)$a; +(integer)$a; +(int)$a; +(object)$a; +(string)$a; +(unset)$a; + +$a & $b; +$a | $b; +$a ^ $b; +$a && $b; +$a || $b; +$a ?? $b; +$a . $b; +$a / $b; +$a == $b; +$a >= $b; +$a > $b; +$a === $b; +$a and $b; +$a or $b; +$a xor $b; +$a - $b; +$a % $b; +$a * $b; +$a != $b; +$a !== $b; +$a + $b; +$a ** $b; +$a << $b; +$a >> $b; +$a <= $b; +$a < $b; +$a <=> $b; + +$a =& $b; +$a = $b; +$a &= $b; +$a |= $b; +$a ^= $b; +$a .= $b; +$a /= $b; +$a -= $b; +$a %= $b; +$a *= $b; +$a += $b; +$a **= $b; +$a <<= $b; +$a >>= $b; + +class foo {public function class() {} } +\foo\bar(); + +function foo(&$a, ...$b) { + + function bar() {} + class Baz {} + trait Quux{} + interface Quuux {} +} + +function foo(&$a = 1, ...$b = 1, $c = 1) {} +function foo(array $a, callable $b) {} +abstract final class foo { abstract protected static function bar(); final private function baz() {} } + +(new Foo)->bar; +(new Foo)(); +[$foo][0](); +foo[1](); +"foo"(); +[1]{$foo}(); +${foo()}; + +Foo::$bar(); +Foo::{$bar[0]}(); + +$foo->$bar; +$foo->{$bar[0]}; + +[1=>&$a, 2=>list($b)]; + +__halt_compiler(); + +parsing process must be terminated \ No newline at end of file diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 88e017e..41b540b 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -20,6 +20,8 @@ type Visitor interface { type NodeVisitor interface { Root(n *Root) Nullable(n *Nullable) + Reference(n *Reference) + Variadic(n *Variadic) Parameter(n *Parameter) Identifier(n *Identifier) ArgumentList(n *ArgumentList) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 99b34a3..0435c7c 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -36,11 +36,29 @@ func (n *Nullable) Accept(v NodeVisitor) { v.Nullable(n) } +// Reference node +type Reference struct { + Node + Var Vertex +} + +func (n *Reference) Accept(v NodeVisitor) { + v.Reference(n) +} + +// Variadic node +type Variadic struct { + Node + Var Vertex +} + +func (n *Variadic) Accept(v NodeVisitor) { + v.Variadic(n) +} + // Parameter node type Parameter struct { Node - ByRef bool - Variadic bool Type Vertex Var Vertex DefaultValue Vertex diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 7a13184..d25b426 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -40,6 +40,30 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Expr) t.visitor.Leave("Expr", true) } + case *ast.Reference: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } + case *ast.Variadic: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.Parameter: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 5273c21..9346d75 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -33,10 +33,18 @@ func (v *Dump) print(str string) { } func (v *Dump) printIndent(indentDepth int) { + if indentDepth < 0 { + indentDepth = 0 + } + v.print(strings.Repeat("\t", indentDepth)) } func (v *Dump) printIndentIfNotSingle(indentDepth int) { + if indentDepth < 0 { + indentDepth = 0 + } + if !v.stack[v.depth-1].singleNode { v.print(strings.Repeat("\t", indentDepth)) } @@ -173,20 +181,22 @@ func (v *Dump) Nullable(n *ast.Nullable) { v.printNode(n.GetNode()) } +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()) +} + func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent - 1) v.print("&ast.Parameter{\n") v.printNode(n.GetNode()) - - if n.ByRef { - v.printIndent(v.indent) - v.print("ByRef: true,\n") - } - - if n.Variadic { - v.printIndent(v.indent) - v.print("Variadic: true,\n") - } } func (v *Dump) Identifier(n *ast.Identifier) { diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index c257ed5..cc9a387 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -30,8 +30,7 @@ func ExampleDump() { Stmts: []ast.Vertex{ &ast.Identifier{}, &ast.Parameter{ - Variadic: true, - Var: &ast.ExprVariable{}, + Var: &ast.ExprVariable{}, }, &ast.StmtInlineHtml{ Value: []byte("foo"), @@ -64,7 +63,6 @@ func ExampleDump() { // Value: []byte(""), // }, // &ast.Parameter{ - // Variadic: true, // Var: &ast.ExprVariable{ // }, // }, diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 607aa9e..6cab1d0 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -502,10 +502,8 @@ func TestResolveFunctionName(t *testing.T) { FunctionName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -540,10 +538,8 @@ func TestResolveMethodName(t *testing.T) { MethodName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -573,10 +569,8 @@ func TestResolveClosureName(t *testing.T) { Static: false, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: false, - Variadic: false, - Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Type: nameAB, + Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, ClosureUse: nil, diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index bdcacbf..6fd6261 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -30,6 +30,14 @@ func (v *Null) Nullable(_ *ast.Nullable) { // do nothing } +func (v *Null) Reference(_ *ast.Reference) { + // do nothing +} + +func (v *Null) Variadic(_ *ast.Variadic) { + // do nothing +} + func (v *Null) Parameter(_ *ast.Parameter) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 37a1a71..77375ea 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -64,6 +64,10 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printNodeRoot(n) case *ast.Identifier: p.printNodeIdentifier(n) + case *ast.Reference: + p.printNodeReference(n) + case *ast.Variadic: + p.printNodeVariadic(n) case *ast.Parameter: p.printNodeParameter(n) case *ast.Nullable: @@ -434,6 +438,20 @@ func (p *PrettyPrinter) printNodeIdentifier(n ast.Vertex) { io.WriteString(p.w, v) } +func (p *PrettyPrinter) printNodeReference(n ast.Vertex) { + nn := n.(*ast.Reference) + + io.WriteString(p.w, "&") + p.Print(nn.Var) +} + +func (p *PrettyPrinter) printNodeVariadic(n ast.Vertex) { + nn := n.(*ast.Variadic) + + io.WriteString(p.w, "...") + p.Print(nn.Var) +} + func (p *PrettyPrinter) printNodeParameter(n ast.Vertex) { nn := n.(*ast.Parameter) @@ -442,14 +460,6 @@ func (p *PrettyPrinter) printNodeParameter(n ast.Vertex) { io.WriteString(p.w, " ") } - if nn.ByRef { - io.WriteString(p.w, "&") - } - - if nn.Variadic { - io.WriteString(p.w, "...") - } - p.Print(nn.Var) if nn.DefaultValue != nil { diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 0403ba3..a686aff 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -119,10 +119,14 @@ func TestPrintParameter(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.Parameter{ - ByRef: false, - Variadic: true, - Type: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Type: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Var: &ast.Variadic{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("var"), + }, + }, + }, DefaultValue: &ast.ScalarString{Value: []byte("'default'")}, }) @@ -140,10 +144,8 @@ func TestPrintNullable(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.Nullable{ Expr: &ast.Parameter{ - ByRef: false, - Variadic: true, Type: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Var: &ast.Variadic{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, DefaultValue: &ast.ScalarString{Value: []byte("'default'")}, }, }) @@ -1389,9 +1391,7 @@ func TestPrintExprClosure(t *testing.T) { ReturnsRef: true, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: true, - Variadic: false, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, }, }, ClosureUse: &ast.ExprClosureUse{ @@ -2446,14 +2446,12 @@ func TestPrintStmtClassMethod(t *testing.T) { MethodName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: true, Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ - Variadic: true, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, + Var: &ast.Variadic{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, @@ -2484,14 +2482,12 @@ func TestPrintStmtAbstractClassMethod(t *testing.T) { MethodName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: true, Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, + Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ - Variadic: true, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, + Var: &ast.Variadic{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, }, }, ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, @@ -3197,9 +3193,7 @@ func TestPrintStmtFunction(t *testing.T) { FunctionName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - ByRef: true, - Variadic: false, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, + Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, }, }, ReturnType: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 09399dd..47a82fb 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -79,6 +79,10 @@ func (p *Printer) printNode(n ast.Vertex) { p.printNodeRoot(n) case *ast.Identifier: p.printNodeIdentifier(n) + case *ast.Reference: + p.printNodeReference(n) + case *ast.Variadic: + p.printNodeVariadic(n) case *ast.Parameter: p.printNodeParameter(n) case *ast.Nullable: @@ -444,6 +448,26 @@ func (p *Printer) printNodeIdentifier(n ast.Vertex) { p.printFreeFloating(nn, token.End) } +func (p *Printer) printNodeReference(n ast.Vertex) { + nn := n.(*ast.Reference) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "&") + p.Print(nn.Var) + + p.printFreeFloating(nn, token.End) +} + +func (p *Printer) printNodeVariadic(n ast.Vertex) { + nn := n.(*ast.Variadic) + p.printFreeFloating(nn, token.Start) + + io.WriteString(p.w, "...") + p.Print(nn.Var) + + p.printFreeFloating(nn, token.End) +} + func (p *Printer) printNodeParameter(n ast.Vertex) { nn := n.(*ast.Parameter) p.printFreeFloating(nn, token.Start) @@ -451,22 +475,10 @@ func (p *Printer) printNodeParameter(n ast.Vertex) { if nn.Type != nil { p.Print(nn.Type) } - p.printFreeFloating(nn, token.OptionalType) - - if nn.ByRef { - io.WriteString(p.w, "&") - } - p.printFreeFloating(nn, token.Ampersand) - - if nn.Variadic { - io.WriteString(p.w, "...") - } - p.printFreeFloating(nn, token.Variadic) p.Print(nn.Var) if nn.DefaultValue != nil { - p.printFreeFloating(nn, token.Var) io.WriteString(p.w, "=") p.Print(nn.DefaultValue) } diff --git a/pkg/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go index 900ae22..a68c502 100644 --- a/pkg/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -107,6 +107,18 @@ func TestParseAndPrintIdentifier(t *testing.T) { } } +func TestParseAndPrintParameterTMP(t *testing.T) { + + src := ` Date: Mon, 3 Aug 2020 21:22:53 +0200 Subject: [PATCH 036/140] [refactoring] update `use` ast structure --- internal/php5/parser_test.go | 897 ++++++----- internal/php5/php5.go | Bin 333216 -> 332402 bytes internal/php5/php5.y | 97 +- internal/php5/php5_test.go | 896 ++++++----- internal/php7/parser_test.go | 1623 +++++++++++-------- internal/php7/php7.go | Bin 273775 -> 273828 bytes internal/php7/php7.y | 103 +- internal/php7/php7_test.go | 1624 ++++++++++++-------- pkg/ast/ast.go | 4 +- pkg/ast/node.go | 52 +- pkg/ast/traverser/dfs.go | 90 +- pkg/ast/visitor/dump.go | 24 +- pkg/ast/visitor/namespace_resolver.go | 62 +- pkg/ast/visitor/namespace_resolver_test.go | 161 +- pkg/ast/visitor/null.go | 16 +- pkg/printer/pretty_printer.go | 80 +- pkg/printer/pretty_printer_test.go | 113 +- pkg/printer/printer.go | 182 ++- pkg/printer/printer_test.go | 115 +- pkg/token/position.go | 1 - pkg/token/position_string.go | 151 +- 21 files changed, 3610 insertions(+), 2681 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index dcb70ae..b210323 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -11442,7 +11442,7 @@ func TestStmtUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11451,17 +11451,17 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11470,17 +11470,27 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -11510,7 +11520,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11519,17 +11529,17 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11538,17 +11548,27 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -11578,7 +11598,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11587,49 +11607,59 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 18, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 18, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, EndPos: 18, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("Bar"), + }, }, }, }, @@ -11657,7 +11687,7 @@ func TestStmtUse_List(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11666,17 +11696,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11685,31 +11715,31 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11718,17 +11748,27 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, @@ -11758,7 +11798,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11767,17 +11807,17 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 22, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11786,63 +11826,73 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 22, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, EndPos: 22, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Baz"), + }, }, }, }, @@ -11870,7 +11920,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11879,38 +11929,46 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 25, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 19, + EndPos: 25, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11919,31 +11977,31 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11952,7 +12010,19 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -11982,7 +12052,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11991,38 +12061,46 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 39, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 26, + EndPos: 39, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 26, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12031,42 +12109,42 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 39, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 39, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 32, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12075,21 +12153,33 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 32, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 39, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 39, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -12116,7 +12206,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12125,38 +12215,47 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, }, - UseType: &ast.Identifier{ + + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 22, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 16, + EndPos: 22, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12165,31 +12264,31 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12198,7 +12297,19 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -12228,7 +12339,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12237,38 +12348,46 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 36, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 23, + EndPos: 36, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 23, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12277,42 +12396,42 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 23, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 23, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 36, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 36, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12321,21 +12440,33 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 36, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 36, - }, - }, - Value: []byte("bar"), - }, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 162c38257aff062d8a898e9dbc2cce8a38d5a841..7a695b705f4fc19c926cd96b45f73dc97d44ff07 100644 GIT binary patch delta 10034 zcmdT~XL!{`_I~Ef+>nHp1PBmHZV(WWa!Yb^FGYetLMJqp9u}hnDM3KQLeLdtap{-? zqLAn+vI-vaEj`HR{wkQ=y{KB@d{KvUUQ&u@&!HIJ>k;u>lt64}pwKQHjn;Jy5aU14%;3&~9%9+di z52?{yep1zpaO0UPk~rH-HF#ME(XMa-C7RFCk+t4rDvr&&J$Lf-ygTx8@8*YsVl?Nl z==NL8FK$Ca_?eK%{Qt=JKRSsXBFN`AibT#|O7*zpX^PhQoy99crg^+Pb_QMM>oPZrHj}qOgch4O+aqQh=r{_(X%%#n#4zKJg%6MJ2=)$LO#@>ED z{H3yUTl2($V)%b7(4URLG(Pu>Xw1pOMJ=B5wrb8ftwkK~7%TF*bEe1=>6|hETY0vK z7;9m*pzz;1c@$^#7Bx6~oR}9;RRU+9p*=cmH81*0gF!&i`w)v@Y z2dKV#;Xko47<`Ej^aV#gBbrOxs6T#t9myQT?~2?07s<@6;Ny3SBrrr|f`OD=k->X! z6p84Qs(lPw~OxN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zJq{9QiV%Zs7~eYzG>*%qJenSs6iZXGUeA=%z8+#Fn| zA4X$1!9;D)2hgYXB$<+pdInmFNw$^fog=E6DIe%Hpcg5o*%mz@P>h>mqo*L!66xS2 z*^l|UrpbeJ9kYC^9%;XF0#Z-u5IaewAK-D1kM(S*9nB&8g`^X8*amUAE6qV2aHdGJ zWt)D7S#}~vX)(SUpxfyN=yj$J2BGQUTs&~QZfy{hki+jW@q6_`#c_onZRqkBx~)mr zum2$F$YGssFus7Tyw1~kQ$(1FIifp&uv_}NrSO*r zd`^&&X6AK9M0~e(zYX@hq0?FK!ALdHKk1u--o1&a0miKyi&F4|AM}rc!fqjK+#ZO< zlF_$xQCW*DoG=bEP44LV0*!u;Q$?P>tJ7pzsZCczNZ6m+hRhXC_XES%VShIXumy^A z2&YfvfIHMFBm~@QAtLZ5|H?1GuQj0|07H-285y!%(){ocb~ktQTx3WFz%Yr2=eTZT N4!T%UdgYLW{{qJh5qJOq diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 50aa2a5..3e87194 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -428,49 +428,56 @@ top_statement: } | T_USE use_declarations ';' { - $$ = &ast.StmtUseList{ast.Node{}, nil, $2} + useList := &ast.StmtUseList{ast.Node{}, $2} + $$ = &ast.StmtUse{ast.Node{}, useList} // save position + useList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_FUNCTION use_function_declarations ';' { - useType := &ast.Identifier{ast.Node{}, $2.Value} - $$ = &ast.StmtUseList{ast.Node{}, useType, $3} + identifier := &ast.Identifier{ast.Node{}, $2.Value} + useList := &ast.StmtUseList{ast.Node{}, $3} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition($2) + identifier.GetNode().Position = position.NewTokenPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($3) + useType.GetNode().Position = position.NewTokenNodePosition($2, useList) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE T_CONST use_const_declarations ';' { - useType := &ast.Identifier{ast.Node{}, $2.Value} - $$ = &ast.StmtUseList{ast.Node{}, useType, $3} + identifier := &ast.Identifier{ast.Node{}, $2.Value} + useList := &ast.StmtUseList{ast.Node{}, $3} + useType := &ast.StmtUseType{ast.Node{}, identifier, useList} + $$ = &ast.StmtUse{ast.Node{}, useType} // save position - useType.GetNode().Position = position.NewTokenPosition($2) + identifier.GetNode().Position = position.NewTokenPosition($2) + useList.GetNode().Position = position.NewNodeListPosition($3) + useType.GetNode().Position = position.NewTokenNodePosition($2, useList) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(useType, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.UseDeclarationList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -511,22 +518,19 @@ use_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -534,7 +538,6 @@ use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -543,16 +546,14 @@ use_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -560,7 +561,7 @@ use_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -568,9 +569,7 @@ use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) @@ -600,22 +599,19 @@ use_function_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -623,7 +619,6 @@ use_function_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -632,16 +627,14 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -649,7 +642,7 @@ use_function_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -657,9 +650,7 @@ use_function_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) @@ -689,22 +680,19 @@ use_const_declaration: namespace_name { name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { name := &ast.NameName{ast.Node{}, $1} alias := &ast.Identifier{ast.Node{}, $3.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($1) @@ -712,7 +700,6 @@ use_const_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) yylex.(*Parser).setFreeFloating(name, token.End, $2.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) @@ -721,16 +708,14 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name { name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, nil, name, nil} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} // save position name.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewNodeListPosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -738,7 +723,7 @@ use_const_declaration: { name := &ast.NameName{ast.Node{}, $2} alias := &ast.Identifier{ast.Node{}, $4.Value} - $$ = &ast.StmtUse{ast.Node{}, nil, name, alias} + $$ = &ast.StmtUseDeclaration{ast.Node{}, name, alias} // save position name.GetNode().Position = position.NewNodeListPosition($2) @@ -746,9 +731,7 @@ use_const_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Slash, $1.Tokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index d36ab6d..7c4c4c6 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -8525,7 +8525,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 154, @@ -8534,17 +8534,17 @@ func TestPhp5(t *testing.T) { EndPos: 3289, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 154, @@ -8553,24 +8553,34 @@ func TestPhp5(t *testing.T) { EndPos: 3288, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 154, + EndLine: 154, + StartPos: 3285, + EndPos: 3288, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 155, @@ -8579,17 +8589,17 @@ func TestPhp5(t *testing.T) { EndPos: 3299, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 155, @@ -8598,24 +8608,34 @@ func TestPhp5(t *testing.T) { EndPos: 3298, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 155, + EndLine: 155, + StartPos: 3295, + EndPos: 3298, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 156, @@ -8624,54 +8644,64 @@ func TestPhp5(t *testing.T) { EndPos: 3316, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3315, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3315, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 156, EndLine: 156, StartPos: 3305, - EndPos: 3308, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3308, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3312, EndPos: 3315, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3308, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3305, + EndPos: 3308, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 156, + EndLine: 156, + StartPos: 3312, + EndPos: 3315, + }, + }, + Value: []byte("Bar"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8680,17 +8710,17 @@ func TestPhp5(t *testing.T) { EndPos: 3330, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3329, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8699,31 +8729,31 @@ func TestPhp5(t *testing.T) { EndPos: 3324, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3324, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3321, + EndPos: 3324, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 157, @@ -8732,24 +8762,34 @@ func TestPhp5(t *testing.T) { EndPos: 3329, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3326, + EndPos: 3329, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 157, + EndLine: 157, + StartPos: 3326, + EndPos: 3329, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, @@ -8758,17 +8798,17 @@ func TestPhp5(t *testing.T) { EndPos: 3351, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3350, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, @@ -8777,68 +8817,78 @@ func TestPhp5(t *testing.T) { EndPos: 3338, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3338, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3335, + EndPos: 3338, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3350, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 158, EndLine: 158, StartPos: 3340, - EndPos: 3343, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3343, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3347, EndPos: 3350, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3340, + EndPos: 3343, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3340, + EndPos: 3343, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 158, + EndLine: 158, + StartPos: 3347, + EndPos: 3350, + }, + }, + Value: []byte("Baz"), + }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8847,38 +8897,46 @@ func TestPhp5(t *testing.T) { EndPos: 3375, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3356, - EndPos: 3364, + EndPos: 3374, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3356, + EndPos: 3364, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, EndLine: 159, StartPos: 3365, - EndPos: 3368, + EndPos: 3374, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3365, - EndPos: 3368, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3365, + EndPos: 3368, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8887,31 +8945,31 @@ func TestPhp5(t *testing.T) { EndPos: 3368, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3365, + EndPos: 3368, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3371, + EndPos: 3374, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 159, @@ -8920,14 +8978,26 @@ func TestPhp5(t *testing.T) { EndPos: 3374, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 159, + EndLine: 159, + StartPos: 3371, + EndPos: 3374, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -8936,38 +9006,46 @@ func TestPhp5(t *testing.T) { EndPos: 3413, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3380, - EndPos: 3388, + EndPos: 3412, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3380, + EndPos: 3388, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, EndLine: 160, StartPos: 3389, - EndPos: 3399, + EndPos: 3412, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3389, - EndPos: 3392, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3389, + EndPos: 3399, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -8976,42 +9054,42 @@ func TestPhp5(t *testing.T) { EndPos: 3392, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3389, + EndPos: 3392, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3396, + EndPos: 3399, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3396, - EndPos: 3399, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3402, + EndPos: 3412, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3412, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3405, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 160, @@ -9020,25 +9098,37 @@ func TestPhp5(t *testing.T) { EndPos: 3405, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3402, + EndPos: 3405, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 160, + EndLine: 160, + StartPos: 3409, + EndPos: 3412, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3409, - EndPos: 3412, - }, - }, - Value: []byte("bar"), - }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9047,38 +9137,46 @@ func TestPhp5(t *testing.T) { EndPos: 3434, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3418, - EndPos: 3423, + EndPos: 3433, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3418, + EndPos: 3423, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, EndLine: 161, StartPos: 3424, - EndPos: 3427, + EndPos: 3433, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3424, - EndPos: 3427, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3424, + EndPos: 3427, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9087,31 +9185,31 @@ func TestPhp5(t *testing.T) { EndPos: 3427, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3424, + EndPos: 3427, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3430, + EndPos: 3433, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9120,14 +9218,26 @@ func TestPhp5(t *testing.T) { EndPos: 3433, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3430, + EndPos: 3433, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, }, }, }, - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9136,38 +9246,46 @@ func TestPhp5(t *testing.T) { EndPos: 3469, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3439, - EndPos: 3444, + EndPos: 3468, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3439, + EndPos: 3444, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, StartPos: 3445, - EndPos: 3455, + EndPos: 3468, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3445, - EndPos: 3448, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3445, + EndPos: 3455, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9176,42 +9294,42 @@ func TestPhp5(t *testing.T) { EndPos: 3448, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3445, + EndPos: 3448, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3452, + EndPos: 3455, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3452, - EndPos: 3455, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3458, + EndPos: 3468, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3468, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3461, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, @@ -9220,21 +9338,33 @@ func TestPhp5(t *testing.T) { EndPos: 3461, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3458, + EndPos: 3461, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3465, + EndPos: 3468, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3465, - EndPos: 3468, - }, - }, - Value: []byte("bar"), - }, }, }, }, diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 47a0eca..22f0676 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -12422,7 +12422,7 @@ func TestStmtUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12431,17 +12431,17 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12450,17 +12450,27 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -12490,7 +12500,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12499,17 +12509,17 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12518,17 +12528,27 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, @@ -12558,7 +12578,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12567,49 +12587,59 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 18, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 18, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, EndPos: 18, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + }, + Value: []byte("Bar"), + }, }, }, }, @@ -12637,7 +12667,7 @@ func TestStmtUse_List(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12646,17 +12676,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12665,31 +12695,31 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12698,17 +12728,27 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), }, - Value: []byte("Bar"), }, }, }, @@ -12738,7 +12778,7 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12747,17 +12787,17 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, }, - Uses: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 22, }, - Use: &ast.NameName{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12766,63 +12806,73 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 22, - }, - }, - Use: &ast.NameName{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, EndPos: 22, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Baz"), + }, }, }, }, @@ -12850,7 +12900,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12859,38 +12909,46 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 25, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 19, + EndPos: 25, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12899,31 +12957,31 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12932,7 +12990,19 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -12962,7 +13032,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12971,38 +13041,46 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 39, }, }, - Value: []byte("function"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, + }, + Value: []byte("function"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 26, + EndPos: 39, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 26, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13011,42 +13089,42 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 39, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 39, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 32, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13055,21 +13133,33 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 32, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 39, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 39, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -13096,7 +13186,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13105,38 +13195,47 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, }, - UseType: &ast.Identifier{ + + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 22, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 16, + EndPos: 22, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13145,31 +13244,31 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13178,7 +13277,19 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, }, @@ -13208,7 +13319,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtUseList{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13217,38 +13328,46 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 36, }, }, - Value: []byte("const"), - }, - Uses: []ast.Vertex{ - &ast.StmtUse{ + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 23, + EndPos: 36, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 23, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13257,42 +13376,42 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 23, + }, + }, + Value: []byte("foo"), }, }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 23, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 36, + }, }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 36, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13301,21 +13420,33 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 36, + }, + }, + Value: []byte("bar"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 36, - }, - }, - Value: []byte("bar"), - }, }, }, }, @@ -13342,7 +13473,7 @@ func TestStmtUse_GroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13351,50 +13482,58 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 22, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 21, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, + EndPos: 20, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13403,31 +13542,31 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 15, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13436,7 +13575,19 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 20, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, + }, + Value: []byte("Baz"), + }, + }, }, }, }, @@ -13466,7 +13617,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13475,50 +13626,58 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 30, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 29, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + }, + Value: []byte("Foo"), }, - Value: []byte("Foo"), }, }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, - EndPos: 15, + EndPos: 28, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13527,31 +13686,31 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 15, }, }, - Value: []byte("Bar"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 28, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 20, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 28, + }, }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13560,21 +13719,33 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 20, }, }, - Value: []byte("Baz"), + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 20, + }, + }, + Value: []byte("Baz"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 28, + }, + }, + Value: []byte("quux"), }, }, }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 28, - }, - }, - Value: []byte("quux"), - }, }, }, }, @@ -13601,7 +13772,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13610,28 +13781,36 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 31, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 15, + EndPos: 30, }, }, - Value: []byte("function"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 15, + }, }, + Value: []byte("function"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 30, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13640,31 +13819,31 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 19, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 21, - EndPos: 24, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 21, - EndPos: 24, + EndPos: 29, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13673,31 +13852,31 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 24, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 24, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 24, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13706,7 +13885,29 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 29, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, @@ -13736,7 +13937,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13745,28 +13946,36 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 28, }, }, - UseType: &ast.Identifier{ + UseList: &ast.StmtUseType{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 12, + EndPos: 27, }, }, - Value: []byte("const"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 12, + }, }, + Value: []byte("const"), }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtGroupUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 27, + }, + }, + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13775,31 +13984,31 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 16, }, }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 21, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, + }, + }, + Value: []byte("Foo"), + }, }, }, - Use: &ast.NameName{ + UseList: &ast.StmtUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 18, - EndPos: 21, + EndPos: 26, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13808,31 +14017,31 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 21, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13841,7 +14050,29 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 26, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, @@ -13871,7 +14102,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13880,61 +14111,69 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 37, }, }, - Prefix: &ast.NameName{ + UseList: &ast.StmtGroupUseList{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 10, + EndPos: 36, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseList: []ast.Vertex{ - &ast.StmtUse{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 18, - EndPos: 21, + StartPos: 7, + EndPos: 10, }, }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 17, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, }, + Value: []byte("Foo"), }, - Value: []byte("const"), }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 21, - }, + }, + UseList: &ast.StmtUseList{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 35, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 21, + }, + }, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 17, + }, + }, + Value: []byte("const"), + }, + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13943,42 +14182,52 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 21, }, }, - Value: []byte("Bar"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 21, + }, + }, + Value: []byte("Bar"), + }, + }, + }, }, }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 32, - EndPos: 35, - }, - }, - UseType: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 31, + &ast.StmtUseType{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 35, + }, }, - }, - Value: []byte("function"), - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 32, - EndPos: 35, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 31, + }, + }, + Value: []byte("function"), }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Use: &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -13987,7 +14236,29 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 35, }, }, - Value: []byte("Baz"), + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 35, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 35, + }, + }, + Value: []byte("Baz"), + }, + }, + }, }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e54c1a76bfc3d00ccdaa38d36a084062b596e527..33a3f5ef54ebc6ca6100e517ad066275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`3KiK@!`UKX-O(Yo6Rfx0>#X$` zA|snPDE9I42_!9<)D$a= Position(len(_Position_index)-1) { From 48e0996a92658f5d1774761afbf1266b645921ea Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 3 Aug 2020 22:39:02 +0200 Subject: [PATCH 037/140] [refactoring] do not inherit free-floating tokens in `name` nodes --- internal/php5/php5.go | Bin 332402 -> 331289 bytes internal/php5/php5.y | 29 +--------- internal/php7/php7.go | Bin 273828 -> 273406 bytes internal/php7/php7.y | 10 +--- pkg/printer/printer.go | 68 +++++++++++++----------- pkg/printer/printer_parsed_php7_test.go | 2 +- 6 files changed, 41 insertions(+), 68 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 7a695b705f4fc19c926cd96b45f73dc97d44ff07..6feebfc24f3054c5afd92070bc093593e3cf6bd6 100644 GIT binary patch delta 9353 zcmbVSd3?=R+W(y8CK4eLM3Kmi+GDvlH`}#GNg{|SrK&2?)>x`y8LGC>X_eMC$fF3_ znpQ2fwN7;y%h;-xP+n78qP52mZKtiG-tRfT-@P|F|Gb~~uiW2Rp7We%{XWmh536gu zx4g!tkLy%&c|$|TP0W9p@;1pQ-Z)rC9jwDEm;OjrLtx{Ak8 z{=0lT&3_$St{=)8Yc8A9{5iZ2z1ER+7KvUj#r0tK>B}^h&Rwbcqb8M}8py)bqfTrB;|YN))=?NIPMtDX2IbY`QEFudi{w1XYqly#p^BhyyJMDhVo@|m zI<8W5Hcm@5N86{J%LX?|-U@X6=Or*&n8Uhomqk&_)pzLX-Vk@PpGRBV`Mp@&woLX4 zqhrsobc*ZA61CvMXwpE|QaQ8Oc1~^jW2f7?`_$(w<|a_v0pKg8!a05>+>CyD9?L+i zqXM0iyn<{VKX(M9R)Y<7Z3bEZeFSyvC8MavIPRp_uXuIUVhGzUXzRB!xv&kZPWbey zQNvlhU`cA(NOqiox_b<-Rp{ou=$lcNZtCW*Y}@_cOkp(T}g=PJ6wwF2Sgz z>OYC?aX?yovUsZM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mD+f)t z1*x@@+k-7SpvGHYcMUEG@*q9>bCpgqY=X*{Z$7Zs1j7CQY&dfWe4qHxHC(Q&{1Dux zy15(SS9((geDE<8V9T4o+;aI7(DAAz+q!_%r)~V3QmKMV%E@M7Q*%d!pPJxA1hQ_7fBb`!4~MI0CFE?V0x zFM)b95*Vf7R?d+grBD{qyJ2zYd8lN;B~?Q{D^-hZAIr7phu^ELphUO5vwIXb(<#SQ z5phz2{`vJRiYksQhnuFX7L5!$IKtqKr+3o@5*4jcK<>B(c&kSEF-6>5IHmr z>1gB`HI`L;Y>LK~JkxhXzKPVs&ck0gAwf?3qQ=O`JhU}IFh_Axyv9@q<+bbrZLOa2 z>J`9g>VE@Ikd$9j!FY)_)?==!VYc8iSZuRT<~1lfEky&WPC`csZkz5e{PJ~loNd$M zg{`s9TI4mGpXTWy%4w~FlHJaJ=^yGgS$qH~>TrC486>rNA2TaV{b4*s>suW>OaKC2AzrtogW|-t_x$?(R%U0K+k^b3 ZjgzI4@tg}ZRsAtewvlPL9Ex$`{}(|v8e0GW diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 752de40..deb2eff 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -392,9 +392,6 @@ name: // save position $$.GetNode().Position = position.NewNodeListPosition($1) - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name @@ -4818,7 +4815,6 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) @@ -4832,7 +4828,6 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) @@ -4846,7 +4841,6 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) @@ -4988,7 +4982,6 @@ new_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) @@ -5002,7 +4995,6 @@ new_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) @@ -5403,7 +5395,7 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) + yylex.(*Parser).setToken(variable, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.Tokens) yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.Tokens) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 4eff938..dd06f0f 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -594,35 +594,48 @@ func (p *Printer) printNameRelative(n ast.Vertex) { func (p *Printer) printScalarLNumber(n ast.Vertex) { nn := n.(*ast.ScalarLnumber) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } func (p *Printer) printScalarDNumber(n ast.Vertex) { nn := n.(*ast.ScalarDnumber) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } func (p *Printer) printScalarString(n ast.Vertex) { nn := n.(*ast.ScalarString) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } func (p *Printer) printScalarEncapsedStringPart(n ast.Vertex) { nn := n.(*ast.ScalarEncapsedStringPart) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } func (p *Printer) printScalarEncapsed(n ast.Vertex) { nn := n.(*ast.ScalarEncapsed) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" io.WriteString(p.w, "\"") for _, part := range nn.Parts { @@ -652,7 +665,8 @@ func (p *Printer) printScalarEncapsed(n ast.Vertex) { func (p *Printer) printScalarHeredoc(n ast.Vertex) { nn := n.(*ast.ScalarHeredoc) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" io.WriteString(p.w, string(nn.Label)) @@ -684,8 +698,11 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) { func (p *Printer) printScalarMagicConstant(n ast.Vertex) { nn := n.(*ast.ScalarMagicConstant) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" + io.WriteString(p.w, string(nn.Value)) + p.printFreeFloating(nn, token.End) } @@ -1613,9 +1630,7 @@ func (p *Printer) printExprInstanceOf(n ast.Vertex) { io.WriteString(p.w, "instanceof") - if nn.Class.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.Print(nn.Class) p.printFreeFloating(nn, token.End) @@ -1673,9 +1688,7 @@ func (p *Printer) printExprNew(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "new") - if nn.Class.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.Print(nn.Class) if nn.ArgumentList != nil { @@ -1900,7 +1913,8 @@ func (p *Printer) printExprUnaryPlus(n ast.Vertex) { func (p *Printer) printExprVariable(n ast.Vertex) { nn := n.(*ast.ExprVariable) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" p.printFreeFloating(nn, token.Dollar) if _, ok := nn.VarName.(*ast.Identifier); !ok { @@ -2282,7 +2296,8 @@ func (p *Printer) printStmtClassMethod(n ast.Vertex) { func (p *Printer) printStmtClass(n ast.Vertex) { nn := n.(*ast.StmtClass) - p.printFreeFloating(nn, token.Start) + p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) + p.bufStart = "" if nn.Modifiers != nil { for k, m := range nn.Modifiers { @@ -2301,9 +2316,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) { p.printFreeFloating(nn, token.Class) if nn.ClassName != nil { - if nn.ClassName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.Print(nn.ClassName) } @@ -2322,9 +2335,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) { io.WriteString(p.w, " ") } io.WriteString(p.w, "extends") - if nn.Extends.ClassName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.Print(nn.Extends.ClassName) } @@ -2890,12 +2901,11 @@ func (p *Printer) printStmtPropertyList(n ast.Vertex) { p.Print(m) } - if nn.Type != nil && nn.Type.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + if nn.Type != nil { + p.bufStart = " " + p.Print(nn.Type) } - p.Print(nn.Type) - if nn.Properties[0].GetNode().Tokens.IsEmpty() { io.WriteString(p.w, " ") } @@ -2931,9 +2941,7 @@ func (p *Printer) printStmtReturn(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "return") - if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) @@ -3102,9 +3110,7 @@ func (p *Printer) printStmtTraitUsePrecedence(n ast.Vertex) { } io.WriteString(p.w, "insteadof") - if nn.Insteadof[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } + p.bufStart = " " p.joinPrint(",", nn.Insteadof) p.printFreeFloating(nn, token.NameList) diff --git a/pkg/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go index a68c502..317ea02 100644 --- a/pkg/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -979,7 +979,7 @@ func TestParseAndPrintClass(t *testing.T) { } - new class ( $c ) extends Foo implements Bar , Baz { + new class ( $c, $a ) extends Foo implements Bar , Baz { } ;` From b7d32b07bfe0f6e7230a0c1d37e813d4de465db4 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 3 Aug 2020 22:42:21 +0200 Subject: [PATCH 038/140] [refactoring] store `colon` as free-floating token --- internal/php7/php7.go | Bin 273406 -> 272612 bytes internal/php7/php7.y | 14 +--- pkg/printer/printer.go | 8 +- pkg/token/position.go | 1 - pkg/token/position_string.go | 149 +++++++++++++++++------------------ 5 files changed, 79 insertions(+), 93 deletions(-) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index c267235803312a2fd26e4ce7c90e3051b7c538d4..f5e4667f756b27dd212e1fd9e8aef4d74dc3af63 100644 GIT binary patch delta 5520 zcmZu#X?T@IvVOYyOCTYEu!TJd5eOL2ljP)_lZ#A zMHWebm_h^%FkEcExXsBD$)%7=anc`8>QgCJp@ZqE}RQ4U}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pq%-a@suc@5W>=rGsg zdhSYYik@OVCrgWk@TI)@yg#)kSN}u+JKBnB>z_7W1#*8f&>fCwSuZ6T(wT za@K?1$#uM0N&5{bHSf=Yzpq=*OO@Q)2v4>AV!w-iZ3EA(3h!3O!({X(KmvWnlzbj9 zO*V6~6;V&#%&#N*c{R$uO(Y9`Z^(Buv#TV%k2>x@Oro~oHj*T6XUk{XxWCEFEo}Sr z+IB<+w`ndr>3XP|O#FKmv-l7(Udl0cBAZ2j+9BisPVyjA znlCQ4!Zz-v;cmG~LXUvoteJq5Iqmr1W_AV3ZGEP|tO8((Ex?h;)MD%C@3ipZyh_#OtYY|JV}THLM8O4Uo)l zI8qLj@NyHdOy|6(6bOs+>7PpZh^Z6w;ftJMT?Il5gm#%bk4Vo7ZlWuHMmZ}NuUOlg z(y#VWJ>e>kfak=?(QEuV9&S$wUYNnG*Xr@PXx)dib}TX^LF?8EFE?AqqouzGI+IW zZ=l*+=B6W=xIg7X^6CT7jH~lS!Sp~q_VsmjWVpVb#I9(YMlIFaZ;=nOxs&WXjI3I} zo+}2utxZ)MjCLa|MSLxDwShvAfSo29-}^3boJ@AP&PtDlu4L&P>I#wkPWX=UaFo8% z$OWFfx=X0*4MIxPI~%*+XX@sBd8+l#I_dCUb636rl`*kC+`?69LxL?EJu|@NsR$SP zlnrt*%rm8NCaJltHx9bU#Wo>cpL2H~tY%@)W^?bdn qt?L~CrYc4MrM)Xf26c3WNx@38HZ7Ncj^G?Ix;k&B$)1ib-~RziEdV6| diff --git a/internal/php7/php7.y b/internal/php7/php7.y index deb2eff..1fb33a9 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1453,9 +1453,6 @@ function_declaration_statement: } yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Tokens) - if $8 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) - } yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) @@ -2286,7 +2283,7 @@ return_type: $$ = $2; // save comments - yylex.(*Parser).setFreeFloating($$, token.Colon, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2540,9 +2537,6 @@ class_statement: } yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) - if $9 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $9.GetNode().Tokens[token.Colon]); delete($9.GetNode().Tokens, token.Colon) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4150,9 +4144,6 @@ inline_function: yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) } yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) - if $8 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.LexicalVars, $8.GetNode().Tokens[token.Colon]); delete($8.GetNode().Tokens, token.Colon) - } yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) @@ -4182,9 +4173,6 @@ inline_function: yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) }; yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $6.GetNode().Tokens[token.Colon]); delete($6.GetNode().Tokens, token.Colon) - }; yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) // normalize diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index dd06f0f..6fd54bc 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1409,7 +1409,7 @@ func (p *Printer) printExprArrowFunction(n ast.Vertex) { p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { - io.WriteString(p.w, ":") + p.bufStart = ":" p.Print(nn.ReturnType) } p.printFreeFloating(nn, token.ReturnType) @@ -1505,7 +1505,7 @@ func (p *Printer) printExprClosure(n ast.Vertex) { p.printFreeFloating(nn, token.LexicalVars) if nn.ReturnType != nil { - io.WriteString(p.w, ":") + p.bufStart = ":" p.Print(nn.ReturnType) } p.printFreeFloating(nn, token.ReturnType) @@ -2285,7 +2285,7 @@ func (p *Printer) printStmtClassMethod(n ast.Vertex) { p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { - io.WriteString(p.w, ":") + p.bufStart = ":" p.Print(nn.ReturnType) } @@ -2703,7 +2703,7 @@ func (p *Printer) printStmtFunction(n ast.Vertex) { p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { - io.WriteString(p.w, ":") + p.bufStart = ":" p.Print(nn.ReturnType) } p.printFreeFloating(nn, token.ReturnType) diff --git a/pkg/token/position.go b/pkg/token/position.go index 1a3b02d..28f7802 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -6,7 +6,6 @@ type Position int const ( Start Position = iota End - Colon SemiColon AltEnd Dollar diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index a2f713a..ef682f8 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -10,84 +10,83 @@ func _() { var x [1]struct{} _ = x[Start-0] _ = x[End-1] - _ = x[Colon-2] - _ = x[SemiColon-3] - _ = x[AltEnd-4] - _ = x[Dollar-5] - _ = x[Ampersand-6] - _ = x[Name-7] - _ = x[Prefix-8] - _ = x[Key-9] - _ = x[Var-10] - _ = x[UseType-11] - _ = x[ReturnType-12] - _ = x[OptionalType-13] - _ = x[CaseSeparator-14] - _ = x[LexicalVars-15] - _ = x[Params-16] - _ = x[Ref-17] - _ = x[Cast-18] - _ = x[Expr-19] - _ = x[InitExpr-20] - _ = x[CondExpr-21] - _ = x[IncExpr-22] - _ = x[True-23] - _ = x[Cond-24] - _ = x[HaltCompiller-25] - _ = x[Namespace-26] - _ = x[Static-27] - _ = x[Class-28] - _ = x[Use-29] - _ = x[While-30] - _ = x[For-31] - _ = x[Switch-32] - _ = x[Break-33] - _ = x[Foreach-34] - _ = x[Declare-35] - _ = x[Label-36] - _ = x[Finally-37] - _ = x[List-38] - _ = x[Default-39] - _ = x[If-40] - _ = x[ElseIf-41] - _ = x[Else-42] - _ = x[Variadic-43] - _ = x[Function-44] - _ = x[DoubleArrow-45] - _ = x[Alias-46] - _ = x[As-47] - _ = x[Equal-48] - _ = x[Exit-49] - _ = x[Array-50] - _ = x[Isset-51] - _ = x[Empty-52] - _ = x[Eval-53] - _ = x[Echo-54] - _ = x[Try-55] - _ = x[Catch-56] - _ = x[Unset-57] - _ = x[Stmts-58] - _ = x[VarList-59] - _ = x[ConstList-60] - _ = x[NameList-61] - _ = x[ParamList-62] - _ = x[ModifierList-63] - _ = x[ArrayPairList-64] - _ = x[CaseListStart-65] - _ = x[CaseListEnd-66] - _ = x[ArgumentList-67] - _ = x[PropertyList-68] - _ = x[ParameterList-69] - _ = x[AdaptationList-70] - _ = x[LexicalVarList-71] - _ = x[UseDeclarationList-72] - _ = x[OpenParenthesisToken-73] - _ = x[CloseParenthesisToken-74] + _ = x[SemiColon-2] + _ = x[AltEnd-3] + _ = x[Dollar-4] + _ = x[Ampersand-5] + _ = x[Name-6] + _ = x[Prefix-7] + _ = x[Key-8] + _ = x[Var-9] + _ = x[UseType-10] + _ = x[ReturnType-11] + _ = x[OptionalType-12] + _ = x[CaseSeparator-13] + _ = x[LexicalVars-14] + _ = x[Params-15] + _ = x[Ref-16] + _ = x[Cast-17] + _ = x[Expr-18] + _ = x[InitExpr-19] + _ = x[CondExpr-20] + _ = x[IncExpr-21] + _ = x[True-22] + _ = x[Cond-23] + _ = x[HaltCompiller-24] + _ = x[Namespace-25] + _ = x[Static-26] + _ = x[Class-27] + _ = x[Use-28] + _ = x[While-29] + _ = x[For-30] + _ = x[Switch-31] + _ = x[Break-32] + _ = x[Foreach-33] + _ = x[Declare-34] + _ = x[Label-35] + _ = x[Finally-36] + _ = x[List-37] + _ = x[Default-38] + _ = x[If-39] + _ = x[ElseIf-40] + _ = x[Else-41] + _ = x[Variadic-42] + _ = x[Function-43] + _ = x[DoubleArrow-44] + _ = x[Alias-45] + _ = x[As-46] + _ = x[Equal-47] + _ = x[Exit-48] + _ = x[Array-49] + _ = x[Isset-50] + _ = x[Empty-51] + _ = x[Eval-52] + _ = x[Echo-53] + _ = x[Try-54] + _ = x[Catch-55] + _ = x[Unset-56] + _ = x[Stmts-57] + _ = x[VarList-58] + _ = x[ConstList-59] + _ = x[NameList-60] + _ = x[ParamList-61] + _ = x[ModifierList-62] + _ = x[ArrayPairList-63] + _ = x[CaseListStart-64] + _ = x[CaseListEnd-65] + _ = x[ArgumentList-66] + _ = x[PropertyList-67] + _ = x[ParameterList-68] + _ = x[AdaptationList-69] + _ = x[LexicalVarList-70] + _ = x[UseDeclarationList-71] + _ = x[OpenParenthesisToken-72] + _ = x[CloseParenthesisToken-73] } -const _Position_name = "StartEndColonSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 13, 22, 28, 34, 43, 47, 53, 56, 59, 66, 76, 88, 101, 112, 118, 121, 125, 129, 137, 145, 152, 156, 160, 173, 182, 188, 193, 196, 201, 204, 210, 215, 222, 229, 234, 241, 245, 252, 254, 260, 264, 272, 280, 291, 296, 298, 303, 307, 312, 317, 322, 326, 330, 333, 338, 343, 348, 355, 364, 372, 381, 393, 406, 419, 430, 442, 454, 467, 481, 495, 513, 533, 554} +var _Position_index = [...]uint16{0, 5, 8, 17, 23, 29, 38, 42, 48, 51, 54, 61, 71, 83, 96, 107, 113, 116, 120, 124, 132, 140, 147, 151, 155, 168, 177, 183, 188, 191, 196, 199, 205, 210, 217, 224, 229, 236, 240, 247, 249, 255, 259, 267, 275, 286, 291, 293, 298, 302, 307, 312, 317, 321, 325, 328, 333, 338, 343, 350, 359, 367, 376, 388, 401, 414, 425, 437, 449, 462, 476, 490, 508, 528, 549} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) { From a70e34d72600747f080bbf0545d1946673f858a0 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 3 Aug 2020 22:44:49 +0200 Subject: [PATCH 039/140] [refactoring] remove unused token positions --- pkg/printer/printer.go | 3 - pkg/token/position.go | 9 --- pkg/token/position_string.go | 135 ++++++++++++++++------------------- 3 files changed, 63 insertions(+), 84 deletions(-) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 6fd54bc..f79c8e7 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -532,7 +532,6 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { if nn.Variadic { io.WriteString(p.w, "...") } - p.printFreeFloating(nn, token.Variadic) p.Print(nn.Expr) @@ -1916,7 +1915,6 @@ func (p *Printer) printExprVariable(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - p.printFreeFloating(nn, token.Dollar) if _, ok := nn.VarName.(*ast.Identifier); !ok { io.WriteString(p.w, "$") } @@ -2313,7 +2311,6 @@ func (p *Printer) printStmtClass(n ast.Vertex) { } p.printFreeFloating(nn, token.ModifierList) io.WriteString(p.w, "class") - p.printFreeFloating(nn, token.Class) if nn.ClassName != nil { p.bufStart = " " diff --git a/pkg/token/position.go b/pkg/token/position.go index 28f7802..c74e558 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -8,15 +8,11 @@ const ( End SemiColon AltEnd - Dollar Ampersand Name - Prefix Key Var - UseType ReturnType - OptionalType CaseSeparator LexicalVars Params @@ -37,7 +33,6 @@ const ( While For Switch - Break Foreach Declare Label @@ -47,11 +42,8 @@ const ( If ElseIf Else - Variadic Function - DoubleArrow Alias - As Equal Exit Array @@ -77,7 +69,6 @@ const ( ParameterList AdaptationList LexicalVarList - UseDeclarationList OpenParenthesisToken CloseParenthesisToken diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index ef682f8..c3c6eab 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -12,81 +12,72 @@ func _() { _ = x[End-1] _ = x[SemiColon-2] _ = x[AltEnd-3] - _ = x[Dollar-4] - _ = x[Ampersand-5] - _ = x[Name-6] - _ = x[Prefix-7] - _ = x[Key-8] - _ = x[Var-9] - _ = x[UseType-10] - _ = x[ReturnType-11] - _ = x[OptionalType-12] - _ = x[CaseSeparator-13] - _ = x[LexicalVars-14] - _ = x[Params-15] - _ = x[Ref-16] - _ = x[Cast-17] - _ = x[Expr-18] - _ = x[InitExpr-19] - _ = x[CondExpr-20] - _ = x[IncExpr-21] - _ = x[True-22] - _ = x[Cond-23] - _ = x[HaltCompiller-24] - _ = x[Namespace-25] - _ = x[Static-26] - _ = x[Class-27] - _ = x[Use-28] - _ = x[While-29] - _ = x[For-30] - _ = x[Switch-31] - _ = x[Break-32] - _ = x[Foreach-33] - _ = x[Declare-34] - _ = x[Label-35] - _ = x[Finally-36] - _ = x[List-37] - _ = x[Default-38] - _ = x[If-39] - _ = x[ElseIf-40] - _ = x[Else-41] - _ = x[Variadic-42] - _ = x[Function-43] - _ = x[DoubleArrow-44] - _ = x[Alias-45] - _ = x[As-46] - _ = x[Equal-47] - _ = x[Exit-48] - _ = x[Array-49] - _ = x[Isset-50] - _ = x[Empty-51] - _ = x[Eval-52] - _ = x[Echo-53] - _ = x[Try-54] - _ = x[Catch-55] - _ = x[Unset-56] - _ = x[Stmts-57] - _ = x[VarList-58] - _ = x[ConstList-59] - _ = x[NameList-60] - _ = x[ParamList-61] - _ = x[ModifierList-62] - _ = x[ArrayPairList-63] - _ = x[CaseListStart-64] - _ = x[CaseListEnd-65] - _ = x[ArgumentList-66] - _ = x[PropertyList-67] - _ = x[ParameterList-68] - _ = x[AdaptationList-69] - _ = x[LexicalVarList-70] - _ = x[UseDeclarationList-71] - _ = x[OpenParenthesisToken-72] - _ = x[CloseParenthesisToken-73] + _ = x[Ampersand-4] + _ = x[Name-5] + _ = x[Key-6] + _ = x[Var-7] + _ = x[ReturnType-8] + _ = x[CaseSeparator-9] + _ = x[LexicalVars-10] + _ = x[Params-11] + _ = x[Ref-12] + _ = x[Cast-13] + _ = x[Expr-14] + _ = x[InitExpr-15] + _ = x[CondExpr-16] + _ = x[IncExpr-17] + _ = x[True-18] + _ = x[Cond-19] + _ = x[HaltCompiller-20] + _ = x[Namespace-21] + _ = x[Static-22] + _ = x[Class-23] + _ = x[Use-24] + _ = x[While-25] + _ = x[For-26] + _ = x[Switch-27] + _ = x[Foreach-28] + _ = x[Declare-29] + _ = x[Label-30] + _ = x[Finally-31] + _ = x[List-32] + _ = x[Default-33] + _ = x[If-34] + _ = x[ElseIf-35] + _ = x[Else-36] + _ = x[Function-37] + _ = x[Alias-38] + _ = x[Equal-39] + _ = x[Exit-40] + _ = x[Array-41] + _ = x[Isset-42] + _ = x[Empty-43] + _ = x[Eval-44] + _ = x[Echo-45] + _ = x[Try-46] + _ = x[Catch-47] + _ = x[Unset-48] + _ = x[Stmts-49] + _ = x[VarList-50] + _ = x[ConstList-51] + _ = x[NameList-52] + _ = x[ParamList-53] + _ = x[ModifierList-54] + _ = x[ArrayPairList-55] + _ = x[CaseListStart-56] + _ = x[CaseListEnd-57] + _ = x[ArgumentList-58] + _ = x[PropertyList-59] + _ = x[ParameterList-60] + _ = x[AdaptationList-61] + _ = x[LexicalVarList-62] + _ = x[OpenParenthesisToken-63] + _ = x[CloseParenthesisToken-64] } -const _Position_name = "StartEndSemiColonAltEndDollarAmpersandNamePrefixKeyVarUseTypeReturnTypeOptionalTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchBreakForeachDeclareLabelFinallyListDefaultIfElseIfElseVariadicFunctionDoubleArrowAliasAsEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListUseDeclarationListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondHaltCompillerNamespaceStaticClassUseWhileForSwitchForeachDeclareLabelFinallyListDefaultIfElseIfElseFunctionAliasEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListOpenParenthesisTokenCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 17, 23, 29, 38, 42, 48, 51, 54, 61, 71, 83, 96, 107, 113, 116, 120, 124, 132, 140, 147, 151, 155, 168, 177, 183, 188, 191, 196, 199, 205, 210, 217, 224, 229, 236, 240, 247, 249, 255, 259, 267, 275, 286, 291, 293, 298, 302, 307, 312, 317, 321, 325, 328, 333, 338, 343, 350, 359, 367, 376, 388, 401, 414, 425, 437, 449, 462, 476, 490, 508, 528, 549} +var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 137, 146, 152, 157, 160, 165, 168, 174, 181, 188, 193, 200, 204, 211, 213, 219, 223, 231, 236, 241, 245, 250, 255, 260, 264, 268, 271, 276, 281, 286, 293, 302, 310, 319, 331, 344, 357, 368, 380, 392, 405, 419, 433, 453, 474} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) { From 45464654c6ebad2d532c07b2b529f80609ba9a68 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 3 Aug 2020 23:21:12 +0200 Subject: [PATCH 040/140] [refactoring] store halt_compiler tokens --- internal/php5/php5.go | Bin 331289 -> 330857 bytes internal/php5/php5.y | 14 ++---- internal/php7/php7.go | Bin 272612 -> 272180 bytes internal/php7/php7.y | 12 ++--- pkg/printer/printer.go | 12 +---- pkg/token/position.go | 1 - pkg/token/position_string.go | 93 +++++++++++++++++------------------ 7 files changed, 54 insertions(+), 78 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 6feebfc24f3054c5afd92070bc093593e3cf6bd6..397fb9de03ab0b5bc305150efa6fa4373bd2fcb1 100644 GIT binary patch delta 9466 zcma)Cd0dv&w*Kwm69E~VMP?P}f$94IM{oeNR2(?v3{D*!DaAC)P_sNa0HrQcaV%34 z#ZtFs4y87zC6(u#d(=cNXH&T6WSJKC+53GzP;d8~`;UHmUVH7ep7pHt^498l*9+^F zY;IgL#>;E^tn6`NRPml{H2?F)>hs3z2VY9NB15RONcz)<(ag`YZCGY@_P8lyThjWi ztP!nGV2x$__U&6yL8?rp)HW=c$0bl^d-g27IE;;;sde}mI{XYTq{^pQ5|!t(wv@J+ z4WfYdEQL80W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TRiV)f#Os^?yIn)ah3Ce|VxR`qk4g$L*!oSipRa z-O8F}O(c^;;bu>n^l2VJzkduMX6G6G*?sD4xSz|%C$!)T2!z|I+4epmGClgoqk_jQ cw0aA#OSfhTPA#+WH4XQR<}|?{KW@4I2QWKbL;wH) diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 05a8884..38a0d87 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -855,46 +855,49 @@ unticked_statement: } | T_IF parenthesis_expr statement elseif_list else_single { - $$ = &ast.StmtIf{ast.Node{}, $2, $3, $4, $5} - - // save position + pos := position.NewTokenNodePosition($1, $3) if $5 != nil { - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) + pos = position.NewTokenNodePosition($1, $5) } else if len($4) > 0 { - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $4) - } else { - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) + pos = position.NewTokenNodeListPosition($1, $4) } - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtIf{ + Node: ast.Node{ + Position: pos, + }, + IfTkn: $1, + OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, + Cond: $2.(*ast.ParserBrackets).Child, + CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, + Stmt: $3, + ElseIf: $4, + Else: $5, + } } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { - stmts := &ast.StmtStmtList{ + $$ = &ast.StmtIf{ Node: ast.Node{ - Position: position.NewNodeListPosition($4), + Position: position.NewTokensPosition($1, $8), }, - Stmts: $4, + Alt: true, + IfTkn: $1, + OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, + Cond: $2.(*ast.ParserBrackets).Child, + CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, + ColonTkn: $3, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($4), + }, + Stmts: $4, + }, + ElseIf: $5, + Else: $6, + EndIfTkn: $7, + SemiColonTkn: $8, } - stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - $$ = &ast.StmtAltIf{ast.Node{}, $2, stmtsBrackets, $5, $6} - - // save position - stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($3, $4) - $$.GetNode().Position = position.NewTokensPosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloating($6.(*ast.StmtAltElse).Stmt, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) - } else if len($5) > 0 { - yylex.(*Parser).setFreeFloating($5[len($5)-1].(*ast.StmtAltElseIf).Stmt, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) - } else { - yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) - } - yylex.(*Parser).setToken($$, token.SemiColon, $8.SkippedTokens) } | T_WHILE parenthesis_expr while_statement { @@ -1946,14 +1949,16 @@ elseif_list: } | elseif_list T_ELSEIF parenthesis_expr statement { - _elseIf := &ast.StmtElseIf{ast.Node{}, $3, $4} - $$ = append($1, _elseIf) - - // save position - _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $4) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) + $$ = append($1, &ast.StmtElseIf{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($2, $4), + }, + ElseIfTkn: $2, + OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, + Cond: $3.(*ast.ParserBrackets).Child, + CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, + Stmt: $4, + }) } ; @@ -1965,23 +1970,23 @@ new_elseif_list: } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { - stmts := &ast.StmtStmtList{ + $$ = append($1, &ast.StmtElseIf{ Node: ast.Node{ - Position: position.NewNodeListPosition($5), + Position: position.NewTokenNodeListPosition($2, $5), }, - Stmts: $5, - } - stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmtsBrackets} - $$ = append($1, _elseIf) - - // save position - stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($4, $5) - _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) - - // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $4.SkippedTokens) + Alt: true, + ElseIfTkn: $2, + OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, + Cond: $3.(*ast.ParserBrackets).Child, + CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, + ColonTkn: $4, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($5), + }, + Stmts: $5, + }, + }) } ; @@ -1993,13 +1998,13 @@ else_single: } | T_ELSE statement { - $$ = &ast.StmtElse{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtElse{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ElseTkn: $1, + Stmt: $2, + } } ; @@ -2011,22 +2016,20 @@ new_else_single: } | T_ELSE ':' inner_statement_list { - stmts := &ast.StmtStmtList{ + $$ = &ast.StmtElse{ Node: ast.Node{ - Position: position.NewNodeListPosition($3), + Position: position.NewTokenNodeListPosition($1, $3), + }, + Alt: true, + ElseTkn: $1, + ColonTkn: $2, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($3), + }, + Stmts: $3, }, - Stmts: $3, } - stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - $$ = &ast.StmtAltElse{ast.Node{}, stmtsBrackets} - - // save position - stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($2, $3) - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $2.SkippedTokens) } ; @@ -4318,10 +4321,13 @@ exit_expr: } | '(' ')' { - $$ = &ast.ParserBrackets{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + OpenBracketTkn: $1, + CloseBracketTkn: $2, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -5166,10 +5172,14 @@ expr: parenthesis_expr: '(' expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -5177,10 +5187,14 @@ parenthesis_expr: } | '(' yield_expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -6008,11 +6022,17 @@ internal_functions_in_yacc: } | T_EMPTY '(' variable ')' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + } $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position - exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -6022,11 +6042,17 @@ internal_functions_in_yacc: } | T_EMPTY '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + } $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position - exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -6056,11 +6082,17 @@ internal_functions_in_yacc: } | T_EVAL '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + } $$ = &ast.ExprEval{ast.Node{}, exprBrackets} // save position - exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index ad42cb2..535f8c7 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -2603,7 +2603,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 41, @@ -2612,6 +2612,7 @@ func TestPhp5(t *testing.T) { EndPos: 867, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2645,7 +2646,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 43, @@ -2654,6 +2655,7 @@ func TestPhp5(t *testing.T) { EndPos: 897, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2687,7 +2689,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 44, @@ -2696,6 +2698,7 @@ func TestPhp5(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2731,7 +2734,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 46, @@ -2740,6 +2743,7 @@ func TestPhp5(t *testing.T) { EndPos: 920, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2772,7 +2776,7 @@ func TestPhp5(t *testing.T) { }, Stmts: []ast.Vertex{}, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 47, @@ -2781,6 +2785,7 @@ func TestPhp5(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ @@ -2794,7 +2799,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 49, @@ -2803,6 +2808,7 @@ func TestPhp5(t *testing.T) { EndPos: 969, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2836,7 +2842,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 50, @@ -2845,6 +2851,7 @@ func TestPhp5(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2878,7 +2885,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 51, @@ -2887,6 +2894,7 @@ func TestPhp5(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -2921,7 +2929,7 @@ func TestPhp5(t *testing.T) { }, }, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 52, @@ -2930,6 +2938,7 @@ func TestPhp5(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index b0e66dd..67ce06a 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -3811,7 +3811,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3820,6 +3820,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndPos: 23, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3882,7 +3883,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3891,6 +3892,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 38, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3924,7 +3926,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -3933,6 +3935,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3997,7 +4000,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -4006,6 +4009,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: 31, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4038,7 +4042,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, Stmts: []ast.Vertex{}, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -4047,6 +4051,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ @@ -4091,7 +4096,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -4100,6 +4105,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 61, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4133,7 +4139,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -4142,6 +4148,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4175,7 +4182,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, @@ -4184,6 +4191,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4218,7 +4226,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, }, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 5, @@ -4227,6 +4235,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index bfc89708bbc79701ef76007c3ca647035367b6f4..e1a071b4f334091cc5d69e6fdde6b58a82c756eb 100644 GIT binary patch delta 11338 zcmcIqcXZc9wm&nI4j}}RP?P)uM5^J}3nc_t5RsN3h|~n>#1M)Y6{M;x9ZRmLXtK+~ zf}mjq20@UrtRg7I##&Zzk8g|aGg#N%2fojg?=OjR_MLra%^xt|J9qBfHuv7S^V_l` z<&j5IYEoMBaO8#5*4zI~Ib(R1yvW%!MpqJ9Hcg6QW1=G;HHu}q^*&cN{Jh%mb75Qq z}Gz2o%wc8DLV6wns-fEdcYh0{N#}09lVRS~{bR z(NR(>1FJA7*X-v=s%UK{is(vfL#l{ow{b?FL`Rd_0>(12(R*#N0;3A^`9`Ms97%(+ zoYC>ei4SgQfH%5hgU@s7b8aUbfQ(M;b~V!e zmL(HAvwQW?$f93%VWVkTipZ9&yRs}sm)m1_dp9=8&R@KdU7)%70G`fc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uD>44I#QvlcRG%iZVE8yx>`yNkim9I*0p4W|RY}o=!N6(< z^oS_Bw5nQkww3n46kc{n#W6)*Tfw_4yxQYe2lJzUaSeJ4*eSf?5Rc{LXr>s3=m~ChGVa zQA7sAAKv1HZ~cDK`8k97ElU<$JAp;sP2%^%nOC(9)I2QPRI-%$uUShV(FfblAnD-i lrhKEU%!NsB=nazu>Z+cCvXd?i*1wJi1N)olP 0 { - yylex.(*Parser).setFreeFloating(altif.ElseIf[len(altif.ElseIf)-1], token.End, append($2.SkippedTokens, $3.SkippedTokens...)) - } else { - yylex.(*Parser).setFreeFloating(altif.Stmt, token.End, append($2.SkippedTokens, $3.SkippedTokens...)) - } - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { - stmts := &ast.StmtStmtList{ + $1.(*ast.StmtIf).Else = &ast.StmtElse{ Node: ast.Node{ - Position: position.NewNodeListPosition($4), + Position: position.NewTokenNodeListPosition($2, $4), + }, + Alt: true, + ElseTkn: $2, + ColonTkn: $3, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($4), + }, + Stmts: $4, }, - Stmts: $4, } - stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - _else := &ast.StmtAltElse{ast.Node{}, stmtsBrackets} - $1.(*ast.StmtAltIf).Else = _else + $1.(*ast.StmtIf).EndIfTkn = $5 + $1.(*ast.StmtIf).SemiColonTkn = $6 + $1.(*ast.StmtIf).Node.Position = position.NewNodeTokenPosition($1, $6) $$ = $1 - - // save position - stmtsBrackets.GetNode().Position = position.NewTokensPosition($3, $5) - _else.GetNode().Position = position.NewTokenNodeListPosition($2, $4) - $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) - - // save comments - yylex.(*Parser).setFreeFloating(_else, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($5.SkippedTokens, $6.SkippedTokens...)) - yylex.(*Parser).setToken($$, token.SemiColon, $6.SkippedTokens) } ; @@ -3368,10 +3367,14 @@ expr_without_variable: } | '(' expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -3825,10 +3828,14 @@ exit_expr: } | '(' optional_expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -4132,10 +4139,14 @@ dereferencable: } | '(' expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -4154,10 +4165,14 @@ callable_expr: } | '(' expr ')' { - $$ = &ast.ParserBrackets{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) @@ -4768,11 +4783,17 @@ internal_functions_in_yacc: } | T_EMPTY '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + } $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position - exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -4802,11 +4823,17 @@ internal_functions_in_yacc: } | T_EVAL '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + } $$ = &ast.ExprEval{ast.Node{}, exprBrackets} // save position - exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 8f474fa..a12803b 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -3375,7 +3375,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 53, @@ -3384,6 +3384,7 @@ func TestPhp7(t *testing.T) { EndPos: 1111, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3417,7 +3418,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 55, @@ -3426,6 +3427,7 @@ func TestPhp7(t *testing.T) { EndPos: 1141, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3459,7 +3461,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 56, @@ -3468,6 +3470,7 @@ func TestPhp7(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3503,7 +3506,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 58, @@ -3512,6 +3515,7 @@ func TestPhp7(t *testing.T) { EndPos: 1164, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3544,7 +3548,7 @@ func TestPhp7(t *testing.T) { }, Stmts: []ast.Vertex{}, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 59, @@ -3553,6 +3557,7 @@ func TestPhp7(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ @@ -3566,7 +3571,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 61, @@ -3575,6 +3580,7 @@ func TestPhp7(t *testing.T) { EndPos: 1213, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3608,7 +3614,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 62, @@ -3617,6 +3623,7 @@ func TestPhp7(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3650,7 +3657,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 63, @@ -3659,6 +3666,7 @@ func TestPhp7(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3693,7 +3701,7 @@ func TestPhp7(t *testing.T) { }, }, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 64, @@ -3702,6 +3710,7 @@ func TestPhp7(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 2da9b8e..4b60110 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -27,11 +27,8 @@ type NodeVisitor interface { ArgumentList(n *ArgumentList) Argument(n *Argument) - StmtAltElse(n *StmtAltElse) - StmtAltElseIf(n *StmtAltElseIf) StmtAltFor(n *StmtAltFor) StmtAltForeach(n *StmtAltForeach) - StmtAltIf(n *StmtAltIf) StmtAltSwitch(n *StmtAltSwitch) StmtAltWhile(n *StmtAltWhile) StmtBreak(n *StmtBreak) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 2013eee..993b65b 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -175,27 +175,6 @@ func (n *ScalarString) Accept(v NodeVisitor) { v.ScalarString(n) } -// StmtAltElse node -type StmtAltElse struct { - Node - Stmt Vertex -} - -func (n *StmtAltElse) Accept(v NodeVisitor) { - v.StmtAltElse(n) -} - -// StmtAltElseIf node -type StmtAltElseIf struct { - Node - Cond Vertex - Stmt Vertex -} - -func (n *StmtAltElseIf) Accept(v NodeVisitor) { - v.StmtAltElseIf(n) -} - // StmtAltFor node type StmtAltFor struct { Node @@ -222,19 +201,6 @@ func (n *StmtAltForeach) Accept(v NodeVisitor) { v.StmtAltForeach(n) } -// StmtAltIf node -type StmtAltIf struct { - Node - Cond Vertex - Stmt Vertex - ElseIf []Vertex - Else Vertex -} - -func (n *StmtAltIf) Accept(v NodeVisitor) { - v.StmtAltIf(n) -} - // StmtAltSwitch node type StmtAltSwitch struct { Node @@ -444,7 +410,10 @@ func (n *StmtEcho) Accept(v NodeVisitor) { // StmtElse node type StmtElse struct { Node - Stmt Vertex + Alt bool + ElseTkn *token.Token + ColonTkn *token.Token + Stmt Vertex } func (n *StmtElse) Accept(v NodeVisitor) { @@ -454,8 +423,13 @@ func (n *StmtElse) Accept(v NodeVisitor) { // StmtElseIf node type StmtElseIf struct { Node - Cond Vertex - Stmt Vertex + Alt bool + ElseIfTkn *token.Token + OpenParenthesisTkn *token.Token + Cond Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex } func (n *StmtElseIf) Accept(v NodeVisitor) { @@ -558,10 +532,17 @@ func (n *StmtHaltCompiler) Accept(v NodeVisitor) { // StmtIf node type StmtIf struct { Node - Cond Vertex - Stmt Vertex - ElseIf []Vertex - Else Vertex + Alt bool + IfTkn *token.Token + OpenParenthesisTkn *token.Token + Cond Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + ElseIf []Vertex + Else Vertex + EndIfTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtIf) Accept(v NodeVisitor) { @@ -1918,7 +1899,9 @@ func (n *ParserNsSeparator) Accept(v NodeVisitor) { type ParserBrackets struct { Node - Child Vertex + OpenBracketTkn *token.Token + Child Vertex + CloseBracketTkn *token.Token } func (n *ParserBrackets) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 3d9d5a5..89d6977 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -119,35 +119,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Expr) t.visitor.Leave("Expr", true) } - case *ast.StmtAltElse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtAltElseIf: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } case *ast.StmtAltFor: if nn == nil { return @@ -208,35 +179,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Stmt) t.visitor.Leave("Stmt", true) } - case *ast.StmtAltIf: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - if nn.ElseIf != nil { - t.visitor.Enter("ElseIf", false) - for _, c := range nn.ElseIf { - t.Traverse(c) - } - t.visitor.Leave("ElseIf", false) - } - if nn.Else != nil { - t.visitor.Enter("Else", true) - t.Traverse(nn.Else) - t.visitor.Leave("Else", true) - } case *ast.StmtAltSwitch: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 61deec6..874e88d 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -252,18 +252,6 @@ func (v *Dump) Argument(n *ast.Argument) { } } -func (v *Dump) StmtAltElse(n *ast.StmtAltElse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltElse{\n") - v.printNode(n.GetNode()) -} - -func (v *Dump) StmtAltElseIf(n *ast.StmtAltElseIf) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltElseIf{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtAltFor(n *ast.StmtAltFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltFor{\n") @@ -276,12 +264,6 @@ func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) { v.printNode(n.GetNode()) } -func (v *Dump) StmtAltIf(n *ast.StmtAltIf) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltIf{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtAltSwitch(n *ast.StmtAltSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltSwitch{\n") @@ -404,12 +386,22 @@ func (v *Dump) StmtElse(n *ast.StmtElse) { 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") + } } func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { 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") + } } func (v *Dump) StmtExpression(n *ast.StmtExpression) { @@ -469,6 +461,11 @@ func (v *Dump) StmtIf(n *ast.StmtIf) { 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") + } } func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 4df410a..859778f 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -13,60 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { return true } -func (v *FilterParserNodes) StmtAltIf(n *ast.StmtAltIf) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } - - if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { - n.Stmt = nn.Child - } -} - -func (v *FilterParserNodes) StmtAltElseIf(n *ast.StmtAltElseIf) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } - - if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { - n.Stmt = nn.Child - } -} - -func (v *FilterParserNodes) StmtAltElse(n *ast.StmtAltElse) { - if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { - n.Stmt = nn.Child - } -} - -func (v *FilterParserNodes) StmtIf(n *ast.StmtIf) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtElseIf(n *ast.StmtElseIf) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - func (v *FilterParserNodes) StmtWhile(n *ast.StmtWhile) { for { if nn, ok := n.Cond.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index b368d8a..a1df886 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -87,3 +87,29 @@ func (v *FilterTokens) StmtStmtList(n *ast.StmtStmtList) { n.OpenCurlyBracket = nil n.CloseCurlyBracket = nil } + +func (v *FilterTokens) StmtIf(n *ast.StmtIf) { + n.IfTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndIfTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtElseIf(n *ast.StmtElseIf) { + n.ElseIfTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil +} + +func (v *FilterTokens) StmtElse(n *ast.StmtElse) { + n.ElseTkn = nil + n.ColonTkn = nil +} + +func (v *FilterTokens) ParserBrackets(n *ast.ParserBrackets) { + n.OpenBracketTkn = nil + n.CloseBracketTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 291d8f9..83c590d 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -54,14 +54,6 @@ func (v *Null) Argument(_ *ast.Argument) { // do nothing } -func (v *Null) StmtAltElse(_ *ast.StmtAltElse) { - // do nothing -} - -func (v *Null) StmtAltElseIf(_ *ast.StmtAltElseIf) { - // do nothing -} - func (v *Null) StmtAltFor(_ *ast.StmtAltFor) { // do nothing } @@ -70,10 +62,6 @@ func (v *Null) StmtAltForeach(_ *ast.StmtAltForeach) { // do nothing } -func (v *Null) StmtAltIf(_ *ast.StmtAltIf) { - // do nothing -} - func (v *Null) StmtAltSwitch(_ *ast.StmtAltSwitch) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index cd5d20f..b089a24 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -297,16 +297,10 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltElseIf: - p.printStmtAltElseIf(n) - case *ast.StmtAltElse: - p.printStmtAltElse(n) case *ast.StmtAltFor: p.printStmtAltFor(n) case *ast.StmtAltForeach: p.printStmtAltForeach(n) - case *ast.StmtAltIf: - p.printStmtAltIf(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) case *ast.StmtAltWhile: @@ -1348,7 +1342,7 @@ func (p *PrettyPrinter) printExprYield(n ast.Vertex) { // smtm func (p *PrettyPrinter) printStmtAltElseIf(n ast.Vertex) { - nn := n.(*ast.StmtAltElseIf) + nn := n.(*ast.StmtElseIf) io.WriteString(p.w, "elseif (") p.Print(nn.Cond) @@ -1361,7 +1355,7 @@ func (p *PrettyPrinter) printStmtAltElseIf(n ast.Vertex) { } func (p *PrettyPrinter) printStmtAltElse(n ast.Vertex) { - nn := n.(*ast.StmtAltElse) + nn := n.(*ast.StmtElse) io.WriteString(p.w, "else :") @@ -1415,7 +1409,7 @@ func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { } func (p *PrettyPrinter) printStmtAltIf(n ast.Vertex) { - nn := n.(*ast.StmtAltIf) + nn := n.(*ast.StmtIf) io.WriteString(p.w, "if (") p.Print(nn.Cond) @@ -1687,6 +1681,11 @@ func (p *PrettyPrinter) printStmtEcho(n ast.Vertex) { func (p *PrettyPrinter) printStmtElseif(n ast.Vertex) { nn := n.(*ast.StmtElseIf) + if nn.Alt { + p.printStmtAltElseIf(nn) + return + } + io.WriteString(p.w, "elseif (") p.Print(nn.Cond) io.WriteString(p.w, ")") @@ -1710,6 +1709,11 @@ func (p *PrettyPrinter) printStmtElseif(n ast.Vertex) { func (p *PrettyPrinter) printStmtElse(n ast.Vertex) { nn := n.(*ast.StmtElse) + if nn.Alt { + p.printStmtAltElse(nn) + return + } + io.WriteString(p.w, "else") switch s := nn.Stmt.(type) { @@ -1854,6 +1858,11 @@ func (p *PrettyPrinter) printStmtHaltCompiler(n ast.Vertex) { func (p *PrettyPrinter) printStmtIf(n ast.Vertex) { nn := n.(*ast.StmtIf) + if nn.Alt { + p.printStmtAltIf(nn) + return + } + io.WriteString(p.w, "if (") p.Print(nn.Cond) io.WriteString(p.w, ")") diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 343703b..f4a3188 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2090,7 +2090,8 @@ func TestPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtAltElseIf{ + p.Print(&ast.StmtElseIf{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2112,7 +2113,8 @@ func TestPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtAltElseIf{ + p.Print(&ast.StmtElseIf{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{}, }) @@ -2129,7 +2131,8 @@ func TestPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtAltElse{ + p.Print(&ast.StmtElse{ + Alt: true, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, @@ -2150,7 +2153,8 @@ func TestPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtAltElse{ + p.Print(&ast.StmtElse{ + Alt: true, Stmt: &ast.StmtStmtList{}, }) @@ -2236,7 +2240,8 @@ func TestPrintAltIf(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2244,7 +2249,8 @@ func TestPrintAltIf(t *testing.T) { }, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2252,12 +2258,14 @@ func TestPrintAltIf(t *testing.T) { }, }, }, - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, Stmt: &ast.StmtStmtList{}, }, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ + Alt: true, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 4d1c2aa..afc80a8 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -359,16 +359,10 @@ func (p *Printer) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltElseIf: - p.printStmtAltElseIf(n) - case *ast.StmtAltElse: - p.printStmtAltElse(n) case *ast.StmtAltFor: p.printStmtAltFor(n) case *ast.StmtAltForeach: p.printStmtAltForeach(n) - case *ast.StmtAltIf: - p.printStmtAltIf(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) case *ast.StmtAltWhile: @@ -1981,68 +1975,6 @@ func (p *Printer) printExprYield(n ast.Vertex) { // smtm -func (p *Printer) printStmtAltElseIf(n ast.Vertex) { - nn := n.(*ast.StmtAltElseIf) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "elseif") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") - } - - p.Print(nn.Cond) - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - stmtList, _ := nn.Stmt.(*ast.StmtStmtList) - brackets, ok := nn.Stmt.(*ast.ParserBrackets) - if ok { - p.printFreeFloating(brackets, token.Start) - stmtList = brackets.Child.(*ast.StmtStmtList) - } else { - io.WriteString(p.w, ":") - } - - p.printFreeFloating(stmtList, token.Stmts) - p.printNodes(stmtList.Stmts) - p.printFreeFloating(stmtList, token.End) - - if ok { - p.printFreeFloating(brackets, token.End) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtAltElse(n ast.Vertex) { - nn := n.(*ast.StmtAltElse) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "else") - - stmtList, _ := nn.Stmt.(*ast.StmtStmtList) - brackets, ok := nn.Stmt.(*ast.ParserBrackets) - if ok { - p.printFreeFloating(brackets, token.Start) - stmtList = brackets.Child.(*ast.StmtStmtList) - } else { - io.WriteString(p.w, ":") - } - - p.printFreeFloating(stmtList, token.Stmts) - p.printNodes(stmtList.Stmts) - p.printFreeFloating(stmtList, token.End) - - if ok { - p.printFreeFloating(brackets, token.End) - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtAltFor(n ast.Vertex) { nn := n.(*ast.StmtAltFor) p.printFreeFloating(nn, token.Start) @@ -2124,59 +2056,6 @@ func (p *Printer) printStmtAltForeach(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtAltIf(n ast.Vertex) { - nn := n.(*ast.StmtAltIf) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "if") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") - } - - p.Print(nn.Cond) - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - stmtList, _ := nn.Stmt.(*ast.StmtStmtList) - brackets, ok := nn.Stmt.(*ast.ParserBrackets) - if ok { - p.printFreeFloating(brackets, token.Start) - stmtList = brackets.Child.(*ast.StmtStmtList) - } else { - io.WriteString(p.w, ":") - } - - p.printFreeFloating(stmtList, token.Stmts) - p.printNodes(stmtList.Stmts) - p.printFreeFloating(stmtList, token.End) - - if ok { - p.printFreeFloating(brackets, token.End) - } - - for _, elseif := range nn.ElseIf { - p.Print(elseif) - } - - if nn.Else != nil { - p.Print(nn.Else) - } - - if !ok { - io.WriteString(p.w, "endif") - } - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtAltSwitch(n ast.Vertex) { nn := n.(*ast.StmtAltSwitch) p.printFreeFloating(nn, token.Start) @@ -2579,42 +2458,54 @@ func (p *Printer) printStmtEcho(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtElseif(n ast.Vertex) { - nn := n.(*ast.StmtElseIf) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "elseif") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") +func (p *Printer) printStmtElseif(n *ast.StmtElseIf) { + if n.Alt { + p.printStmtAltElseIf(n) + return } - p.Print(nn.Cond) + p.printToken(n.ElseIfTkn, "elseif") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) + p.Print(n.Stmt) } -func (p *Printer) printStmtElse(n ast.Vertex) { - nn := n.(*ast.StmtElse) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtAltElseIf(n *ast.StmtElseIf) { + p.printToken(n.ElseIfTkn, "elseif") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") - io.WriteString(p.w, "else") + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.Print(n.Stmt) + } +} - if _, ok := nn.Stmt.(*ast.StmtStmtList); !ok { - if nn.Stmt.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } +func (p *Printer) printStmtElse(n *ast.StmtElse) { + if n.Alt { + p.printStmtAltElse(n) + return } - p.Print(nn.Stmt) + p.printToken(n.ElseTkn, "else") + p.bufStart = " " + p.Print(n.Stmt) +} - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtAltElse(n *ast.StmtElse) { + p.printToken(n.ElseTkn, "else") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.Print(n.Stmt) + } } func (p *Printer) printStmtExpression(n ast.Vertex) { @@ -2789,33 +2680,40 @@ func (p *Printer) printStmtHaltCompiler(n *ast.StmtHaltCompiler) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtIf(n ast.Vertex) { - nn := n.(*ast.StmtIf) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "if") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") +func (p *Printer) printStmtIf(n *ast.StmtIf) { + if n.Alt { + p.printStmtAltIf(n) + return } - p.Print(nn.Cond) + p.printToken(n.IfTkn, "if") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") + p.Print(n.Stmt) + p.printNodes(n.ElseIf) + p.Print(n.Else) +} + +func (p *Printer) printStmtAltIf(n *ast.StmtIf) { + p.printToken(n.IfTkn, "if") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.Print(n.Stmt) } - p.Print(nn.Stmt) + p.printNodes(n.ElseIf) + p.Print(n.Else) - if nn.ElseIf != nil { - p.printNodes(nn.ElseIf) - } - - if nn.Else != nil { - p.Print(nn.Else) - } - - p.printFreeFloating(nn, token.End) + p.printToken(n.EndIfTkn, "endif") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtInlineHTML(n ast.Vertex) { @@ -2900,7 +2798,7 @@ func (p *Printer) printStmtNamespace(n *ast.StmtNamespace) { } func (p *Printer) printStmtNop(n ast.Vertex) { - p.printFreeFloating(n, token.Start) + p.printFreeFloatingOrDefault(n, token.Start, p.bufStart) p.printFreeFloating(n, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { io.WriteString(p.w, ";") diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index cd835d9..82dd9a2 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -743,7 +743,8 @@ func TestParseAndPrintPhp5Yield(t *testing.T) { // test stmt func TestParseAndPrintPhp5AltIf(t *testing.T) { - src := ` Date: Fri, 4 Sep 2020 10:33:47 +0300 Subject: [PATCH 052/140] [refactoring] update ast structure of "While" node --- internal/php5/parser_test.go | 3 +- internal/php5/php5.go | Bin 295688 -> 294441 bytes internal/php5/php5.y | 52 ++++++++--------- internal/php5/php5_test.go | 3 +- internal/php7/parser_test.go | 3 +- internal/php7/php7.go | Bin 248339 -> 247565 bytes internal/php7/php7.y | 63 ++++++++------------ internal/php7/php7_test.go | 3 +- pkg/ast/ast.go | 1 - pkg/ast/node.go | 22 +++---- pkg/ast/traverser/dfs.go | 17 ------ pkg/ast/visitor/dump.go | 11 ++-- pkg/ast/visitor/filter_parser_nodes.go | 20 ------- pkg/ast/visitor/filter_tokens.go | 9 +++ pkg/ast/visitor/null.go | 4 -- pkg/printer/pretty_printer.go | 37 ++++++------ pkg/printer/pretty_printer_test.go | 15 ++--- pkg/printer/printer.go | 73 ++++++++---------------- pkg/printer/printer_parsed_php5_test.go | 6 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 5 +- 21 files changed, 140 insertions(+), 213 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 0a8d776..725f642 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -12762,7 +12762,7 @@ func TestStmtBreak(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12771,6 +12771,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 34, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 953db897e00983ea3c13adb39882cde84a6f7924..d6165d2f5ef985667abdf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: } | T_WHILE parenthesis_expr while_statement { - switch n := $3.(type) { - case *ast.StmtWhile : - n.Cond = $2 - case *ast.StmtAltWhile : - n.Cond = $2 - } + $3.(*ast.StmtWhile).WhileTkn = $1 + $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn + $3.(*ast.StmtWhile).Cond = $2.(*ast.ParserBrackets).Child + $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn + $3.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition($1, $3) $$ = $3 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DO statement T_WHILE parenthesis_expr ';' { @@ -1914,29 +1907,30 @@ case_separator: while_statement: statement { - $$ = &ast.StmtWhile{ast.Node{}, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtWhile{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndWhileTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 535f8c7..de9eb19 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -3049,7 +3049,7 @@ func TestPhp5(t *testing.T) { }, }, }, - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 57, @@ -3058,6 +3058,7 @@ func TestPhp5(t *testing.T) { EndPos: 1046, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 67ce06a..8421ca1 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -14441,7 +14441,7 @@ func TestStmtBreak(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -14450,6 +14450,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 34, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e1a071b4f334091cc5d69e6fdde6b58a82c756eb..323095b1e3952e9d51a3edff425be0be75264e58 100644 GIT binary patch delta 6729 zcmai333Qc3mOl4ZLI@BNmLxzz64oYRd;5YQ2_#_=5Hv`$Nf3fTAR&lK1Uf9zE+9l& zas{~3c~M|gFs{;FGd`M!IL z-#woA=<39}#10(vEN|68x9UK#Bf3{s=9kZ&J$2qh|KvVp<R3vV6KkoNter_C zR4C-p=Vns>7j>xWfm_3o* zb}prvOkT-5L74v$^S%e@HX@%R$=X0MdglrvCckVxjXkX7*n_lL$*u=+l?gX;3%zV5 ze6m>~DChUUv=7%)Z^35S(l^Ah z`ni2HPr(gK>S>CV2qbOv`ajWMVKCQqmpptB`vrYQ5|rGRXgnb{u5g;pn$E3Aj=XGa z0DDJ8;d+++SE0z)M-U`F?01AZ>WV+pQeuBlW*wzYl6;hk zIN;V8yg>HMBh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#m1&p#@od}5U9JAy!9sHb)%C(}9@W${>L2D2=g>mDyO!6Yy}A58-%GN1 zAry=GG~^>lg}gr9U5W!87WfFVDS%10rD!ma&~9ZgqD`i(|w0QdPyK1>{jiY^C`NfO9 z(<|x)Th$TVbwcK!2m_RgVk?_d)jPnd;1Q&MuHd7AF5HE70thlQyO2J=8>C}i)k^oM wHahTu8cDKxFA{s*9^FKS+0K(@++KLY2rm-0xL3=sa&KPvzK1LO`zXaE2J diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 03fbb1e..bc12e9f 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -870,31 +870,13 @@ statement: } | T_WHILE '(' expr ')' while_statement { - exprBrackets := &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - OpenBracketTkn: $2, - Child: $3, - CloseBracketTkn: $4, - } - - switch n := $5.(type) { - case *ast.StmtWhile : - n.Cond = exprBrackets - case *ast.StmtAltWhile : - n.Cond = exprBrackets - } + $5.(*ast.StmtWhile).WhileTkn = $1 + $5.(*ast.StmtWhile).OpenParenthesisTkn = $2 + $5.(*ast.StmtWhile).Cond = $3 + $5.(*ast.StmtWhile).CloseParenthesisTkn = $4 + $5.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition($1, $5) $$ = $5 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_DO statement T_WHILE '(' expr ')' ';' { @@ -1740,29 +1722,30 @@ case_separator: while_statement: statement { - $$ = &ast.StmtWhile{ast.Node{}, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtWhile{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtWhile{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndWhileTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index a12803b..2204bc8 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -3821,7 +3821,7 @@ func TestPhp7(t *testing.T) { }, }, }, - &ast.StmtAltWhile{ + &ast.StmtWhile{ Node: ast.Node{ Position: &position.Position{ StartLine: 69, @@ -3830,6 +3830,7 @@ func TestPhp7(t *testing.T) { EndPos: 1290, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 4b60110..cceb924 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -30,7 +30,6 @@ type NodeVisitor interface { StmtAltFor(n *StmtAltFor) StmtAltForeach(n *StmtAltForeach) StmtAltSwitch(n *StmtAltSwitch) - StmtAltWhile(n *StmtAltWhile) StmtBreak(n *StmtBreak) StmtCase(n *StmtCase) StmtCaseList(n *StmtCaseList) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 993b65b..80ca23e 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -212,17 +212,6 @@ func (n *StmtAltSwitch) Accept(v NodeVisitor) { v.StmtAltSwitch(n) } -// StmtAltWhile node -type StmtAltWhile struct { - Node - Cond Vertex - Stmt Vertex -} - -func (n *StmtAltWhile) Accept(v NodeVisitor) { - v.StmtAltWhile(n) -} - // StmtBreak node type StmtBreak struct { Node @@ -839,8 +828,15 @@ func (n *StmtUseDeclaration) Accept(v NodeVisitor) { // StmtWhile node type StmtWhile struct { Node - Cond Vertex - Stmt Vertex + Alt bool + WhileTkn *token.Token + OpenParenthesisTkn *token.Token + Cond Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + EndWhileTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtWhile) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 89d6977..5903f24 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -196,23 +196,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.CaseList) t.visitor.Leave("CaseList", true) } - case *ast.StmtAltWhile: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } case *ast.StmtBreak: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 874e88d..c684ede 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -270,12 +270,6 @@ func (v *Dump) StmtAltSwitch(n *ast.StmtAltSwitch) { v.printNode(n.GetNode()) } -func (v *Dump) StmtAltWhile(n *ast.StmtAltWhile) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltWhile{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") @@ -637,6 +631,11 @@ func (v *Dump) StmtWhile(n *ast.StmtWhile) { 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") + } } func (v *Dump) ExprArray(n *ast.ExprArray) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 859778f..20ed98d 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -13,26 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { return true } -func (v *FilterParserNodes) StmtWhile(n *ast.StmtWhile) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtAltWhile(n *ast.StmtAltWhile) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - func (v *FilterParserNodes) StmtDo(n *ast.StmtDo) { for { if nn, ok := n.Cond.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index a1df886..620b703 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -113,3 +113,12 @@ func (v *FilterTokens) ParserBrackets(n *ast.ParserBrackets) { n.OpenBracketTkn = nil n.CloseBracketTkn = nil } + +func (v *FilterTokens) StmtWhile(n *ast.StmtWhile) { + n.WhileTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndWhileTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 83c590d..4054486 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -66,10 +66,6 @@ func (v *Null) StmtAltSwitch(_ *ast.StmtAltSwitch) { // do nothing } -func (v *Null) StmtAltWhile(_ *ast.StmtAltWhile) { - // do nothing -} - func (v *Null) StmtBreak(_ *ast.StmtBreak) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index b089a24..c172f41 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -303,8 +303,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printStmtAltForeach(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) - case *ast.StmtAltWhile: - p.printStmtAltWhile(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -1450,21 +1448,6 @@ func (p *PrettyPrinter) printStmtAltSwitch(n ast.Vertex) { io.WriteString(p.w, "endswitch;") } -func (p *PrettyPrinter) printStmtAltWhile(n ast.Vertex) { - nn := n.(*ast.StmtAltWhile) - - io.WriteString(p.w, "while (") - p.Print(nn.Cond) - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endwhile;") -} - func (p *PrettyPrinter) printStmtBreak(n ast.Vertex) { nn := n.(*ast.StmtBreak) @@ -2190,6 +2173,11 @@ func (p *PrettyPrinter) printStmtUseDeclaration(n ast.Vertex) { func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { nn := n.(*ast.StmtWhile) + if nn.Alt { + p.printStmtAltWhile(nn) + return + } + io.WriteString(p.w, "while (") p.Print(nn.Cond) io.WriteString(p.w, ")") @@ -2209,3 +2197,18 @@ func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { p.indentDepth-- } } + +func (p *PrettyPrinter) printStmtAltWhile(n ast.Vertex) { + nn := n.(*ast.StmtWhile) + + io.WriteString(p.w, "while (") + p.Print(nn.Cond) + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endwhile;") +} diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index f4a3188..6bb07ea 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2091,7 +2091,7 @@ func TestPrintAltElseIf(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2114,7 +2114,7 @@ func TestPrintAltElseIfEmpty(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{}, }) @@ -2154,7 +2154,7 @@ func TestPrintAltElseEmpty(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtElse{ - Alt: true, + Alt: true, Stmt: &ast.StmtStmtList{}, }) @@ -2241,7 +2241,7 @@ func TestPrintAltIf(t *testing.T) { p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ &ast.StmtIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2250,7 +2250,7 @@ func TestPrintAltIf(t *testing.T) { }, ElseIf: []ast.Vertex{ &ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -2259,7 +2259,7 @@ func TestPrintAltIf(t *testing.T) { }, }, &ast.StmtElseIf{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, Stmt: &ast.StmtStmtList{}, }, @@ -2342,7 +2342,8 @@ func TestPrintAltWhile(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltWhile{ + &ast.StmtWhile{ + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index afc80a8..8275817 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -365,8 +365,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtAltForeach(n) case *ast.StmtAltSwitch: p.printStmtAltSwitch(n) - case *ast.StmtAltWhile: - p.printStmtAltWhile(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -2091,39 +2089,6 @@ func (p *Printer) printStmtAltSwitch(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtAltWhile(n ast.Vertex) { - nn := n.(*ast.StmtAltWhile) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "while") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") - } - - p.Print(nn.Cond) - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - io.WriteString(p.w, "endwhile") - p.printFreeFloating(nn, token.AltEnd) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtBreak(n ast.Vertex) { nn := n.(*ast.StmtBreak) p.printFreeFloating(nn, token.Start) @@ -3169,25 +3134,35 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.printToken(n.CommaTkn, "") } -func (p *Printer) printStmtWhile(n ast.Vertex) { - nn := n.(*ast.StmtWhile) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "while") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") +func (p *Printer) printStmtWhile(n *ast.StmtWhile) { + if n.Alt { + p.printStmtAltWhile(n) + return } - p.Print(nn.Cond) + p.printToken(n.WhileTkn, "while") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") + p.Print(n.Stmt) +} + +func (p *Printer) printStmtAltWhile(n *ast.StmtWhile) { + p.printToken(n.WhileTkn, "while") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.Print(n.Stmt) } - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) + p.printToken(n.EndWhileTkn, "endwhile") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printParserAs(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 82dd9a2..1af1e60 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -820,7 +820,8 @@ func TestParseAndPrintPhp5AltSwitch(t *testing.T) { } func TestParseAndPrintPhp5AltWhile(t *testing.T) { - src := ` Date: Fri, 4 Sep 2020 10:53:07 +0300 Subject: [PATCH 053/140] [refactoring] update ast structure of "Do" node --- internal/php5/php5.go | Bin 294441 -> 294399 bytes internal/php5/php5.y | 22 ++++++------ internal/php7/php7.go | Bin 247565 -> 247013 bytes internal/php7/php7.y | 25 +++++--------- pkg/ast/node.go | 9 +++-- pkg/ast/visitor/filter_parser_nodes.go | 10 ------ pkg/ast/visitor/filter_tokens.go | 8 +++++ pkg/printer/pretty_printer_test.go | 2 +- pkg/printer/printer.go | 43 +++++------------------- pkg/printer/printer_parsed_php5_test.go | 3 +- pkg/printer/printer_parsed_php7_test.go | 3 +- pkg/printer/printer_test.go | 2 +- 12 files changed, 51 insertions(+), 76 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index d6165d2f5ef985667abdf25adcdc4703ba3b0032..a5870d0bb8a00809c9db70e639580a8c20b8a468 100644 GIT binary patch delta 7968 zcmZu$d0dxO*8iM)A3zWhTu=lAcQHwR>}m>{qG_XOmb-{r?t)8YrG`yrIpgo^$U#`#Jag)?SUcaV4T+ zR+Au~FC=8vV}&ndsi;3MYhso)q1XDc`iatbbQ@~T{Sqir^(f$<#!@@Zc2pq06{H&T zg?tLC+dd>1e}gAXobuqH$R|KCM zM-4dhArQw8r*K@C@1w>%douN;OtW(`{iG>{@jsUPhNxgZJDH-)xdQr`ShaPcxu_L6 z=IV3`Qv7l^ier4%(2VuL360y~^P80P)!(;JfWs9=`W{BE|C; zP@I|YXKJh{)1GL`7f=-TRiATYAx%`g@d!n7?pO*j`HSfR;!W#sI%fy*^Gk%sZ*bVJ zOX##xsXlYGgdPttM@p!RG9@dhtLAR!b(}fBlCl&uCG4Af%cz7Xb$JB1F3(ee=K3l+ zta#vToDMj^{IZ%FDC%f}|4yNrGMFl0vC8&N6!&nT>Q!^TH$*}tZOawye3u&R+$hpTcZhVR&j)l5EJtTOn2f^;w!_0b`` zLsrvnx@z%T6zuqqtJ!^U3wX-($@Wk9jDcr#glLgm(vqTi*gKRXJbB;&0j*jsw)a+C zk<7(gX%eM#K_{Ke?YChmMV4CeifuS7!(9*Gj`dV-_Ka@G{gYKZ?|Q;%-GLl?AFCU;@z;roC4~tUp zznS^`AU%&$`Q#yr=VuSm{fHfWZy@rOR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jAj>Bed%T?tuQkZThE3 zUEs#FmON4`mh^suxPCMY&6hRfscAE8dTCO;K0#?QSf{wp)G-zp zr@27ecmNp&ROlSo?A^iUwwAcb5gC;^=H*R|*Q5VnPxZEfWO!BldJSGCQTnIn*k{Up zP_{7niMm9D*mnamX#5ii6p@NbIk>$Jqx0?b&u-AIlzvo}q;y4=j-kR_?MLNjQPINk zC(+V-^m>tM&|!ZJyG~YZ>xsH_(vRYCV29H=`mdJlO;VD^2rm6@C%Yu*xEE4qv7@2& zIh?BV(I+$@g2PQ0bSNDb1uyJteU9LBm*|m9e3(j&yXbD_WTsA4GCSJ<+RsBx{LXbe zwy2xNj5f>CQO#U=O+D0_XE*g`QP8f->)A+rN$F#%-PByEC}9n>(T#V z5Pf^YAhMjnj6vCp;aS}v$0R+dZ%fxSmuJh){1;)gnbuElK^K=neU}qmhDi!WGWup{^eu) rw(q9uUIt^yQj}d|v_GwVlF#)OVvHFv%bJi|nlUEkDPYo>rc(X~2@VA) diff --git a/internal/php5/php5.y b/internal/php5/php5.y index b760bdc..c5e03a3 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -911,16 +911,18 @@ unticked_statement: } | T_DO statement T_WHILE parenthesis_expr ';' { - $$ = &ast.StmtDo{ast.Node{}, $2, $4} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($4, token.End, $5.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) + $$ = &ast.StmtDo{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $5), + }, + DoTkn: $1, + Stmt: $2, + WhileTkn: $3, + OpenParenthesisTkn: $4.(*ast.ParserBrackets).OpenBracketTkn, + Cond: $4.(*ast.ParserBrackets).Child, + CloseParenthesisTkn: $4.(*ast.ParserBrackets).CloseBracketTkn, + SemiColonTkn: $5, + } } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 323095b1e3952e9d51a3edff425be0be75264e58..2862d9e8ec6947a2b73ed99e965250d4605fd7ef 100644 GIT binary patch delta 6365 zcmZ`-d0f_2*8iMy0R=%oL6O}R%k6=Ohb5Op0hio&Q4~o_$40aQb23G3GA&ayIZp0n zW~1gdavM#hd@W5=9Gez*vr@;I#Ijy{U7GK`zX#Cj{p)$|x%YSOx#xV(_ndndyb}D) zyx^_Dk(}b06B?;QBPpnloQ&ik3CSXV&Mc6O@zg^?Hc)+ewKp~J%Pbf)aneJw?I(&T z?L>8D#Lwg}cWzL)R1Q@^{zJ!4cw(HhA|0}$t*N$bX-$6O>Onp-ESVyuZx4L7@&?7q zkK?JHOukEvq<1e0l8wm}Cy{+AlH5|_$BpFh%k+RsOHY-x^C(8b7f^Fu`UGuOl%z+$ ztHMbSpF#r^dF1-H93`D6kdHq6G=(t^qc0SZhbdJ`(p9u}PooH?G&#=7yKdsM6v>n* z*Hb7~uX~Of*+I3MGc#!dQ<8+nSAFoqHic%fq-&*<0m6qI9f3}7Ke8^=MKF>+X#^5lW*PgqO>{(CQ&Vd`q^hmBNE#IPU zSZZDN%3Bn}?D3cnAC`Z=OON{Pwb^EQMcFWuY0Cx9}aK6q5;6it*hGaFt%d0-3#%5*^dy+K<+bJN$Vgk7EmkS@m z(FKQSn17Jo>I9&erKd9Y( zStvLENmp=&wf~?G^t#XKPwb%AP>P&CMPagewhENolXO60PEvqC!{0O}rkO0OazeuSX z9}Yx@*jRfLVcoyr=+snw^^kK@-oxi67<5NpCM}D9;P4r&ANv$OK4o#QJ`QSL$KEQBGDY!801_kMXKT)|^ z6&lWol64dIq$O*7a)PkkwjU@*`W>VPWXNq04Mt)sSkL<5Q`CQ@&oIF zB`s-$$iOhpa*moLhr<9i3FBnx8V;#t-$?yNI0KZRASbcvk$58PY>i+;BM2<+yr7PY z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DBpw?##&yZqlGz=~^`>L}Y5fm6D^(1v@EL@xoxSon!G zSAc`)H_Rt8kQPgD2>{oAtg=vYXc-={LzeY*f($KDBTd6?qdi8xC;=pS+%i3z+DS+% zps#N!9AXNo?SDU7u3GsEyDgUpqmH`8v#P?VW4mGObkbLzQ!yCAJ#yv+Ou#Xh!0FN7 zsFf(S8aut&l+FYbZjm}`g&Je(=h!lQhkD=uJ{+CC0O<2`7jO^Pg)b?kP$R~bsVIDz zvmJV*{|nq07&fz9<>_HBtBGhP8^71Z$gNjQrSWK-qgzY=-?2AyotjF@>vAQH8qA%~F!h*eA0#U{*&YM(LVO3Y|^Q zYJ9N*!|ocPe%GQ2u79RX-o%+&nqt01x0kw?>0uM%?Pcat6)2l7a1YtK&3IV@+j^69 zc*lf_9{-LSV!mPN9otnIY|})ThN}1&$v=UA#(y?r3wNt;jSuiSJCgJxTJ<;0k3D*8 zpF;QGTlDx)O~%5Z6VOHLLkCnRKXE`!6XNF&s!0eD-^`ECwlUKCka^VSBwNd~4nt}Vla{(S~ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index bc12e9f..e1914fe 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -880,25 +880,18 @@ statement: } | T_DO statement T_WHILE '(' expr ')' ';' { - exprBrackets := &ast.ParserBrackets{ + $$ = &ast.StmtDo{ Node: ast.Node{ - Position: position.NewTokensPosition($4, $6), + Position: position.NewTokensPosition($1, $7), }, - OpenBracketTkn: $4, - Child: $5, - CloseBracketTkn: $6, + DoTkn: $1, + Stmt: $2, + WhileTkn: $3, + OpenParenthesisTkn: $4, + Cond: $5, + CloseParenthesisTkn: $6, + SemiColonTkn: $7, } - $$ = &ast.StmtDo{ast.Node{}, $2, exprBrackets} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating(exprBrackets, token.End, append($6.SkippedTokens, $7.SkippedTokens...)) - yylex.(*Parser).setToken($$, token.SemiColon, $7.SkippedTokens) } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 80ca23e..017d979 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -378,8 +378,13 @@ func (n *StmtDefault) Accept(v NodeVisitor) { // StmtDo node type StmtDo struct { Node - Stmt Vertex - Cond Vertex + DoTkn *token.Token + Stmt Vertex + WhileTkn *token.Token + OpenParenthesisTkn *token.Token + Cond Vertex + CloseParenthesisTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtDo) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 20ed98d..83f9cb2 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -13,16 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { return true } -func (v *FilterParserNodes) StmtDo(n *ast.StmtDo) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - func (v *FilterParserNodes) StmtSwitch(n *ast.StmtSwitch) { for { if nn, ok := n.Cond.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 620b703..3d60dd5 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -122,3 +122,11 @@ func (v *FilterTokens) StmtWhile(n *ast.StmtWhile) { n.EndWhileTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtDo(n *ast.StmtDo) { + n.DoTkn = nil + n.WhileTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 6bb07ea..a193202 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2343,7 +2343,7 @@ func TestPrintAltWhile(t *testing.T) { p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ &ast.StmtWhile{ - Alt: true, + Alt: true, Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 8275817..e678ae6 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2361,42 +2361,17 @@ func (p *Printer) printStmtDefault(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtDo(n ast.Vertex) { - nn := n.(*ast.StmtDo) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtDo(n *ast.StmtDo) { + p.printToken(n.DoTkn, "do") + p.bufStart = " " - io.WriteString(p.w, "do") + p.Print(n.Stmt) - if _, ok := nn.Stmt.(*ast.StmtStmtList); !ok { - if nn.Stmt.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - } - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.Stmts) - - io.WriteString(p.w, "while") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") - } - - p.Print(nn.Cond) - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - p.printFreeFloating(nn, token.Cond) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) + p.printToken(n.WhileTkn, "while") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtEcho(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 1af1e60..ce35495 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -945,7 +945,8 @@ func TestParseAndPrintPhp5Declare(t *testing.T) { } func TestParseAndPrintPhp5DoWhile(t *testing.T) { - src := ` Date: Fri, 4 Sep 2020 11:37:17 +0300 Subject: [PATCH 054/140] [refactoring] update ast structure of "For" node --- internal/php5/parser_test.go | 3 +- internal/php5/php5.go | Bin 294399 -> 293827 bytes internal/php5/php5.y | 64 ++++++++---------- internal/php5/php5_test.go | 3 +- internal/php7/parser_test.go | 3 +- internal/php7/php7.go | Bin 247013 -> 246441 bytes internal/php7/php7.y | 64 ++++++++---------- internal/php7/php7_test.go | 3 +- pkg/ast/ast.go | 1 - pkg/ast/node.go | 30 ++++----- pkg/ast/traverser/dfs.go | 33 --------- pkg/ast/visitor/dump.go | 11 ++- pkg/ast/visitor/filter_parser_nodes.go | 38 ----------- pkg/ast/visitor/filter_tokens.go | 11 +++ pkg/ast/visitor/null.go | 4 -- pkg/printer/pretty_printer.go | 45 +++++++------ pkg/printer/pretty_printer_test.go | 3 +- pkg/printer/printer.go | 86 ++++++++++-------------- pkg/printer/printer_parsed_php5_test.go | 6 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 3 +- 21 files changed, 161 insertions(+), 256 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 725f642..1af3152 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -6141,7 +6141,7 @@ func TestStmtFor_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltFor{ + &ast.StmtFor{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6150,6 +6150,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 33, }, }, + Alt: true, Cond: []ast.Vertex{ &ast.ExprBinarySmaller{ Node: ast.Node{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a5870d0bb8a00809c9db70e639580a8c20b8a468..90079efcd239c7b6e05abbbb1cce5f3bc36269c1 100644 GIT binary patch delta 8475 zcmb7Jd0f?1+W(yA{8&}Ihynu2btM`|&K3O656!v}a^`*! zvOo8kESm94<3(aZSiE@doY-+~MK3a7$2fkco8t(B=<*-2Qc+cXhP6bf;_YehO^)QYpcG?K?;h-^NW zB=6zs=g3?2f{f$dm0~t$+$-|Q72@+D(N;ZjFE$I0eHR7^d?Zr-Z+qwPgL6fm$l*bK zantXu{tFK}EYb{*tJ~fuNcaqgs?U6pOg!c9WY4K-59)DzF(vV_t3-@izd(#5;o|Ck zc&>kuxK&{Ar+y+`;gr_|kADT)uCWI7q^4 zuBs}e2=#6agipSpI{K_=B1M3gcDJ%QWeqkgEwFmCYak`?u>vckzFZ@&wZJzdmB?i! zko}N#A|C{;BvrRgq!D>M4B@w8*DrWUR4t}G_JOnU%^z+MNnDv{bz!j)!|Q7?9Fu9a zu5yZ&+&!P7`Ek(6>*eA#Vu2d-vWT`|G~lQMAL|dnui1p@09Y6&1H8dSPjH>WK`)ot zVn}7zW?UK693^VGr1I*`M!OKa5mYL-t<$FB<~?;-QnW=h=S6iQkH6Y19DJlsOyIF~ zB7;k|fVQg+`aOj&^5pQ81+o=829lGV)2vRmnLfN#tgy%%Y?xF<+rD$boQu-<#lh1XjS{R$Q0ztQAc-(Y6@EeR1~A0eNXfjwct!PYF*MTa*Y0K$*6b5aRr($=Ly#||U+Ura_KN=G_w%BCq8)qp zi6P8;g+o2HPdqCqn8SVciwX(`^na(?zh5i{D=vPlyVc&7e9ZyucX`$617f+bnF|}i z+K)tkT+lC3rdM5}zFc@nEadnZ(8#$%q8OfaeyfBJ_ps8{(!*E^*Vv$OayHQ}J~v!A z^_O4EpjK$4ilDnGC!n1mOPz_JmVlwEXu2E5y0;V$fk(CFa}kusrPskaYTLkpH&lyg zPF^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C9X=$1iu?MiV9+yV^K*XRs;E{F(xTp6_uA2kC(EkL5m zc0ui$?@$$+s{zG$hj_yq4Z35jVH#73AKFu|yS*0}geDI-hz^N0a@S z>FBQWa2*SH0lxPxUfCvB;0EYL_xS)65B#bv@r}PgyT5!`M}NVz;C4$t#EgL5&PI>8 zp@nJl5d}Wdn|Sk2m{oHbd3wi3@V}sL^R`sY{)$X3!rn$kV!+iV1bUo;8TnTBH1#BQlO+KK!TB=~;f zq~)TM<|)KCYh;0{>Sp1K%%0Pj4eZpql+7Xq}xm4P%P>({t8b zT62fxeCw(g;&YJcxf)MgDJ=cnMZ=k@wJb2U3JWtFI(oyP<*Fv=1EL3Gl7RNAm}pEg z&}b}$k4jnqmU;wP;VORXI?r+SNDLk`;XKZE>Q>}a4H)xjZObUL$U*k#bhjLLdKAQ^LVsF z25s^bb0E_zFlIlNVioBW?`~@y=kHUkLJ`PwF7#3>ybAiAr@yzsDj}8I)UzTiM>yZ!T7@2m*SHU_Y>RJ7E3e6D zKA3GK@k`m(Wm5}r`sdQ8E_JZtaLMXgN9!G7cVJKESP!FZ^}pJjk9C2bP7_BVjDH0j z3Dn1>8~j_Hz1`C3*rO1dJBinLVTAxAGDhOe%tpMP8)*#;ks*)mORtS$Cl> z`1dB7`li2i13gIf^&smC%+mN18wh_FK2>1Fsp7%bzf9WF9qEQ*03Q*1NjSUtMp{>Q zX0f{xE&fQcHH4EA(VDIq0%y-04yVP%97W~_xl15kJpyMAs^cT9fzS()j|xTMgnLN_ z@C_QoJ4^K*YvF^hS5=i*iIPi8u!c`R43qrCB&(CknP`nAj(-re`PwMmOxJbj?LKr~ba9lxhvZvDDS}VVMGS-kx5^U*uYSbx{tu9o B;$#2- diff --git a/internal/php5/php5.y b/internal/php5/php5.y index c5e03a3..4bae606 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -926,28 +926,17 @@ unticked_statement: } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { - switch n := $9.(type) { - case *ast.StmtFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - case *ast.StmtAltFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - } + $9.(*ast.StmtFor).ForTkn = $1 + $9.(*ast.StmtFor).OpenParenthesisTkn = $2 + $9.(*ast.StmtFor).Init = $3 + $9.(*ast.StmtFor).InitSemiColonTkn = $4 + $9.(*ast.StmtFor).Cond = $5 + $9.(*ast.StmtFor).CondSemiColonTkn = $6 + $9.(*ast.StmtFor).Loop = $7 + $9.(*ast.StmtFor).CloseParenthesisTkn = $8 + $9.(*ast.StmtFor).Node.Position = position.NewTokenNodePosition($1, $9) $$ = $9 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $9) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.SkippedTokens) } | T_SWITCH parenthesis_expr switch_case_list { @@ -1668,29 +1657,30 @@ foreach_variable: for_statement: statement { - $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtFor{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtFor{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndForTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index de9eb19..1fdd0e7 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -4490,7 +4490,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltFor{ + &ast.StmtFor{ Node: ast.Node{ Position: &position.Position{ StartLine: 78, @@ -4499,6 +4499,7 @@ func TestPhp5(t *testing.T) { EndPos: 1685, }, }, + Alt: true, Cond: []ast.Vertex{ &ast.ExprBinarySmaller{ Node: ast.Node{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 8421ca1..cfcf491 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -6738,7 +6738,7 @@ func TestStmtFor_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltFor{ + &ast.StmtFor{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6747,6 +6747,7 @@ func TestStmtFor_Alt(t *testing.T) { EndPos: 33, }, }, + Alt: true, Cond: []ast.Vertex{ &ast.ExprBinarySmaller{ Node: ast.Node{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 2862d9e8ec6947a2b73ed99e965250d4605fd7ef..80adf9ad96ba4e6037ec9d7b4be8d9a6a062cd0b 100644 GIT binary patch delta 6297 zcmai2X?T@ImVVBuup|Ts1OkNY1T@fuyX4;7uo)l;AhOe-BA6h8AP|(NSj(M{RQim5zEy&5A znUad15zore`qWy&h{IamcbUwaK)$H^PNm4T$rO|P{~gnR+N1)h=uU~!X(EM>yg#ed zKKaweC-g|DW#$``I%U$Vg0Rr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5SmqC6CxQEHbpkAr;h%u2S!)*(&o@!ut>gr&Mm3C2C^c1{-wec z%d#!hLe6wEvGRDK>1Ma~HtSGA^fB3y{)+{sfMjwZ;BczK#M@SV&21#HMW(GSD>RQp z69r6r6M{Ft$P^)>8f&4Nq6RBv*yR2upq@oxG$w+CKV4@=qEZdXr-OKO;}9N%_uZhv zYTUYW)8+ff05~@~Fy%()VCPi#qWIuOMQK=ujMeJkCd@ht_sf6XWcq6Xd!-EaYUpkOq#SG2Cdz9o~Rir zG2jS83RanRf_h-8)W>n4@=_CuJSoc8K%la9riXZTa!a}K8Pic@1dfStiyFg$X4`PH zisb2$PFqL1f8@lcM?n$P^G&33VHCpaB6B2+g)aUm{i+8a919_$&nf59^N|5)n_FIp}A5qtNT;o#p;@x|D6Ghi^FM?I&q_D8~7!(RFJZU>9pjHM)Y!qFcGx$l-Yt0Bfj59Y}ZO4mcs$fW=}WV5>q+cBumX|ljzzmve{M5;!cvDtj0kL7ODD21$NtLepZXuG+>-eb*Zt(qOI zPj5GO=(nfHGQqNTcF|5GQMqb2)*gC8*P_bO5E!`IOag&4Jzvx0`#pgBfPKb&Fxe$B S`_!RY%eapoDKclD@&6yL!@(>7 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index e1914fe..0ecf1de 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -895,28 +895,17 @@ statement: } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement { - switch n := $9.(type) { - case *ast.StmtFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - case *ast.StmtAltFor : - n.Init = $3 - n.Cond = $5 - n.Loop = $7 - } + $9.(*ast.StmtFor).ForTkn = $1 + $9.(*ast.StmtFor).OpenParenthesisTkn = $2 + $9.(*ast.StmtFor).Init = $3 + $9.(*ast.StmtFor).InitSemiColonTkn = $4 + $9.(*ast.StmtFor).Cond = $5 + $9.(*ast.StmtFor).CondSemiColonTkn = $6 + $9.(*ast.StmtFor).Loop = $7 + $9.(*ast.StmtFor).CloseParenthesisTkn = $8 + $9.(*ast.StmtFor).Node.Position = position.NewTokenNodePosition($1, $9) $$ = $9 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $9) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.SkippedTokens) } | T_SWITCH '(' expr ')' switch_case_list { @@ -1522,29 +1511,30 @@ foreach_variable: for_statement: statement { - $$ = &ast.StmtFor{ast.Node{}, nil, nil, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtFor{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtFor{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndForTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 2204bc8..24499be 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -5397,7 +5397,7 @@ func TestPhp7(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltFor{ + &ast.StmtFor{ Node: ast.Node{ Position: &position.Position{ StartLine: 92, @@ -5406,6 +5406,7 @@ func TestPhp7(t *testing.T) { EndPos: 1959, }, }, + Alt: true, Cond: []ast.Vertex{ &ast.ExprBinarySmaller{ Node: ast.Node{ diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index cceb924..d86bf68 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -27,7 +27,6 @@ type NodeVisitor interface { ArgumentList(n *ArgumentList) Argument(n *Argument) - StmtAltFor(n *StmtAltFor) StmtAltForeach(n *StmtAltForeach) StmtAltSwitch(n *StmtAltSwitch) StmtBreak(n *StmtBreak) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 017d979..80685cd 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -175,19 +175,6 @@ func (n *ScalarString) Accept(v NodeVisitor) { v.ScalarString(n) } -// StmtAltFor node -type StmtAltFor struct { - Node - Init []Vertex - Cond []Vertex - Loop []Vertex - Stmt Vertex -} - -func (n *StmtAltFor) Accept(v NodeVisitor) { - v.StmtAltFor(n) -} - // StmtAltForeach node type StmtAltForeach struct { Node @@ -453,10 +440,19 @@ func (n *StmtFinally) Accept(v NodeVisitor) { // StmtFor node type StmtFor struct { Node - Init []Vertex - Cond []Vertex - Loop []Vertex - Stmt Vertex + Alt bool + ForTkn *token.Token + OpenParenthesisTkn *token.Token + Init []Vertex + InitSemiColonTkn *token.Token + Cond []Vertex + CondSemiColonTkn *token.Token + Loop []Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + EndForTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtFor) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 5903f24..629d6ec 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -119,39 +119,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Expr) t.visitor.Leave("Expr", true) } - case *ast.StmtAltFor: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Init != nil { - t.visitor.Enter("Init", false) - for _, c := range nn.Init { - t.Traverse(c) - } - t.visitor.Leave("Init", false) - } - if nn.Cond != nil { - t.visitor.Enter("Cond", false) - for _, c := range nn.Cond { - t.Traverse(c) - } - t.visitor.Leave("Cond", false) - } - if nn.Loop != nil { - t.visitor.Enter("Loop", false) - for _, c := range nn.Loop { - t.Traverse(c) - } - t.visitor.Leave("Loop", false) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } case *ast.StmtAltForeach: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index c684ede..bd9cc4e 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -252,12 +252,6 @@ func (v *Dump) Argument(n *ast.Argument) { } } -func (v *Dump) StmtAltFor(n *ast.StmtAltFor) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtAltFor{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) StmtAltForeach(n *ast.StmtAltForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtAltForeach{\n") @@ -414,6 +408,11 @@ func (v *Dump) StmtFor(n *ast.StmtFor) { 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") + } } func (v *Dump) StmtForeach(n *ast.StmtForeach) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index 83f9cb2..9160d72 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -209,44 +209,6 @@ func (v *FilterParserNodes) ExprVariable(n *ast.ExprVariable) { } } -func (v *FilterParserNodes) StmtFor(n *ast.StmtFor) { - for k, v := range n.Init { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Init[k] = v - } - - for k, v := range n.Cond { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Cond[k] = v - } - - for k, v := range n.Loop { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Loop[k] = v - } -} - func (v *FilterParserNodes) ExprAssign(n *ast.ExprAssign) { for { if nn, ok := n.Expr.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 3d60dd5..9ec8a3d 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -130,3 +130,14 @@ func (v *FilterTokens) StmtDo(n *ast.StmtDo) { n.CloseParenthesisTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtFor(n *ast.StmtFor) { + n.ForTkn = nil + n.OpenParenthesisTkn = nil + n.InitSemiColonTkn = nil + n.CondSemiColonTkn = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndForTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 4054486..7fd4992 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -54,10 +54,6 @@ func (v *Null) Argument(_ *ast.Argument) { // do nothing } -func (v *Null) StmtAltFor(_ *ast.StmtAltFor) { - // do nothing -} - func (v *Null) StmtAltForeach(_ *ast.StmtAltForeach) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index c172f41..1053b76 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -297,8 +297,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltFor: - p.printStmtAltFor(n) case *ast.StmtAltForeach: p.printStmtAltForeach(n) case *ast.StmtAltSwitch: @@ -1363,25 +1361,6 @@ func (p *PrettyPrinter) printStmtAltElse(n ast.Vertex) { } } -func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { - nn := n.(*ast.StmtAltFor) - - io.WriteString(p.w, "for (") - p.joinPrint(", ", nn.Init) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Cond) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Loop) - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - - io.WriteString(p.w, "endfor;") -} - func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { nn := n.(*ast.StmtAltForeach) @@ -1736,6 +1715,11 @@ func (p *PrettyPrinter) printStmtFinally(n ast.Vertex) { func (p *PrettyPrinter) printStmtFor(n ast.Vertex) { nn := n.(*ast.StmtFor) + if nn.Alt { + p.printStmtAltFor(nn) + return + } + io.WriteString(p.w, "for (") p.joinPrint(", ", nn.Init) io.WriteString(p.w, "; ") @@ -1760,6 +1744,25 @@ func (p *PrettyPrinter) printStmtFor(n ast.Vertex) { } } +func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { + nn := n.(*ast.StmtFor) + + io.WriteString(p.w, "for (") + p.joinPrint(", ", nn.Init) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Cond) + io.WriteString(p.w, "; ") + p.joinPrint(", ", nn.Loop) + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + io.WriteString(p.w, "\n") + p.printIndent() + + io.WriteString(p.w, "endfor;") +} + func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { nn := n.(*ast.StmtForeach) diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index a193202..0eec375 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2172,7 +2172,8 @@ func TestPrintAltFor(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltFor{ + &ast.StmtFor{ + Alt: true, Init: []ast.Vertex{ &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, }, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index e678ae6..b7ded2f 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -359,8 +359,6 @@ func (p *Printer) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltFor: - p.printStmtAltFor(n) case *ast.StmtAltForeach: p.printStmtAltForeach(n) case *ast.StmtAltSwitch: @@ -1973,39 +1971,6 @@ func (p *Printer) printExprYield(n ast.Vertex) { // smtm -func (p *Printer) printStmtAltFor(n ast.Vertex) { - nn := n.(*ast.StmtAltFor) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "for") - p.printFreeFloating(nn, token.For) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Init) - p.printFreeFloating(nn, token.InitExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Cond) - p.printFreeFloating(nn, token.CondExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Loop) - p.printFreeFloating(nn, token.IncExpr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - io.WriteString(p.w, "endfor") - p.printFreeFloating(nn, token.AltEnd) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtAltForeach(n ast.Vertex) { nn := n.(*ast.StmtAltForeach) p.printFreeFloating(nn, token.Start) @@ -2477,26 +2442,43 @@ func (p *Printer) printStmtFinally(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtFor(n ast.Vertex) { - nn := n.(*ast.StmtFor) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtFor(n *ast.StmtFor) { + if n.Alt { + p.printStmtAltFor(n) + return + } - io.WriteString(p.w, "for") - p.printFreeFloating(nn, token.For) - io.WriteString(p.w, "(") - p.joinPrint(",", nn.Init) - p.printFreeFloating(nn, token.InitExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Cond) - p.printFreeFloating(nn, token.CondExpr) - io.WriteString(p.w, ";") - p.joinPrint(",", nn.Loop) - p.printFreeFloating(nn, token.IncExpr) - io.WriteString(p.w, ")") + p.printToken(n.ForTkn, "for") + p.printToken(n.OpenParenthesisTkn, "(") + p.joinPrint(",", n.Init) + p.printToken(n.InitSemiColonTkn, ";") + p.joinPrint(",", n.Cond) + p.printToken(n.CondSemiColonTkn, ";") + p.joinPrint(",", n.Loop) + p.printToken(n.CloseParenthesisTkn, ")") - p.Print(nn.Stmt) + p.Print(n.Stmt) +} - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtAltFor(n *ast.StmtFor) { + p.printToken(n.ForTkn, "for") + p.printToken(n.OpenParenthesisTkn, "(") + p.joinPrint(",", n.Init) + p.printToken(n.InitSemiColonTkn, ";") + p.joinPrint(",", n.Cond) + p.printToken(n.CondSemiColonTkn, ";") + p.joinPrint(",", n.Loop) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) + } else { + p.printNode(n.Stmt) + } + + p.printToken(n.EndForTkn, "endfor") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtForeach(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index ce35495..c607b65 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -762,7 +762,8 @@ func TestParseAndPrintPhp5AltIf(t *testing.T) { } func TestParseAndPrintPhp5AltFor(t *testing.T) { - src := ` Date: Sun, 6 Sep 2020 12:45:08 +0300 Subject: [PATCH 055/140] [refactoring] update ast structure of "Switch", "Case", "Default" nodes; remove "CaseList" node --- internal/php5/parser_test.go | 336 +++++++++++------------- internal/php5/php5.go | Bin 293827 -> 293045 bytes internal/php5/php5.y | 143 +++++----- internal/php5/php5_test.go | 336 +++++++++++------------- internal/php7/parser_test.go | 336 +++++++++++------------- internal/php7/php7.go | Bin 246441 -> 243941 bytes internal/php7/php7.y | 155 +++++------ internal/php7/php7_test.go | 336 +++++++++++------------- pkg/ast/ast.go | 2 - pkg/ast/node.go | 45 ++-- pkg/ast/traverser/dfs.go | 39 +-- pkg/ast/visitor/dump.go | 17 +- pkg/ast/visitor/filter_parser_nodes.go | 20 -- pkg/ast/visitor/filter_tokens.go | 22 ++ pkg/ast/visitor/null.go | 8 - pkg/printer/pretty_printer.go | 39 +-- pkg/printer/pretty_printer_test.go | 47 ++-- pkg/printer/printer.go | 128 +++------ pkg/printer/printer_parsed_php5_test.go | 6 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 63 +++-- 21 files changed, 883 insertions(+), 1201 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 1af3152..11e39da 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -9431,78 +9431,68 @@ func TestStmtSwitch(t *testing.T) { }, Value: []byte("1"), }, - CaseList: &ast.StmtCaseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 5, - StartPos: 17, - EndPos: 58, + CaseList: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 22, + EndPos: 36, + }, }, - }, - Cases: []ast.Vertex{ - &ast.StmtCase{ + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 22, - EndPos: 36, + StartPos: 27, + EndPos: 28, }, }, - Cond: &ast.ScalarLnumber{ + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 27, - EndPos: 28, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 30, - EndPos: 36, - }, + StartPos: 30, + EndPos: 36, }, }, }, }, - &ast.StmtCase{ + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 40, + EndPos: 54, + }, + }, + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 40, - EndPos: 54, + StartPos: 45, + EndPos: 46, }, }, - Cond: &ast.ScalarLnumber{ + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 45, - EndPos: 46, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 48, - EndPos: 54, - }, + StartPos: 48, + EndPos: 54, }, }, }, @@ -9560,78 +9550,68 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, Value: []byte("1"), }, - CaseList: &ast.StmtCaseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 5, - StartPos: 17, - EndPos: 59, + CaseList: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 23, + EndPos: 37, + }, }, - }, - Cases: []ast.Vertex{ - &ast.StmtCase{ + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 23, - EndPos: 37, + StartPos: 28, + EndPos: 29, }, }, - Cond: &ast.ScalarLnumber{ + Value: []byte("1"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, EndLine: 3, - StartPos: 28, - EndPos: 29, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 31, - EndPos: 37, - }, + StartPos: 31, + EndPos: 37, }, }, }, }, - &ast.StmtCase{ + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 41, + EndPos: 55, + }, + }, + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 41, - EndPos: 55, + StartPos: 46, + EndPos: 47, }, }, - Cond: &ast.ScalarLnumber{ + Value: []byte("2"), + }, + Stmts: []ast.Vertex{ + &ast.StmtBreak{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 46, - EndPos: 47, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 49, - EndPos: 55, - }, + StartPos: 49, + EndPos: 55, }, }, }, @@ -9670,7 +9650,7 @@ func TestStmtSwitch_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltSwitch{ + &ast.StmtSwitch{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -9679,6 +9659,7 @@ func TestStmtSwitch_Alt(t *testing.T) { EndPos: 65, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ @@ -9690,71 +9671,61 @@ func TestStmtSwitch_Alt(t *testing.T) { }, Value: []byte("1"), }, - CaseList: &ast.StmtCaseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: -1, - StartPos: 22, - EndPos: -1, + CaseList: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: -1, + StartPos: 22, + EndPos: -1, + }, }, - }, - Cases: []ast.Vertex{ - &ast.StmtCase{ + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, - EndLine: -1, - StartPos: 22, - EndPos: -1, + EndLine: 3, + StartPos: 27, + EndPos: 28, }, }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 27, - EndPos: 28, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, + Value: []byte("1"), }, - &ast.StmtDefault{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: -1, - StartPos: 33, - EndPos: -1, - }, + Stmts: []ast.Vertex{}, + }, + &ast.StmtDefault{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: -1, + StartPos: 33, + EndPos: -1, }, - Stmts: []ast.Vertex{}, }, - &ast.StmtCase{ + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: -1, + StartPos: 45, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 5, - EndLine: -1, - StartPos: 45, - EndPos: -1, + EndLine: 5, + StartPos: 50, + EndPos: 51, }, }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 50, - EndPos: 51, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, + Value: []byte("2"), }, + Stmts: []ast.Vertex{}, }, }, }, @@ -9788,7 +9759,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltSwitch{ + &ast.StmtSwitch{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -9797,6 +9768,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { EndPos: 54, }, }, + Alt: true, Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ @@ -9808,60 +9780,50 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, Value: []byte("1"), }, - CaseList: &ast.StmtCaseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: -1, - StartPos: 23, - EndPos: -1, + CaseList: []ast.Vertex{ + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 3, + EndLine: -1, + StartPos: 23, + EndPos: -1, + }, }, - }, - Cases: []ast.Vertex{ - &ast.StmtCase{ + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, - EndLine: -1, - StartPos: 23, - EndPos: -1, + EndLine: 3, + StartPos: 28, + EndPos: 29, }, }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 29, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, + Value: []byte("1"), }, - &ast.StmtCase{ + Stmts: []ast.Vertex{}, + }, + &ast.StmtCase{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: -1, + StartPos: 34, + EndPos: -1, + }, + }, + Cond: &ast.ScalarLnumber{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, - EndLine: -1, - StartPos: 34, - EndPos: -1, + EndLine: 4, + StartPos: 39, + EndPos: 40, }, }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 39, - EndPos: 40, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, + Value: []byte("2"), }, + Stmts: []ast.Vertex{}, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 90079efcd239c7b6e05abbbb1cce5f3bc36269c1..86cad0f133cf710774b105fa374b81a072dc3323 100644 GIT binary patch delta 13799 zcmaJoX>^rEvZuR0$U-)juqEVPAgm&}_vYpw6WKEvRh|CjE#}NU2Rn^}X-kkRb@>Nw=RaaM6S5^1j z`|rj(E;Qagr*&#L5lT;=yP)FnzOvQBYg_BJt;IGe)6!sewk*(hw-F-+eJx!sgZe;$ zn9pB?g9$-#8=(%qjD&}SqJUBO70}JviMySz0;p^+MmdCF6^h&4j|KjZZwtj}2csu+ z5DzhjcYj2FvXgkh<)=UBEF`PQlFxJ%a~RjSOcm&b-9&Hi>(gt+XZ$sLiVEtFio_ug zw>xZWOyl5UL>wmJ{PAtEnB;uu`=a6w!=qXS^fx6UY|L{Azj`DD5KbRVirEalkYxp+ zyqEZl#&5~Tk5RqFMEfJCkM$O}GqZQQTLC??ugwgH7wFCX#1o9Gn`IT~Q3J#+%#ps} z{eeb3{@69hsK<1rgKhQrOJ6S{?kJry)X#DEFq;#ZANt%KVu{CY#ho6VmSaU9)|a)o>uzy_ zOQ`pjiP4@;iF?E-@9V`$Vz@W1#T0Ru_qAr4_|pAS$!G*#o+R35-7|R$1oxZn{o3%`W(>&b_K08{cDBz*qx?K#$Zc75zvVLmk%0; zH6J3h_dIdd2Tj1zPgOqjm?v7o>Q*WPehtgvusx;@L#R$>!%Yu~MUYq^I+FB}ThYTq zP&eJmhb0|^r8h1RXP6mbWGD<hOK(MGS#;47QRfpK<$35~%fw|LGzJ&$z&S5}L|pViPeC7FbTlO*PQvjI9U!Auy~WZ5&;oe*A_$B7n{URcYr7+ zRRa3x7JKbcKtM*5`urcoKV2$lyiT@&${ivT0$Xu^o23oNco>#0ls%#Ec-d6%*(%B{ z2L%{QTEMAvnFSNKc`88Lv5qTz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A-XWZ5oI^&CWP?3|F6p zu(#!W36fg~2HarSV&G7rLM^cxA-DKPLKF}Usczj!wU?9|sr&|L6%*5fm~JEIs#K(| z8>MChi+GZ~y($9zaMV1$2lKODrWM*G{l}o8+cnxaspaL?L2V8qlaGVg$pOqh7mrs9 zNgU&C-?6gqGbIQWsqMwhBxW$j%c`}iiCmii8>N{DcS}VP6oFjapq;fO4^32AGQC74 z-%!~pQXY7}b?2#K2*n`t3QY8I*4lhY>YV zN6uC2gO%ONEy?o23CsdEwB{l?^e{4pKUGdIPy;04bKG^$BkCDoMVH1_3PYt0RR*`k z>WoDuZTOrX8NWo8YRrd*D}Z~a1{sUVw$&Tt$>Aq(vDa-yyDnI!CL0bg%TJf9Pr`gY z8Rk`kZ;bmJY4jo^P+(m@?^I>WAtVPpH2e~m(TP>Qd5PY8GJ5Q*REDuN%=8|fLjk1T-{T{nXg;<0e8F)q-`M- ztM&JoNn4yOt|DuQ7bj)2RJd$B$-QLLddL^-LQTptDI20eqYrFQdH9XSuXj|d70NU< z4J~%4Dh?<49;we@Bg-+zY*AkT8@Y7qRy9o7_a^JD+f`Apr%l# 0 { - p.printNodes(nn.Stmts) - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtCase(n *ast.StmtCase) { + p.printToken(n.CaseTkn, "case") + p.bufStart = " " + p.Print(n.Cond) + p.printToken(n.CaseSeparatorTkn, ":") + p.printNodes(n.Stmts) } func (p *Printer) printStmtCatch(n ast.Vertex) { @@ -2308,22 +2257,10 @@ func (p *Printer) printStmtDeclare(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtDefault(n ast.Vertex) { - nn := n.(*ast.StmtDefault) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "default") - p.printFreeFloating(nn, token.Default) - p.printFreeFloating(nn, token.CaseSeparator) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ":") - } - - if len(nn.Stmts) > 0 { - p.printNodes(nn.Stmts) - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtDefault(n *ast.StmtDefault) { + p.printToken(n.DefaultTkn, "default") + p.printToken(n.CaseSeparatorTkn, ":") + p.printNodes(n.Stmts) } func (p *Printer) printStmtDo(n *ast.StmtDo) { @@ -2828,31 +2765,32 @@ func (p *Printer) printStmtStmtList(n *ast.StmtStmtList) { p.printToken(n.CloseCurlyBracket, "}") } -func (p *Printer) printStmtSwitch(n ast.Vertex) { - nn := n.(*ast.StmtSwitch) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "switch") - - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") +func (p *Printer) printStmtSwitch(n *ast.StmtSwitch) { + if n.Alt { + p.printStmtAltSwitch(n) + return } - p.Print(nn.Cond) + p.printToken(n.SwitchTkn, "switch") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.OpenCurlyBracketTkn, "{") + p.printToken(n.CaseSeparatorTkn, "") + p.printNodes(n.CaseList) + p.printToken(n.CloseCurlyBracketTkn, "}") +} - if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") - } - - p.printFreeFloating(nn.CaseList, token.Start) - io.WriteString(p.w, "{") - p.printFreeFloating(nn.CaseList, token.CaseListStart) - p.printNodes(nn.CaseList.Cases) - p.printFreeFloating(nn.CaseList, token.CaseListEnd) - io.WriteString(p.w, "}") - p.printFreeFloating(nn.CaseList, token.End) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtAltSwitch(n *ast.StmtSwitch) { + p.printToken(n.SwitchTkn, "switch") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Cond) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + p.printToken(n.CaseSeparatorTkn, "") + p.printNodes(n.CaseList) + p.printToken(n.EndSwitchTkn, "endswitch") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtThrow(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index c607b65..2ea9ea4 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -791,7 +791,8 @@ func TestParseAndPrintPhp5AltForeach(t *testing.T) { } func TestParseAndPrintPhp5AltSwitch(t *testing.T) { - src := ` Date: Sun, 6 Sep 2020 13:02:13 +0300 Subject: [PATCH 056/140] [refactoring] update ast structure of "Break", "Continue" nodes --- internal/php5/php5.go | Bin 293045 -> 292106 bytes internal/php5/php5.y | 66 +++++++++++------------- internal/php7/php7.go | Bin 243941 -> 244481 bytes internal/php7/php7.y | 34 ++++++------ pkg/ast/node.go | 8 ++- pkg/ast/visitor/filter_tokens.go | 10 ++++ pkg/printer/printer.go | 45 +++++----------- pkg/printer/printer_parsed_php5_test.go | 6 ++- pkg/printer/printer_parsed_php7_test.go | 6 ++- 9 files changed, 82 insertions(+), 93 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 86cad0f133cf710774b105fa374b81a072dc3323..c43d502c0cdb079727b65e15b09585de9282865b 100644 GIT binary patch delta 8090 zcmai3cX*XW)_mq_k(G|$@VIl~KC`DLg5%_*H@4YuS-?Pv2{Xw{MX6DS9GpGE{d3Rh7 zU359La#n<2sv|IP)|?ruGkB{7Ya-N|2qy9E z+IZH2wmc$&XsMkwreRO9Y${sFqFrn316e+07O-%yJwAPB&zRYjzF#21=-7D?NMF=~ z$FgoLh?aK*k5@`rHcO^nbu5a0EybA)PxtFHecG%^(@Lq&w&AX@3N7O%+R-q-URH&D6L*v)hc0jbts>*;s%Atp#Ux3Z3Fwr76c5y*M9A z7`@3&ygZ)?Zj_=LFJKXzIqUhVtd}$;g^rJ8;fCq_g={isskE{Wi&lY)*yD_)Sp)F- zm{HHAU_P^4v{sPoBIkA|Ra_IzDe-mguija~3Voov29y|1a~feqbqNbph3i?IAo~kE zoGRj>+o1KV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K#Q&kP_#uQR_;r-Rh(ZH z&*N)`Mdh}+TvXM4!6Tqm1n#NWNZ1nLpiSYIHbq@-S;N`I-&7M8l0 za8fk|%(p)0h&T==Cos-bH>oMkNcr%Al?P05np0cp477pZ4&|NMP<|+2^#v?~1_^MO ze1DsGzlb_n07?hj*6O#6!YZ`+TDNxEl3994e@NW84Fv5rlFK?^?svUwmIZwC0C z*#aoLzz4j2EDi0YtSsk21w?ZP>JM+{{H203Jb4H7ebUE{HIHUH>+Sb5d~+LH*0U}v z3jXU`tFj(;Y@aE?pr&o+21^%dSr8aCQk~~5d17VeuRNy{C`zh8(Q~?vK{Neb;%VeH z+s&}Y9ee@}m&P&r?PXg$Df69QN~%LoGjm lisKZ2G{VUi7sqIa*cJYdRoq|<2u?FUk8nmQ{&uXB^#7nOwiN&X diff --git a/internal/php5/php5.y b/internal/php5/php5.y index cab691e..355007f 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -950,51 +950,45 @@ unticked_statement: } | T_BREAK ';' { - $$ = &ast.StmtBreak{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = &ast.StmtBreak{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + BreakTkn: $1, + SemiColonTkn: $2, + } } | T_BREAK expr ';' { - $$ = &ast.StmtBreak{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtBreak{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + BreakTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_CONTINUE ';' { - $$ = &ast.StmtContinue{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = &ast.StmtContinue{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + ContinueTkn: $1, + SemiColonTkn: $2, + } } | T_CONTINUE expr ';' { - $$ = &ast.StmtContinue{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtContinue{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ContinueTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_RETURN ';' { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 90b19728dd6dd71eb116e10a471ddc385b771375..d34558c203a38f2ea33c58eef621fd08ae7c7025 100644 GIT binary patch delta 10998 zcmai433Qc3vOe9NkcALJfCNI4d&9nlyDt(*0tw;pJGF#+ceda=I=6&7l71d|+u zVVBo}KliqT>k2IROhHR{ZC49^y=zOjx|;}J8i?$+Rm7K1R{*u$E*rAKq#FpTPH z!Rvaqgk!xF+;ob1V0ka)5jptU8Q{sv=fCbvmdUhK@EP(Y^d%Er*YKr%iO0=Y`Fwvr zGDD7Pa+n8#1IQ_vN_sO7?^Z~zl~8FRj@Aq$-Q?(0gyh3tePohgl!GF_I^}ZktUc%* zu#iWcL1`6g>KIf4#DK30l6$ml-YZOYixEe8UMl``B}QrtUVjbgCr9l{aHXFPBBRZy zVlWwOMo$hQGsT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7.y +++ b/internal/php7/php7.y @@ -919,27 +919,25 @@ statement: } | T_BREAK optional_expr ';' { - $$ = &ast.StmtBreak{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtBreak{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + BreakTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_CONTINUE optional_expr ';' { - $$ = &ast.StmtContinue{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtContinue{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ContinueTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_RETURN optional_expr ';' { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 26850a4..2ed7187 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -191,7 +191,9 @@ func (n *StmtAltForeach) Accept(v NodeVisitor) { // StmtBreak node type StmtBreak struct { Node - Expr Vertex + BreakTkn *token.Token + Expr Vertex + SemiColonTkn *token.Token } func (n *StmtBreak) Accept(v NodeVisitor) { @@ -314,7 +316,9 @@ func (n *StmtConstant) Accept(v NodeVisitor) { // StmtContinue node type StmtContinue struct { Node - Expr Vertex + ContinueTkn *token.Token + Expr Vertex + SemiColonTkn *token.Token } func (n *StmtContinue) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index b59f05b..4cc6a27 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -163,3 +163,13 @@ func (v *FilterTokens) StmtDefault(n *ast.StmtDefault) { n.DefaultTkn = nil n.CaseSeparatorTkn = nil } + +func (v *FilterTokens) StmtBreak(n *ast.StmtBreak) { + n.BreakTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtContinue(n *ast.StmtContinue) { + n.ContinueTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 5064d70..3380c90 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2017,25 +2017,15 @@ func (p *Printer) printStmtAltForeach(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtBreak(n ast.Vertex) { - nn := n.(*ast.StmtBreak) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtBreak(n *ast.StmtBreak) { + p.printToken(n.BreakTkn, "break") - io.WriteString(p.w, "break") - if nn.Expr != nil { - if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - } - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + if n.Expr != nil { + p.bufStart = " " } - p.printFreeFloating(nn, token.End) + p.Print(n.Expr) + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtCase(n *ast.StmtCase) { @@ -2202,26 +2192,15 @@ func (p *Printer) printStmtConstant(n *ast.StmtConstant) { p.printToken(n.CommaTkn, "") } -func (p *Printer) printStmtContinue(n ast.Vertex) { - nn := n.(*ast.StmtContinue) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtContinue(n *ast.StmtContinue) { + p.printToken(n.ContinueTkn, "continue") - io.WriteString(p.w, "continue") - - if nn.Expr != nil { - if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.Expr) - } - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + if n.Expr != nil { + p.bufStart = " " } - p.printFreeFloating(nn, token.End) + p.Print(n.Expr) + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtDeclare(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 2ea9ea4..d5b2c0b 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -837,7 +837,8 @@ func TestParseAndPrintPhp5AltWhile(t *testing.T) { } func TestParseAndPrintPhp5Break(t *testing.T) { - src := ` Date: Sun, 6 Sep 2020 13:09:00 +0300 Subject: [PATCH 057/140] [refactoring] update ast structure of "Return" node --- internal/php5/php5.go | Bin 292106 -> 291414 bytes internal/php5/php5.y | 50 ++++++++++++++----------------- internal/php7/php7.go | Bin 244481 -> 244258 bytes internal/php7/php7.y | 17 +++++------ pkg/ast/node.go | 4 ++- pkg/ast/visitor/filter_tokens.go | 5 ++++ pkg/printer/printer.go | 18 ++++------- 7 files changed, 45 insertions(+), 49 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index c43d502c0cdb079727b65e15b09585de9282865b..d7d7936f765403286ef4cce4244492efe9713623 100644 GIT binary patch delta 7899 zcma)Bd03X!wtv>%FEYuff`S5yL!R_751$%fDxf)_IF^VSsH7G-G?{Z{rsmAbGL!U{ zvsB8ilLMu7%~Z5f%Th7DopTBmQ!~x-{Pupo@8h%XeV+S=kL>-fz4w~eZ>{g8A45)D z2&tGF;T`YiH|6QlVoqpkHJ!U6Lam6Ph~eC73O(*Opm@sENskU3|7a(^k|!g%<0MMp z@lR0>m!G0&FY}q>`%nRA6;jw=$O|XaKrVlVa(Q+i5mpvYzW=`?Uq4GZl*q@1kvXI? zr;`x8^t5Qs6{pEkqh?a1;E#5QNDi(eFSU9$MF_q!25a;E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wj=tNW&VgV7~DSK<8Fzbx8+ceP|KO~9*u&I9zq4 zhY76a&UiTQW~G^WTqQTOwhDgI6H#a$cDy~o9A}`-x%^d75EyvDw4Y)Nyew^5+}n9> zs=hP1E_TvZD!vPtX;14C8}T_nNP3iMqW& zdN|k28cK2MvE~*&Cd4!TI@CjdtAp^0_4M#qfd3v-CUIB@wNQNmtXVo;m@i;i4FNW# ztt>Bulx}S*I{+v%!maiuW>iFw)mUdYJR^+a&`>K(sbI_0v<6|&$@^&TVD1%aJyqwK z@kpqV*Ss~u1N~HDn1#3Yq?!=N z5^@)IvU;#1%1Tz7I$J{oq{B>i1VQo(UnN4%ufeNlAhx8ki-{g}ikKC(Hutre<9CsFF&NWZS zo@zsH%RHax&Fs%#DE+&0_7ObMl%!aHkW50cVm8NwX%%|&^dK3=l|8NAsxr-bPavP6 z@i+CY`BVhASxNz%(L&_&^8UCSyMfbr*<|n9vaetuE;u$y^&4mn(9MfEr?f3pFLg+7 z6+GB_QF}yfv$uDM6%512s5dfUC^d4VbqVhjBdk7Fyu(q4+D;3F&<;`SM_XtZ?KX}v zXs9}lwZ>_a={<%>oND+U?h922KELJvzP&PoD{!CDkW465Q@t HEBb!{w8Ft0 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 355007f..be091ce 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -992,39 +992,35 @@ unticked_statement: } | T_RETURN ';' { - $$ = &ast.StmtReturn{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = &ast.StmtReturn{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + ReturnTkn: $1, + SemiColonTkn: $2, + } } | T_RETURN expr_without_variable ';' { - $$ = &ast.StmtReturn{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtReturn{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ReturnTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_RETURN variable ';' { - $$ = &ast.StmtReturn{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtReturn{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ReturnTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | yield_expr ';' { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index d34558c203a38f2ea33c58eef621fd08ae7c7025..7ce01b9fe68ae02018ccf855e505cf9f3707a36c 100644 GIT binary patch delta 5540 zcma)AdsvoLwtv>zd?1JyP(dIB1szdS?w3kM8!^;SvrKV_(J&ZOLPjModFxbDS;J(* zGM!P#a-J?IdK#CJV>&gbCw0b{GCQLwT8`Pt6fLc$srl{weq6NvIRC)A)?Rz<-&%X! z_P6SC*Jr=z+R!bUQ*s^*i`KAcikvQg-(hZ%=I(;EUv!qm-h?;5&)~Bi{hNWetv8w@ka53G>GP#1{bm}rHB=7Uk0~ElN zCVlUwK6-HlJ!dFIE<8-J`pScJqoFhfan4vZ5prQF)PDOI-R#$M*Aw(KQL0{glExUy z@|4{96h$(p=4i#!)Xh-3t`sU_&d3pp;$D(Gn7YW7V*Kg4o^HX(TMPNd-+soyx?w#{ z44@1rRC5n(K5!9VIX&x9%Gx-))BC zbW87-u;(cs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cnf-uQ@FgP8+Is3?w^%Zymb(#wyhk($2)y{>VV8<1y_oqtL zJh<-iAq;N05<0Wb6#gKA9=FCd!pe2jVd@{wMkpALc)7x((Vacwt z?>y$=+T|uzo3>(llv|fVJ1_u)(IV4BR=kgY1ge&q=aD66A2368^m4NqFMkD5;QkoN zl(4cS9bJR+1Axzc*xaSbtIQPp*Bpop<2@zD$+1V_NU4NNF+&F2z%kxG9GljfkpDt) z*d4PDtc42JgBGkKucdIV*oV&(#y*cQ_iy&hK-Q)z(0nH2L@ck-jT_9@96iVzu7}r} ze4AEjdg^I|!L-P#9V6M(xxaoT2LEXcQgns4@i(K*VS6EpE){g(?n44#aS9C5H9O1% zJUaBmPO|}i+SA%MnU-hG65>*SoNx{0k>|{58@o66n`=oo?lHamKeayIYpVVJaZ96_ yYqf*tCKMq4@{+>`O^gnI(Ny^?purM(to4&QFS$;D#|a)#UQf4wue82w3jZI7iiFev diff --git a/internal/php7/php7.y b/internal/php7/php7.y index d3cfde3..45741de 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -941,15 +941,14 @@ statement: } | T_RETURN optional_expr ';' { - $$ = &ast.StmtReturn{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtReturn{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ReturnTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_GLOBAL global_var_list ';' { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 2ed7187..1bed711 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -618,7 +618,9 @@ func (n *StmtPropertyList) Accept(v NodeVisitor) { // StmtReturn node type StmtReturn struct { Node - Expr Vertex + ReturnTkn *token.Token + Expr Vertex + SemiColonTkn *token.Token } func (n *StmtReturn) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 4cc6a27..91f6ddd 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -173,3 +173,8 @@ func (v *FilterTokens) StmtContinue(n *ast.StmtContinue) { n.ContinueTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtReturn(n *ast.StmtReturn) { + n.ReturnTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 3380c90..469a837 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2690,21 +2690,15 @@ func (p *Printer) printStmtProperty(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtReturn(n ast.Vertex) { - nn := n.(*ast.StmtReturn) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtReturn(n *ast.StmtReturn) { + p.printToken(n.ReturnTkn, "return") - io.WriteString(p.w, "return") - p.bufStart = " " - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + if n.Expr != nil { + p.bufStart = " " } + p.Print(n.Expr) - p.printFreeFloating(nn, token.End) + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtStaticVar(n ast.Vertex) { From 3f12ada3114cd2a1477d8e7573709a33bc1176ad Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Wed, 9 Sep 2020 22:53:51 +0300 Subject: [PATCH 058/140] [refactoring] update ast structure of "Static", "Global" and "StaticVar" nodes --- internal/php5/php5.go | Bin 291414 -> 291575 bytes internal/php5/php5.y | 110 +++++++++++++++--------- internal/php7/php7.go | Bin 244258 -> 243341 bytes internal/php7/php7.y | 78 +++++++++-------- pkg/ast/node.go | 15 +++- pkg/ast/visitor/filter_tokens.go | 16 ++++ pkg/printer/printer.go | 74 ++++++++-------- pkg/printer/printer_parsed_php5_test.go | 9 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 4 +- 10 files changed, 185 insertions(+), 127 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index d7d7936f765403286ef4cce4244492efe9713623..8f172745feeccc6f547808e220c2b98adb0ae9c5 100644 GIT binary patch delta 10634 zcmb_i3s{v^x_;JLKOiWGiWq{j!JsVAeZQCnjwxa)B1L6hz-ty>Qfe$UG0Vy(LrK0Y zOPV>=lvxvM&2 z9KL{$+b(o_@D%dm%jI;U$K&xGb4D$z?WR5;#4}Avfr1xM|Vm(&feCJUhKPLwIWjHmBrcT@bhn3%mThpHXOTq=VT22}jFi<1vGo#yj#- z4>kuRq_?a2BH?d1*_eh1X)?1~Azyj0Jq3{1v?H z|0HCrl3m0M;e)m@72b^x*ve>xgAs?bu>9P^rR`V%;MHBT>+oX68I=VUvnG~T^zLK-PXnik^Xb9KA|bA=lj7Z?yYNu) zG?8TbQrh}@_bHh&yL?W0<*YeZ+%R)4xiUo;Gp5(S9h2jjIlZDcoIRHApDenyKVu-h zS|obVs6`?~Q~xBAsd=|(M>pRlisQTiOqky~$*^8hSzbAP5;!pb|AzH2@tmx;PW%t7 zpL5K)SPu_8C+qc9qFDH7MT1PG^gBhA&Ri^}ODaDly45;GtX{W7TrEU^Rtys9`rcc` z%YqIp6$P|qw@Ai-I6dSpaY#z1j|Lu9Nz}ATwxhRJi+J61zvv?Ax^fXub?1v%ieD)@ z&{vR_u7=zcl=b@wB~iR?I&E7f+UpUkgii_=Iqp$udM$}sA)GXDKlnU;wT#wRtrmME z?Vc~w^~g1%o5X_UV}+lZgQ`pIY^$^0@~CK#wD@Z%sb!2xp}#yP3UJaJ*NMCJ+&_y# zi#Ci^-RRX`q9Yx80!LcBUZv{Go)j5UxkCXu=n!4$)DrCX;8SAg84GoM8Vfne^@U2N zdLesL?bGNl`3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Eq&7uYCEpGxRmhEd4jh86t7=Ciu}x#$p+2wB)mXS_w%R@{zzCa_*uOwsLyX$ zVd6c9DlWitx7q~b%7);-04t!JHRtiktZxVipS}q8Xv-!9)DW$ z`(xvDWjWVD#BmY>S%hU)lEv>sk%heUV3Gwly`-CWNuYH`!AQ1H{puuT9ZR;JM(4?i zKOlvx`2pVLqt0pI@3FffYtz6V$O1NNMR{4)8}w!)i~^Ws;RQlv8i4kP!FsywT;9+M9VxoE)V z?F@;Ax3w%f>9R&9dRy@NiS$uxE0yK}+3CY=tUvJ$E0{mnSjp z|IQV&X<--W(`RzaK$9^vGDbFVzMm=rRxkZfS1X_pp(DCly|ujDszA%o9wI#T(MVu- zOY{OG8q=@FFT10bZNIPgg{=~9`w;+EsXiLEkU~8U&@@pvJ<48yZa9FL{W{@^GU#u{ zZL%57oTD0QZ+9zd(k{w@d4v9Y2_Jr#)eGkU@=IK8_>D+E{^NjN+>8XO!z&IQ>uoJF zsIK0$p88yobwM@=d)ew#wN`YaH63J*?sJ9p0aIVAy5O7O`-xBT&!z`SY7xAtiKv+ zT?v=LEuLRSnT9L$)Y2|{RWsn@62Xk${W~7xX ztza}9)!nYQE*JWjYpr8~7LKv502R#9k-qArvJC0Q5VU`^y6V%=1{|3-L;C*oXdF6je%CLsonPqF&53f1hLd{udY& B?z{j1 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index be091ce..a912b40 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -239,7 +239,7 @@ import ( %type optional_class_type parameter class_entry_type class_statement class_constant_declaration %type trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method -%type static_scalar_value static_operation +%type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list %type trait_adaptations %type switch_case_list @@ -253,7 +253,7 @@ import ( %type lexical_vars %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations -%type inner_statement_list global_var_list static_var_list encaps_list isset_variables non_empty_array_pair_list +%type inner_statement_list encaps_list isset_variables non_empty_array_pair_list %type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list echo_expr_list unset_variables declare_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list @@ -1036,27 +1036,21 @@ unticked_statement: } | T_GLOBAL global_var_list ';' { - $$ = &ast.StmtGlobal{ast.Node{}, $2} + $2.(*ast.StmtGlobal).GlobalTkn = $1 + $2.(*ast.StmtGlobal).SemiColonTkn = $3 + $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) + $2.(*ast.StmtGlobal).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_STATIC static_var_list ';' { - $$ = &ast.StmtStatic{ast.Node{}, $2} + $2.(*ast.StmtStatic).StaticTkn = $1 + $2.(*ast.StmtStatic).SemiColonTkn = $3 + $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) + $2.(*ast.StmtStatic).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_ECHO echo_expr_list ';' { @@ -2218,14 +2212,16 @@ function_call_parameter: global_var_list: global_var_list ',' global_var { - $$ = append($1, $3) + $1.(*ast.StmtGlobal).Vars = append($1.(*ast.StmtGlobal).Vars, $3) + $1.(*ast.StmtGlobal).SeparatorTkns = append($1.(*ast.StmtGlobal).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | global_var { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtGlobal{ + Vars: []ast.Vertex{$1}, + } } ; @@ -2273,65 +2269,95 @@ static_var_list: { identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} - $$ = append($1, staticVar) + + $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Var: variable, + }) + $1.(*ast.StmtStatic).SeparatorTkns = append($1.(*ast.StmtStatic).SeparatorTkns, $2) + + $$ = $1 // save position identifier.GetNode().Position = position.NewTokenPosition($3) variable.GetNode().Position = position.NewTokenPosition($3) - staticVar.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } | static_var_list ',' T_VARIABLE '=' static_scalar { identifier := &ast.Identifier{ast.Node{}, $3.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $5} - $$ = append($1, staticVar) + + $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $5), + }, + Var: variable, + EqualTkn: $4, + Expr: $5, + }) + $1.(*ast.StmtStatic).SeparatorTkns = append($1.(*ast.StmtStatic).SeparatorTkns, $2) + + $$ = $1 // save position identifier.GetNode().Position = position.NewTokenPosition($3) variable.GetNode().Position = position.NewTokenPosition($3) - staticVar.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } | T_VARIABLE { identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - staticVar := &ast.StmtStaticVar{ast.Node{}, variable, nil} - $$ = []ast.Vertex{staticVar} + + $$ = &ast.StmtStatic{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Var: variable, + }, + }, + } // save position identifier.GetNode().Position = position.NewTokenPosition($1) variable.GetNode().Position = position.NewTokenPosition($1) - staticVar.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' static_scalar { identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - staticVar := &ast.StmtStaticVar{ast.Node{}, variable, $3} - $$ = []ast.Vertex{staticVar} + + $$ = &ast.StmtStatic{ + Vars: []ast.Vertex{ + &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + Var: variable, + EqualTkn: $2, + Expr: $3, + }, + }, + } // save position identifier.GetNode().Position = position.NewTokenPosition($1) variable.GetNode().Position = position.NewTokenPosition($1) - staticVar.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } ; diff --git a/internal/php7/php7.go b/internal/php7/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i`B?36s7>q2MqBU1L)9GK2W3yN%nv-?n<_^!fQtaWCHG&0iaPVq?U!QWi zhd2sYfSWJUj%~f_yQhL;W69U`n2?>r2)#B7vR~u*n?DZpz%V_=GBcgOF+d-W zt{7w8Bg}H(#mv4j&K7aF5dEVLnfPLnh>vsz<@-5B3&)4kIb5WQ?H}(vTV%yGfLQL) zfrgNklgGO5oD)K&@a}}mpUM?eof`V+ga~)?1bAugGN&h140am5tgS!E?ugigb5L&1 zP`~Xlj(rL$$+&M(_4ZA~=ikX!>Eq1YQ=RH!;7Co8eu9|{nCwR&nT|UhZURuWOU%@> zoqAO6q;5tZJ*HaG^DFR9d+;K>%Ws_=Y($-H>G-?R|26A@Dd8+Mw7&5p_%!3S35`QF z#g;m?VmIL>buz_<=zb9hi%7tw#hj72`2XQ()za*r=bze;!xv(5^Ks{VMDZ`@ zJ9}6b|IrLS&+-C8DE1lNRu-()$15tm)LO+j{JETucs}x|`XbD}U>7d?XSdVS>DvZ2aZsYk}a-uW}9^jos@h~ z6lyMIK>b@WD{Apq_Kh$7I?#DnTRpe{I%&kl+N&LV!@(4tcI{mwJ~{WJd#{c1qB4Vb z6yf4NZce`re)6Lna&RRrdAsZSFmFLlWgB10jc3<%qhW+dIr0kJq^v1*CeRCA^;ml1 zc6GY_EV65y^C+EkbC3g&gHO})p{n@JAa8msb3O>nbkf#UI{^ZL00iErwS+DZ$Qz&T}H9 z-D-}!wE5^E$Ftv#nZO?BtE&mCospsx*!V9mqzHo8!o2&a-`I$NvCsS$dTqkA@U+;_#NnSMyxJ1QUPli#U@s|O`F9%Q2XHP{Ddv5U` LuvF5d4UYFeCoI&8 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 45741de..a095f9a 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -241,8 +241,8 @@ import ( %type const_decl inner_statement %type expr optional_expr %type declare_statement finally_statement unset_variable variable -%type parameter optional_type argument expr_without_variable global_var -%type static_var class_statement trait_adaptation trait_precedence trait_alias +%type parameter optional_type argument expr_without_variable global_var_list global_var +%type static_var_list static_var class_statement trait_adaptation trait_precedence trait_alias %type absolute_trait_method_reference trait_method_reference property echo_expr %type new_expr anonymous_class class_name class_name_reference simple_variable %type internal_functions_in_yacc @@ -275,8 +275,8 @@ import ( %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list -%type const_list echo_expr_list for_exprs non_empty_for_exprs global_var_list -%type unprefixed_use_declarations inline_use_declarations property_list static_var_list +%type const_list echo_expr_list for_exprs non_empty_for_exprs +%type unprefixed_use_declarations inline_use_declarations property_list %type case_list trait_adaptation_list unset_variables %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list %type array_pair_list non_empty_argument_list top_statement_list @@ -952,27 +952,21 @@ statement: } | T_GLOBAL global_var_list ';' { - $$ = &ast.StmtGlobal{ast.Node{}, $2} + $2.(*ast.StmtGlobal).GlobalTkn = $1 + $2.(*ast.StmtGlobal).SemiColonTkn = $3 + $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) + $2.(*ast.StmtGlobal).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_STATIC static_var_list ';' { - $$ = &ast.StmtStatic{ast.Node{}, $2} + $2.(*ast.StmtStatic).StaticTkn = $1 + $2.(*ast.StmtStatic).SemiColonTkn = $3 + $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) + $2.(*ast.StmtStatic).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_ECHO echo_expr_list ';' { @@ -2063,14 +2057,16 @@ argument: global_var_list: global_var_list ',' global_var { - $$ = append($1, $3) + $1.(*ast.StmtGlobal).Vars = append($1.(*ast.StmtGlobal).Vars, $3) + $1.(*ast.StmtGlobal).SeparatorTkns = append($1.(*ast.StmtGlobal).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | global_var { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtGlobal{ + Vars: []ast.Vertex{$1}, + } } ; @@ -2084,14 +2080,16 @@ global_var: static_var_list: static_var_list ',' static_var { - $$ = append($1, $3) + $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, $3) + $1.(*ast.StmtStatic).SeparatorTkns = append($1.(*ast.StmtStatic).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | static_var { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtStatic{ + Vars: []ast.Vertex{$1}, + } } ; @@ -2100,30 +2098,40 @@ static_var: { identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtStaticVar{ast.Node{}, variable, nil} + + $$ = &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Var: variable, + } // save position identifier.GetNode().Position = position.NewTokenPosition($1) variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' expr { identifier := &ast.Identifier{ast.Node{}, $1.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtStaticVar{ast.Node{}, variable, $3} + $$ = &ast.StmtStaticVar{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + Var: variable, + EqualTkn: $2, + Expr: $3, + } // save position identifier.GetNode().Position = position.NewTokenPosition($1) variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 1bed711..1aa3120 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -476,7 +476,10 @@ func (n *StmtFunction) Accept(v NodeVisitor) { // StmtGlobal node type StmtGlobal struct { Node - Vars []Vertex + GlobalTkn *token.Token + Vars []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtGlobal) Accept(v NodeVisitor) { @@ -630,7 +633,10 @@ func (n *StmtReturn) Accept(v NodeVisitor) { // StmtStatic node type StmtStatic struct { Node - Vars []Vertex + StaticTkn *token.Token + Vars []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtStatic) Accept(v NodeVisitor) { @@ -640,8 +646,9 @@ func (n *StmtStatic) Accept(v NodeVisitor) { // StmtStaticVar node type StmtStaticVar struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *StmtStaticVar) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 91f6ddd..c0f9ef5 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -178,3 +178,19 @@ func (v *FilterTokens) StmtReturn(n *ast.StmtReturn) { n.ReturnTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtGlobal(n *ast.StmtGlobal) { + n.GlobalTkn = nil + n.SeparatorTkns = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtStatic(n *ast.StmtStatic) { + n.StaticTkn = nil + n.SeparatorTkns = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtStaticVar(n *ast.StmtStaticVar) { + n.EqualTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 469a837..e7da279 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -65,6 +65,26 @@ func (p *Printer) joinPrintRefactored(glue string, nn []ast.Vertex) { } } +func (p *Printer) printSeparatedList(nodeList []ast.Vertex, separatorList []*token.Token, def string) { + var separators []*token.Token + + if cap(separatorList) >= len(nodeList) { + separators = separatorList[:len(nodeList)] + } else { + separators = make([]*token.Token, len(nodeList)) + copy(separators, separatorList) + } + + for k, n := range nodeList { + p.Print(n) + if k < len(nodeList)-1 { + p.printToken(separators[k], def) + } else { + p.printToken(separators[k], "") + } + } +} + func (p *Printer) printNodes(nn []ast.Vertex) { for _, n := range nn { p.Print(n) @@ -2476,20 +2496,11 @@ func (p *Printer) printStmtFunction(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtGlobal(n ast.Vertex) { - nn := n.(*ast.StmtGlobal) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "global") - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, token.VarList) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtGlobal(n *ast.StmtGlobal) { + p.printToken(n.GlobalTkn, "global") + p.bufStart = " " + p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtGoto(n ast.Vertex) { @@ -2701,35 +2712,20 @@ func (p *Printer) printStmtReturn(n *ast.StmtReturn) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtStaticVar(n ast.Vertex) { - nn := n.(*ast.StmtStaticVar) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtStaticVar(n *ast.StmtStaticVar) { + p.Print(n.Var) - p.Print(nn.Var) - - if nn.Expr != nil { - p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "=") - p.Print(nn.Expr) + if n.Expr != nil { + p.printToken(n.EqualTkn, "=") + p.Print(n.Expr) } - - p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtStatic(n ast.Vertex) { - nn := n.(*ast.StmtStatic) - p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "static") - - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, token.VarList) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtStatic(n *ast.StmtStatic) { + p.printToken(n.StaticTkn, "static") + p.bufStart = " " + p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtStmtList(n *ast.StmtStmtList) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index d5b2c0b..8a2ee8d 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1036,7 +1036,8 @@ func TestParseAndPrintPhp5Function(t *testing.T) { } func TestParseAndPrintPhp5Global(t *testing.T) { - src := ` Date: Thu, 10 Sep 2020 23:11:08 +0300 Subject: [PATCH 059/140] [refactoring] update ast structure of "Echo" node --- internal/php5/php5.go | Bin 291575 -> 291345 bytes internal/php5/php5.y | 28 +- internal/php7/php7.go | Bin 243341 -> 243865 bytes internal/php7/php7.y | 30 +- internal/scanner/lexer.go | 2 +- internal/scanner/scanner.go | Bin 412458 -> 412497 bytes internal/scanner/scanner.rl | 8 +- pkg/ast/node.go | 5 +- pkg/ast/visitor/filter_tokens.go | 6 + pkg/printer/printer.go | 592 ++++++++++++------------ pkg/printer/printer_parsed_php5_test.go | 87 ++-- pkg/printer/printer_parsed_php7_test.go | 91 ++-- pkg/printer/printer_test.go | 40 +- 13 files changed, 401 insertions(+), 488 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8f172745feeccc6f547808e220c2b98adb0ae9c5..5392ff0446928a6a8795c72598e5956f085ce441 100644 GIT binary patch delta 9897 zcmai334B$>)&I@RO+pe95|%(nNL~U&kObeBx3GgHA)pWh1qC!BitK?F3Kdxdv1rBM zgB%c)fGrgj2?QOtVz9KetWjH0M2LWV3JQn|DgxjC%zf`AV84F+csF;>%$zy(LG!@= z$bV)5XW$c08gjHN-sc^?>3Tks z>BY~_+iWV>23=lohOwV9g3QpjNAs{LqrQ6|o-k(UW#ZXuumHj?02VXBgaHIu7O3KC z9_W9DctEn-9XTC)jVu@~2Ne&9_Sn(^&%D-PPyf6_OO_V%>ng;&k$%t}8v1!Zpk48K z7ZG^2_H#aB=NEG`uz+34UJePeE(}tqCp7X@CR;ckR^a23@#P#?{XJjZhUe>F-2pAPI+N`%oERF| zt8gY0%Zg{T*j6+AO#3H^=8E)${`cHJt#em?Qt$Di13fcWG`Gy~#cr}KwR})q7h~4Y zUxtWwM3aO%`2L=UO!9uvKl^aObLK#cJ7!Zb?RCgSyrD@0#O<@KsHl?}o; zi9|@y!r>~7s)}Wz-nmK~l)@E7ZRuCnh%_nP0bTdBNK(@4qv?rOD=OP0(kW@Z7$BUq zUdq8#?@>Yh$$Bx+qObF08m&vPl4;OJQ7rv_`m~eC(%UwQY$@El-$`;4Sa8$OffDi= zrJB;5O=19*CxXxgi)81@=S49vzxy0yaBiS1q|oy?%G+=hEpVw=Iyb;-N>#Ox!0%oV z-+<>Zb&P^GZvnc@7 zsyC%PBwEn4kVvLCC&^se`<^}PqN4ZlW{f(eQpW3--WT`VMom1X(~rycbk|_{E2^8X z4%6%p#1T+By&i&OOQl%{#eT|pNo8tC^OO*Ujp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AUO;n%Q+={CfP(X{pWsFzG83??fy zzh@`o@JmzvLOMZK(C{yK`oz+C!YkWt}H z=!9@plTPP~te*UhVl-XqVhz`~7Fee^ZKLp-h8D)OKV@Z8QGa~h2p?5T>8AeBr0Fdp zDPN-nyhTW#N5>4X3MC~wRcDHd#-Fj! trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation static_var_list global_var_list -%type ctor_arguments function_call_parameter_list +%type ctor_arguments function_call_parameter_list echo_expr_list %type trait_adaptations %type switch_case_list %type method_body @@ -255,7 +255,7 @@ import ( %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list encaps_list isset_variables non_empty_array_pair_list %type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr -%type for_expr case_list echo_expr_list unset_variables declare_list catch_statement additional_catches +%type for_expr case_list unset_variables declare_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration %type interface_list non_empty_function_call_parameter_list trait_list trait_adaptation_list non_empty_trait_adaptation_list @@ -1054,16 +1054,11 @@ unticked_statement: } | T_ECHO echo_expr_list ';' { - $$ = &ast.StmtEcho{ast.Node{}, $2} + $2.(*ast.StmtEcho).EchoTkn = $1 + $2.(*ast.StmtEcho).SemiColonTkn = $3 + $2.(*ast.StmtEcho).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Echo, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_INLINE_HTML { @@ -2874,14 +2869,16 @@ class_constant_declaration: echo_expr_list: echo_expr_list ',' expr { - $$ = append($1, $3) + $1.(*ast.StmtEcho).Exprs = append($1.(*ast.StmtEcho).Exprs, $3) + $1.(*ast.StmtEcho).SeparatorTkns = append($1.(*ast.StmtEcho).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | expr { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtEcho{ + Exprs: []ast.Vertex{$1}, + } } ; @@ -3335,7 +3332,6 @@ expr_without_variable: $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '+' expr diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e26b9a2073fb49ece3b1bbcde0a46629e8ef4809..4734582a7493eaa72f99118a4072352d22ff6208 100644 GIT binary patch delta 12529 zcmZ`<33ydSvi`c8BqVGJO9&*~d)c=H?z#Ixz_2Ns5Zn*}AtH+7LI6b_5CNT0M2F>$ z)I-q`mvKQMg3vIa0_q?>6c9&8MMcKv=r{u+%2P+jS5#tE;Q4 ztNY~Mf3#eCs%3p~N8xNK>A0-ywoJmQjAYyxz2cRTR62#fGRexK!c06`8A;PCmP{fs ziE!E_*iF+bQyGaPVqyvVMkR~p6s!-M|C z5e83oD*4(; zct5Hr(wzjEK_OB_(Ng7Nv&wPMRD`pwUM&}~Y~NR>784eyDWv$TN~N=FUp*q+>~(*9 zAfF`C@odX|%Ztc!_*A*6?4$dZRHNDW)1z_M#G9aysp6GDrUbvpI?pJaWa|Hl*Se$e zcfVFHGFyKC+9-j>e6_!8F`~3KtJvjLuCt}<>r-VV*-TnFL~%`+u~Fa?r7Apd&MhTnRWY_3xg1*RRp~^w>6_F0<{)n%G$v%F z(Ghkzk8bSrzs(;Lrh7R&aQdNM~yg*A^ou4xQL}c9Pk* z4);P|{_}88Wb67CIeFAuQ%k8E%1+2jzM+MLuk5b3y0;DZ|PT#!MRiv_I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php7/php7.y +++ b/internal/php7/php7.y @@ -249,7 +249,7 @@ import ( %type exit_expr scalar lexical_var function_call member_name property_name %type variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable -%type encaps_var encaps_var_offset +%type encaps_var encaps_var_offset echo_expr_list %type if_stmt %type alt_if_stmt %type if_stmt_without_else @@ -275,7 +275,7 @@ import ( %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list -%type const_list echo_expr_list for_exprs non_empty_for_exprs +%type const_list for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations property_list %type case_list trait_adaptation_list unset_variables %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list @@ -954,7 +954,6 @@ statement: { $2.(*ast.StmtGlobal).GlobalTkn = $1 $2.(*ast.StmtGlobal).SemiColonTkn = $3 - $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) $2.(*ast.StmtGlobal).Node.Position = position.NewTokensPosition($1, $3) $$ = $2 @@ -963,23 +962,17 @@ statement: { $2.(*ast.StmtStatic).StaticTkn = $1 $2.(*ast.StmtStatic).SemiColonTkn = $3 - $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) $2.(*ast.StmtStatic).Node.Position = position.NewTokensPosition($1, $3) $$ = $2 } | T_ECHO echo_expr_list ';' { - $$ = &ast.StmtEcho{ast.Node{}, $2} + $2.(*ast.StmtEcho).EchoTkn = $1 + $2.(*ast.StmtEcho).SemiColonTkn = $3 + $2.(*ast.StmtEcho).Node.Position = position.NewTokensPosition($1, $3) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Echo, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = $2 } | T_INLINE_HTML { @@ -2629,14 +2622,16 @@ const_decl: echo_expr_list: echo_expr_list ',' echo_expr { - $$ = append($1, $3) + $1.(*ast.StmtEcho).Exprs = append($1.(*ast.StmtEcho).Exprs, $3) + $1.(*ast.StmtEcho).SeparatorTkns = append($1.(*ast.StmtEcho).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | echo_expr { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtEcho{ + Exprs: []ast.Vertex{$1}, + } } ; @@ -3061,7 +3056,6 @@ expr_without_variable: $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '+' expr diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index b21ff7c..7986acb 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -58,7 +58,7 @@ func (lex *Lexer) setTokenPosition(token *token.Token) { } func (lex *Lexer) addSkippedToken(t *token.Token, id token.ID, ps, pe int) { - if lex.sts == 0 { + if lex.sts == -1 { lex.sts = lex.ts } diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index f90db2331179561005b52c12de75d42bed8a805e..9f779e69b85f30e18eea65d069f5eb189c65f1f8 100644 GIT binary patch delta 82 zcmZ2AP4eP2$qi3fm~;)BpR%++WnlzjCLm@8Vi2Eo`%@OSMXt)3X$m>16?(-b#R|5z Y3c7|0)m)sMa1jLqF3#HNEnaNP0O@`k+W-In delta 45 vcmcaOO>)&V$qi3f7!8`Av9v#9VFY3(AZ7+)5TAAXGZwZ*uG80fu`LDwuGA75 diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index 18874ae..b3a0015 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -26,7 +26,7 @@ func (lex *Lexer) Lex() *token.Token { tkn := lex.tokenPool.Get() - lex.sts = 0 + lex.sts = -1 lex.ste = 0 lblStart := 0 @@ -498,9 +498,13 @@ func (lex *Lexer) Lex() *token.Token { write exec; }%% + if lex.sts == -1 { + lex.sts = 0 + } + tkn.Value = lex.data[lex.ts:lex.te] tkn.ID = token.ID(tok) - tkn.SkippedString = lex.data[lex.sts:lex.ste] + tkn.Skipped = lex.data[lex.sts:lex.ste] lex.addSkippedToken(tkn, tok, lex.ts, lex.te); return tkn diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 1aa3120..16aa214 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -368,7 +368,10 @@ func (n *StmtDo) Accept(v NodeVisitor) { // StmtEcho node type StmtEcho struct { Node - Exprs []Vertex + EchoTkn *token.Token + Exprs []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtEcho) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index c0f9ef5..ef9f1b3 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -194,3 +194,9 @@ func (v *FilterTokens) StmtStatic(n *ast.StmtStatic) { func (v *FilterTokens) StmtStaticVar(n *ast.StmtStaticVar) { n.EqualTkn = nil } + +func (v *FilterTokens) StmtEcho(n *ast.StmtEcho) { + n.EchoTkn = nil + n.SeparatorTkns = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index e7da279..20df694 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1,6 +1,7 @@ package printer import ( + "bytes" "io" "strings" @@ -16,9 +17,10 @@ const ( ) type Printer struct { - w io.Writer - s printerState - bufStart string + w io.Writer + s printerState + bufStart string + lastWrite []byte } // NewPrinter - Constructor for Printer @@ -32,12 +34,17 @@ func (p *Printer) SetState(s printerState) { p.s = s } +func (p *Printer) write(b []byte) { + p.lastWrite = b + p.w.Write(b) +} + func (p *Printer) Print(n ast.Vertex) { _, isRoot := n.(*ast.Root) _, isInlineHtml := n.(*ast.StmtInlineHtml) if p.s == HtmlState && !isInlineHtml && !isRoot { if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " 0 { - io.WriteString(p.w, glue) + p.write([]byte(glue)) } p.Print(n) @@ -97,28 +104,28 @@ func (p *Printer) printFreeFloatingOrDefault(n ast.Vertex, pos token.Position, d } if len(n.GetNode().Tokens[pos]) == 0 { - io.WriteString(p.w, def) + p.write([]byte(def)) return } for _, m := range n.GetNode().Tokens[pos] { - io.WriteString(p.w, string(m.Value)) + p.write(m.Value) } } func (p *Printer) printToken(t *token.Token, def string) { if t != nil { - p.w.Write(t.Skipped) - p.w.Write(t.Value) + p.write(t.Skipped) + p.write(t.Value) p.bufStart = "" return } if def != "" { - p.w.Write([]byte(p.bufStart)) + p.write([]byte(p.bufStart)) p.bufStart = "" - p.w.Write([]byte(def)) + p.write([]byte(def)) return } } @@ -129,7 +136,7 @@ func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { } for _, m := range n.GetNode().Tokens[pos] { - io.WriteString(p.w, string(m.Value)) + p.write(m.Value) } } @@ -503,7 +510,7 @@ func (p *Printer) printNodeIdentifier(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -512,7 +519,7 @@ func (p *Printer) printNodeReference(n ast.Vertex) { nn := n.(*ast.Reference) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "&") + p.write([]byte("&")) p.Print(nn.Var) p.printFreeFloating(nn, token.End) @@ -522,7 +529,7 @@ func (p *Printer) printNodeVariadic(n ast.Vertex) { nn := n.(*ast.Variadic) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "...") + p.write([]byte("...")) p.Print(nn.Var) p.printFreeFloating(nn, token.End) @@ -539,7 +546,7 @@ func (p *Printer) printNodeParameter(n ast.Vertex) { p.Print(nn.Var) if nn.DefaultValue != nil { - io.WriteString(p.w, "=") + p.write([]byte("=")) p.Print(nn.DefaultValue) } @@ -550,7 +557,7 @@ func (p *Printer) printNodeNullable(n ast.Vertex) { nn := n.(*ast.Nullable) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "?") + p.write([]byte("?")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -561,12 +568,12 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { p.printFreeFloating(nn, token.Start) if nn.IsReference { - io.WriteString(p.w, "&") + p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) if nn.Variadic { - io.WriteString(p.w, "...") + p.write([]byte("...")) } p.Print(nn.Expr) @@ -615,7 +622,7 @@ func (p *Printer) printScalarLNumber(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -625,7 +632,7 @@ func (p *Printer) printScalarDNumber(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -635,7 +642,7 @@ func (p *Printer) printScalarString(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -645,7 +652,7 @@ func (p *Printer) printScalarEncapsedStringPart(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -655,7 +662,7 @@ func (p *Printer) printScalarEncapsed(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, "\"") + p.write([]byte("\"")) for _, part := range nn.Parts { switch part.(type) { case *ast.ExprArrayDimFetch: @@ -676,7 +683,7 @@ func (p *Printer) printScalarEncapsed(n ast.Vertex) { p.Print(part) } } - io.WriteString(p.w, "\"") + p.write([]byte("\"")) p.printFreeFloating(nn, token.End) } @@ -686,7 +693,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Label)) + p.write(nn.Label) for _, part := range nn.Parts { switch part.(type) { @@ -709,7 +716,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) { } } - io.WriteString(p.w, strings.Trim(string(nn.Label), "<\"'\n")) + p.write([]byte(strings.Trim(string(nn.Label), "<\"'\n"))) p.printFreeFloating(nn, token.End) } @@ -719,7 +726,7 @@ func (p *Printer) printScalarMagicConstant(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -731,7 +738,7 @@ func (p *Printer) printAssign(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "=") + p.write([]byte("=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -742,9 +749,9 @@ func (p *Printer) printAssignReference(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "=") + p.write([]byte("=")) p.printFreeFloating(nn, token.Equal) - io.WriteString(p.w, "&") + p.write([]byte("&")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -755,8 +762,8 @@ func (p *Printer) printAssignBitwiseAnd(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "&") - io.WriteString(p.w, "=") + p.write([]byte("&")) + p.write([]byte("=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -767,7 +774,7 @@ func (p *Printer) printAssignBitwiseOr(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "|=") + p.write([]byte("|=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -778,7 +785,7 @@ func (p *Printer) printAssignBitwiseXor(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "^=") + p.write([]byte("^=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -789,7 +796,7 @@ func (p *Printer) printAssignCoalesce(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "??=") + p.write([]byte("??=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -800,7 +807,7 @@ func (p *Printer) printAssignConcat(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, ".=") + p.write([]byte(".=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -811,7 +818,7 @@ func (p *Printer) printAssignDiv(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "/=") + p.write([]byte("/=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -822,7 +829,7 @@ func (p *Printer) printAssignMinus(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "-=") + p.write([]byte("-=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -833,7 +840,7 @@ func (p *Printer) printAssignMod(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "%=") + p.write([]byte("%=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -844,7 +851,7 @@ func (p *Printer) printAssignMul(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "*=") + p.write([]byte("*=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -855,7 +862,7 @@ func (p *Printer) printAssignPlus(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "+=") + p.write([]byte("+=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -866,7 +873,7 @@ func (p *Printer) printAssignPow(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "**=") + p.write([]byte("**=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -877,7 +884,7 @@ func (p *Printer) printAssignShiftLeft(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "<<=") + p.write([]byte("<<=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -888,7 +895,7 @@ func (p *Printer) printAssignShiftRight(n ast.Vertex) { p.printFreeFloating(nn, token.Start) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, ">>=") + p.write([]byte(">>=")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -902,7 +909,7 @@ func (p *Printer) printBinaryBitwiseAnd(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "&") + p.write([]byte("&")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -914,7 +921,7 @@ func (p *Printer) printBinaryBitwiseOr(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "|") + p.write([]byte("|")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -926,7 +933,7 @@ func (p *Printer) printBinaryBitwiseXor(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "^") + p.write([]byte("^")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -938,7 +945,7 @@ func (p *Printer) printBinaryBooleanAnd(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "&&") + p.write([]byte("&&")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -950,7 +957,7 @@ func (p *Printer) printBinaryBooleanOr(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "||") + p.write([]byte("||")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -962,7 +969,7 @@ func (p *Printer) printBinaryCoalesce(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "??") + p.write([]byte("??")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -974,7 +981,7 @@ func (p *Printer) printBinaryConcat(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ".") + p.write([]byte(".")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -986,7 +993,7 @@ func (p *Printer) printBinaryDiv(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "/") + p.write([]byte("/")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -998,7 +1005,7 @@ func (p *Printer) printBinaryEqual(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "==") + p.write([]byte("==")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1010,7 +1017,7 @@ func (p *Printer) printBinaryGreaterOrEqual(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ">=") + p.write([]byte(">=")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1022,7 +1029,7 @@ func (p *Printer) printBinaryGreater(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ">") + p.write([]byte(">")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1034,7 +1041,7 @@ func (p *Printer) printBinaryIdentical(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "===") + p.write([]byte("===")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1047,11 +1054,11 @@ func (p *Printer) printBinaryLogicalAnd(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "and") + p.write([]byte("and")) if nn.Right.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Right) @@ -1065,11 +1072,11 @@ func (p *Printer) printBinaryLogicalOr(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "or") + p.write([]byte("or")) if nn.Right.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Right) @@ -1083,11 +1090,11 @@ func (p *Printer) printBinaryLogicalXor(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "xor") + p.write([]byte("xor")) if nn.Right.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Right) @@ -1100,7 +1107,7 @@ func (p *Printer) printBinaryMinus(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "-") + p.write([]byte("-")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1112,7 +1119,7 @@ func (p *Printer) printBinaryMod(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "%") + p.write([]byte("%")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1124,7 +1131,7 @@ func (p *Printer) printBinaryMul(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "*") + p.write([]byte("*")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1138,7 +1145,7 @@ func (p *Printer) printBinaryNotEqual(n ast.Vertex) { p.printFreeFloating(nn, token.Expr) p.printFreeFloating(nn, token.Equal) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "!=") + p.write([]byte("!=")) } p.Print(nn.Right) @@ -1151,7 +1158,7 @@ func (p *Printer) printBinaryNotIdentical(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "!==") + p.write([]byte("!==")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1163,7 +1170,7 @@ func (p *Printer) printBinaryPlus(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "+") + p.write([]byte("+")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1175,7 +1182,7 @@ func (p *Printer) printBinaryPow(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "**") + p.write([]byte("**")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1187,7 +1194,7 @@ func (p *Printer) printBinaryShiftLeft(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "<<") + p.write([]byte("<<")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1199,7 +1206,7 @@ func (p *Printer) printBinaryShiftRight(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ">>") + p.write([]byte(">>")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1211,7 +1218,7 @@ func (p *Printer) printBinarySmallerOrEqual(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "<=") + p.write([]byte("<=")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1223,7 +1230,7 @@ func (p *Printer) printBinarySmaller(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "<") + p.write([]byte("<")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1235,7 +1242,7 @@ func (p *Printer) printBinarySpaceship(n ast.Vertex) { p.Print(nn.Left) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "<=>") + p.write([]byte("<=>")) p.Print(nn.Right) p.printFreeFloating(nn, token.End) @@ -1249,7 +1256,7 @@ func (p *Printer) printArray(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(array)") + p.write([]byte("(array)")) } p.Print(nn.Expr) @@ -1262,7 +1269,7 @@ func (p *Printer) printBool(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(boolean)") + p.write([]byte("(boolean)")) } p.Print(nn.Expr) @@ -1275,7 +1282,7 @@ func (p *Printer) printDouble(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(float)") + p.write([]byte("(float)")) } p.Print(nn.Expr) @@ -1288,7 +1295,7 @@ func (p *Printer) printInt(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(integer)") + p.write([]byte("(integer)")) } p.Print(nn.Expr) @@ -1301,7 +1308,7 @@ func (p *Printer) printObject(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(object)") + p.write([]byte("(object)")) } p.Print(nn.Expr) @@ -1314,7 +1321,7 @@ func (p *Printer) printString(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(string)") + p.write([]byte("(string)")) } p.Print(nn.Expr) @@ -1327,7 +1334,7 @@ func (p *Printer) printUnset(n ast.Vertex) { p.printFreeFloating(nn, token.Cast) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "(unset)") + p.write([]byte("(unset)")) } p.Print(nn.Expr) @@ -1342,12 +1349,12 @@ func (p *Printer) printExprArrayDimFetch(n ast.Vertex) { p.Print(nn.Var) p.printFreeFloating(nn, token.Var) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "[") + p.write([]byte("[")) } p.Print(nn.Dim) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "]") + p.write([]byte("]")) } p.printFreeFloating(nn, token.End) } @@ -1358,12 +1365,12 @@ func (p *Printer) printExprArrayDimFetchWithoutLeadingDollar(n ast.Vertex) { p.printExprVariableWithoutLeadingDollar(nn.Var) p.printFreeFloating(nn, token.Var) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "[") + p.write([]byte("[")) } p.Print(nn.Dim) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "]") + p.write([]byte("]")) } p.printFreeFloating(nn, token.End) } @@ -1373,13 +1380,13 @@ func (p *Printer) printExprArrayItem(n ast.Vertex) { p.printFreeFloating(nn, token.Start) if nn.Unpack { - io.WriteString(p.w, "...") + p.write([]byte("...")) } if nn.Key != nil { p.Print(nn.Key) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "=>") + p.write([]byte("=>")) } p.Print(nn.Val) @@ -1390,12 +1397,12 @@ func (p *Printer) printExprArrayItem(n ast.Vertex) { func (p *Printer) printExprArray(n ast.Vertex) { nn := n.(*ast.ExprArray) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "array") + p.write([]byte("array")) p.printFreeFloating(nn, token.Array) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Items) p.printFreeFloating(nn, token.ArrayPairList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.End) } @@ -1405,25 +1412,25 @@ func (p *Printer) printExprArrowFunction(n ast.Vertex) { p.printFreeFloating(nn, token.Start) if nn.Static { - io.WriteString(p.w, "static") + p.write([]byte("static")) } p.printFreeFloating(nn, token.Static) if nn.Static && n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "fn") + p.write([]byte("fn")) p.printFreeFloating(nn, token.Function) if nn.ReturnsRef { - io.WriteString(p.w, "&") + p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Params) p.printFreeFloating(nn, token.ParameterList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { @@ -1432,9 +1439,9 @@ func (p *Printer) printExprArrowFunction(n ast.Vertex) { } p.printFreeFloating(nn, token.ReturnType) - io.WriteString(p.w, "=>") + p.write([]byte("=>")) - p.printNode(nn.Expr) + p.Print(nn.Expr) p.printFreeFloating(nn, token.End) } @@ -1442,7 +1449,7 @@ func (p *Printer) printExprArrowFunction(n ast.Vertex) { func (p *Printer) printExprBitwiseNot(n ast.Vertex) { nn := n.(*ast.ExprBitwiseNot) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "~") + p.write([]byte("~")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) } @@ -1450,7 +1457,7 @@ func (p *Printer) printExprBitwiseNot(n ast.Vertex) { func (p *Printer) printExprBooleanNot(n ast.Vertex) { nn := n.(*ast.ExprBooleanNot) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "!") + p.write([]byte("!")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) } @@ -1461,7 +1468,7 @@ func (p *Printer) printExprClassConstFetch(n ast.Vertex) { p.Print(nn.Class) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "::") + p.write([]byte("::")) p.Print(nn.ConstantName) p.printFreeFloating(nn, token.End) @@ -1470,9 +1477,9 @@ func (p *Printer) printExprClassConstFetch(n ast.Vertex) { func (p *Printer) printExprClone(n ast.Vertex) { nn := n.(*ast.ExprClone) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "clone") + p.write([]byte("clone")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1481,12 +1488,12 @@ func (p *Printer) printExprClone(n ast.Vertex) { func (p *Printer) printExprClosureUse(n ast.Vertex) { nn := n.(*ast.ExprClosureUse) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "use") + p.write([]byte("use")) p.printFreeFloating(nn, token.Use) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Uses) p.printFreeFloating(nn, token.LexicalVarList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.End) } @@ -1496,25 +1503,25 @@ func (p *Printer) printExprClosure(n ast.Vertex) { p.printFreeFloating(nn, token.Start) if nn.Static { - io.WriteString(p.w, "static") + p.write([]byte("static")) } p.printFreeFloating(nn, token.Static) if nn.Static && n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "function") + p.write([]byte("function")) p.printFreeFloating(nn, token.Function) if nn.ReturnsRef { - io.WriteString(p.w, "&") + p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Params) p.printFreeFloating(nn, token.ParameterList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Params) if nn.ClosureUse != nil { @@ -1528,10 +1535,10 @@ func (p *Printer) printExprClosure(n ast.Vertex) { } p.printFreeFloating(nn, token.ReturnType) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -1546,16 +1553,16 @@ func (p *Printer) printExprConstFetch(n ast.Vertex) { func (p *Printer) printExprEmpty(n ast.Vertex) { nn := n.(*ast.ExprEmpty) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "empty") + p.write([]byte("empty")) if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") + p.write([]byte("(")) } p.Print(nn.Expr) if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") + p.write([]byte(")")) } p.printFreeFloating(nn, token.End) @@ -1564,7 +1571,7 @@ func (p *Printer) printExprEmpty(n ast.Vertex) { func (p *Printer) printExprErrorSuppress(n ast.Vertex) { nn := n.(*ast.ExprErrorSuppress) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "@") + p.write([]byte("@")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1574,16 +1581,16 @@ func (p *Printer) printExprEval(n ast.Vertex) { nn := n.(*ast.ExprEval) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "eval") + p.write([]byte("eval")) if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, "(") + p.write([]byte("(")) } p.Print(nn.Expr) if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - io.WriteString(p.w, ")") + p.write([]byte(")")) } p.printFreeFloating(nn, token.End) @@ -1594,13 +1601,13 @@ func (p *Printer) printExprExit(n ast.Vertex) { p.printFreeFloating(nn, token.Start) if nn.Die { - io.WriteString(p.w, "die") + p.write([]byte("die")) } else { - io.WriteString(p.w, "exit") + p.write([]byte("exit")) } if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() && nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) @@ -1624,9 +1631,9 @@ func (p *Printer) printExprFunctionCall(n ast.Vertex) { func (p *Printer) printExprInclude(n ast.Vertex) { nn := n.(*ast.ExprInclude) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "include") + p.write([]byte("include")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1635,9 +1642,9 @@ func (p *Printer) printExprInclude(n ast.Vertex) { func (p *Printer) printExprIncludeOnce(n ast.Vertex) { nn := n.(*ast.ExprIncludeOnce) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "include_once") + p.write([]byte("include_once")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1650,10 +1657,10 @@ func (p *Printer) printExprInstanceOf(n ast.Vertex) { p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "instanceof") + p.write([]byte("instanceof")) p.bufStart = " " p.Print(nn.Class) @@ -1665,12 +1672,12 @@ func (p *Printer) printExprIsset(n ast.Vertex) { nn := n.(*ast.ExprIsset) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "isset") + p.write([]byte("isset")) p.printFreeFloating(nn, token.Isset) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Vars) p.printFreeFloating(nn, token.VarList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.End) } @@ -1679,12 +1686,12 @@ func (p *Printer) printExprList(n ast.Vertex) { nn := n.(*ast.ExprList) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "list") + p.write([]byte("list")) p.printFreeFloating(nn, token.List) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Items) p.printFreeFloating(nn, token.ArrayPairList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.End) } @@ -1695,7 +1702,7 @@ func (p *Printer) printExprMethodCall(n ast.Vertex) { p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "->") + p.write([]byte("->")) p.Print(nn.Method) p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") @@ -1709,7 +1716,7 @@ func (p *Printer) printExprNew(n ast.Vertex) { nn := n.(*ast.ExprNew) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "new") + p.write([]byte("new")) p.bufStart = " " p.Print(nn.Class) @@ -1728,7 +1735,7 @@ func (p *Printer) printExprPostDec(n ast.Vertex) { p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "--") + p.write([]byte("--")) p.printFreeFloating(nn, token.End) } @@ -1739,7 +1746,7 @@ func (p *Printer) printExprPostInc(n ast.Vertex) { p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "++") + p.write([]byte("++")) p.printFreeFloating(nn, token.End) } @@ -1748,7 +1755,7 @@ func (p *Printer) printExprPreDec(n ast.Vertex) { nn := n.(*ast.ExprPreDec) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "--") + p.write([]byte("--")) p.Print(nn.Var) p.printFreeFloating(nn, token.End) @@ -1758,7 +1765,7 @@ func (p *Printer) printExprPreInc(n ast.Vertex) { nn := n.(*ast.ExprPreInc) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "++") + p.write([]byte("++")) p.Print(nn.Var) p.printFreeFloating(nn, token.End) @@ -1768,9 +1775,9 @@ func (p *Printer) printExprPrint(n ast.Vertex) { nn := n.(*ast.ExprPrint) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "print") + p.write([]byte("print")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) @@ -1783,7 +1790,7 @@ func (p *Printer) printExprPropertyFetch(n ast.Vertex) { p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "->") + p.write([]byte("->")) p.Print(nn.Property) p.printFreeFloating(nn, token.End) @@ -1793,7 +1800,7 @@ func (p *Printer) printExprReference(n ast.Vertex) { nn := n.(*ast.ExprReference) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "&") + p.write([]byte("&")) p.Print(nn.Var) p.printFreeFloating(nn, token.End) @@ -1803,9 +1810,9 @@ func (p *Printer) printExprRequire(n ast.Vertex) { nn := n.(*ast.ExprRequire) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "require") + p.write([]byte("require")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) @@ -1816,9 +1823,9 @@ func (p *Printer) printExprRequireOnce(n ast.Vertex) { nn := n.(*ast.ExprRequireOnce) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "require_once") + p.write([]byte("require_once")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) @@ -1829,9 +1836,9 @@ func (p *Printer) printExprShellExec(n ast.Vertex) { nn := n.(*ast.ExprShellExec) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "`") + p.write([]byte("`")) p.joinPrint("", nn.Parts) - io.WriteString(p.w, "`") + p.write([]byte("`")) p.printFreeFloating(nn, token.End) } @@ -1840,10 +1847,10 @@ func (p *Printer) printExprShortArray(n ast.Vertex) { nn := n.(*ast.ExprShortArray) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "[") + p.write([]byte("[")) p.joinPrint(",", nn.Items) p.printFreeFloating(nn, token.ArrayPairList) - io.WriteString(p.w, "]") + p.write([]byte("]")) p.printFreeFloating(nn, token.End) } @@ -1852,10 +1859,10 @@ func (p *Printer) printExprShortList(n ast.Vertex) { nn := n.(*ast.ExprShortList) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "[") + p.write([]byte("[")) p.joinPrint(",", nn.Items) p.printFreeFloating(nn, token.ArrayPairList) - io.WriteString(p.w, "]") + p.write([]byte("]")) p.printFreeFloating(nn, token.End) } @@ -1866,7 +1873,7 @@ func (p *Printer) printExprStaticCall(n ast.Vertex) { p.Print(nn.Class) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "::") + p.write([]byte("::")) p.Print(nn.Call) p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") @@ -1882,7 +1889,7 @@ func (p *Printer) printExprStaticPropertyFetch(n ast.Vertex) { p.Print(nn.Class) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "::") + p.write([]byte("::")) p.Print(nn.Property) p.printFreeFloating(nn, token.End) @@ -1894,14 +1901,14 @@ func (p *Printer) printExprTernary(n ast.Vertex) { p.Print(nn.Condition) p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, "?") + p.write([]byte("?")) if nn.IfTrue != nil { p.Print(nn.IfTrue) } p.printFreeFloating(nn, token.True) - io.WriteString(p.w, ":") + p.write([]byte(":")) p.Print(nn.IfFalse) p.printFreeFloating(nn, token.End) @@ -1911,7 +1918,7 @@ func (p *Printer) printExprUnaryMinus(n ast.Vertex) { nn := n.(*ast.ExprUnaryMinus) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "-") + p.write([]byte("-")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1921,7 +1928,7 @@ func (p *Printer) printExprUnaryPlus(n ast.Vertex) { nn := n.(*ast.ExprUnaryPlus) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "+") + p.write([]byte("+")) p.Print(nn.Expr) p.printFreeFloating(nn, token.End) @@ -1933,7 +1940,7 @@ func (p *Printer) printExprVariable(n ast.Vertex) { p.bufStart = "" if _, ok := nn.VarName.(*ast.Identifier); !ok { - io.WriteString(p.w, "$") + p.write([]byte("$")) } p.Print(nn.VarName) @@ -1954,9 +1961,9 @@ func (p *Printer) printExprYieldFrom(n ast.Vertex) { nn := n.(*ast.ExprYieldFrom) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "yield from") + p.write([]byte("yield from")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) @@ -1967,18 +1974,18 @@ func (p *Printer) printExprYield(n ast.Vertex) { nn := n.(*ast.ExprYield) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "yield") + p.write([]byte("yield")) if nn.Key != nil { if nn.Key.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Key) p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, "=>") + p.write([]byte("=>")) } else { if nn.Value.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } @@ -1993,45 +2000,45 @@ func (p *Printer) printStmtAltForeach(n ast.Vertex) { nn := n.(*ast.StmtAltForeach) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "foreach") + p.write([]byte("foreach")) p.printFreeFloating(nn, token.Foreach) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "as") + p.write([]byte("as")) if nn.Key != nil { if nn.Key.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Key) p.printFreeFloating(nn, token.Key) - io.WriteString(p.w, "=>") + p.write([]byte("=>")) } else { if nn.Var.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") + p.write([]byte(":")) s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "endforeach") + p.write([]byte("endforeach")) p.printFreeFloating(nn, token.AltEnd) p.printFreeFloating(nn, token.SemiColon) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2060,20 +2067,20 @@ func (p *Printer) printStmtCatch(n ast.Vertex) { nn := n.(*ast.StmtCatch) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "catch") + p.write([]byte("catch")) p.printFreeFloating(nn, token.Catch) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrintRefactored("|", nn.Types) p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2085,37 +2092,37 @@ func (p *Printer) printStmtClassMethod(n ast.Vertex) { if nn.Modifiers != nil { for k, m := range nn.Modifiers { if k > 0 && m.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(m) } if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.printFreeFloating(nn, token.ModifierList) - io.WriteString(p.w, "function") + p.write([]byte("function")) p.printFreeFloating(nn, token.Function) if nn.ReturnsRef { if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "&") + p.write([]byte("&")) p.printFreeFloating(nn, token.Ampersand) } else { if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.Print(nn.MethodName) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Params) p.printFreeFloating(nn, token.ParameterList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { @@ -2136,17 +2143,17 @@ func (p *Printer) printStmtClass(n ast.Vertex) { if nn.Modifiers != nil { for k, m := range nn.Modifiers { if k > 0 && m.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(m) } if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.printFreeFloating(nn, token.ModifierList) - io.WriteString(p.w, "class") + p.write([]byte("class")) if nn.ClassName != nil { p.bufStart = " " @@ -2162,9 +2169,9 @@ func (p *Printer) printStmtClass(n ast.Vertex) { if nn.Extends != nil { p.printFreeFloating(nn.Extends, token.Start) if nn.Extends.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "extends") + p.write([]byte("extends")) p.bufStart = " " p.Print(nn.Extends.ClassName) } @@ -2172,19 +2179,19 @@ func (p *Printer) printStmtClass(n ast.Vertex) { if nn.Implements != nil { p.printFreeFloating(nn.Implements, token.Start) if nn.Implements.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "implements") + p.write([]byte("implements")) p.bufStart = " " p.joinPrintRefactored(",", nn.Implements.InterfaceNames) } p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2227,27 +2234,27 @@ func (p *Printer) printStmtDeclare(n ast.Vertex) { nn := n.(*ast.StmtDeclare) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "declare") + p.write([]byte("declare")) p.printFreeFloating(nn, token.Declare) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrintRefactored(",", nn.Consts) p.printFreeFloating(nn, token.ConstList) - io.WriteString(p.w, ")") + p.write([]byte(")")) if nn.Alt { p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") + p.write([]byte(":")) s := nn.Stmt.(*ast.StmtStmtList) p.printNodes(s.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "enddeclare") + p.write([]byte("enddeclare")) p.printFreeFloating(nn, token.AltEnd) p.printFreeFloating(nn, token.SemiColon) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } } else { p.Print(nn.Stmt) @@ -2275,28 +2282,11 @@ func (p *Printer) printStmtDo(n *ast.StmtDo) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtEcho(n ast.Vertex) { - nn := n.(*ast.StmtEcho) - - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "echo") - } - if nn.Exprs[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - - p.printFreeFloating(nn, token.Start) - p.printFreeFloating(nn, token.Echo) - - p.joinPrint(",", nn.Exprs) - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtEcho(n *ast.StmtEcho) { + p.printToken(n.EchoTkn, "echo") + p.bufStart = " " + p.printSeparatedList(n.Exprs, n.SeparatorTkns, ",") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtElseif(n *ast.StmtElseIf) { @@ -2358,7 +2348,7 @@ func (p *Printer) printStmtExpression(n ast.Vertex) { p.printFreeFloating(nn, token.SemiColon) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2368,12 +2358,12 @@ func (p *Printer) printStmtFinally(n ast.Vertex) { nn := n.(*ast.StmtFinally) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "finally") + p.write([]byte("finally")) p.printFreeFloating(nn, token.Finally) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2410,7 +2400,7 @@ func (p *Printer) printStmtAltFor(n *ast.StmtFor) { if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { p.printNodes(stmtList.Stmts) } else { - p.printNode(n.Stmt) + p.Print(n.Stmt) } p.printToken(n.EndForTkn, "endfor") @@ -2421,34 +2411,34 @@ func (p *Printer) printStmtForeach(n ast.Vertex) { nn := n.(*ast.StmtForeach) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "foreach") + p.write([]byte("foreach")) p.printFreeFloating(nn, token.Foreach) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "as") + p.write([]byte("as")) if nn.Key != nil { if nn.Key.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Key) p.printFreeFloating(nn, token.Key) - io.WriteString(p.w, "=>") + p.write([]byte("=>")) } else { if nn.Var.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.Print(nn.Var) p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.Print(nn.Stmt) @@ -2459,27 +2449,27 @@ func (p *Printer) printStmtFunction(n ast.Vertex) { nn := n.(*ast.StmtFunction) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "function") + p.write([]byte("function")) p.printFreeFloating(nn, token.Function) if nn.ReturnsRef { if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "&") + p.write([]byte("&")) } else { if nn.FunctionName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } } p.Print(nn.FunctionName) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Params) p.printFreeFloating(nn, token.ParamList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.Params) if nn.ReturnType != nil { @@ -2488,10 +2478,10 @@ func (p *Printer) printStmtFunction(n ast.Vertex) { } p.printFreeFloating(nn, token.ReturnType) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2507,16 +2497,16 @@ func (p *Printer) printStmtGoto(n ast.Vertex) { nn := n.(*ast.StmtGoto) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "goto") + p.write([]byte("goto")) if nn.Label.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Label) p.printFreeFloating(nn, token.Label) p.printFreeFloating(nn, token.SemiColon) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2569,12 +2559,12 @@ func (p *Printer) printStmtInlineHTML(n ast.Vertex) { nn := n.(*ast.StmtInlineHtml) p.printFreeFloating(nn, token.Start) - if p.s == PhpState && nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, "?>") + if p.s == PhpState && !bytes.Contains(p.lastWrite, []byte("?>")) { + p.write([]byte("?>")) } p.SetState(HtmlState) - io.WriteString(p.w, string(nn.Value)) + p.write(nn.Value) p.printFreeFloating(nn, token.End) } @@ -2583,10 +2573,10 @@ func (p *Printer) printStmtInterface(n ast.Vertex) { nn := n.(*ast.StmtInterface) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "interface") + p.write([]byte("interface")) if nn.InterfaceName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.InterfaceName) @@ -2594,18 +2584,18 @@ func (p *Printer) printStmtInterface(n ast.Vertex) { if nn.Extends != nil { p.printFreeFloating(nn.Extends, token.Start) if nn.Extends.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "extends") + p.write([]byte("extends")) p.bufStart = " " p.joinPrintRefactored(",", nn.Extends.InterfaceNames) } p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2617,7 +2607,7 @@ func (p *Printer) printStmtLabel(n ast.Vertex) { p.Print(nn.LabelName) p.printFreeFloating(nn, token.Label) - io.WriteString(p.w, ":") + p.write([]byte(":")) p.printFreeFloating(nn, token.End) } @@ -2650,7 +2640,7 @@ func (p *Printer) printStmtNop(n ast.Vertex) { p.printFreeFloatingOrDefault(n, token.Start, p.bufStart) p.printFreeFloating(n, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(n, token.End) } @@ -2661,7 +2651,7 @@ func (p *Printer) printStmtPropertyList(n ast.Vertex) { for k, m := range nn.Modifiers { if k > 0 && m.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(m) } @@ -2672,7 +2662,7 @@ func (p *Printer) printStmtPropertyList(n ast.Vertex) { } if nn.Properties[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.joinPrint(",", nn.Properties) @@ -2680,7 +2670,7 @@ func (p *Printer) printStmtPropertyList(n ast.Vertex) { p.printFreeFloating(n, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2694,7 +2684,7 @@ func (p *Printer) printStmtProperty(n ast.Vertex) { if nn.Expr != nil { p.printFreeFloating(nn, token.Var) - io.WriteString(p.w, "=") + p.write([]byte("=")) p.Print(nn.Expr) } @@ -2766,16 +2756,16 @@ func (p *Printer) printStmtThrow(n ast.Vertex) { nn := n.(*ast.StmtThrow) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "throw") + p.write([]byte("throw")) if nn.Expr.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Expr) p.printFreeFloating(nn, token.Expr) p.printFreeFloating(nn, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2785,10 +2775,10 @@ func (p *Printer) printStmtTraitAdaptationList(n ast.Vertex) { nn := n.(*ast.StmtTraitAdaptationList) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Adaptations) p.printFreeFloating(nn, token.AdaptationList) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2800,7 +2790,7 @@ func (p *Printer) printStmtTraitMethodRef(n ast.Vertex) { if nn.Trait != nil { p.Print(nn.Trait) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "::") + p.write([]byte("::")) } p.Print(nn.Method) @@ -2816,20 +2806,20 @@ func (p *Printer) printStmtTraitUseAlias(n ast.Vertex) { p.printFreeFloating(nn, token.Ref) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "as") + p.write([]byte("as")) if nn.Modifier != nil { if nn.Modifier.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Modifier) } if nn.Alias != nil { if nn.Alias.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.Alias) } @@ -2837,7 +2827,7 @@ func (p *Printer) printStmtTraitUseAlias(n ast.Vertex) { p.printFreeFloating(nn, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2850,17 +2840,17 @@ func (p *Printer) printStmtTraitUsePrecedence(n ast.Vertex) { p.Print(nn.Ref) p.printFreeFloating(nn, token.Ref) if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } - io.WriteString(p.w, "insteadof") + p.write([]byte("insteadof")) p.bufStart = " " p.joinPrint(",", nn.Insteadof) p.printFreeFloating(nn, token.NameList) p.printFreeFloating(nn, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -2870,7 +2860,7 @@ func (p *Printer) printStmtTraitUse(n ast.Vertex) { nn := n.(*ast.StmtTraitUse) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "use") + p.write([]byte("use")) p.bufStart = " " p.joinPrintRefactored(",", nn.Traits) @@ -2883,17 +2873,17 @@ func (p *Printer) printStmtTrait(n ast.Vertex) { nn := n.(*ast.StmtTrait) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "trait") + p.write([]byte("trait")) if nn.TraitName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") + p.write([]byte(" ")) } p.Print(nn.TraitName) p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) p.printFreeFloating(nn, token.End) } @@ -2902,12 +2892,12 @@ func (p *Printer) printStmtTry(n ast.Vertex) { nn := n.(*ast.StmtTry) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "try") + p.write([]byte("try")) p.printFreeFloating(nn, token.Try) - io.WriteString(p.w, "{") + p.write([]byte("{")) p.printNodes(nn.Stmts) p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") + p.write([]byte("}")) if nn.Catches != nil { p.printNodes(nn.Catches) @@ -2924,17 +2914,17 @@ func (p *Printer) printStmtUnset(n ast.Vertex) { nn := n.(*ast.StmtUnset) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "unset") + p.write([]byte("unset")) p.printFreeFloating(nn, token.Unset) - io.WriteString(p.w, "(") + p.write([]byte("(")) p.joinPrint(",", nn.Vars) p.printFreeFloating(nn, token.VarList) - io.WriteString(p.w, ")") + p.write([]byte(")")) p.printFreeFloating(nn, token.CloseParenthesisToken) p.printFreeFloating(nn, token.SemiColon) if n.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") + p.write([]byte(";")) } p.printFreeFloating(nn, token.End) @@ -3033,7 +3023,7 @@ func (p *Printer) printParserAs(n ast.Vertex) { nn := n.(*ast.ParserAs) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "as") + p.write([]byte("as")) p.Print(nn.Child) p.printFreeFloating(nn, token.End) @@ -3043,7 +3033,7 @@ func (p *Printer) printParserNsSeparator(n ast.Vertex) { nn := n.(*ast.ParserNsSeparator) p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "\\") + p.write([]byte("\\")) p.Print(nn.Child) p.printFreeFloating(nn, token.End) diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 8a2ee8d..75dfafa 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -45,7 +45,6 @@ func TestParseAndPrintPhp5Root(t *testing.T) { } func TestParseAndPrintPhp5Identifier(t *testing.T) { - // TODO: remove ; after HTML")}, - &ast.StmtExpression{ - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Tokens: token.Collection{ - token.Start: []*token.Token{ - { - ID: token.ID('$'), - Value: []byte("$"), - }, - }, - }, - }, - VarName: &ast.Identifier{ - Value: []byte("a"), + &ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ScalarString{ + Value: []byte(`"a"`), }, }, }, &ast.StmtInlineHtml{Value: []byte("

")}, - &ast.StmtExpression{ - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Tokens: token.Collection{ - token.Start: []*token.Token{ - { - ID: token.ID('$'), - Value: []byte("$"), - }, - }, - }, - }, - VarName: &ast.Identifier{ - Value: []byte("a"), + &ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ScalarString{ + Value: []byte(`"b"`), }, }, }, }, }) - expected := `
HTML
HTML
HTML
HTML
Date: Mon, 14 Sep 2020 16:36:01 +0300 Subject: [PATCH 060/140] [refactoring] update ast structure of "InlinHtml" node --- internal/php5/php5.go | Bin 291345 -> 291269 bytes internal/php5/php5.y | 14 +++++++------- internal/php7/php7.go | Bin 243865 -> 243789 bytes internal/php7/php7.y | 14 +++++++------- pkg/ast/node.go | 3 ++- pkg/ast/visitor/filter_tokens.go | 4 ++++ pkg/printer/printer.go | 9 ++------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 5392ff0446928a6a8795c72598e5956f085ce441..e87357e92158cf68c2af31449675a699e984a979 100644 GIT binary patch delta 88 zcmbREMDXZi!G")) { p.write([]byte("?>")) } p.SetState(HtmlState) - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) + p.printToken(n.InlineHtmlTkn, string(n.Value)) } func (p *Printer) printStmtInterface(n ast.Vertex) { From 62fc16da974d43f12356ec476e67f3d6e537b096 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 14 Sep 2020 17:19:17 +0300 Subject: [PATCH 061/140] [refactoring] update ast structure of "Unset" node --- internal/php5/php5.go | Bin 291269 -> 291164 bytes internal/php5/php5.y | 30 +++++++++++++-------------- internal/php7/php7.go | Bin 243789 -> 242614 bytes internal/php7/php7.y | 34 ++++++++++++++----------------- pkg/ast/node.go | 7 ++++++- pkg/ast/visitor/filter_tokens.go | 9 ++++++++ pkg/printer/printer.go | 24 ++++++---------------- 7 files changed, 50 insertions(+), 54 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e87357e92158cf68c2af31449675a699e984a979..324e99211e77ff85fc478fa9c5a4663b0e960af2 100644 GIT binary patch delta 9678 zcmZ`<3w(`Nw*T$Dzl20Y5`@T`P$A)*oIK7!i7JswNf~9-BdJHK^$0ar>lsu>O%V=O zTb*KBqthxO)!m0j+>Tp}dbBfbsYg(4P|u-Msrz61JLe?k_WpkIop0~G*4pd6*504p zXCjZCj;#1Yi(p4+=#=M6z1?I?n80ZcHMBO5H>$vij#k>#;b3@v6f8*grJ z@xJH=jx0t1cxH}w?!GgP0B8dnY7Xz@f26YDPQyDu1OJ>3Lk$mX;Qt4%SzJ842mjGL z*l>~Qz4(vq!ES)KbG%#jcc0Co;}4h~OqxGX^)Me9{)Z4VrUHSc&?*$7_OW&VLX~pI-yO@VDhGC5zj6FNuljBW4JursJvI){NpbF;5$AQE9 z+G%QLxXm&mfz2GFCFs|icc!y&d*_{5COqEg?-H9c91If>E5L1^?^2BTlfEnLfDIrT zyNvlsO1BkOs|w?dOao$Nc`tug7Gd^x`?>ODduN^PX6WrayM%u$3%~Da8;O4C=K_lv z8Gb%M!zhT!b3Wl!m(eb7<1)-(mzbKACOpgHJG1a+tm1KbAFJtZc3NK39zs^t+%uzH z=Vru$EP~620;NJ84oDWtJNSHDEY!stre|jvQCUj2z3%WXK7XMNzt?KP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e(A;tuN$N#=8Bu;XlQ4g-9}-jZ^1@ws#E1lh`_k+TcmK}SqctLUzg zw$G*L_eWZZ(#mu?UD`RuYNF`u-4?$0n$al!>d0ZF*NwF%vn9>o)_iN4fc|(xH=%b= zu-fq{$*hGH0+2fmhkkCNHC@%9101! diff --git a/internal/php5/php5.y b/internal/php5/php5.y index fb42de1..f599ddd 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -241,7 +241,7 @@ import ( %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list echo_expr_list -%type trait_adaptations +%type trait_adaptations unset_variables %type switch_case_list %type method_body %type foreach_statement for_statement while_statement @@ -255,7 +255,7 @@ import ( %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list encaps_list isset_variables non_empty_array_pair_list %type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr -%type for_expr case_list unset_variables declare_list catch_statement additional_catches +%type for_expr case_list declare_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration %type interface_list non_empty_function_call_parameter_list trait_list trait_adaptation_list non_empty_trait_adaptation_list @@ -1084,17 +1084,13 @@ unticked_statement: } | T_UNSET '(' unset_variables ')' ';' { - $$ = &ast.StmtUnset{ast.Node{}, $3} + $3.(*ast.StmtUnset).UnsetTkn = $1 + $3.(*ast.StmtUnset).OpenParenthesisTkn = $2 + $3.(*ast.StmtUnset).CloseParenthesisTkn = $4 + $3.(*ast.StmtUnset).SemiColonTkn = $5 + $3.(*ast.StmtUnset).Node.Position = position.NewTokensPosition($1, $5) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) + $$ = $3 } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { @@ -1334,14 +1330,16 @@ additional_catch: unset_variables: unset_variable { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtUnset{ + Vars: []ast.Vertex{$1}, + } } | unset_variables ',' unset_variable { - $$ = append($1, $3) + $1.(*ast.StmtUnset).Vars = append($1.(*ast.StmtUnset).Vars, $3) + $1.(*ast.StmtUnset).SeparatorTkns = append($1.(*ast.StmtUnset).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index ab2cdc4804ea1b62e7cb13ebc9aca4774b4938bb..56d0fc96060dce48607931670beb6660c7c39032 100644 GIT binary patch delta 11882 zcmZ`uQfk_h@NB1LTxpH>1?Y@e-t-&uY)x!Cu|y~%v%%sFSyoH=vm z%stxBYR{LgYO^|Ue{@$)hjIB!Vo|5m>-WV8`H> zJ(f*~MU>Pq1_u>!B&5C|1gb^V-vD~TieoH-|NJpMSm~sM#=?qR@pt70fCd$H2xut0 zYtHU_SSolqPWaC z@!D5Ljl)Eo|M1bvqrNgTLQqb9{62`%U&^Qfd|*QT34wv%7t#{+znHGy7v44D)d?&W zBb{LU&}$VLu#8$0C$=kNZ-BMLV6{%>v+J6Dk2edb`6)@ti0Yp*N9k_ZgL@g40T{TK z`TdZO?s(Q)1uVF$*IRend6VYaP%y9eDO!$pQG2kOsl6n3zLYqJ=T+j;scI#W0CmOW8HHwAw6-- zO{?mUZ#_1T`Q!O@0Z?35SHz<6yXp$`a)z`bJ}17eZXTGV*WX_S#2?b8QTpQ(P|IZr z)vBN~Gb0F4`6;FaAwgwC{a=~dH;}C8wBaK059+(KVEl*rZV=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ecJ`9 zQqc58cq%w}JKCP#U+!7Jg&$WNY`m@WAtMM8P= zc*HRsjm16ih^=O4Kj8&Oo02%^YRRPqP;2xuH@G6VR@7$zE{_4W6g& z@g-xlt5PEfp7B6X^ci0}GJA6*zZ3bmop?b8eD%)>H0Kt-Yn7 zq9qEQ$*n3yuixqIF1$SA{S?CX+G&POpp*Xp+@~||32MUoF!$lGzo&7cHz{i%wIY method_body %type foreach_statement for_statement while_statement %type inline_function +%type unset_variables %type extends_from %type implements_list %type interface_extends_list @@ -277,7 +278,7 @@ import ( %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list %type const_list for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations property_list -%type case_list trait_adaptation_list unset_variables +%type case_list trait_adaptation_list %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list %type array_pair_list non_empty_argument_list top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list @@ -998,21 +999,14 @@ statement: } | T_UNSET '(' unset_variables possible_comma ')' ';' { - $$ = &ast.StmtUnset{ast.Node{}, $3} + $3.(*ast.StmtUnset).UnsetTkn = $1 + $3.(*ast.StmtUnset).OpenParenthesisTkn = $2 + $3.(*ast.StmtUnset).SeparatorTkns = append($3.(*ast.StmtUnset).SeparatorTkns, $4) + $3.(*ast.StmtUnset).CloseParenthesisTkn = $5 + $3.(*ast.StmtUnset).SemiColonTkn = $6 + $3.(*ast.StmtUnset).Node.Position = position.NewTokensPosition($1, $6) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $6) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.SkippedTokens) - if $4 != nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.SkippedTokens, $5.SkippedTokens...)) - } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $6.SkippedTokens) + $$ = $3 } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement { @@ -1205,14 +1199,16 @@ finally_statement: unset_variables: unset_variable { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtUnset{ + Vars: []ast.Vertex{$1}, + } } | unset_variables ',' unset_variable { - $$ = append($1, $3) + $1.(*ast.StmtUnset).Vars = append($1.(*ast.StmtUnset).Vars, $3) + $1.(*ast.StmtUnset).SeparatorTkns = append($1.(*ast.StmtUnset).SeparatorTkns, $2) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index e83b438..50235a7 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -783,7 +783,12 @@ func (n *StmtTry) Accept(v NodeVisitor) { // StmtUnset node type StmtUnset struct { Node - Vars []Vertex + UnsetTkn *token.Token + OpenParenthesisTkn *token.Token + Vars []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtUnset) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index f3c440e..d3ad950 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -204,3 +204,12 @@ func (v *FilterTokens) StmtEcho(n *ast.StmtEcho) { func (v *FilterTokens) StmtInlineHtml(n *ast.StmtInlineHtml) { n.InlineHtmlTkn = nil } + +func (v *FilterTokens) StmtUnset(n *ast.StmtUnset) { + n.UnsetTkn = nil + n.OpenParenthesisTkn = nil + n.SeparatorTkns = nil + n.CloseParenthesisTkn = nil + n.SemiColonTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index b35840d..0068785 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2905,24 +2905,12 @@ func (p *Printer) printStmtTry(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtUnset(n ast.Vertex) { - nn := n.(*ast.StmtUnset) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("unset")) - p.printFreeFloating(nn, token.Unset) - p.write([]byte("(")) - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, token.VarList) - p.write([]byte(")")) - p.printFreeFloating(nn, token.CloseParenthesisToken) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtUnset(n *ast.StmtUnset) { + p.printToken(n.UnsetTkn, "unset") + p.printToken(n.OpenParenthesisTkn, "(") + p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtUse(n *ast.StmtUse) { From 69bc0af2bed3d06487fca47189d0efb24641f08d Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 14 Sep 2020 18:36:55 +0300 Subject: [PATCH 062/140] [refactoring] update ast structure of "Foreach" node --- internal/php5/parser_test.go | 3 +- internal/php5/php5.go | Bin 291164 -> 289930 bytes internal/php5/php5.y | 123 +++++++++---------------- internal/php5/php5_test.go | 3 +- internal/php7/parser_test.go | 3 +- internal/php7/php7.go | Bin 242614 -> 242866 bytes internal/php7/php7.y | 88 +++++++----------- internal/php7/php7_test.go | 3 +- pkg/ast/ast.go | 1 - pkg/ast/node.go | 30 +++--- pkg/ast/traverser/dfs.go | 27 ------ pkg/ast/visitor/dump.go | 6 -- pkg/ast/visitor/filter_parser_nodes.go | 20 ---- pkg/ast/visitor/filter_tokens.go | 11 +++ pkg/ast/visitor/null.go | 4 - pkg/printer/pretty_printer.go | 55 +++++------ pkg/printer/pretty_printer_test.go | 3 +- pkg/printer/printer.go | 118 ++++++++---------------- pkg/printer/printer_test.go | 3 +- 19 files changed, 179 insertions(+), 322 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 11e39da..0eb1d67 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -6431,7 +6431,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6440,6 +6440,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 35, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 324e99211e77ff85fc478fa9c5a4663b0e960af2..498f6b5468fba0723139ac5341758a126490bb1a 100644 GIT binary patch delta 9266 zcmeHMX>?UZwqCpHBq0eI36YS5+%Sqv_ukx*F%d|RK|ny1F^M85NW#=eJ21AhkRWE$ zP6Q_$F*u|e5eWzgh$J*i0UIUQ&j*5N5MP4>@V=^ZZvwPyz4z<=di-GJ>{F*|*B-w8 z?R}4Yll17}q^h~Cqr9$|n7Io|pX?{nmab~8R<)+xGh!Aj7*H}}M$zo?0nVO5DX~+E zZkyJ*dw$96DMg%DLLJGLTUyR5rcyh;7!b)JX@ptLuH}?*^+r+lMtL0jAZ743Pl^=& z;c<$)dRb_Pq9-VwU$$gIvn#X-y&drf`)Awx4=9;eJY!1U?AayrM^B&W=;LU-kI&qv z-5)KBiN?Rih4uwQN1b_?uHjBIC_cmf@aCe~diDMKzpK88v{&%rj?{uDmr`@`vtuTu zTwyV1P_*IF71WDUXHjZYU}E=~CAUxE2Og)JQd}PFdhZ|X{Qpk)KXJlu<#dzCadS}} zwNZDkq&z_$b_@_Xs&bt06Q@;B0eMwX1)UQ-bS1S?rGKS1Lbw8|>=}xe!s+H?x61Ck z?|CW^P9M+eB6{(MWfaZ1y(vN!uAzr4a&vZHO65hrQam?*2|MQStOFvQ6FZZo=Degg z^aR+oR5#R+9z(Sk?6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 z%Tjv^ts6-#yVW{Q95>wRZ^2!fQM(AIZ!}vR8DXI-wcAER7&*!+g|W;F!zGS{=bIv` zeB(4L1|pPJPTnfhW8qQIjE w6HcNkE!OQ;)t7(D@%PjAI1OHdDDF6Tf diff --git a/internal/php5/php5.y b/internal/php5/php5.y index f599ddd..5fb516e 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1094,79 +1094,39 @@ unticked_statement: } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { + $8.(*ast.StmtForeach).ForeachTkn = $1 + $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $8.(*ast.StmtForeach).Expr = $3 + $8.(*ast.StmtForeach).AsTkn = $4 if $6 == nil { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Var = $5 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Var = $5 - } + $8.(*ast.StmtForeach).Var = $5 } else { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - } + $8.(*ast.StmtForeach).Key = $5 + $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } + $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 + $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) $$ = $8 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { + $8.(*ast.StmtForeach).ForeachTkn = $1 + $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 + $8.(*ast.StmtForeach).Expr = $3 + $8.(*ast.StmtForeach).AsTkn = $4 if $6 == nil { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Var = $5 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Var = $5 - } + $8.(*ast.StmtForeach).Var = $5 } else { - switch n := $8.(type) { - case *ast.StmtForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - case *ast.StmtAltForeach : - n.Expr = $3 - n.Key = $5 - n.Var = $6 - } + $8.(*ast.StmtForeach).Key = $5 + $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } + $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 + $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) - // save position $$ = $8 - - $$.GetNode().Position = position.NewTokenNodePosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) - } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_DECLARE '(' declare_list ')' declare_statement { @@ -1586,10 +1546,10 @@ foreach_optional_arg: } | T_DOUBLE_ARROW foreach_variable { - $$ = $2 - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Key, $1.SkippedTokens) + $$ = &ast.StmtForeach{ + DoubleArrowTkn: $1, + Var: $2, + } } ; @@ -1655,29 +1615,30 @@ for_statement: foreach_statement: statement { - $$ = &ast.StmtForeach{ast.Node{}, nil, nil, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtForeach{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtForeach{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndForeachTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 8537e6c..406f860 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -4705,7 +4705,7 @@ func TestPhp5(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 81, @@ -4714,6 +4714,7 @@ func TestPhp5(t *testing.T) { EndPos: 1762, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 5efe233..94835e1 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -7028,7 +7028,7 @@ func TestStmtForeach_Alt(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -7037,6 +7037,7 @@ func TestStmtForeach_Alt(t *testing.T) { EndPos: 35, }, }, + Alt: true, Expr: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 56d0fc96060dce48607931670beb6660c7c39032..4b801a5b3ae24a87ce3b4613bacb781be912af34 100644 GIT binary patch delta 11444 zcma)Cd3aStvj4i9Bm@#jfFwY|y*KOx2zOt^Kmy3VBnXNi$Rf&`ghdb`LR99Vf+PwQ z`ve_D5Fvor0wUo#>M#n1=VM%e0k@|JC~?%$8F@~1_c?t!@tgVlCttdLRn^s1-PP4~ z?#o{^J8-#Kb+fiK5<8gEcGs6QF%kCnpf3JCCHD|9+OeCuVP8B6z}iNnQ+-N&TtiCP zuPERBiZVOCzSOw-O7BRh4+o$&fppe9YZ{Xv3~6leAmxtwa4gY)%Mu&H-I^Hi+$Ig- zHcbt9V$+6jVv+%mNHSm?1mPzW&Pz7np3M-xoNP!V#j#w%A2u`KcFh~YCz~5^a!Nz^ zaEbxnFku`7VOOdFUrW`}9{6hujPIrv8kQ70E*AV~O9MXLk~Dyqv@+n=S~Y}crWx?w zGy}##0PaXP;O*%ecEg$s5$_BQON!$)3CCI+a9L};FiW~y8v~x(rXk#>tpQJLYrr@N zLSm)?kH~BY|75|wBX~~ovJ`9&Fy2{8T2gwpYY2bX&Vbvw8p0=C2Au3RU>pSDu-kxd zm@p17-W~(K<}sutyeZp&FJw1_A8l{Ir`k7!mvk`TV;u}Q)X^Bc*kBNZJ31MH+d9?f z#ZY%P;5D5a!m%z2E;xbiF6*LTIr!chV8U|oIbF#EGJVavihOZ7WUQ4TT>SnV;o%{%6j0UF}J>qR=sQPDu=hLc`$n_!fKK0b207?k^o8(uO8 zIev{SvN&9j7Es$8*xGb2yFhkRwTxOmzO z@}o2AK8t*&7tVXkC3O;$`{1S$5_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`g1l zYr2al?lT?ifk@s{!GpV7W6PDj6nvzI17GZ|Y<@*AD_`E;SHaKpcHqDDQ~cq+mY?wX zpisJd3N&|5^|MTfDFkq5`EXx>yS2Z>IoN2xM`zZGtEluRTyoFtz;>ES#0jhU+W}E7 zGkl`R!V5!qPuuSnEoF^g47Ik1>Pt=mVZ~(n)GPYQEDCsfA2bM?Z1wW54R+YH>rFHqx(kHEC?v zBU!$sL&0})1j?yS<$7*&42PX{R5L$fR5AjL6{tz@Jv_VF>AT~w(08KwN{Enl%e$`@ z4>Ia;H8!cH>1SO+ib|8^zY@sKy~-Sc0g324gVzfs9lJ$2lUuJ5&sj|Twi?Dblk~fY zm-5RI7-}L%oWZPKx~JS>(Tz!wET1l_87&y=prhv5+__ce$n0@qA*v|8U~+_#ezYx^ zfM<+{CqUWLm0}(~6sQlKs@&^xsi+cEquC|DWt7>I1bQCbL_atS=1|{V zRmZFB7)M(%$Dx_zVBV|F-)OO_=(nflrMU91Oy>J2Yo0i&MRAibz0~a{XrqPeeA!XG z-M40R|9m4sw=8Hl;w3yp;}^gI^p{}$>ZKj*tp!#PNB+lE%tIrq9NqN2Wtmw9UnEqj zn_TS>BQ#(*-T^-ui=O6KwJI4}ohae{l|y9qh7?Rc?@j$ApvPHc46j(XH{ z%}BbVlJ}My|3jQM1RnCpySItm#xh8L`0V5O*?rdTz@C{e@D8MMH0n~onHrF}4~V{I zc^(SNSv$l+BS?f$%>JqExT8U}9ZFSN_!;Y30n)Zo-4wwF{;F7@Gi6V^a nsCf%|(jFQOK99D{@do{(y_H%% ") - } - - p.Print(nn.Var) - - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endforeach;") -} - func (p *PrettyPrinter) printStmtAltIf(n ast.Vertex) { nn := n.(*ast.StmtIf) @@ -1749,6 +1723,11 @@ func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { nn := n.(*ast.StmtForeach) + if nn.Alt { + p.printStmtAltForeach(n) + return + } + io.WriteString(p.w, "foreach (") p.Print(nn.Expr) io.WriteString(p.w, " as ") @@ -1777,6 +1756,30 @@ func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { } } +func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { + nn := n.(*ast.StmtForeach) + + io.WriteString(p.w, "foreach (") + p.Print(nn.Expr) + io.WriteString(p.w, " as ") + + if nn.Key != nil { + p.Print(nn.Key) + io.WriteString(p.w, " => ") + } + + p.Print(nn.Var) + + io.WriteString(p.w, ") :\n") + + s := nn.Stmt.(*ast.StmtStmtList) + p.printNodes(s.Stmts) + + io.WriteString(p.w, "\n") + p.printIndent() + io.WriteString(p.w, "endforeach;") +} + func (p *PrettyPrinter) printStmtFunction(n ast.Vertex) { nn := n.(*ast.StmtFunction) diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 54fcdd0..82ac6ef 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2210,7 +2210,8 @@ func TestPrintAltForeach(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ Stmts: []ast.Vertex{ - &ast.StmtAltForeach{ + &ast.StmtForeach{ + Alt: true, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("key")}}, Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("val")}}}, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0068785..b808de1 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -386,8 +386,6 @@ func (p *Printer) printNode(n ast.Vertex) { // stmt - case *ast.StmtAltForeach: - p.printStmtAltForeach(n) case *ast.StmtBreak: p.printStmtBreak(n) case *ast.StmtCase: @@ -1996,54 +1994,6 @@ func (p *Printer) printExprYield(n ast.Vertex) { // smtm -func (p *Printer) printStmtAltForeach(n ast.Vertex) { - nn := n.(*ast.StmtAltForeach) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("foreach")) - p.printFreeFloating(nn, token.Foreach) - p.write([]byte("(")) - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("as")) - - if nn.Key != nil { - if nn.Key.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Key) - p.printFreeFloating(nn, token.Key) - p.write([]byte("=>")) - } else { - if nn.Var.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - - p.write([]byte(")")) - p.printFreeFloating(nn, token.Cond) - - p.write([]byte(":")) - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - p.write([]byte("endforeach")) - p.printFreeFloating(nn, token.AltEnd) - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printStmtBreak(n *ast.StmtBreak) { p.printToken(n.BreakTkn, "break") @@ -2407,42 +2357,50 @@ func (p *Printer) printStmtAltFor(n *ast.StmtFor) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtForeach(n ast.Vertex) { - nn := n.(*ast.StmtForeach) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("foreach")) - p.printFreeFloating(nn, token.Foreach) - p.write([]byte("(")) - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) +func (p *Printer) printStmtForeach(n *ast.StmtForeach) { + if n.Alt { + p.printStmtAltForeach(n) + return } - p.write([]byte("as")) + p.printToken(n.ForeachTkn, "foreach") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Expr) + p.bufStart = " " + p.printToken(n.AsTkn, "as") + p.bufStart = " " + if n.Key != nil { + p.Print(n.Key) + p.printToken(n.DoubleArrowTkn, "=>") + } + p.Print(n.Var) + p.printToken(n.CloseParenthesisTkn, ")") + p.Print(n.Stmt) +} - if nn.Key != nil { - if nn.Key.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Key) - p.printFreeFloating(nn, token.Key) - p.write([]byte("=>")) +func (p *Printer) printStmtAltForeach(n *ast.StmtForeach) { + p.printToken(n.ForeachTkn, "foreach") + p.printToken(n.OpenParenthesisTkn, "(") + p.Print(n.Expr) + p.bufStart = " " + p.printToken(n.AsTkn, "as") + p.bufStart = " " + if n.Key != nil { + p.Print(n.Key) + p.printToken(n.DoubleArrowTkn, "=>") + } + p.Print(n.Var) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") + + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) } else { - if nn.Var.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } + p.Print(n.Stmt) } - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte(")")) - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) + p.printToken(n.EndForeachTkn, "endforeach") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtFunction(n ast.Vertex) { diff --git a/pkg/printer/printer_test.go b/pkg/printer/printer_test.go index de97168..8956574 100644 --- a/pkg/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -2667,7 +2667,8 @@ func TestPrinterPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o) - p.Print(&ast.StmtAltForeach{ + p.Print(&ast.StmtForeach{ + Alt: true, Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, From e78f0dc650016ffd19ebd4782b0cb0b73d93fcbc Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 14 Sep 2020 19:25:38 +0300 Subject: [PATCH 063/140] [refactoring] update ast structure of "Declare" and "ConstList" nodes --- internal/php5/php5.go | Bin 289930 -> 290009 bytes internal/php5/php5.y | 114 ++++++++++++++++--------------- internal/php7/php7.go | Bin 242866 -> 242956 bytes internal/php7/php7.y | 71 ++++++++++--------- pkg/ast/ast.go | 3 +- pkg/ast/node.go | 48 ++++++------- pkg/ast/traverser/dfs.go | 24 ------- pkg/ast/visitor/dump.go | 16 ++--- pkg/ast/visitor/filter_tokens.go | 11 +++ pkg/ast/visitor/null.go | 12 ++-- pkg/printer/printer.go | 74 +++++++------------- 11 files changed, 164 insertions(+), 209 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 498f6b5468fba0723139ac5341758a126490bb1a..7492a95e14214c9de398c6cdef4dd7978946ff0b 100644 GIT binary patch delta 10028 zcma)B3tW{&+W*bW3kqKF1}cyo47>uK_gsLJidqJ0TBLa?O(CVSR7fy$T`w(dwYn)r z@t9r2tnJ$_ijj_$8CF`E8CJSwdB0@dt1YuN{r=Cq=Nzzhzx{qc&dWP9&ph+YbN$b} z3%+dq<(I8%X2dtiijFRuRZ>K2Vyq6ekHuGan&-3ATmfHZn#+^v<_DUYf$TJw--}1U z6F^_UofaMC<6*yzw%5jp*Y>5kY)=+wvbxJiJ3i_VY4-20J@b(z=CSnnffwu8{4guP(s*FH6Wa?~v)nezVjElAzS`(dDnvZiFxs_kGsGIgD?e&qt1p*hZB`sVe9jN+at}K| z@L??Qe>_-!W|(*2ZuF>p^t00pH}P#FStdYir4_8FdL&|iD$>rKpW)7~W_vvS0~UU)CxH?#*6 zGZ}ta4j=AeH?(~a7JSVTki7EzzOI;*y#K0P<3-Mrc6d3oAzwNeH3)+@$eo_eQidhu z;Nw9)^V5jH}DZIsUDPR|b1S_hQKV6R|1fCZb$f$Yl6gEz$+ayC~wufV!tO&J-UJNQH_`Z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irNS2e)Nd3IFv+qsFb|IJ)f;3vL_Kcnf)5Iz7bPR#rROnPK6VHRqiTHCF}= z$ON_KhlR7dRJz`lY25*WY_b83Y9`pKz!QC7rJOsD*Xe-Z}V&1`cH+LZ({qj{-nr!gPh5MUn zOB?Kg5R^bj!RG08dv|1*fdQ*T6-I(w8qMJ4MNK`Vkny5Sq@AH(e^j)~@d z4lTrT^d9D|d$InoizSt-sWKZ6ns`-jrQ2R@ZG_<5H+l3I-T5UxMGq*lesU3Y)d1hG z+{VW^k1>w`mG!VTQqvNvkK^i@8g<`D$Sth*^tA@^n-=I8MB7J+=KPLN+o$6ffwldu z*}}YbIu8kvfmROM8J#xV>MZo3>#Wb9kZY}yhM*48$>gTd_1<9N(ZytTlQl6<(i?_Z z=s*pY>s0-sUO4Ka%{pncbqgD@`6;Aw4D?>$RPyH6ot@>ds-lCjy6x(*FbLz}FOS8} ou&$n9-7e{l382o;rRi3QM9PB-NoOa)yYQTc*)&N{O|ks{2Zw7Fg8%>k diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 5fb516e..53276ee 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -241,7 +241,7 @@ import ( %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list echo_expr_list -%type trait_adaptations unset_variables +%type trait_adaptations unset_variables declare_list %type switch_case_list %type method_body %type foreach_statement for_statement while_statement @@ -255,7 +255,7 @@ import ( %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list encaps_list isset_variables non_empty_array_pair_list %type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr -%type for_expr case_list declare_list catch_statement additional_catches +%type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration %type interface_list non_empty_function_call_parameter_list trait_list trait_adaptation_list non_empty_trait_adaptation_list @@ -722,7 +722,7 @@ constant_declaration: { constList := $1.(*ast.StmtConstList) constList.Node.Position = position.NewNodesPosition($1, $5) - lastNode(constList.Consts).(*ast.StmtConstant).CommaTkn = $2 + constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ Node: ast.Node{ Position: position.NewTokenNodePosition($3, $5), @@ -1130,16 +1130,14 @@ unticked_statement: } | T_DECLARE '(' declare_list ')' declare_statement { + $5.(*ast.StmtDeclare).DeclareTkn = $1 + $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 + $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 + $5.(*ast.StmtDeclare).Node.Position = position.NewTokenNodePosition($1, $5) + $$ = $5 - $$.(*ast.StmtDeclare).Consts = $3 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) } | ';' { @@ -1646,29 +1644,30 @@ foreach_statement: declare_statement: statement { - $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtDeclare{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtDeclare{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndDeclareTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1676,42 +1675,49 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - $$ = []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), }, - Value: $1.Value, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Value: $1.Value, + }, + EqualTkn: $2, + Expr: $3, }, - EqualTkn: $2, - Expr: $3, }, } - yylex.(*Parser).setFreeFloating(lastNode($$).(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.ParserSeparatedList).Items).(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } | declare_list ',' T_STRING '=' static_scalar { - lastNode($1).(*ast.StmtConstant).CommaTkn = $2 - $$ = append($1, &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append( + $1.(*ast.ParserSeparatedList).Items, + &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $5), }, - Value: $3.Value, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Value: $3.Value, + }, + EqualTkn: $4, + Expr: $5, }, - EqualTkn: $4, - Expr: $5, - }) + ) - yylex.(*Parser).setFreeFloating(lastNode($$).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) + $$ = $1 + + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.ParserSeparatedList).Items).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 4b801a5b3ae24a87ce3b4613bacb781be912af34..6ecb7f7a0d42c861a24492f24c51ab7651f705ad 100644 GIT binary patch delta 8002 zcma)B33Qd!wO;$2B#;0h2@ps^$V~!-KyJ8yhC9e&2xSNY8i5iK0|^j7nZj%pgjh>K zv|_KaRiq?Zu?`h9%0UJTOY@XL3=YMog5pS(La09Nt8IPXKL5>twO!BUxjExLd-(Qn zexChP{GDIK?~YH^L7%T7G4=5WI_Aa227^wXC;VbVzYcM+0beotUo_;RAM^*%Pkk<@ zTU@LY%<}|`?GH8ti;EhreeN#m==gkj9{hyAe12H8KhG2Lhx7N8#rQ*c9)BpjVb5Ke z1+s2`aEaq{a9;s7N(>btUVh?Yi*QVu<7@c|6f}fhsG(lCHi+gF zU@zA2e+Z(4io%EY4Nt^EDAIz^NU$KBxc_fMi$wt3=UDa0PvGA-=oFOOTDbH;Ir$sv z4*ViULHeARmh^yxUQviwc<>hDB5%+ae)6UJC=@Pvd7Ix_T?BWEut7Rr7YIeT*71QG zui(WSf<3&BBjf}lT^myrP%)^n0(3Sto>d^a@V~ajfOBu4DBR_h&2b_)bnXoW!w~`+_Bbmpu=T9Dig~VCi77;n7zMC|Tg> zEs)!-*aadM*u8KhI{{Y}TUqQ%sIVdPXobqNdcl$)#VN*VN8}eLkr}TT2+|9gfIs}i z@kL3N53hs87EZ%Cuier?aPAEigdcyc)T&-?b|54;6%v8saLkFSfucpML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AS{3{MUd-T$5KI2p)+3vgWgm-hR*s3M(VY-GHY#u=NHBS4&{=SK z0g^7$@vLB?UUg;n8Pto*e^jqVBl-B}z>_nN(>(Wuv^cawr&;->ni7%0{P2}pU~!}4 z%`<*&4{k8#Y!$>v`D|8`nLcY0LArDA~B40NB(0j zE+JeSR1BYO4mr1$)w4L*HNea4*eVH*49H~JLrDIm)hu& zk)$dwhJ_}#)qk)h4Ji>_R}g=d2qc?aa-uWXxfm9bLqnude%(orZqYhscE%Fu9zNSy zOSgsRJ$z>ppfD?rg)-hAO~NNz0n*H_Vfs_zm=qv1c1L^Wzk}T7w<)?eM*il$p2p5p zsAw;m?D4)GuTIsYB!cWcQyRym2`5QwXPJ&QOVe~WC1u@4a7{Oj^QQGn8n;h}&Rd;& zg5==my|jzlZPD56?x(-t%pO_}Gy*kidcf*1I~IQ8v`qODT|C{ZaZ%QcQQ5Z<2=q?Z zH!e^$E3(8QvKNbXIgndMJaaWerxCC2kM#|!@B?r4;>2_v%LREl+myQXuTd20kt5B( z*B?-EYS)r3ArcPmZW>~&cTs*8w55zhiJKPgqFtjGf}o(S&!5sl-nMQJpA*K z@U+y2h^H@&(VK9GGaAICQnUpAVhn&bgeB+LRik|a1b9$#?%;+OM8CZC(AuQRhA*Iwd%x8sWq!h*+jQe}m5 z@b_hEET7w<>-f6~xalpKpl`SBLE@4HYag(P)m@^L-0t9l;$Xc|>OYw=+fZ zX#I;d(`IQL1H3kU8WVo>Tu`RA=C}ImGWR z*Ebr^efnwK0vIfCl(QLPjhAFREA$jelXXAWZ_Cvk{x0OQBjn)S3skBYxGRHJtchEx z=g3VSN^_v;{;m+AKVTK~L}p*d-?heI@$fIS`+uF variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list -%type if_stmt +%type if_stmt const_list %type alt_if_stmt %type if_stmt_without_else %type class_const_decl @@ -276,7 +276,7 @@ import ( %type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list -%type const_list for_exprs non_empty_for_exprs +%type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations property_list %type case_list trait_adaptation_list %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list @@ -541,9 +541,10 @@ top_statement: Node: ast.Node{ Position: position.NewTokensPosition($1, $3), }, - ConstTkn: $1, - Consts: $2, - SemiColonTkn: $3, + ConstTkn: $1, + Consts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $3, } } ; @@ -782,13 +783,16 @@ use_declaration: const_list: const_list ',' const_decl { - lastNode($1).(*ast.StmtConstant).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | const_decl { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -1036,16 +1040,14 @@ statement: } | T_DECLARE '(' const_list ')' declare_statement { + $5.(*ast.StmtDeclare).DeclareTkn = $1 + $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 + $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 + $5.(*ast.StmtDeclare).Node.Position = position.NewTokenNodePosition($1, $5) + $$ = $5 - $$.(*ast.StmtDeclare).Consts = $3 - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) } | ';' { @@ -1509,29 +1511,30 @@ foreach_statement: declare_statement: statement { - $$ = &ast.StmtDeclare{ast.Node{}, false, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) + $$ = &ast.StmtDeclare{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Stmt: $1, + } } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := &ast.StmtStmtList{ + $$ = &ast.StmtDeclare{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewTokensPosition($1, $4), }, - Stmts: $2, + Alt: true, + ColonTkn: $1, + Stmt: &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + }, + EndDeclareTkn: $3, + SemiColonTkn: $4, } - $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index aa2170a..7e02236 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -189,7 +189,6 @@ type NodeVisitor interface { NameRelative(n *NameRelative) NameNamePart(n *NameNamePart) - ParserAs(n *ParserAs) - ParserNsSeparator(n *ParserNsSeparator) ParserBrackets(n *ParserBrackets) + ParserSeparatedList(n *ParserSeparatedList) } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 516019f..845c124 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -278,9 +278,10 @@ func (n *StmtClassMethod) Accept(v NodeVisitor) { // StmtConstList node type StmtConstList struct { Node - ConstTkn *token.Token - Consts []Vertex - SemiColonTkn *token.Token + ConstTkn *token.Token + Consts []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtConstList) Accept(v NodeVisitor) { @@ -315,9 +316,16 @@ func (n *StmtContinue) Accept(v NodeVisitor) { // StmtDeclare node type StmtDeclare struct { Node - Alt bool - Consts []Vertex - Stmt Vertex + Alt bool + DeclareTkn *token.Token + OpenParenthesisTkn *token.Token + Consts []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + Stmt Vertex + EndDeclareTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtDeclare) Accept(v NodeVisitor) { @@ -1887,24 +1895,6 @@ func (n *NameNamePart) Accept(v NodeVisitor) { v.NameNamePart(n) } -type ParserAs struct { - Node - Child Vertex -} - -func (n *ParserAs) Accept(v NodeVisitor) { - v.ParserAs(n) -} - -type ParserNsSeparator struct { - Node - Child Vertex -} - -func (n *ParserNsSeparator) Accept(v NodeVisitor) { - v.ParserNsSeparator(n) -} - type ParserBrackets struct { Node OpenBracketTkn *token.Token @@ -1915,3 +1905,13 @@ type ParserBrackets struct { func (n *ParserBrackets) Accept(v NodeVisitor) { v.ParserBrackets(n) } + +type ParserSeparatedList struct { + Node + Items []Vertex + SeparatorTkns []*token.Token +} + +func (n *ParserSeparatedList) Accept(v NodeVisitor) { + v.ParserSeparatedList(n) +} diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 615c682..b9189a0 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -2607,30 +2607,6 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - case *ast.ParserAs: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Child != nil { - t.visitor.Enter("Child", true) - t.Traverse(nn.Child) - t.visitor.Leave("Child", true) - } - case *ast.ParserNsSeparator: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Child != nil { - t.visitor.Enter("Child", true) - t.Traverse(nn.Child) - t.visitor.Leave("Child", true) - } case *ast.ParserBrackets: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index de06927..d8160c1 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -1293,20 +1293,12 @@ func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) } -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()) } + +func (v *Dump) ParserSeparatedList(n *ast.ParserSeparatedList) { + // do nothing +} diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 6c86b92..63fc40e 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -70,6 +70,7 @@ func (v *FilterTokens) StmtHaltCompiler(n *ast.StmtHaltCompiler) { func (v *FilterTokens) StmtConstList(n *ast.StmtConstList) { n.ConstTkn = nil + n.SeparatorTkns = nil n.SemiColonTkn = nil } @@ -224,3 +225,13 @@ func (v *FilterTokens) StmtForeach(n *ast.StmtForeach) { n.EndForeachTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtDeclare(n *ast.StmtDeclare) { + n.DeclareTkn = nil + n.OpenParenthesisTkn = nil + n.SeparatorTkns = nil + n.CloseParenthesisTkn = nil + n.ColonTkn = nil + n.EndDeclareTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 582033e..f5e1467 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -674,14 +674,10 @@ func (v *Null) NameNamePart(_ *ast.NameNamePart) { // do nothing } -func (v *Null) ParserAs(_ *ast.ParserAs) { - // do nothing -} - -func (v *Null) ParserNsSeparator(_ *ast.ParserNsSeparator) { - // do nothing -} - func (v *Null) ParserBrackets(_ *ast.ParserBrackets) { // do nothing } + +func (v *Null) ParserSeparatedList(_ *ast.ParserSeparatedList) { + // do nothing +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index b808de1..9195d83 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -484,10 +484,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtUseDeclaration(n) case *ast.StmtWhile: p.printStmtWhile(n) - case *ast.ParserAs: - p.printParserAs(n) - case *ast.ParserNsSeparator: - p.printParserNsSeparator(n) case *ast.ParserBrackets: p.printParserBrackets(n) } @@ -2158,7 +2154,7 @@ func (p *Printer) printStmtClassConstList(n *ast.StmtClassConstList) { func (p *Printer) printStmtConstList(n *ast.StmtConstList) { p.printToken(n.ConstTkn, "const") p.bufStart = " " - p.joinPrintRefactored(",", n.Consts) + p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") p.printToken(n.SemiColonTkn, ";") } @@ -2180,37 +2176,33 @@ func (p *Printer) printStmtContinue(n *ast.StmtContinue) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtDeclare(n ast.Vertex) { - nn := n.(*ast.StmtDeclare) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtDeclare(n *ast.StmtDeclare) { + if n.Alt { + p.printStmtAltDeclare(n) + return + } + p.printToken(n.DeclareTkn, "declare") + p.printToken(n.OpenParenthesisTkn, "(") + p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") + p.printToken(n.CloseParenthesisTkn, ")") + p.Print(n.Stmt) +} - p.write([]byte("declare")) - p.printFreeFloating(nn, token.Declare) - p.write([]byte("(")) - p.joinPrintRefactored(",", nn.Consts) - p.printFreeFloating(nn, token.ConstList) - p.write([]byte(")")) +func (p *Printer) printStmtAltDeclare(n *ast.StmtDeclare) { + p.printToken(n.DeclareTkn, "declare") + p.printToken(n.OpenParenthesisTkn, "(") + p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.ColonTkn, ":") - if nn.Alt { - p.printFreeFloating(nn, token.Cond) - p.write([]byte(":")) - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - p.printFreeFloating(nn, token.Stmts) - - p.write([]byte("enddeclare")) - p.printFreeFloating(nn, token.AltEnd) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } + if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { + p.printNodes(stmtList.Stmts) } else { - p.Print(nn.Stmt) + p.Print(n.Stmt) } - p.printFreeFloating(nn, token.End) + p.printToken(n.EndDeclareTkn, "enddeclare") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtDefault(n *ast.StmtDefault) { @@ -2960,26 +2952,6 @@ func (p *Printer) printStmtAltWhile(n *ast.StmtWhile) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printParserAs(n ast.Vertex) { - nn := n.(*ast.ParserAs) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("as")) - p.Print(nn.Child) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printParserNsSeparator(n ast.Vertex) { - nn := n.(*ast.ParserNsSeparator) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("\\")) - p.Print(nn.Child) - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printParserBrackets(n ast.Vertex) { nn := n.(*ast.ParserBrackets) p.printFreeFloating(nn, token.Start) From 33af1df9c486af274f8e0ccd227ec7506e7e1589 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 14 Sep 2020 19:34:02 +0300 Subject: [PATCH 064/140] [refactoring] update ast structure of "Nop" node --- internal/php5/php5.go | Bin 290009 -> 288431 bytes internal/php5/php5.y | 41 ++++++++++++++----------------- internal/php7/php7.go | Bin 242956 -> 241432 bytes internal/php7/php7.y | 41 ++++++++++++++----------------- pkg/ast/node.go | 1 + pkg/ast/visitor/filter_tokens.go | 4 +++ pkg/printer/printer.go | 9 ++----- 7 files changed, 43 insertions(+), 53 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 7492a95e14214c9de398c6cdef4dd7978946ff0b..8e6d434447692ffc9724c3d2f6ec6c45710521cc 100644 GIT binary patch delta 11340 zcma)CcX*aXwtr^k4I!Z=Kxir7hZxFA`Ff#ATY5=WDIo}fwXsryv_(X!t1ALQgoDD> zpaSY5L|qvb7lMnjvPfHl1ujK|b-i@k>Z0y%%KIj|KKtB12=kpebLPy9lYy_sK8) zESITfo(x^b#xcs2+($39V#76&+FZ{@n${Dl)w7EGscAkNLBS&!y*!`Y$LR3i(d^KM zJ;$i05I*^JTgJGN+3W^3ozcn&l=wq?){PPC2Zpqctcp>~vBJMSz}~a{Uj$hmqu_ku zqi~oV)q|*AgxxMNd^VU~!N_(o7UUG%i{{(}q^Tw}@62w})I8eQmA$Wtw7wg=-E?2q zofR=E?CAL9`Wx-|Jb9rfTg&M5c*id{_hyBhuJmPj)T}SYqqRi+@yRv)*eIrZWc>jw zWSC^hAT?C+%VtB=)P*C^Tsn-E3e(KKiA9726>O@H(nev+#*bn%)gK>yJqmk?qsgVo zMXboQ&blpm%V@ShpHVJdE4JNo#u(OJA7`#SJeCbG{W4j?MhQJ$R{WZc5OifaG--VY z8wyob^U;ZHjBRF2VrOi#(NuP`Z9XuKHN;vJ?`wCn7?Ws*Euqg$mbA_PnZ+70nzj;b zhi0>cZML1`H5c5&I5!MW-OCPHhDYx6nu`{&n=SRLg{-b^UbomA*5`h9#Zreqz@8OK zm`~;{Wt(mD+;aANJw6S1 zsvhEFF$zkaZOFxI*q3@LA4|}zF)U7Hud;UX$Xd3{aPwq>7W!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2{)2p_n{6OKj2~!RMl~ z`1O01nEJ{*@h4XvJ}mU1DCr}21Ni5BOU)QmRf~RZ5Koco7T~cudU{oVum^Og)(qGF zs6!-%eceh>1iXp#(VMPN^~25;Ld1*9V@vHB)kvr>(S3)KV#I?-xkxOLI~R*jU1Cba zN1wQlH|1r3*DF_k_n6Qh>1bi>-?$(7RnAo^8!r`SNmat}F{EEkByzHcz!MjZS1wL7!?*?JVG7_&WCIumqsp#0Ql`B_@j;;_M^2>7|s>tj(Lzx{H zr6f@o*~I1)igMX{vCr^gi+j=r5zzfHA7+73zb=r+Y!<2V{PV*3dP7ivAc;^vQU}9T zk%$IKL}w Date: Mon, 14 Sep 2020 20:15:50 +0300 Subject: [PATCH 065/140] [refactoring] update ast structure of "Try", "Catch" and "Finally" nodes --- internal/php5/php5.go | Bin 288431 -> 287826 bytes internal/php5/php5.y | 75 +++++++++++++++++------------- internal/php7/php7.go | Bin 241432 -> 241851 bytes internal/php7/php7.y | 76 +++++++++++++++++-------------- pkg/ast/node.go | 26 ++++++++--- pkg/ast/visitor/filter_tokens.go | 21 +++++++++ pkg/printer/printer.go | 71 ++++++++++------------------- 7 files changed, 148 insertions(+), 121 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8e6d434447692ffc9724c3d2f6ec6c45710521cc..6527ca84144e97cec960d423a28227d51f28f739 100644 GIT binary patch delta 8527 zcmc&(X?Rpc)_zXa&C&_kAOu2y?yxH&y`_^D17S%-K?o8+5J`f7qAUSX0RdqE#}(Pk zQ5FGZRFEYqT7t+X$fhQuBkF(#K~a%SMFmHgx9Z*|!FlF+zJFi-h_<}` zZFv=+n@=-%^Z<(E)eEVB&u*8Exuj57D*0(j73AZL!4%?Y*IV_t{W?lhvzXQjF6}4M zc&-PElq{kG3UErk)qy=E>hWBk6>e~c*2!~SuBTP$y%VnOJ7M$$qa}~KgT}|2$D(`2 zaOu_5K%b;J-|{szj4ql~hGQ&<7mfMJTqrbZF}a$XWA`r|f1T&Q{_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3dClkz^5AEgKkb;zsu@nKHNawTUP44J#vEFIhgcD+#bB(nsf_vd03jIC z)FGDXpL;mxL3lYz;`8Y4m*-&>KK?A_`-VXZpVQxVQUAB%Y6x_{!6e^S92}0@^5FXh rXy-2d@k;-gLA+(Og-^>09qB2=YYMG!o>T%CLL(2)A18K?vwZ&xS(z@# diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 0c3d768..21c19ac 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1150,19 +1150,20 @@ unticked_statement: } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { - $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} + $$ = &ast.StmtTry{ + TryTkn: $1, + OpenCurlyBracket: $2, + Stmts: $3, + CloseCurlyBracket: $4, + Catches: $5, + Finally: $6, + } - // save position if $6 == nil { $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) } else { $$.GetNode().Position = position.NewTokenNodePosition($1, $6) } - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } | T_THROW expr ';' { @@ -1202,21 +1203,27 @@ catch_statement: { identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - catchNode := &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} - $$ = append([]ast.Vertex{catchNode}, $9...) + catch := &ast.StmtCatch{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $8), + }, + CatchTkn: $1, + OpenParenthesisTkn: $2, + Types: []ast.Vertex{$3}, + Var: variable, + CloseParenthesisTkn: $5, + OpenCurlyBracketTkn: $6, + Stmts: $7, + CloseCurlyBracketTkn: $8, + } + $$ = append([]ast.Vertex{catch}, $9...) // save position identifier.GetNode().Position = position.NewTokenPosition($4) variable.GetNode().Position = position.NewTokenPosition($4) - catchNode.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.SkippedTokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.SkippedTokens) } ; @@ -1227,15 +1234,15 @@ finally_statement: } | T_FINALLY '{' inner_statement_list '}' { - $$ = &ast.StmtFinally{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) + $$ = &ast.StmtFinally{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + FinallyTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, + } } ; @@ -1266,20 +1273,26 @@ additional_catch: { identifier := &ast.Identifier{ast.Node{}, $4.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtCatch{ast.Node{}, []ast.Vertex{$3}, variable, $7} + $$ = &ast.StmtCatch{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $8), + }, + CatchTkn: $1, + OpenParenthesisTkn: $2, + Types: []ast.Vertex{$3}, + Var: variable, + CloseParenthesisTkn: $5, + OpenCurlyBracketTkn: $6, + Stmts: $7, + CloseCurlyBracketTkn: $8, + } // save position identifier.GetNode().Position = position.NewTokenPosition($4) variable.GetNode().Position = position.NewTokenPosition($4) - $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Catch, $2.SkippedTokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 5c6b024bfc6b7108314d65926c1a66a4e75c8b05..5c94ada59c55fa257206a10c7ea3f6a2284f54bf 100644 GIT binary patch delta 12920 zcmaJ{34D}Amj6|Ka%MD&f)Ke6#o#c)=%8qe z4^dRSP*I7Z6bK0DI68uyvgnE!7Q!~t zoyy&LI=3mevlS26TMIg`E50QdiS+Zw-+}>qR7v?CPK-kcSdl`Nw1BL_-)!#m9c2D-NCvX`icm9mt1nNiwGvy z9jwftjI4~slLro7R)m(b0oqCyQ5jDp1BZMflB_+{MZ}Y{4#h<%x#`e?ZYd>|F=k_R zB#Ty%sul?yeE5Js?MJQhdWxw2*d~z9r(x_m1>N(c)+?oYv=PcNq^PYmQFh z9gU04vnd5Q8nHz3^`jNJB$^^g|Hu9D!_jVNmhV_s5lap^_6Zu->)q)nZOyyAITz#6 zt*^c-t7KLdywFybt5Z^3BWP4tAp3SfL{C?8X{NZ+97N!)OoO3qR%>{BmI43p3;3yQ1O76*HTSx<2K+%=1Kyt_ zBCsmQfRW;v#_*zc2E4PK0plP7({l}Yb8c(+@;n26Ag?t%BHw`T$T#4n1t>gTV8BT6 zOk=ordjp=)-hgosf#MDZJh4M-IJ2VxkL=hQ{@#QK78-EhA{72vp}~z5&oqYLD>C5H zP6mtvT<=Z>+_tziyuH|ffA|IbREYt9Sz>U1&>4lV>ukVC@l0cQRjC2*FE!wuWyrm# z%z%;NaWg!G#;JHwR|wJQXEOu z6;)9shIWfD<>DuA)VM<2;f|osO1<_Z1pKQ+TUdWc6y=Pavv_HC7XF7{ z;HOVT3EXu||!FNIw-Pa(B;NjyU4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kJAd1zHwSU9FLZUBuM~ApsdI#`d0gS^eQ+}lTyrDAjUrFa*{smo0_dd!8Sp=!P-r?CEW?IBh*u8G z_%oTg3g_sLSO2t9g3w8@6GIMvx7dpZa<+lGGt<;-sno diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 969ed05..a679f14 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -249,7 +249,7 @@ import ( %type exit_expr scalar lexical_var function_call member_name property_name %type variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable -%type encaps_var encaps_var_offset echo_expr_list +%type encaps_var encaps_var_offset echo_expr_list catch_name_list %type if_stmt const_list %type alt_if_stmt %type if_stmt_without_else @@ -275,7 +275,7 @@ import ( %type foreach_variable -%type encaps_list backticks_expr namespace_name catch_name_list catch_list class_const_list +%type encaps_list backticks_expr namespace_name catch_list class_const_list %type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations property_list %type case_list trait_adaptation_list @@ -1060,18 +1060,20 @@ statement: } | T_TRY '{' inner_statement_list '}' catch_list finally_statement { - if $6 == nil { - $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) - } else { - $$ = &ast.StmtTry{ast.Node{}, $3, $5, $6} - $$.GetNode().Position = position.NewTokenNodePosition($1, $6) + $$ = &ast.StmtTry{ + TryTkn: $1, + OpenCurlyBracket: $2, + Stmts: $3, + CloseCurlyBracket: $4, + Catches: $5, + Finally: $6, } - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) + if $6 == nil { + $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) + } else { + $$.GetNode().Position = position.NewTokenNodePosition($1, $6) + } } | T_THROW expr ';' { @@ -1123,36 +1125,40 @@ catch_list: { identifier := &ast.Identifier{ast.Node{}, $5.Value} variable := &ast.ExprVariable{ast.Node{}, identifier} - catch := &ast.StmtCatch{ast.Node{}, $4, variable, $8} + + catch := $4.(*ast.StmtCatch) + catch.CatchTkn = $2 + catch.OpenParenthesisTkn = $3 + catch.Var = variable + catch.CloseParenthesisTkn = $6 + catch.OpenCurlyBracketTkn = $7 + catch.Stmts = $8 + catch.CloseCurlyBracketTkn = $9 + catch.GetNode().Position = position.NewTokensPosition($2, $9) + $$ = append($1, catch) // save position identifier.GetNode().Position = position.NewTokenPosition($5) variable.GetNode().Position = position.NewTokenPosition($5) - catch.GetNode().Position = position.NewTokensPosition($2, $9) // save comments - yylex.(*Parser).setFreeFloating(catch, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.SkippedTokens) yylex.(*Parser).setFreeFloating(variable, token.Start, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating(catch, token.Var, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.SkippedTokens) - yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.SkippedTokens) } ; catch_name_list: name { - $$ = []ast.Vertex{$1} + $$ = &ast.StmtCatch{ + Types: []ast.Vertex{$1}, + } } | catch_name_list '|' name { - switch n := lastNode($1).(type) { - case *ast.NameName: n.ListSeparatorTkn = $2 - case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 - case *ast.NameRelative: n.ListSeparatorTkn = $2 - } - $$ = append($1, $3) + $1.(*ast.StmtCatch).SeparatorTkns = append($1.(*ast.StmtCatch).SeparatorTkns, $2) + $1.(*ast.StmtCatch).Types = append($1.(*ast.StmtCatch).Types, $3) + + $$ = $1 } ; @@ -1163,15 +1169,15 @@ finally_statement: } | T_FINALLY '{' inner_statement_list '}' { - $$ = &ast.StmtFinally{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) + $$ = &ast.StmtFinally{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + FinallyTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index b16ad15..0479183 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -203,9 +203,15 @@ func (n *StmtCase) Accept(v NodeVisitor) { // StmtCatch node type StmtCatch struct { Node - Types []Vertex - Var Vertex - Stmts []Vertex + CatchTkn *token.Token + OpenParenthesisTkn *token.Token + Types []Vertex + SeparatorTkns []*token.Token + Var Vertex + CloseParenthesisTkn *token.Token + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtCatch) Accept(v NodeVisitor) { @@ -415,7 +421,10 @@ func (n *StmtExpression) Accept(v NodeVisitor) { // StmtFinally node type StmtFinally struct { Node - Stmts []Vertex + FinallyTkn *token.Token + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtFinally) Accept(v NodeVisitor) { @@ -776,9 +785,12 @@ func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { // StmtTry node type StmtTry struct { Node - Stmts []Vertex - Catches []Vertex - Finally Vertex + TryTkn *token.Token + OpenCurlyBracket *token.Token + Stmts []Vertex + CloseCurlyBracket *token.Token + Catches []Vertex + Finally Vertex } func (n *StmtTry) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index fc28ce8..83a3410 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -239,3 +239,24 @@ func (v *FilterTokens) StmtDeclare(n *ast.StmtDeclare) { func (v *FilterTokens) StmtNop(n *ast.StmtNop) { n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtTry(n *ast.StmtTry) { + n.TryTkn = nil + n.OpenCurlyBracket = nil + n.CloseCurlyBracket = nil +} + +func (v *FilterTokens) StmtCatch(n *ast.StmtCatch) { + n.CatchTkn = nil + n.OpenParenthesisTkn = nil + n.SeparatorTkns = nil + n.CloseParenthesisTkn = nil + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil +} + +func (v *FilterTokens) StmtFinally(n *ast.StmtFinally) { + n.FinallyTkn = nil + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 07318bd..fab6102 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2009,26 +2009,15 @@ func (p *Printer) printStmtCase(n *ast.StmtCase) { p.printNodes(n.Stmts) } -func (p *Printer) printStmtCatch(n ast.Vertex) { - nn := n.(*ast.StmtCatch) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("catch")) - p.printFreeFloating(nn, token.Catch) - p.write([]byte("(")) - - p.joinPrintRefactored("|", nn.Types) - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte(")")) - p.printFreeFloating(nn, token.Cond) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtCatch(n *ast.StmtCatch) { + p.printToken(n.CatchTkn, "catch") + p.printToken(n.OpenParenthesisTkn, "(") + p.printSeparatedList(n.Types, n.SeparatorTkns, "|") + p.Print(n.Var) + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.OpenCurlyBracketTkn, "{") + p.printNodes(n.Stmts) + p.printToken(n.CloseCurlyBracketTkn, "}") } func (p *Printer) printStmtClassMethod(n ast.Vertex) { @@ -2296,18 +2285,11 @@ func (p *Printer) printStmtExpression(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtFinally(n ast.Vertex) { - nn := n.(*ast.StmtFinally) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("finally")) - p.printFreeFloating(nn, token.Finally) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtFinally(n *ast.StmtFinally) { + p.printToken(n.FinallyTkn, "finally") + p.printToken(n.OpenCurlyBracketTkn, "{") + p.printNodes(n.Stmts) + p.printToken(n.CloseCurlyBracketTkn, "}") } func (p *Printer) printStmtFor(n *ast.StmtFor) { @@ -2828,26 +2810,19 @@ func (p *Printer) printStmtTrait(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtTry(n ast.Vertex) { - nn := n.(*ast.StmtTry) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtTry(n *ast.StmtTry) { + p.printToken(n.TryTkn, "try") + p.printToken(n.OpenCurlyBracket, "{") + p.printNodes(n.Stmts) + p.printToken(n.CloseCurlyBracket, "}") - p.write([]byte("try")) - p.printFreeFloating(nn, token.Try) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - if nn.Catches != nil { - p.printNodes(nn.Catches) + if n.Catches != nil { + p.printNodes(n.Catches) } - if nn.Finally != nil { - p.Print(nn.Finally) + if n.Finally != nil { + p.Print(n.Finally) } - - p.printFreeFloating(nn, token.End) } func (p *Printer) printStmtUnset(n *ast.StmtUnset) { From 48aaa7cc474dddfc530a83acca44032b0ccf1daa Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 17 Sep 2020 16:37:34 +0300 Subject: [PATCH 066/140] [refactoring] update ast structure of "Throw" node --- internal/php5/php5.go | Bin 287826 -> 287603 bytes internal/php5/php5.y | 17 ++++++++--------- internal/php7/php7.go | Bin 241851 -> 240642 bytes internal/php7/php7.y | 17 ++++++++--------- pkg/ast/node.go | 4 +++- pkg/ast/visitor/filter_tokens.go | 5 +++++ pkg/printer/printer.go | 22 +++++----------------- 7 files changed, 29 insertions(+), 36 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 6527ca84144e97cec960d423a28227d51f28f739..f819223c6be86bef3d4702be7e8777a6d45f1526 100644 GIT binary patch delta 7404 zcma)Bd3?@S*8kjle_5W8O)MjeJeEZ5SrJrXOS)K66@*rns$Ee_)SxoP(kUahoT5~X zQHnGu*HjTpQM+iT3!3P3@J^={^u@Ha^F8UpIyKxkDIj3VD-)Ne%7$}Sguk;QT+E=~6^Kbb14g|(p@2$<2sgd-iWnd|P`6Ui zkm3qNOBvsh!k@#)+Tkj84~bGq@z+FsDsqFNVwFf22~?RcJ5!ei%0NNtWbJux(uMj>#LtJDJDpQPDt|OuyOiza2^AJ6Uz8QVSpbaD&KF)OfFbqz}EkNz4=NDI`(U zrOL@Nm=4Ype!9s!qLZMd**I(QW|2;H(o}tlYbGMeXN%}XFK+~yyG7*T@}XNHZJ(nm zh^}oh!eJnha^D5pp)DeoPT>oRz-WO?PNBE&sbqa{t2l1qPE4@&!t}XPu}6ux>XBG| z^?mU-iG}gkRfLA`o0vu5GJQ1fe zj*GQ|4>eW`BL9y?2JJZN$UrZBEVj|@aurWcpTqhcyc--=Zj@E&{kTPQCtRkpLwOZ%s&Ej{NMxh8#Y z9J*Qn!$;stqq2{ng0gGyvvtdbzs|iWhDq8v9fJtzAo}_iw(fRDMw+;$OLq{jMc>Ib zbo?wVS$112r6!#{o;39iOAo8qNdU}8gq=yeN#NXn8>jUO-}$cSCEKU4cc#*zyEyK` zCDoBq?};yQ|LU}(k#<`6;#QB03=q5BGSi0x+!1(%k2Fpjq2~;hp@RJU9;IjagN73~ zr?Lc5i|+W#bUNG*Hz@uRCWwH+Z8N1d3n^? zgoRx}ABA8mlMFpu`Rlf!vZJ8GQ{Z*j$Dcsop_yS4DTT9UH6u^d)%U|>S3%283NLq{ z9#Ky|FOXuqiLGd+@F#ZzX;JJuB8HgMA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tY#>r+>llZX%(k|ZKm7m zs`@s!67*9F3cEG*;s295m+^KN2FO3s%6eFEk=shw52-!TQs)L(xTMsycD}1lZ$>#lZO*gsmScVfOXtCZ zV3St?q43&o9`;Y<>nL@eRHOLr!NzF3d`=SFWGIYERw#Ucc+vmya6hNO%F-`QD2>An IX`~hZe>q(QlmGw# diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 21c19ac..cdd7bc5 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1167,15 +1167,14 @@ unticked_statement: } | T_THROW expr ';' { - $$ = &ast.StmtThrow{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtThrow{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ThrowTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_GOTO T_STRING ';' { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 5c94ada59c55fa257206a10c7ea3f6a2284f54bf..f784230e41ba8be76c84c374b4f0153e4fd0233b 100644 GIT binary patch delta 9771 zcmZ`;d3ct^wSQ(N3kgdSAS6JN?+X(4<=YoQNDzt`6o?=oAOTTO6cP%GD4_{+mDcT?ozY#L+0Dtx z7+sdxJ(J#@lE(DwT+z#RH{^*3UE9XvV!B5&yHoShMyIAtyDUF#AVTkDc5B*ZjPA

)sX^sdbAne=Y!k`el* z$dd(2MrdwFuUk-z?(xj-v`!hL|C8Ar*EwVKgY>Rj(lC9!IE^k$u`ZtA7!6ZPX18C7 zH+r-b0&Onw=9;drG^4vdz3Y}VbgR2&(B*c^=r-o2b;I;sx3ne0w77dl_uI_wyfTc| z?1Fi3D-%;wtq9F12UBk#LZ4)Ijrp{Weprz~Jj$2W4bvOGv^Bz%@O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zeBCOIOD42L1548QCg&`sarMFr LAU+6fQn7yljba`q diff --git a/internal/php7/php7.y b/internal/php7/php7.y index a679f14..920dc76 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1077,15 +1077,14 @@ statement: } | T_THROW expr ';' { - $$ = &ast.StmtThrow{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtThrow{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ThrowTkn: $1, + Expr: $2, + SemiColonTkn: $3, + } } | T_GOTO T_STRING ';' { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 0479183..e459723 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -709,7 +709,9 @@ func (n *StmtSwitch) Accept(v NodeVisitor) { // StmtThrow node type StmtThrow struct { Node - Expr Vertex + ThrowTkn *token.Token + Expr Vertex + SemiColonTkn *token.Token } func (n *StmtThrow) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 83a3410..62f7700 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -260,3 +260,8 @@ func (v *FilterTokens) StmtFinally(n *ast.StmtFinally) { n.OpenCurlyBracketTkn = nil n.CloseCurlyBracketTkn = nil } + +func (v *FilterTokens) StmtThrow(n *ast.StmtThrow) { + n.ThrowTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index fab6102..0ade2a0 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2674,23 +2674,11 @@ func (p *Printer) printStmtAltSwitch(n *ast.StmtSwitch) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtThrow(n ast.Vertex) { - nn := n.(*ast.StmtThrow) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("throw")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtThrow(n *ast.StmtThrow) { + p.printToken(n.ThrowTkn, "throw") + p.bufStart = " " + p.Print(n.Expr) + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtTraitAdaptationList(n ast.Vertex) { From 94aa9cf8291096235f7a92d11981fa59271e44c3 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 17 Sep 2020 16:49:54 +0300 Subject: [PATCH 067/140] [refactoring] update ast structure of "Goto" and "Label" nodes --- internal/php5/php5.go | Bin 287603 -> 287375 bytes internal/php5/php5.y | 26 +++++++++++++++-------- internal/php7/php7.go | Bin 240642 -> 240414 bytes internal/php7/php7.y | 26 +++++++++++++++-------- pkg/ast/node.go | 5 ++++- pkg/ast/visitor/filter_tokens.go | 9 ++++++++ pkg/printer/printer.go | 35 +++++++------------------------ 7 files changed, 55 insertions(+), 46 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f819223c6be86bef3d4702be7e8777a6d45f1526..2e1bb38eefe402006c4fdb148fc9c2bc5bac38b3 100644 GIT binary patch delta 8477 zcmZ`;3wV^p)qc**7ZM^N7a$k{*>DLLp|G3XWV0Y47)ZdsK)?ucQNm3tU_d~Tf)Ff~ z+6n}f90U=tDhi4Lg+aN6QmKL<7i|?$f>05ZtBAEm?R)0iCBgpXc{Dro%{O!A%zNJR z&iTIClep;Z#L8*SqJx>SvD0QuezJ#3`Q1~^%u~(i>z=HSMsIiG5)n(?|3)Q5}iP&vGWsRbu&)UDZf7v=NkQ&qY- zR-_bh#YpO*N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j6#YDl1f&9@t(bwkj6Aw4?g7AN3P-LAB~gGCxig zI;GthuOjrtIQ5v#@>EPNBRZ=wCSw8RT?C6@-9JgiqEr&pAYjjr$rBPmw!r@Y_qnbh z=RU|i*6-#A7?*#ByJbTVWxxg?Ko^0AAv!b7962l%LR_tcIOIQf2icaLUlPcW?U4Zs zRhg7#a-`L}rkCoiGkU5zW17V%W2~jdr>lZyIqV;R;2f5hi^DLS*b;2W1)ptT7B@d3xseCCzzIjksXxUE zeJgMZmPS!?Au~9eZ0ZUy=70TKKSv3-gy-YQ;#p)J#ddf@^g0 z0GJCmoAF75c@s(0AcVs2U5f&<2dQ(^tn-p0t21)OZ`4F;QaHv%SH0uQ<-cgRl=I(8y zyK59oYMGP5W$R28^q}Vip8HyMkG8g3B!c%glI(c`6lZAC(Z5t^CU#y*GDj6z7tC!9 z>@8%EineEfEzX_Wm`2WcwBvCdW1f43P` zj`QqX9IFBE+i=?{4{-l_vUN#dz)z67AOwcwnx_HxE2gN?Fax8NbxB!>H_wjdWnDN? zKR;E?q6n8E;4kc{sgg2X^^}g&)orW4>2cO)eROFp<^Xwf2F`QI$b8jZc1=}@y4%yL z3q~oAE|{r4Vsr7pLqF5j!t}Tbb%jiiH$yR$iPa091s0eDd}FSfB^P$%d(P0=>K6*1 z4K+xy3LXu7)aos_7O3Iu%azqVRH+=wN24^~y7ZBSsu$T_h&#&)6t-a~HW}F2aCOvQ zEmr-Zlh@wgf1H_HmLN0DRWoo^E0P~(Ky+m-J|4TGxK?jore21US(c-|;aAFBclN%h zZWF#s7@30wjVnWt-|FZ8TBBwik?no?czMP7N_vr7vGoYmK9fTEnGcJ3e;VIU~?v z=lchy*EgthtZ)O(n$v#FEzrRWR?91v@}MF9CRAu8WoHJCx`D0n;tNcmMzZ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 920dc76..e4709aa 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1089,30 +1089,38 @@ statement: | T_GOTO T_STRING ';' { label := &ast.Identifier{ast.Node{}, $2.Value} - $$ = &ast.StmtGoto{ast.Node{}, label} + + $$ = &ast.StmtGoto{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + GotoTkn: $1, + Label: label, + SemiColonTkn: $3, + } // save position label.GetNode().Position = position.NewTokenPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) yylex.(*Parser).setFreeFloating(label, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_STRING ':' { label := &ast.Identifier{ast.Node{}, $1.Value} - $$ = &ast.StmtLabel{ast.Node{}, label} + $$ = &ast.StmtLabel{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + LabelName: label, + ColonTkn: $2, + } // save position label.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $1.SkippedTokens) } catch_list: diff --git a/pkg/ast/node.go b/pkg/ast/node.go index e459723..7882623 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -505,7 +505,9 @@ func (n *StmtGlobal) Accept(v NodeVisitor) { // StmtGoto node type StmtGoto struct { Node - Label Vertex + GotoTkn *token.Token + Label Vertex + SemiColonTkn *token.Token } func (n *StmtGoto) Accept(v NodeVisitor) { @@ -582,6 +584,7 @@ func (n *StmtInterfaceExtends) Accept(v NodeVisitor) { type StmtLabel struct { Node LabelName Vertex + ColonTkn *token.Token } func (n *StmtLabel) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 62f7700..579bb8d 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -265,3 +265,12 @@ func (v *FilterTokens) StmtThrow(n *ast.StmtThrow) { n.ThrowTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtGoto(n *ast.StmtGoto) { + n.GotoTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtLabel(n *ast.StmtLabel) { + n.ColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0ade2a0..2dd68a4 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2425,23 +2425,11 @@ func (p *Printer) printStmtGlobal(n *ast.StmtGlobal) { p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtGoto(n ast.Vertex) { - nn := n.(*ast.StmtGoto) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("goto")) - if nn.Label.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Label) - p.printFreeFloating(nn, token.Label) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtGoto(n *ast.StmtGoto) { + p.printToken(n.GotoTkn, "goto") + p.bufStart = " " + p.Print(n.Label) + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtHaltCompiler(n *ast.StmtHaltCompiler) { @@ -2527,16 +2515,9 @@ func (p *Printer) printStmtInterface(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtLabel(n ast.Vertex) { - nn := n.(*ast.StmtLabel) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.LabelName) - p.printFreeFloating(nn, token.Label) - - p.write([]byte(":")) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtLabel(n *ast.StmtLabel) { + p.Print(n.LabelName) + p.printToken(n.ColonTkn, ":") } func (p *Printer) printStmtNamespace(n *ast.StmtNamespace) { From bf3ae74d5640e3ca95f0f0106e84509faa2c8027 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 22:02:36 +0200 Subject: [PATCH 068/140] [refactoring] update ast structure of "Identifier" --- internal/php5/php5.go | Bin 287375 -> 288256 bytes internal/php5/php5.y | 620 ++++++++++++++++++++++++++++-------------- internal/php7/php7.go | Bin 240414 -> 240491 bytes internal/php7/php7.y | 559 ++++++++++++++++++++++--------------- pkg/ast/node.go | 3 +- 5 files changed, 757 insertions(+), 425 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 2e1bb38eefe402006c4fdb148fc9c2bc5bac38b3..e4b164640dcef6809d57294149825cb577ea49b6 100644 GIT binary patch delta 13848 zcmcIqcYM`Fw*Q=&UkFJ^ql6M57f2`y$-OtZO?na#gg|IZ??pg`P?aWu1#C|VqB$0j zULMUYTUT9N@O@`~H;uRNJqh^Ny}vX4%qib<&MbdBHupem z;Scp!p00my^;DlTJbdPyoRu9#{mqXwI1sjZbmFrQ)D53Kdb(rIob1tKXFA$Dh9)N` z51%w;=Df`f3xBG+GWy-Rn_IlwSk?*l>g%f1XUP6_)ytaPm73}u?q4k~I4Wb}ZI#*< zAH7hkv@LV|gi3AqpXnV_x~KkAZ>zlCxyx@;g~m!NzIK4d3Y9GB#EoIy$BmydbJB!K z<9XWG)QHzNp&I=AB8ucr$EkY$W~#;?Xi~=%D&Qt#DS><9S^ZY|9+s@`E5}XrMWxyDj)EaCHK7Q5wup8#S$N8KSyH;e_3bGW|222?76(z4 zb~mjvHuCgf5zp92x8UwtWMFF7AKqVceyj^+inQ`gKFJSuEoWuy&6v(pw$oa~_jbdo z&s?xq&EQc1aBM_t;b!M7aB+SIdYs$)i2o>)hgarr9}+(2RqX!vUf6xAlkcA_Ts&_8 zg{g(T>C;M=@_$`%4VBx6`Vda2FO*BRQHZ+Gm-fB8@1=OCJ)f2S>`ICh?a^n5yqGH@y9qh*kgHP{eV45nG+<|g|nPUR(0 zI`PP%;CCvc!Ocg8QU>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<27biw<_z(+S#UTk zVZ+a9Ztgb_-#MmCr74Pz%ob-fv)}8MXRZ^^Xrn>J%TM^ah#J-cj-}5LubUm;^&HD3 zM6FcWZ=UF{X~K^}$)rVM4sCl17b9_j=p&58kWYgCotCJ*#CYd1!YY zIE5C_tm!#pdMhZUpGHUFpaGPCZ*j$+=v4?OGm9SBwKH*z+~YMVoFr zyF#TNU`9vHC|@{jR?C{J`ArMe{|A2aQPW3ULdAo{WzjtiXQY5mm1{*D9l6~YV@x1u z?4)>=C?L3iRC&X1#5%iusDe1#*Muc|6MRh^<^5I^I1Zt~Ck( zshc*iNr(od7gLXQXRYrXfK&-~esj@>HvWM}%bs_NJM|=02@Jm4zSRA)-db!BC(k+w zmjXwAvl^7Z17fX{K*{ Date: Fri, 20 Nov 2020 22:07:58 +0200 Subject: [PATCH 069/140] [refactoring] update ast structure of "Nullable" --- internal/php5/php5.go | Bin 288256 -> 289296 bytes internal/php7/php7.go | Bin 240491 -> 239425 bytes internal/php7/php7.y | 14 +++++++------- pkg/ast/node.go | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e4b164640dcef6809d57294149825cb577ea49b6..56f92ea4f48b2ce62de30626dd1de5cf3cc835f1 100644 GIT binary patch delta 6960 zcmYkBd3;XC9>za2a}d30G^MrXeS=aV+NPFjY(Z?-QcENfqO?WO#V*oR?WI~p>0DQ} zC<%&EWYpSRqLxyz)!It!gimANduN_G=gj<-e9!ayJ+q!O%RBbh@EM20$F3uZ5wv7U zKBOBBiV+c{6HycsN(16-fQi43!tn(X z&2~xSaxao)ibQS=5=qrR1vSY`=$$LEpqLp=8i8`7 zB^A~tjtb&Z3y82+NHI`R52?NSs#`^+@%QSG-@QQoR$bCh!NN=yDK6C|NpKwZnat`{ zpY(=D!4BzossZ^AG)Y16Wh@y7E&nD9@;Z&lQDp+C(S-C>Q2B|BThWAc_p$<_N*w89 z92Yis9oIB)0wO7%jEAO(-)*Jq2qx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8qvN_Lj7tE4NTTp^1o@cbV zttj1SO{plF(&e_4X2ckZl^1**U-;AutWOri@<((B2xsDWf-V=KeF87^l!`=-&kj_Q zJ92z$(jaO&;Y?tANN2AtD?9UKFTBMa9IqP~zPpP7F{+yvB94-FW_O%ZOk2_2_;l`J z+8az;w&`iF90rU^Hcm%PTW0nqP771e$^LlrM+(QAjQ(CDXZ7W0ang~B`cW!QqcnQ} zKk0hTQ4?o>{P`u_-Z$wP9F6KXR@P>4``L&|w-4eGxG|9GGWna{yssZZraECL$MX;; z4u%^Lr|G>5?X(e~y>B|MkE;${-{*<$y#OCpykBphX-49wmxosj3a{H6V^11zFt(>Y>V%sD> z0OuE}@f5yCPm@&C4I7uI^A%c`^JnlXJV4MfzmVU++0`UUW^ueSq7+_aM+p6yO?*(y z@oI_R+%jhK)z}%*wK>iTAtjXXZkQkG$$5OSp|%V7H&}$yc6rNKRmRV2ADq%pm+%hS z1)=dW`yY-_TF$$AF-Mm3CowO6^?T$+9*v_w5-;;QLo3(tUdHpsSGavuLC-1cxcvY? py7Uj;Q+rB93!NG)S@pW(Q?XfntsJ_U+lTUI-pq9oXW!uC{tsgd4)p*4 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 72ec026..0bfff99 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1948,13 +1948,13 @@ type_expr: } | '?' type { - $$ = &ast.Nullable{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.Nullable{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + QuestionTkn: $1, + Expr: $2, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d792bea..eaf4930 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -33,7 +33,8 @@ func (n *Root) Accept(v NodeVisitor) { // Nullable node type Nullable struct { Node - Expr Vertex + QuestionTkn *token.Token + Expr Vertex } func (n *Nullable) Accept(v NodeVisitor) { From ddb9f3b985f47fc5e2078562b026511c8d4ffa89 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 22:14:26 +0200 Subject: [PATCH 070/140] [refactoring] update ast structure of parameter "Variadic" and "Reference" nodes --- internal/php5/php5.go | Bin 289296 -> 288140 bytes internal/php5/php5.y | 40 ++++++++++++++++++++++++++++------------ internal/php7/php7.go | Bin 239425 -> 239309 bytes internal/php7/php7.y | 40 ++++++++++++++++++++++++++++------------ pkg/ast/node.go | 6 ++++-- 5 files changed, 60 insertions(+), 26 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 56f92ea4f48b2ce62de30626dd1de5cf3cc835f1..ad07c76ef19c11d7677447c264197942a66905bc 100644 GIT binary patch delta 10731 zcmc&)X?&K&wg1h`10<0pL3TpkH;}Ljy!#R)CO`o}F|5HL0hCoG0*VxoCE`MnUO)>+ zv<2cq!39FA4z?5$v=l*EyeKLa0ckHzqpC+S9_h%+G5!q3f7^+TR^vYEmdD1ZuelW5fq~Zftd!WB z+%H$|! z3{Dk3IV!|DK#L0DqbI`b1M~H>2%AE+3o+a*%Ens$$6{;}r`kfOo|a@!F<842f1nhTMC8nNufdPL-W;bFq>wEw+&`x zma^**cDtdJTW(_OEIMhJ%P+-nwow?iJ)_uE`#ESVTVQDE)UB}I_A;3D)-sqCU-whh zIQ$$u4g>hQUtu{iej8iN^e25Vo{cr&uyVHBfU@UAHrRfynZ!zkA!s~>jTUs|P6()+ z&W3S`&j+{x?wZLyv!4~S*eLsXdJb!j!=X4@+{a?}^Uk@fC6kr+vr-stC&sSMV=e6G zb@N%mem?ww_xa}qjKlnj_WOnGuqF6%vG;kRl8v(Hh^4Ht{ap00$F}iNcG05Sm$A*l z2%Epc`z&6?mYXT)Z%<&G^kkns$;R4w$E{^?E8sW8J~f}TeI4woNxMGHhB^9^)~;ta z8IW&ai!9~FjqFx4+_uW{(5fn&0>w?Op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xdK28*gnkV8$;ZOWgwhJ2hG z3eIdSF~@~iK&rk6B;DWxw?OhIf&@$rX;q>eVw%x4>^tTmh)NJ_CCeVQTz;fR%}o$D zrO0gEc>^lhocA@87zq4)c$$2G|8SA8`Q4y!zBC1P9cm^|2WySCl)r2Z+ithO;8&A1 z27vrlvM`V}<_xyqn}i8?v*JFPqtQ28TJ1JA`gSU-k~Y$%v*xm!&YR>`9n)l~;M?tC zr)8wGd%^bf%+-9Q3Z8zmDwzlw)u~%@e0%f2r7mrM70#U8+ruz2)!!D zaiTd!jVpjBpw@?OjK|*R{(_58mvO**Qw6ho)K7flcVoeo1Ef3-Y zoe^?!g!Y@o{Ri2wnr?O%y~7YY5RA6^8$;g1AcVT)Z+g zazz$(;*2SBi1c82{$-I;C{jbPRhh2^U3uO#sB8HZn6_iia)tI>9jf&OKl*#v?zVyp zT0E3b=Gbx>rEZr=L6mNOdqqa1`_j!8v$aB`v5B|CXAqQMWr@1#_H5XxF*2D@z62jz zViwkXD?7Ydbmh_;)K)EfQtmK4!F*Et4Yqz7swTDyE9c6c1lPh%wrdr>Ede~UKqT75 z9gQYN@cw6DN4itRE|9&j>U-6&MRJiO3!zri)fKurswx6WkBMeF>9JJ)9q4;i%JZ_n z)Ty7UDwfGndhjw^f|++fiBL^e$b9s3!`e}(jjK@b$QRg@4BNz)!FFYh93C7D%^M(( i1@y>~bHJhDD{zQ2v@-AHHtUd4u3%Sh$jjDA=f43e)xs Date: Fri, 20 Nov 2020 22:25:37 +0200 Subject: [PATCH 071/140] [refactoring] update ast structure of parameter "Parameter" node --- internal/php5/php5.go | Bin 288140 -> 288363 bytes internal/php5/php5.y | 42 +++++++++++++++++++++++++++--------------- internal/php7/php7.go | Bin 239309 -> 239265 bytes internal/php7/php7.y | 40 ++++++++++++++++++++++++++-------------- pkg/ast/node.go | 1 + 5 files changed, 54 insertions(+), 29 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index ad07c76ef19c11d7677447c264197942a66905bc..199fa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a$ zec}`l9%hPGAA4q|UM3#;eagfy0|59cl9=g}cto&d#(9dVzdQ?1j-Nbz+=nMmvQfNS RGZ#-8sd>DqvuC87{|kL|$n^jK diff --git a/internal/php5/php5.y b/internal/php5/php5.y index d801635..0e7e6fa 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2060,19 +2060,24 @@ parameter: } } - $$ = &ast.Parameter{ast.Node{}, $1, variable, nil} - + pos := position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) + pos = position.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.GetNode().Position = position.NewTokensPosition($2, $4) + pos = position.NewTokensPosition($2, $4) } else if $3 != nil { - $$.GetNode().Position = position.NewTokensPosition($3, $4) - } else { - $$.GetNode().Position = position.NewTokenPosition($4) + pos = position.NewTokensPosition($3, $4) + } + + $$ = &ast.Parameter{ + Node: ast.Node{ + Position: pos, + }, + Type: $1, + Var: variable, } } - | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar + | optional_class_type is_reference is_variadic T_VARIABLE '=' expr { identifier := &ast.Identifier{ Node: ast.Node{ @@ -2108,16 +2113,23 @@ parameter: } } - $$ = &ast.Parameter{ast.Node{}, $1, variable, $6} - + pos := position.NewTokenNodePosition($4, $6) if $1 != nil { - $$.GetNode().Position = position.NewNodesPosition($1, $6) + pos = position.NewNodesPosition($1, $6) } else if $2 != nil { - $$.GetNode().Position = position.NewTokenNodePosition($2, $6) + pos = position.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.GetNode().Position = position.NewTokenNodePosition($3, $6) - } else { - $$.GetNode().Position = position.NewTokenNodePosition($4, $6) + pos = position.NewTokenNodePosition($3, $6) + } + + $$ = &ast.Parameter{ + Node: ast.Node{ + Position: pos, + }, + Type: $1, + Var: variable, + EqualTkn: $5, + DefaultValue: $6, } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index a3ed309bbded8bd06727da832288419e18468d6b..62c54a9db833c3a233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;Z1LYP{-MV}G?igJD!ZSFnguBc76l kaI1MIW$~$};dWGA`-N`z;$NRZ7fgKHdI2Z%yc+5KA2wDhu>b%7 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 602859b..586a9aa 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1884,16 +1884,21 @@ parameter: } } - $$ = &ast.Parameter{ast.Node{}, $1, variable, nil} - + pos := position.NewTokenPosition($4) if $1 != nil { - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) + pos = position.NewNodeTokenPosition($1, $4) } else if $2 != nil { - $$.GetNode().Position = position.NewTokensPosition($2, $4) + pos = position.NewTokensPosition($2, $4) } else if $3 != nil { - $$.GetNode().Position = position.NewTokensPosition($3, $4) - } else { - $$.GetNode().Position = position.NewTokenPosition($4) + pos = position.NewTokensPosition($3, $4) + } + + $$ = &ast.Parameter{ + Node: ast.Node{ + Position: pos, + }, + Type: $1, + Var: variable, } } | optional_type is_reference is_variadic T_VARIABLE '=' expr @@ -1932,16 +1937,23 @@ parameter: } } - $$ = &ast.Parameter{ast.Node{}, $1, variable, $6} - + pos := position.NewTokenNodePosition($4, $6) if $1 != nil { - $$.GetNode().Position = position.NewNodesPosition($1, $6) + pos = position.NewNodesPosition($1, $6) } else if $2 != nil { - $$.GetNode().Position = position.NewTokenNodePosition($2, $6) + pos = position.NewTokenNodePosition($2, $6) } else if $3 != nil { - $$.GetNode().Position = position.NewTokenNodePosition($3, $6) - } else { - $$.GetNode().Position = position.NewTokenNodePosition($4, $6) + pos = position.NewTokenNodePosition($3, $6) + } + + $$ = &ast.Parameter{ + Node: ast.Node{ + Position: pos, + }, + Type: $1, + Var: variable, + EqualTkn: $5, + DefaultValue: $6, } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 5242bf6..8d4b885 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -68,6 +68,7 @@ type Parameter struct { Node Type Vertex Var Vertex + EqualTkn *token.Token DefaultValue Vertex } From 7e2965f53b0f48b94d03ccace652839f65eaf2b1 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 22:57:27 +0200 Subject: [PATCH 072/140] [refactoring] update ast structure of "Argument" and "ArgumentList" nodes --- internal/php5/php5.go | Bin 288363 -> 288783 bytes internal/php5/php5.y | 120 +++++++++++++++++----------------- internal/php7/php7.go | Bin 239265 -> 239825 bytes internal/php7/php7.y | 73 ++++++++++----------- pkg/ast/node.go | 11 ++-- pkg/ast/visitor/dump.go | 10 --- pkg/printer/pretty_printer.go | 4 +- pkg/printer/printer.go | 4 +- 8 files changed, 106 insertions(+), 116 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 199faecd90d1e29eefba5daee8ffbce002b0b852..1e89fea02c196214cf799a1f33cd76dc8a4b1093 100644 GIT binary patch delta 14364 zcmaib37l2MvG=e092jQUR|kffdxu?QhPyAIZ0?3N3L+qjf{F_a2r5xv^oho(z<8Cy zg#h~H#SH@DN8|QDqvl2SNHiK3P{ainP^09j@cpa$+;a|?yzlpOuD5IN>gwvM?#sb# zt(WX-y>3pYCaGAgtZdG_y23!+al?I`R#YZ(`AnZ^GT$ef&L;XqbJHV5|1UJDGBDZXk@3sRe2U1i(|mH#NsU6nhQ%| zG*2%U14klVcw_5>tt=MF%xwL52Zg70{h;t7_A55}-F;M!+)_H4z@NQ6ELhjzAW&Eq&v zCoanpPj6_yYl*7FngAgm2q4C?dhcVy=H0jIajc2gH3driaYQo2|B!h6-##GKqIse= z5bU?Yiao;{v%_P#4TtxvZLH!OR{i}?N+k+cygR8U8GL{vMiZt*liq17{inrFk1{8g>UeB4R8AZ$orp1g*E$fU6@5SHg9`g-I{nx zZ0DuG0IN{)LAg?yLiEG(GSF~P)a3JpAs>$J$mHzm8fIi0Je`Tcx)1Mf59`u00es0? znXz19;{JX*9xFVsKdBKnyY^qK;)U9esxhyTAGO2hw2yk=^RACZ)>`{HAYd(PwLS^v zD{kZY!^~`6#3$EN5(tkuDFu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X@yCm zDGktO`zKTq{)XR{a=>q@hjjArG+?k2Nkd50Z;8U~7kQ`6df|WjzBRrZtPCR5@`OTQ z67}uw6%Zm}Yy9z;*T_klM$?O*%hp#}?2yd(`f!zpWQzYbOW`li>t3--e4yEhXwt$Xm`>Vu-&W$Af{^cGw99cU) zl=bY@UJs#f8RmT~NDajbHP^tLew_&=4Gb|pc*!Z$J4blv$}uYH{T!G8F3^Lo^7`93 zyp1z|UomE#o}Lbm&XLzi&h=z{CHjQiaXD5}zbSBi Qqq11akX diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 0e7e6fa..f905e1d 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -242,7 +242,7 @@ import ( %type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list echo_expr_list %type trait_adaptations unset_variables declare_list -%type switch_case_list +%type switch_case_list non_empty_function_call_parameter_list %type method_body %type foreach_statement for_statement while_statement %type foreach_variable foreach_optional_arg @@ -258,7 +258,7 @@ import ( %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration -%type interface_list non_empty_function_call_parameter_list trait_list trait_adaptation_list non_empty_trait_adaptation_list +%type interface_list trait_list trait_adaptation_list non_empty_trait_adaptation_list %type trait_reference_list non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list %type chaining_dereference chaining_instance_call chaining_method_or_property instance_call variable_property @@ -2170,38 +2170,40 @@ optional_class_type: function_call_parameter_list: '(' ')' { - $$ = &ast.ArgumentList{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) + $$ = &ast.ArgumentList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + OpenParenthesisTkn: $1, + CloseParenthesisTkn: $2, + } } | '(' non_empty_function_call_parameter_list ')' { - $$ = &ast.ArgumentList{ast.Node{}, $2} + argumentList := $2.(*ast.ArgumentList) + argumentList.Position = position.NewTokensPosition($1, $3) + argumentList.OpenParenthesisTkn = $1 + argumentList.CloseParenthesisTkn = $3 - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = argumentList } | '(' yield_expr ')' { - arg := &ast.Argument{ast.Node{}, false, false, $2} - $$ = &ast.ArgumentList{ast.Node{}, []ast.Vertex{arg}} - - // save position - arg.GetNode().Position = position.NewNodePosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = &ast.ArgumentList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenParenthesisTkn: $1, + Arguments: []ast.Vertex{ + &ast.Argument{ + Node: ast.Node{ + Position: position.NewNodePosition($2), + }, + Expr: $2, + }, + }, + CloseParenthesisTkn: $3, + } } ; @@ -2209,57 +2211,57 @@ function_call_parameter_list: non_empty_function_call_parameter_list: function_call_parameter { - $$ = []ast.Vertex{$1} + $$ = &ast.ArgumentList{ + Arguments: []ast.Vertex{$1}, + } } | non_empty_function_call_parameter_list ',' function_call_parameter { - $$ = append($1, $3) + $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) + $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; function_call_parameter: expr_without_variable { - $$ = &ast.Argument{ast.Node{}, false, false, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Expr: $1, + } } | variable { - $$ = &ast.Argument{ast.Node{}, false, false, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Expr: $1, + } } | '&' w_variable { - $$ = &ast.Argument{ast.Node{}, false, true, $2} - - // save position - $$.GetNode().Position = position.NewNodePosition($2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + AmpersandTkn: $1, + Expr: $2, + } } | T_ELLIPSIS expr { - $$ = &ast.Argument{ast.Node{}, true, false, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + VariadicTkn: $1, + Expr: $2, + } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 62c54a9db833c3a233ea77f83e09ff033627c32d..a66ce9259d8c3eaa4ac90001eed929d29f88aa41 100644 GIT binary patch delta 12237 zcmZ`<33wGnw*IP`5N=3F!V;D&_XY?A4_C=O}fP!p6)EO38L`GzgL{StJ!3BH> z7`c*zh)5ho#0`eQLKX*xL4^S!sBZ?5_kxZvgP)8zt|In}qj6X$)OeeHApI%}Oe zT~(p(NUQq#R$KBriRiZ0oqBb+KOBzr3WOt8uRttp^~&;Du_V$~1b^Zo`Z0S2tT>Lb z5(ro{&E1VUXeDW&6~~__zQq&x7LJizGE6_HFp(tGilImZe*=j~sMn-G zBte2P#N#o-lL`7E$2r(IIuzr;$e$RF zh>*vWEGvdXQEP&bFsY7VT*Hx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qUp3V%jn35i(ZRC3L)9XK=$`GYiUXacB} zke+mp%5j2xxh+G_;B8UwU7~PoGYZoY{o}o=pUsOON$3&F)of+5W?R&BN*}!@^wySPiU|L2oSMC%KM~s@_HisyBGH-$vz+nL@?3wMJCX JLyxKG{{h?$=F variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list -%type if_stmt const_list +%type if_stmt const_list non_empty_argument_list %type alt_if_stmt %type if_stmt_without_else %type class_const_decl @@ -280,7 +280,7 @@ import ( %type unprefixed_use_declarations inline_use_declarations property_list %type case_list trait_adaptation_list %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list -%type array_pair_list non_empty_argument_list top_statement_list +%type array_pair_list top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers %type non_empty_member_modifiers name_list class_modifiers @@ -2030,66 +2030,61 @@ return_type: argument_list: '(' ')' { - $$ = &ast.ArgumentList{ast.Node{}, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) + $$ = &ast.ArgumentList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + OpenParenthesisTkn: $1, + CloseParenthesisTkn: $2, + } } | '(' non_empty_argument_list possible_comma ')' { - $$ = &ast.ArgumentList{ast.Node{}, $2} + argumentList := $2.(*ast.ArgumentList) + argumentList.Position = position.NewTokensPosition($1, $4) + argumentList.OpenParenthesisTkn = $1 + argumentList.SeparatorTkns = append(argumentList.SeparatorTkns, $3) + argumentList.CloseParenthesisTkn = $4 - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - if $3 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($3.SkippedTokens, $4.SkippedTokens...)) - } else { - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) - } + $$ = argumentList } ; non_empty_argument_list: argument { - $$ = []ast.Vertex{$1} + $$ = &ast.ArgumentList{ + Arguments: []ast.Vertex{$1}, + } } | non_empty_argument_list ',' argument { - $$ = append($1, $3) + $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) + $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; argument: expr { - $$ = &ast.Argument{ast.Node{}, false, false, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Expr: $1, + } } | T_ELLIPSIS expr { - $$ = &ast.Argument{ast.Node{}, true, false, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.Argument{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + VariadicTkn: $1, + Expr: $2, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 8d4b885..9cc59f4 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -90,7 +90,10 @@ func (n *Identifier) Accept(v NodeVisitor) { // ArgumentList node type ArgumentList struct { Node - Arguments []Vertex + OpenParenthesisTkn *token.Token + Arguments []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token } func (n *ArgumentList) Accept(v NodeVisitor) { @@ -100,9 +103,9 @@ func (n *ArgumentList) Accept(v NodeVisitor) { // Argument node type Argument struct { Node - Variadic bool - IsReference bool - Expr Vertex + VariadicTkn *token.Token + AmpersandTkn *token.Token + Expr Vertex } func (n *Argument) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index d8160c1..7e11d72 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -240,16 +240,6 @@ func (v *Dump) Argument(n *ast.Argument) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Argument{\n") v.printNode(n.GetNode()) - - 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) StmtBreak(n *ast.StmtBreak) { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 67d4571..6caa793 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -465,11 +465,11 @@ func (p *PrettyPrinter) printNodeNullable(n ast.Vertex) { func (p *PrettyPrinter) printNodeArgument(n ast.Vertex) { nn := n.(*ast.Argument) - if nn.IsReference { + if nn.AmpersandTkn != nil { io.WriteString(p.w, "&") } - if nn.Variadic { + if nn.VariadicTkn != nil { io.WriteString(p.w, "...") } diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 2dd68a4..7f5fae5 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -561,12 +561,12 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { nn := n.(*ast.Argument) p.printFreeFloating(nn, token.Start) - if nn.IsReference { + if nn.AmpersandTkn != nil { p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) - if nn.Variadic { + if nn.VariadicTkn != nil { p.write([]byte("...")) } From e3ad9747f472a8b67d879926f0877d52c61182be Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 23:08:30 +0200 Subject: [PATCH 073/140] [refactoring] update ast structure of "Lnumber" and "Dnumber" nodes --- internal/php5/php5.go | Bin 288783 -> 288752 bytes internal/php5/php5.y | 36 ++++++++++++++++++------------- internal/php7/php7.go | Bin 239825 -> 239733 bytes internal/php7/php7.y | 49 ++++++++++++++++++++++++------------------ pkg/ast/node.go | 6 ++++-- 5 files changed, 53 insertions(+), 38 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 1e89fea02c196214cf799a1f33cd76dc8a4b1093..51b160f699860b239e55ba78bcf2e11522c8aba3 100644 GIT binary patch delta 389 zcmZ|JKP*FW5C`zwy^BB9MBh@hQcW@V6Mr79G!bf$wuYxdM714M%G5-}pRgez7KWzz zE+V>%*nS%^8!$-(L2MSIjrY<-EQU+IclXKV4sZ3(8~uFEQxS4FRyLLj!`!e_^z0Qq zWEHETN82C7dn;$eT+L@u3Q8NU1JnqAlAUOo(U$++s-vV9{(u-1$7dDSB5hFh?-?I1 z1Jn-PC3VU*DtW?0jvp{o&mC|PJJmr{+6h-~_99WwqV8kjV+yOYDd{G)IWErx&6Mch zQ7hwhS8Gxi6S6?qKGK?C#Y#0cDf3i@lUkYhXKZ3?Sg}%_CS{JeuLpOX+>CEG>oC{3 z24+g)6v9X|bs^Fr)p+@$0Dd Ue}?R4mJ!KGtW2gDPm5yw0KGtZZ2$lO delta 355 zcmYk0&nv@m7{_~_&x2XiMloMyQ6yFyD_SWcnS-{q6~04@{3zvDQcgly4jQrEN1T*{ z+&(TOH#yi}faIpM$(`?7;qW}YU(fS8yt9waRK|I^W)%DE_SN;J!)~tGP8-RzLDsNN z8)~-;Tl?%nxK}=q8CENQsJ}*3;Qg1&5%IHuizX^X##BX^7*!ta?H4a0_e~4P+ISwf zUh%*|T&5QXq=itq$8LQUlsYEAPQ@%)$3yZ&cpH*||EER<9a-*iL}m!DXY7U*OLS{g zrl=rBRY9SVywdPYwFtXd^v))m~$K{mSAIOI|V`I`P>dS-4sGpW#L5VSLW~KcH DW#e+F diff --git a/internal/php5/php5.y b/internal/php5/php5.y index f905e1d..e529812 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -4493,23 +4493,23 @@ ctor_arguments: common_scalar: T_LNUMBER { - $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarLnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } | T_DNUMBER { - $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarDnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } | T_CONSTANT_ENCAPSED_STRING { @@ -6146,7 +6146,13 @@ encaps_var_offset: { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { - $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + $$ = &ast.ScalarLnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } else { $$ = &ast.ScalarString{ast.Node{}, $1.Value} } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index a66ce9259d8c3eaa4ac90001eed929d29f88aa41..1ee2e1fbb86abfa51cd51c2e6b3bee21fb1ab3bd 100644 GIT binary patch delta 464 zcma)1%PWL&6z$$?@Oj1542?%DOc;;B45erykvy}c^m!FA@{B|y#d5sQLYk38R zYhhud_ya6#WI?19vhWS%v9mmnd(OF+mkG}o386$AmlrRZZOdjGDYK1DZ#d22I(TZx z8qqvC+>NYw&V}7WNeE_0BtkyX;H}|kb~&+IK(*+#h~vLUYSSvQGw61Z{+*ryXA8&u ztuT>>m0n3fOQ#`?7{%(|FCAnmi_x@M1Xjgssi@4f>*EuJ?LGRCKGx_p#`cXtcTfW! z^C=pMA&Nr!9chu_KMd)*jnnYrr#MW$a~f-NxbRCde5V|N)+0{F^qQQ(cg@8Josb&fTjsI8A$3%$7GC*@aK0t=SgDds<%V1_m8+?s6p^almTX3wi&8%$)zXgi(=Qww zkU{!#x62QY;eClx4|~$}+iZ{n#BL`>o45+r1F2`XD-0|M-qJDh4h^Qvg{&KPAaE!p EAJ>AElK=n! delta 404 zcmex*f$!o)z6}CWOlBs{LQ?HQQjFV$q?lNLO)pAkl9>Kpf%*OPQzFcT2ri?+^ukJJ zm+i)4%ttHW!o1UiJ~9bSzYxJBIQ@b+GwXDL$;>j-Kgco*Ot+cL>^J>^8L+#k%CrYafx1Va$-(mkq<;@dUzkR$#kQM%vsZ! zM3_aV8=VEZNq;iX(5?N0sL13yeZypCuIWNL zKnLAdVZJimd>F1U+doY?#SL9&UneM!T*$4pB CiHFw! diff --git a/internal/php7/php7.y b/internal/php7/php7.y index b246064..d171ae7 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3940,23 +3940,23 @@ dereferencable_scalar: scalar: T_LNUMBER { - $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarLnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } | T_DNUMBER { - $$ = &ast.ScalarDnumber{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarDnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } | T_LINE { @@ -4785,7 +4785,13 @@ encaps_var_offset: { // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { - $$ = &ast.ScalarLnumber{ast.Node{}, $1.Value} + $$ = &ast.ScalarLnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + NumberTkn: $1, + Value: $1.Value, + } } else { $$ = &ast.ScalarString{ast.Node{}, $1.Value} } @@ -4798,13 +4804,17 @@ encaps_var_offset: } | '-' T_NUM_STRING { - var lnumber *ast.ScalarLnumber - // TODO: add option to handle 64 bit integer _, err := strconv.Atoi(string($2.Value)); isInt := err == nil if isInt { - lnumber = &ast.ScalarLnumber{ast.Node{}, $2.Value} + lnumber := &ast.ScalarLnumber{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + NumberTkn: $2, + Value: $2.Value, + } $$ = &ast.ExprUnaryMinus{ast.Node{}, lnumber} } else { $2.Value = append([]byte("-"), $2.Value...) @@ -4812,9 +4822,6 @@ encaps_var_offset: } // save position - if isInt { - lnumber.GetNode().Position = position.NewTokensPosition($1, $2) - } $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 9cc59f4..5e6e373 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -115,7 +115,8 @@ func (n *Argument) Accept(v NodeVisitor) { // ScalarDnumber node type ScalarDnumber struct { Node - Value []byte + NumberTkn *token.Token + Value []byte } func (n *ScalarDnumber) Accept(v NodeVisitor) { @@ -156,7 +157,8 @@ func (n *ScalarHeredoc) Accept(v NodeVisitor) { // ScalarLnumber node type ScalarLnumber struct { Node - Value []byte + NumberTkn *token.Token + Value []byte } func (n *ScalarLnumber) Accept(v NodeVisitor) { From e6a23dfa3a58902963b03e615f79623087632229 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 23:36:45 +0200 Subject: [PATCH 074/140] [refactoring] update ast structure of "Encapsed", "EncapsedStringPart" and "Heredoc" nodes --- internal/php5/php5.go | Bin 288752 -> 288464 bytes internal/php5/php5.y | 119 +++++++++++++++++++--------------- internal/php7/php7.go | Bin 239733 -> 239445 bytes internal/php7/php7.y | 119 +++++++++++++++++++--------------- pkg/ast/node.go | 12 ++-- pkg/ast/visitor/dump.go | 3 - pkg/printer/pretty_printer.go | 4 +- pkg/printer/printer.go | 4 +- 8 files changed, 148 insertions(+), 113 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 51b160f699860b239e55ba78bcf2e11522c8aba3..51ae8568f9a971bce1b6f0f0018c41b6b3c2aabf 100644 GIT binary patch delta 3636 zcmbtXdvKK16`y<0C7TT- zETw8x$PcL*V6>$Ql~^$sY!iZDrf8MmNXM$YQcY>cNFHxE)iZdJ7gAa^9pCwja7G))vT;oJhK+Xts)i8)6}rW5~)y_DWZ^`uM)6tk#L}` zSVZHN*_1Cs9^5cij6mU6A_Z^GrkhYVhg|snyoiB!4i%vO9C@*G4qwE@$rK$smz=^r zf{zh;;yj}M^z9`yr$1e|kVXjnvy?TN_u)rj=8^^fh1q@kVCI5B>RbYUE2DgL%~gHs zm|1oQGY5QwnI{(aXCie!MWVb+tcob8xVvI;HTEaURAf&j2R6Fk%+nTL`<}E>ayyU6=B79pm>uQhm1-p5FV`P zk}lL&QiAz*DXMFQYiMCjMb!_o??%ZnjvokX2Bo62mh<)dB~&1N9{tb)RU$F_E{@Do z%gB!-cTt|mF}}KRa*A?d>p6H^o6f$UG|6}BCOrarq@7jvFqt-y=tA&b?KLUELu;y1U`C#vQV{-9D2gzhHhz~ z@%m7Qv8bwnUp@UaTd?I%vP$5`PqXn$H_$j-{klAg^k)gk+(3EAYh-oUV4jcJ#K(U$ z8-qRsKmYDoR^PCJ)fa9uU;gW_`2MQRMs#-*YcAR$mkTUwV$mnJF#TZ@y(X}H8y{cW zLVE1Ybvs{g{x!WSko6)TS8g}Qh#h>q#=m|TRmH|%k8kvTPyIADXY55z0_g>~&4Vu)t(0N*3qZjR>Z-ofiAJcWO zm}usPiHmQ`barw#2O_hDGIT?iyh-4jNHrA4U!#1k_>5Kk@}GctEetiDTvLbl3+eL? zD#0>z?qQG`p2oFY{|Bz+gL^4Y`h&e?Ib95tm?r~%U3P)G1=?HLiulK6U)d*MVjCL~ z8f?VwFn2)PBp`bq%jROm9x)o7^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T*a}gi$YKK-L$q0Ui!yc{kP8P`II_nWa zSUcIkZ`C7Wy}Xari>X99INB4U?&3CT6WCkCh@9Uo?do9>y(fj!3I_UVuqH+I_mU9! zb}1jjvt(EKrSzEyR6UT7)@&2#c|H)hu2$G`u2wE04+Q4g%66APWO;xGjw}`SCJItJ z@(2RaFL3fnF$L9y z@)8DLVy#Q3n2LRsB3Ko!p>BcUW(L}VWNM{_6jPHJxRG7OH%2h(zsnn~?+u!T_FrWN zy4KKRJb0PA%>!X#Z8g`{YmDu^MEp=q#pDXK!b&&|bv3j~x<&{as?m0zPc86Mmym`- zefP<9P6|STG0*$pYO&2XqODh2M%C9-r3R?8kv1#uCR$14_PN!8Mv5nCaEbJu?z<;u;-?m>h&6Km&$ha= zOlFR)vpFz&MZ&-BqjMc{E*u|;h;ie=^CBK?#~Dj&M^tQKCQR#Vu@FCRp^{kVf2_-~ z57D^4_K!u@xU{H5wvJ0T(kKsQTloc-XO#KNTplNCy6F}+hsn|aI6RV>l04pVgHO$C zqr-Bl!>7xEzEGKsg;!;)nzoDH7t%Cw{6q1Lb}<)yODI%*zFX_LD-EwvP>^1vX?J-5 zHDzGR=D{(@YrUbFmcsrzC7`f_mtymqJXV7lG;{3R_6Ya)@c`#~-O9ONx7XoOp>s=wZ*9HA~Bp>)Zs!KkJ8Hv32P!s{A^-pY diff --git a/internal/php7/php7.y b/internal/php7/php7.y index d171ae7..f896af8 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3878,11 +3878,15 @@ backticks_expr: } | T_ENCAPSED_AND_WHITESPACE { - part := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} - $$ = []ast.Vertex{part} - - // save position - part.GetNode().Position = position.NewTokenPosition($1) + $$ = []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + EncapsedStrTkn: $1, + Value: $1.Value, + }, + } } | encaps_list { @@ -4040,45 +4044,54 @@ scalar: } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { - encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} - $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, []ast.Vertex{encapsed}} - - // save position - encapsed.GetNode().Position = position.NewTokenPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarHeredoc{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenHeredocTkn: $1, + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + EncapsedStrTkn: $2, + Value: $2.Value, + }, + }, + CloseHeredocTkn: $3, + } } | T_START_HEREDOC T_END_HEREDOC { - $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarHeredoc{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + OpenHeredocTkn: $1, + CloseHeredocTkn: $2, + } } | '"' encaps_list '"' { - $$ = &ast.ScalarEncapsed{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarEncapsed{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenQoteTkn: $1, + Parts: $2, + CloseQoteTkn: $1, + } } | T_START_HEREDOC encaps_list T_END_HEREDOC { - $$ = &ast.ScalarHeredoc{ast.Node{}, $1.Value, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarHeredoc{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenHeredocTkn: $1, + Parts: $2, + CloseHeredocTkn: $3, + } } | dereferencable_scalar { @@ -4615,14 +4628,16 @@ encaps_list: } | encaps_list T_ENCAPSED_AND_WHITESPACE { - encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $2.Value} - $$ = append($1, encapsed) - - // save position - encapsed.GetNode().Position = position.NewTokenPosition($2) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.SkippedTokens) + $$ = append( + $1, + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + EncapsedStrTkn: $2, + Value: $2.Value, + }, + ) } | encaps_var { @@ -4630,14 +4645,16 @@ encaps_list: } | T_ENCAPSED_AND_WHITESPACE encaps_var { - encapsed := &ast.ScalarEncapsedStringPart{ast.Node{}, $1.Value} - $$ = []ast.Vertex{encapsed, $2} - - // save position - encapsed.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.SkippedTokens) + $$ = []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + EncapsedStrTkn: $1, + Value: $1.Value, + }, + $2, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 5e6e373..a1b04f4 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -126,7 +126,9 @@ func (n *ScalarDnumber) Accept(v NodeVisitor) { // ScalarEncapsed node type ScalarEncapsed struct { Node - Parts []Vertex + OpenQoteTkn *token.Token + Parts []Vertex + CloseQoteTkn *token.Token } func (n *ScalarEncapsed) Accept(v NodeVisitor) { @@ -136,7 +138,8 @@ func (n *ScalarEncapsed) Accept(v NodeVisitor) { // ScalarEncapsedStringPart node type ScalarEncapsedStringPart struct { Node - Value []byte + EncapsedStrTkn *token.Token + Value []byte } func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { @@ -146,8 +149,9 @@ func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { // ScalarHeredoc node type ScalarHeredoc struct { Node - Label []byte - Parts []Vertex + OpenHeredocTkn *token.Token + Parts []Vertex + CloseHeredocTkn *token.Token } func (n *ScalarHeredoc) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 7e11d72..15c3226 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -1224,9 +1224,6 @@ func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarHeredoc{\n") v.printNode(n.GetNode()) - - v.printIndent(v.indent) - v.print(fmt.Sprintf("Label: %q,\n", n.Label)) } func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 6caa793..b1e411f 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -558,7 +558,7 @@ func (p *PrettyPrinter) printScalarEncapsed(n ast.Vertex) { func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) { nn := n.(*ast.ScalarHeredoc) - io.WriteString(p.w, string(nn.Label)) + io.WriteString(p.w, string(nn.OpenHeredocTkn.Value)) for _, part := range nn.Parts { switch part.(type) { @@ -571,7 +571,7 @@ func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) { } } - io.WriteString(p.w, strings.Trim(string(nn.Label), "<\"'\n")) + io.WriteString(p.w, strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n")) } func (p *PrettyPrinter) printScalarMagicConstant(n ast.Vertex) { diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 7f5fae5..4925c35 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -687,7 +687,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) { p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) p.bufStart = "" - p.write(nn.Label) + p.write(nn.OpenHeredocTkn.Value) for _, part := range nn.Parts { switch part.(type) { @@ -710,7 +710,7 @@ func (p *Printer) printScalarHeredoc(n ast.Vertex) { } } - p.write([]byte(strings.Trim(string(nn.Label), "<\"'\n"))) + p.write([]byte(strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n"))) p.printFreeFloating(nn, token.End) } From 3bda40e8ce866c7574c84f8883553cc72aa97d01 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 20 Nov 2020 23:53:58 +0200 Subject: [PATCH 075/140] [refactoring] update ast structure of "MagicConstant" and "String" nodes --- internal/php5/php5.go | Bin 288464 -> 286681 bytes internal/php5/php5.y | 172 ++++++++++++++++++++++-------------------- internal/php7/php7.go | Bin 239445 -> 237609 bytes internal/php7/php7.y | 171 ++++++++++++++++++++--------------------- pkg/ast/node.go | 7 +- 5 files changed, 182 insertions(+), 168 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 51ae8568f9a971bce1b6f0f0018c41b6b3c2aabf..704561a4f8b0cb642ddffb7b4134666177575295 100644 GIT binary patch delta 8684 zcma)CcX*Y>(tl?6C4~|aN&;!;1f+&wW1qhiCGevNN-@v$OA^{BYPe zyTdk3hzv|fs9t^i6GaPCS;J=*M~cOfaG2xKyAUg$j)iQ%_(9AiZn|JH;PtW0g>&Md z7sfRvJ~V<@5JXM`tXN2_-SjEP2nlfWJ+^bYe?P#7(=MT zU7~4A7z?;JlF03?pdDbgm&ouoU@?sANMzf1B1L+F^D&6e|`cK>@>~8wsud4?vJ)toXDoJk7A+3h9sTK>9?vaY!mWuGyDUAs29EkmVMG z)8P?@*)52?ct4bq#~EaGS!bzFrR5v5Q<cbl^;=X~-9!b=1~B2iFzq61!f2)l|ldz$IqQameoT;RUsX3vVxkuLbcZ>c2%H zg5T)wei{CyjpNRxRL9CC-z(7FQY5~<9J*>SWCct&lIvGevZW+8dEMyXtFOZljWvD) z#%YzUZ$Ox_b8$61r@^^v;6Y>O=eKP;q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VIa1*85~)Z~78sC#P}gcob`IIP1V6nB+CrT-P`NF5ytL+d`s zoYynVyVZM;d3>;8J~{Y7<|9HZ^BE20r;#-wJof+RUKDDWSA;&ud{2GDJTUA*=GVdu z^EM40WF8%^&Be3f++(eCITEqT!y{;h)VRbCUfxzyyC`nmqEe%qT7FcD#QM>+z=VVh zvQ?j&#JNVCPH0FpyNN;AxEZGtt&;F>Ce&-r>7*b(P*Df;q3TX^YX$dd;r8kk7h70a z%dZa}Z1e~%SGq3I*P?E$btjO}rBTPGI@FMMEsgI~2?oqiAbovm5T9aK6US${?c!1v&vm*G`9nCpPEqH}pX79mAjo@~cXZ884CO*q ziIjCCcx@L>XB*L87|B=C#!H_cO!7{?5|&Uw&o8C5`c zCUuunz~_L^<_goW)-mS6v9Iz2xON^_|GXmOU*_?NP<>it_VeSjBlD{S%0ImN0fex~ zcDQxE+z<{G@%MFN;mU zKE=GTxVDJ5vn%6eaS1{;(wR+$^0HRs^azN`i#dI)qt=83EFULdmAWmpHX>?Fv>OkU z@NP~#NW#)67L12dSX0b>+o`FSwT{D1sjM}g>A?aq_694&*~=U?63gSD1>Rc5Tm1)X C59TER diff --git a/internal/php7/php7.y b/internal/php7/php7.y index f896af8..b98517d 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3931,13 +3931,13 @@ dereferencable_scalar: } | T_CONSTANT_ENCAPSED_STRING { - $$ = &ast.ScalarString{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarString{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, + } } ; @@ -3964,83 +3964,83 @@ scalar: } | T_LINE { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_FILE { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_DIR { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_TRAIT_C { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_METHOD_C { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_FUNC_C { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_NS_C { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_CLASS_C { - $$ = &ast.ScalarMagicConstant{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarMagicConstant{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + MagicConstTkn: $1, + Value: $1.Value, + } } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { @@ -4790,13 +4790,13 @@ encaps_var: encaps_var_offset: T_STRING { - $$ = &ast.ScalarString{ast.Node{}, $1.Value} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ScalarString{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, + } } | T_NUM_STRING { @@ -4810,14 +4810,14 @@ encaps_var_offset: Value: $1.Value, } } else { - $$ = &ast.ScalarString{ast.Node{}, $1.Value} + $$ = &ast.ScalarString{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, + } } - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '-' T_NUM_STRING { @@ -4833,16 +4833,17 @@ encaps_var_offset: Value: $2.Value, } $$ = &ast.ExprUnaryMinus{ast.Node{}, lnumber} + $$.GetNode().Position = position.NewTokensPosition($1, $2) } else { - $2.Value = append([]byte("-"), $2.Value...) - $$ = &ast.ScalarString{ast.Node{}, $2.Value} + $$ = &ast.ScalarString{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + MinusTkn: $1, + StringTkn: $2, + Value: append([]byte("-"), $2.Value...), + } } - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index a1b04f4..d395f57 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -172,7 +172,8 @@ func (n *ScalarLnumber) Accept(v NodeVisitor) { // ScalarMagicConstant node type ScalarMagicConstant struct { Node - Value []byte + MagicConstTkn *token.Token + Value []byte } func (n *ScalarMagicConstant) Accept(v NodeVisitor) { @@ -182,7 +183,9 @@ func (n *ScalarMagicConstant) Accept(v NodeVisitor) { // ScalarString node type ScalarString struct { Node - Value []byte + MinusTkn *token.Token + StringTkn *token.Token + Value []byte } func (n *ScalarString) Accept(v NodeVisitor) { From fe2e097d8f9bf3774720e8f4bb79b6cfd790d3b6 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 22 Nov 2020 02:03:39 +0200 Subject: [PATCH 076/140] [refactoring] update ast structure of "Class" and "Trait" nodes --- internal/php5/php5.go | Bin 286681 -> 287326 bytes internal/php5/php5.y | 111 +++++++++++++++++----------------- internal/php7/php7.go | Bin 237609 -> 237965 bytes internal/php7/php7.y | 105 +++++++++++++++++--------------- pkg/ast/node.go | 24 +++++--- pkg/printer/pretty_printer.go | 2 +- pkg/printer/printer.go | 2 +- 7 files changed, 130 insertions(+), 114 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 704561a4f8b0cb642ddffb7b4134666177575295..ece4fadf313ae30811db11044fd45f22eb53c3ab 100644 GIT binary patch delta 12867 zcmcgSX?RsdvR`)}2tk&F9TIYH#Dq=Z-kZCM2tiOmmY^U)KoS%bWlKN@6ipB}kii6y zatG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YWRhJo{K1k50CZoY6tLNPYagpW$l-5V)NCPIWg-{nQ4dH8veTPL; z6bwGMbakcKVpH`2l_K;!023(*z&6C@&hquoMFpeQ2VJtw8nGYwbhk@2nZCMGW!+Jg zFx~UD9ROaa!nXYWpjgZ3zHhA>bCz-s*~zQ3gkPPmf#tk(2On^!XwOVp^qRBj58 zm8hd+(&_d9)Ajk{Ug|#*iJGdYNK{nXB7mzEL}Rk8<1Dtnkmuo-Uw)J3q~mML9LJmE zkGfwD&Aie#3tvYTismwu=^&+2{Y?U~WIxT_FV3Q$v+%9fds)t2&5*KjY1F@k(?tcN zENb7_`BwMi6id{(A2!38g=tvl$#KRh4izEwQE`)pY-RXg$e zlHJM4Fq7v%#_s1R`a=l&WW2DmQ>X`240yT7r~5v_M@#z#q0GX%I0zlNU7chIN`|NM zuJ9%Fondl`*ST(1BMS&lg}4A^DPasb^#!sfyG_f;dh)2DgBxWkJaRoK@G@cn_Vmi#^iafvd@yLdc-EDz{vsLm6U zC*`E=v(L^t1-q)ZQ*VchMCI&0P9Jk3YmQ4LI+=)j=I3#f(1@ZL(GzSFDo#3cws}cL0QA$u#^wTcBcpe40pD$5zimV=< zJE_m&+95^8#1&0_A%SCOAK^BQwPf?K;Th*3$g3g3gu6OG|257PD+)`zJXax*PEdZN keoW+a_%bX}tBr>g2`T2CQ*eARYuo`^WHhI9E_Z_e4JcqJI{*Lx diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 1674719..67d3536 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1408,33 +1408,38 @@ unticked_function_declaration_statement: unticked_class_declaration_statement: class_entry_type T_STRING extends_from implements_list '{' class_statement_list '}' { - name := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, - IdentifierTkn: $2, - Value: $2.Value, - } switch n := $1.(type) { case *ast.StmtClass : - n.ClassName = name - n.Stmts = $6 + n.Position = position.NewNodeTokenPosition($1, $7) + n.ClassName = &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + } n.Extends = $3 n.Implements = $4 - - case *ast.StmtTrait : - // TODO: is it possible that trait extend or implement - n.TraitName = name + n.OpenCurlyBracket = $5 n.Stmts = $6 + n.CloseCurlyBracket = $7 + case *ast.StmtTrait : + n.Position = position.NewNodeTokenPosition($1, $7) + n.TraitName = &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + } + n.Extends = $3 + n.Implements = $4 + n.OpenCurlyBracket = $5 + n.Stmts = $6 + n.CloseCurlyBracket = $7 } + $$ = $1 - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.SkippedTokens) } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { @@ -1461,59 +1466,57 @@ unticked_class_declaration_statement: class_entry_type: T_CLASS { - $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, nil, nil, nil} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtClass{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + ClassTkn: $1, + } } | T_ABSTRACT T_CLASS { - classModifier := &ast.Identifier{ + $$ = &ast.StmtClass{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokensPosition($1, $2), }, - IdentifierTkn: $1, - Value: $1.Value, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + ClassTkn: $2, } - $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } | T_TRAIT { - $$ = &ast.Identifier{ + $$ = &ast.StmtTrait{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + TraitTkn: $1, } } | T_FINAL T_CLASS { - classModifier := &ast.Identifier{ + $$ = &ast.StmtClass{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokensPosition($1, $2), }, - IdentifierTkn: $1, - Value: $1.Value, + Modifiers: []ast.Vertex{ + &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + ClassTkn: $2, } - $$ = &ast.StmtClass{ast.Node{}, nil, []ast.Vertex{classModifier}, nil, nil, nil, nil} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index c075510a6bb309a7cb71889a29299a2065e1a19c..aa80680dcba01bc0cfbb635bd2683a9b53de5d6d 100644 GIT binary patch delta 11269 zcmcIqX?&JNlK*vgLM{^S03pfyhHxL@y^knI6p_mzAcq7P61fpE0XzUja0C%SZc2{9 zpeziG3K@kSZ?cYnFpQwC4meyYsG|!(R|EyK)%6_RMEB$R0pG5Fb#--hbyame*|9HU z**h7#8)or%=;g*)uYAQ*QsCGe?vdv>o50klI)M#=O$n^6J$TS1E=hEWLx9yY1`nBo zi{@ZrlEHQ|iM6w(d0;~_3&HSY7beQc8{s}F2D~JN)qx|a20SOVF5E87fTyO_g){3L za7ldw#z6?`r5kYnbOSETK=`r=BSou5@c9g5cBck);g1^_a8|>*@cxDdoZ85MaS(#N zjSToF6aIH>s*|V5Df(2wvC3fKN233omMFz=xXFg&$~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p`b<5HQF<8mFaSwEC+e6}N4WO&4#0#0M`7??HErZ*oo()f} wbq3j{O3!t65c+Og)i)idC6_}7p3qT2eJattQFzC8I@V}G9XblAYQ6CP7bHde`2YX_ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index b98517d..5577a10 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1271,40 +1271,46 @@ is_variadic: class_declaration_statement: class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - name := &ast.Identifier{ + $$ = &ast.StmtClass{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewOptionalListTokensPosition($1, $2, $9), }, - IdentifierTkn: $3, - Value: $3.Value, + Modifiers: $1, + ClassTkn: $2, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, + }, + Extends: $4, + Implements: $5, + OpenCurlyBracket: $7, + Stmts: $8, + CloseCurlyBracket: $9, } - $$ = &ast.StmtClass{ast.Node{}, name, $1, nil, $4, $5, $8} - - // save position - $$.GetNode().Position = position.NewOptionalListTokensPosition($1, $2, $9) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.SkippedTokens) } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - name := &ast.Identifier{ + $$ = &ast.StmtClass{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $8), }, - IdentifierTkn: $2, - Value: $2.Value, + ClassTkn: $1, + ClassName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + Extends: $3, + Implements: $4, + OpenCurlyBracket: $6, + Stmts: $7, + CloseCurlyBracket: $8, } - $$ = &ast.StmtClass{ast.Node{}, name, nil, nil, $3, $4, $7} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; @@ -1345,22 +1351,22 @@ class_modifier: trait_declaration_statement: T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' { - name := &ast.Identifier{ + $$ = &ast.StmtTrait{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $6), }, - IdentifierTkn: $2, - Value: $2.Value, + TraitTkn: $1, + TraitName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + OpenCurlyBracket: $4, + Stmts: $5, + CloseCurlyBracket: $6, } - $$ = &ast.StmtTrait{ast.Node{}, name, $5} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $6) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.SkippedTokens) } ; @@ -2756,19 +2762,18 @@ non_empty_for_exprs: anonymous_class: T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - if $2 != nil { - $$ = &ast.StmtClass{ast.Node{}, nil, nil, $2.(*ast.ArgumentList), $3, $4, $7} - } else { - $$ = &ast.StmtClass{ast.Node{}, nil, nil, nil, $3, $4, $7} + $$ = &ast.StmtClass{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $8), + }, + ClassTkn: $1, + ArgumentList: $2, + Extends: $3, + Implements: $4, + OpenCurlyBracket: $6, + Stmts: $7, + CloseCurlyBracket: $8, } - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $8) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d395f57..cb820b0 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -238,12 +238,15 @@ func (n *StmtCatch) Accept(v NodeVisitor) { // StmtClass node type StmtClass struct { Node - ClassName Vertex - Modifiers []Vertex - ArgumentList *ArgumentList - Extends *StmtClassExtends - Implements *StmtClassImplements - Stmts []Vertex + Modifiers []Vertex + ClassTkn *token.Token + ClassName Vertex + ArgumentList Vertex + Extends *StmtClassExtends + Implements *StmtClassImplements + OpenCurlyBracket *token.Token + Stmts []Vertex + CloseCurlyBracket *token.Token } func (n *StmtClass) Accept(v NodeVisitor) { @@ -741,8 +744,13 @@ func (n *StmtThrow) Accept(v NodeVisitor) { // StmtTrait node type StmtTrait struct { Node - TraitName Vertex - Stmts []Vertex + TraitTkn *token.Token + TraitName Vertex + Extends *StmtClassExtends + Implements *StmtClassImplements + OpenCurlyBracket *token.Token + Stmts []Vertex + CloseCurlyBracket *token.Token } func (n *StmtTrait) Accept(v NodeVisitor) { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index b1e411f..943cc10 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1476,7 +1476,7 @@ func (p *PrettyPrinter) printStmtClass(n ast.Vertex) { if nn.ArgumentList != nil { io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(", ", nn.ArgumentList.(*ast.ArgumentList).Arguments) io.WriteString(p.w, ")") } diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 4925c35..302773a 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2097,7 +2097,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) { if nn.ArgumentList != nil { p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") - p.joinPrint(",", nn.ArgumentList.Arguments) + p.joinPrint(",", nn.ArgumentList.(*ast.ArgumentList).Arguments) p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") } From 4c54c56af50e0656d1a273b28dc7f5f7a62faa83 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 22 Nov 2020 13:02:36 +0200 Subject: [PATCH 077/140] [refactoring] update ast structure of "ClassExtends", "ClassImplements", "InterfaceExtends", "StmtTraitUse" and "StmtTraitUsePrecedence" nodes --- internal/php5/php5.go | Bin 287326 -> 286340 bytes internal/php5/php5.y | 131 +++++++++++++------------- internal/php7/php7.go | Bin 237965 -> 237795 bytes internal/php7/php7.y | 104 ++++++++++---------- pkg/ast/node.go | 27 ++++-- pkg/ast/traverser/dfs.go | 8 +- pkg/ast/visitor/namespace_resolver.go | 8 +- pkg/printer/pretty_printer.go | 8 +- pkg/printer/printer.go | 8 +- 9 files changed, 154 insertions(+), 140 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index ece4fadf313ae30811db11044fd45f22eb53c3ab..d65f45df7538b6e51edc7b43bd7aa8dd6d797d46 100644 GIT binary patch delta 15546 zcmb_j2b`2evj27WYyvh(4!b)@R9Tq3Ge}lM4q*XdRq`qz24G1hP!_{^&j=1u26*i1 znNNbK{lEaLXAXdP9?BuRDwqf=rza}%{?*;z%;I_Xe82bnIUnCwT~%FOU0qdO-TUF6 z3$K5!aNR_iJ$v4QxzonZo3`N#c}wfeM3W}-udGV;mu)xP*=}*s=vcIeKNJh_BiO^A zh(&rd$%!XoJ^b--f**L}muOk2hd&qy;u#GCF&aZdFc2`$U>HRB0IRZ4G&wEaRfQwL z<*M@Mok9JwyUQkc7hwjPN6|;qJr@%N7TW*hcg+<`gJH zpI{U+A2D7hppG^7E@Z#oE=0dsR8lzi`vdkZWx1{k@b$t7=|6fqi)asNI1 zssAxBM#H1g|2!w)jYsmsH``IjBd8^Ag4X9mqZ2Jnaj13%zmD*W!jgW)-1`!GL@ zGhu$otGAw1XgcNYgCW*sD4x_?yB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K|eU@v^7`l za%?Zc3Y6Pwyh+cZvjEgQMX!D28BjDt`QLeubA~?|n2C>S@~cl$blfL}LwRR4s>l0) z`YfC*IAsSvQwT#^{2sP@^Jj3+)ZTDh%ap3ab za+cF|EulD#%em$#vh?5ro)GgsqsP83r19?Vr7goZ@xgujOh52f>U3dN|Nb}O*o={k zOrEGu{I)=FrtoFS>)(bvP6j>(Z|zAVesI>&zVAXNClil*?!D*xkV9t@=7CG~6N+~H zBZN8`T&DYS_W16=Pohv1d2c`Z{1npjJsp=zX2DO+4|adBKV`D9r|x&JE&$}>cirzs z&4t=+8<@b!#-e74>s}JlWpVR?4eACET+#9JNuPoqFLnEKq?7x5UUuBCB?vbqlgv-; z+>-*qG~zp59k5i;^26M;KNlyP4j&REe5lT*xkemd?rrZ*3I^BNtU>&aY8r)+eOf1* z%NhjT?E#&W!-4(Z#OmRSj_DdQ<8`vZVR4M27rKQ|CznW2U6osFPAGE^mky>(FNY_r z0yaI|OM>Y+Iox6~m;fFj=Yx5@+&!&;05^#su7Ot zHF)6GnL3<|2OHCSyV6zQe{bU8AN|^=*?69G95_8-ii=mJs9QgGbO1%m{E&p;n*Oe| zXqXH4T((2gs-e@(plB#z-7SsR#R+Ik$q@GnA6*p9CHYAyEga|$sng%mD8UpvM&E4 z2T=`?M_Q0lRr?k4Hh=OloFY%<+*)2et4q#~YA}^Y*;g2fOjMpxUO2*){UVg{c+PAe z<#urB&QUIRFD*1F(6}#9BldGsjy8>Ui_G|w+}Z-6TsasZPV!++JS*(OlsRv#E2lS0 z<$s35Ld^1?xubkqoUC{$;5E4i*M~wh+!7b`eeC0ut>av7K#Fn+yv~C^y-FXA4}dx$ zoq#eLIl(>FBh(4x%Ul=#WkNvbByjbOQu{3YJFC+RpqZ2h?RHiHG?(_EYbX0q{$~gb MJWbR1v)%ar17zv7i~s-t diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 67d3536..e5d4558 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -18,9 +18,6 @@ import ( list []ast.Vertex simpleIndirectReference simpleIndirectReference - ClassExtends *ast.StmtClassExtends - ClassImplements *ast.StmtClassImplements - InterfaceExtends *ast.StmtInterfaceExtends ClosureUse *ast.ExprClosureUse } @@ -243,13 +240,12 @@ import ( %type ctor_arguments function_call_parameter_list echo_expr_list %type trait_adaptations unset_variables declare_list %type switch_case_list non_empty_function_call_parameter_list -%type method_body +%type method_body trait_reference_list %type foreach_statement for_statement while_statement %type foreach_variable foreach_optional_arg - -%type extends_from -%type implements_list -%type interface_extends_list +%type extends_from interface_list trait_list +%type implements_list +%type interface_extends_list %type lexical_vars %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations @@ -258,8 +254,8 @@ import ( %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers class_variable_declaration -%type interface_list trait_list trait_adaptation_list non_empty_trait_adaptation_list -%type trait_reference_list non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list +%type trait_adaptation_list non_empty_trait_adaptation_list +%type non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list %type chaining_dereference chaining_instance_call chaining_method_or_property instance_call variable_property %type method_or_not array_method_dereference object_property object_dim_list dynamic_class_name_variable_property @@ -1527,13 +1523,13 @@ extends_from: } | T_EXTENDS fully_qualified_class_name { - $$ = &ast.StmtClassExtends{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtClassExtends{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ExtendTkn: $1, + ClassName: $2, + } } ; @@ -1551,13 +1547,14 @@ interface_extends_list: } | T_EXTENDS interface_list { - $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + }, + ExtendsTkn: $1, + InterfaceNames: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + }; } ; @@ -1568,29 +1565,30 @@ implements_list: } | T_IMPLEMENTS interface_list { - $$ = &ast.StmtClassImplements{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtClassImplements{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + }, + ImplementsTkn: $1, + InterfaceNames: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + }; } ; interface_list: fully_qualified_class_name { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | interface_list ',' fully_qualified_class_name { - switch n := lastNode($1).(type) { - case *ast.NameName: n.ListSeparatorTkn = $2 - case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 - case *ast.NameRelative: n.ListSeparatorTkn = $2 - } - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + + $$ = $1 } ; @@ -2520,29 +2518,31 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtTraitUse{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + UseTkn: $1, + Traits: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Adaptations: $3, + } } ; trait_list: fully_qualified_class_name { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | trait_list ',' fully_qualified_class_name { - switch n := lastNode($1).(type) { - case *ast.NameName: n.ListSeparatorTkn = $2 - case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 - case *ast.NameRelative: n.ListSeparatorTkn = $2 - } - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + + $$ = $1 } ; @@ -2612,28 +2612,31 @@ trait_adaptation_statement: trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { - $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeNodeListPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + $$ = &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ + Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + }, + Ref: $1, + InsteadofTkn: $2, + Insteadof: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + } } ; trait_reference_list: fully_qualified_class_name { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | trait_reference_list ',' fully_qualified_class_name { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index aa80680dcba01bc0cfbb635bd2683a9b53de5d6d..0a0e9afa09a9715af2877ad3a04d7d129e32be74 100644 GIT binary patch delta 18174 zcmb7q2b5LS+4kD|FvH9+l%bayXDA{91NWSBPq_$!N)bhhfCUR6V2c#RsEK8egwJS< zq9?LVY=9BP57 zFC?G#8!|J9vC<3jSe_?cFT!icg`v*}27D6tUGAOtK@BtTbbW3Kj+z3FdjVK=J-m8h zoGk4>uq6)B9Tr^lL?ngfG5*GRtPcu!#CeeMeC!|(-zNo%BJb5LwG@*X*cDVt($NLtXg=$P6j_*!CO&X2K69Ab9tQXncKAa-NXTqLV~ zY~ay!k;MvDN2C>r@_}xw!&Xr)z%CvUpZC$}itch)9Fj~Z%u`602y6)hb^`q{5OtWR z0R!QJBz%DuNHztOEg;2!x}}tGM~dl@doh{Ek%CAq4kS|2>>;rbfHZ7b04u^&kavf+ zKy0oSK}zh#;;*DbyF$&xgG-o(G+!9eQ1D3@3X5HNjqvIbB0)qo2ja%WZa`NIJgSDW z2LUDqafMlM?4;UwW`d~mW@&MGD>g2uU4K08d#{C$N zJogC%8$SKd4LFq|=V{M8t&L4Q%I1;ffEcyWh5e-AadS~AR)jQmNV9u1ML+_sgfdS^ zgYlLokGgPUOm`(d60feHgx2(^Gj0#9P=~@q_TUog!X>&~BHks4+yYpj<}u{c!-D{Z z7L^x-1925%uHc6)7^bWRSeg+U3LHHVI7vxXkGy$C8tLVb3zHJWXcWepr43{jU-KkZXubvqI*j~7YN0jn8^akFhCe_ zhIKx5;sdMJ0D%BICtBtx?U5Iwh`bCpc4wb17g&}!hjGWJ=lD51TxJ;;%BdM&9TU1@ zGml)vWI5*aSV98L8q(qgJ|YPLA(ar5y+|@uKA-gc_6Q(LRzdDO17N_2OCM!4!yfV; zk)^DaPqu%rd%rvo2;&l)5d%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Qx z%>*iwyId3@@tduz!Ng0x@Tf8a$}w3yPfjNHlw0E&FghpDt!QnrGDi6C8DG=d!cCuG z4cGi_te^5KmvXJ{YPB}4zHdEeW>;c0;N9IU>1Z{NU$4YfX36^>+m^n+W!`U}C_$#b zW!iL1Ut_H9R9yI$xw3PUi4S)vdEIZ`=~}Yue$%3=$!plXmCU*+0a46$GcG!H|ah0EikLm&cdWSjGbViH(N_j?Dg%8RFEtk0F{ zFdVbsc8<9Nt^C?n8T7ur9Q{h5<2+{WjUlDlT4 zb$*F@o*bE|rz)--Wj(J@x1m7)O_H%UFSY(@o~{!q8N%q>9plU?R-{>e7rG3(%Hnlv zEZoNHvEZVRj$`<1y)s+st?Lql72fgl#CXVr2CKF~$m$XMvn~9{lZnr7u-@Zw3g4p)?g7i006m1R?(z2)Lzy}o7Or}58FVEix#>)t25`0AM$TLY z;qF~??p4-h+7FBHi28s416>zZ+pF&n&bb_8_X2CF~?j+TpS9qtGsn=M4 zNv5__@!8i}M#GgqxgHJ&+5Yo|_v}_U$G&;8RUZHGMhi7@R(`(tw;3l!#<8u$E%Vnx z15D*UT-7cgX5C}feh;WZftLnX1YG>c6vVA>v2M}Y3FCWyV4Z7WlcpIjM#e+Fkq9sO zXWX6EhZ^=-d7m|0#b-tq?%|{w$8A~5c#Kaj^V&KL#R!egeaw2^S rH@jWe0A6z7lrkB^m&xyJeUe`e2dN7 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 5577a10..58eed16 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -18,9 +18,6 @@ import ( tkn *token.Token list []ast.Vertex - ClassExtends *ast.StmtClassExtends - ClassImplements *ast.StmtClassImplements - InterfaceExtends *ast.StmtInterfaceExtends ClosureUse *ast.ExprClosureUse } @@ -249,7 +246,7 @@ import ( %type exit_expr scalar lexical_var function_call member_name property_name %type variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable -%type encaps_var encaps_var_offset echo_expr_list catch_name_list +%type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list %type if_stmt const_list non_empty_argument_list %type alt_if_stmt %type if_stmt_without_else @@ -265,9 +262,9 @@ import ( %type foreach_statement for_statement while_statement %type inline_function %type unset_variables -%type extends_from -%type implements_list -%type interface_extends_list +%type extends_from +%type implements_list +%type interface_extends_list %type lexical_vars %type member_modifier @@ -283,7 +280,7 @@ import ( %type array_pair_list top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers -%type non_empty_member_modifiers name_list class_modifiers +%type non_empty_member_modifiers class_modifiers %% @@ -1399,13 +1396,13 @@ extends_from: } | T_EXTENDS name { - $$ = &ast.StmtClassExtends{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtClassExtends{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ExtendTkn: $1, + ClassName: $2, + } } ; @@ -1416,13 +1413,14 @@ interface_extends_list: } | T_EXTENDS name_list { - $$ = &ast.StmtInterfaceExtends{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtInterfaceExtends{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + }, + ExtendsTkn: $1, + InterfaceNames: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + }; } ; @@ -1433,13 +1431,14 @@ implements_list: } | T_IMPLEMENTS name_list { - $$ = &ast.StmtClassImplements{ast.Node{}, $2}; - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtClassImplements{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + }, + ImplementsTkn: $1, + InterfaceNames: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + }; } ; @@ -2223,13 +2222,15 @@ class_statement: } | T_USE name_list trait_adaptations { - $$ = &ast.StmtTraitUse{ast.Node{}, $2, $3} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.StmtTraitUse{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + UseTkn: $1, + Traits: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Adaptations: $3, + } } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { @@ -2269,16 +2270,16 @@ class_statement: name_list: name { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | name_list ',' name { - switch n := lastNode($1).(type) { - case *ast.NameName: n.ListSeparatorTkn = $2 - case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 - case *ast.NameRelative: n.ListSeparatorTkn = $2 - } - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + + $$ = $1 } ; @@ -2347,14 +2348,15 @@ trait_adaptation: trait_precedence: absolute_trait_method_reference T_INSTEADOF name_list { - $$ = &ast.StmtTraitUsePrecedence{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeNodeListPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + $$ = &ast.StmtTraitUsePrecedence{ + Node: ast.Node{ + Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + }, + Ref: $1, + InsteadofTkn: $2, + Insteadof: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index cb820b0..3c64e3d 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -242,8 +242,8 @@ type StmtClass struct { ClassTkn *token.Token ClassName Vertex ArgumentList Vertex - Extends *StmtClassExtends - Implements *StmtClassImplements + Extends Vertex + Implements Vertex OpenCurlyBracket *token.Token Stmts []Vertex CloseCurlyBracket *token.Token @@ -269,6 +269,7 @@ func (n *StmtClassConstList) Accept(v NodeVisitor) { // StmtClassExtends node type StmtClassExtends struct { Node + ExtendTkn *token.Token ClassName Vertex } @@ -279,7 +280,9 @@ func (n *StmtClassExtends) Accept(v NodeVisitor) { // StmtClassImplements node type StmtClassImplements struct { Node + ImplementsTkn *token.Token InterfaceNames []Vertex + SeparatorTkns []*token.Token } func (n *StmtClassImplements) Accept(v NodeVisitor) { @@ -582,7 +585,7 @@ func (n *StmtInlineHtml) Accept(v NodeVisitor) { type StmtInterface struct { Node InterfaceName Vertex - Extends *StmtInterfaceExtends + Extends Vertex Stmts []Vertex } @@ -593,7 +596,9 @@ func (n *StmtInterface) Accept(v NodeVisitor) { // StmtInterfaceExtends node type StmtInterfaceExtends struct { Node + ExtendsTkn *token.Token InterfaceNames []Vertex + SeparatorTkns []*token.Token } func (n *StmtInterfaceExtends) Accept(v NodeVisitor) { @@ -746,8 +751,8 @@ type StmtTrait struct { Node TraitTkn *token.Token TraitName Vertex - Extends *StmtClassExtends - Implements *StmtClassImplements + Extends Vertex + Implements Vertex OpenCurlyBracket *token.Token Stmts []Vertex CloseCurlyBracket *token.Token @@ -781,8 +786,10 @@ func (n *StmtTraitMethodRef) Accept(v NodeVisitor) { // StmtTraitUse node type StmtTraitUse struct { Node - Traits []Vertex - TraitAdaptationList Vertex + UseTkn *token.Token + Traits []Vertex + SeparatorTkns []*token.Token + Adaptations Vertex } func (n *StmtTraitUse) Accept(v NodeVisitor) { @@ -804,8 +811,10 @@ func (n *StmtTraitUseAlias) Accept(v NodeVisitor) { // StmtTraitUsePrecedence node type StmtTraitUsePrecedence struct { Node - Ref Vertex - Insteadof []Vertex + Ref Vertex + InsteadofTkn *token.Token + Insteadof []Vertex + SeparatorTkns []*token.Token } func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index b9189a0..8a6cdec 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -893,10 +893,10 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Traits", false) } - if nn.TraitAdaptationList != nil { - t.visitor.Enter("TraitAdaptationList", true) - t.Traverse(nn.TraitAdaptationList) - t.visitor.Leave("TraitAdaptationList", true) + if nn.Adaptations != nil { + t.visitor.Enter("Adaptations", true) + t.Traverse(nn.Adaptations) + t.visitor.Leave("Adaptations", true) } case *ast.StmtTraitUseAlias: if nn == nil { diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 3eac4a1..5bc82ca 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -73,11 +73,11 @@ func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { if n.Extends != nil { - nsr.ResolveName(n.Extends.ClassName, "") + nsr.ResolveName(n.Extends.(*ast.StmtClassExtends).ClassName, "") } if n.Implements != nil { - for _, interfaceName := range n.Implements.InterfaceNames { + for _, interfaceName := range n.Implements.(*ast.StmtClassImplements).InterfaceNames { nsr.ResolveName(interfaceName, "") } } @@ -89,7 +89,7 @@ func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface) { if n.Extends != nil { - for _, interfaceName := range n.Extends.InterfaceNames { + for _, interfaceName := range n.Extends.(*ast.StmtInterfaceExtends).InterfaceNames { nsr.ResolveName(interfaceName, "") } } @@ -184,7 +184,7 @@ func (nsr *NamespaceResolver) StmtTraitUse(n *ast.StmtTraitUse) { nsr.ResolveName(t, "") } - if adaptationList, ok := n.TraitAdaptationList.(*ast.StmtTraitAdaptationList); ok { + if adaptationList, ok := n.Adaptations.(*ast.StmtTraitAdaptationList); ok { for _, a := range adaptationList.Adaptations { switch aa := a.(type) { case *ast.StmtTraitUsePrecedence: diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 943cc10..65c4cf6 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1482,12 +1482,12 @@ func (p *PrettyPrinter) printStmtClass(n ast.Vertex) { if nn.Extends != nil { io.WriteString(p.w, " extends ") - p.Print(nn.Extends.ClassName) + p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName) } if nn.Implements != nil { io.WriteString(p.w, " implements ") - p.joinPrint(", ", nn.Implements.InterfaceNames) + p.joinPrint(", ", nn.Implements.(*ast.StmtClassImplements).InterfaceNames) } io.WriteString(p.w, "\n") @@ -1888,7 +1888,7 @@ func (p *PrettyPrinter) printStmtInterface(n ast.Vertex) { if nn.Extends != nil { io.WriteString(p.w, " extends ") - p.joinPrint(", ", nn.Extends.InterfaceNames) + p.joinPrint(", ", nn.Extends.(*ast.StmtInterfaceExtends).InterfaceNames) } io.WriteString(p.w, "\n") @@ -2073,7 +2073,7 @@ func (p *PrettyPrinter) printStmtTraitUse(n ast.Vertex) { io.WriteString(p.w, "use ") p.joinPrint(", ", nn.Traits) - if adaptationList, ok := nn.TraitAdaptationList.(*ast.StmtTraitAdaptationList); ok { + if adaptationList, ok := nn.Adaptations.(*ast.StmtTraitAdaptationList); ok { adaptations := adaptationList.Adaptations io.WriteString(p.w, " {\n") p.printNodes(adaptations) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 302773a..5848f39 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2108,7 +2108,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) { } p.write([]byte("extends")) p.bufStart = " " - p.Print(nn.Extends.ClassName) + p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName) } if nn.Implements != nil { @@ -2118,7 +2118,7 @@ func (p *Printer) printStmtClass(n ast.Vertex) { } p.write([]byte("implements")) p.bufStart = " " - p.joinPrintRefactored(",", nn.Implements.InterfaceNames) + p.joinPrintRefactored(",", nn.Implements.(*ast.StmtClassImplements).InterfaceNames) } @@ -2503,7 +2503,7 @@ func (p *Printer) printStmtInterface(n ast.Vertex) { } p.write([]byte("extends")) p.bufStart = " " - p.joinPrintRefactored(",", nn.Extends.InterfaceNames) + p.joinPrintRefactored(",", nn.Extends.(*ast.StmtInterfaceExtends).InterfaceNames) } p.printFreeFloating(nn, token.Name) @@ -2755,7 +2755,7 @@ func (p *Printer) printStmtTraitUse(n ast.Vertex) { p.bufStart = " " p.joinPrintRefactored(",", nn.Traits) - p.Print(nn.TraitAdaptationList) + p.Print(nn.Adaptations) p.printFreeFloating(nn, token.End) } From 2d6ae3a9a27ef6d4dbcce80405d9a42a35cd639f Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 22 Nov 2020 14:26:24 +0200 Subject: [PATCH 078/140] [refactoring] update ast structure of "ClassMethod", "Function", "ArrowFunction" and "Closure" nodes --- internal/php5/php5.go | Bin 286340 -> 284993 bytes internal/php5/php5.y | 149 ++++++++++++--------------- internal/php7/php7.go | Bin 237795 -> 235322 bytes internal/php7/php7.y | 187 +++++++++++++++------------------- pkg/ast/node.go | 77 ++++++++++---- pkg/ast/visitor/dump.go | 30 ------ pkg/printer/pretty_printer.go | 8 +- pkg/printer/printer.go | 16 +-- 8 files changed, 211 insertions(+), 256 deletions(-) diff --git a/internal/php5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`h%A z$N>G9&hpttn2Bx#L&p5CyBHU#N3!iKJ`hstNjusIpV?kj$xc(D+Ir)1e^wQ2=FH+$ zk>+^ge%6Xm)n|PQ9^qyT0TUk8!od@f>OVf>|A~?&vR=A#-b{$@&w^voFJySW&ZNni zPJ4VZha`qi@ts!k&zVjK^~G8iq7*oxe7ZWzNC=;CLaim}k`WQUKu{f<(~N4e9raxw zG8K9DS@M@JkMfE(PNw=+4pKN9`c?B+q#np|=4q(}Uo@;Ia{LN^2OIn(bX(JPlZt?6X0T^`(U>hf0{?UZaMVyXIi>iy!yobre?hYeY2{I^#4psRnKrJ|jjtM_8msR$5q{L_ zJTlZ7jF!XEyM9&g4GN2`4WJ{9AC50qe)7P&mhLS;t 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) + $$ = &ast.StmtClassMethod{ + Node: ast.Node{ + Position: pos, + }, + Modifiers: $1, + FunctionTkn: $2, + AmpersandTkn: $3, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + OpenParenthesisTkn: $5, + Params: $6, + CloseParenthesisTkn: $7, + Stmt: $8, } - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.SkippedTokens) } ; @@ -3907,51 +3900,37 @@ expr_without_variable: } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $4, $6, nil, $8} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $9) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.SkippedTokens) - - // normalize - if $6 == nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) + $$ = &ast.ExprClosure{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $9), + }, + FunctionTkn: $1, + AmpersandTkn: $2, + OpenParenthesisTkn: $3, + Params: $4, + CloseParenthesisTkn: $5, + ClosureUse: $6, + OpenCurlyBracketTkn: $7, + Stmts: $8, + CloseCurlyBracketTkn: $9, } } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ast.Node{}, $3 != nil, true, $5, $7, nil, $9} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $10) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Static, $2.SkippedTokens) - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.SkippedTokens) - - // normalize - if $7 == nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) + $$ = &ast.ExprClosure{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $10), + }, + StaticTkn: $1, + FunctionTkn: $2, + AmpersandTkn: $3, + OpenParenthesisTkn: $4, + Params: $5, + CloseParenthesisTkn: $6, + ClosureUse: $7, + OpenCurlyBracketTkn: $8, + Stmts: $9, + CloseCurlyBracketTkn: $10, } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 0a0e9afa09a9715af2877ad3a04d7d129e32be74..5d03f1b9af6664a5da7847bcfbbc5672a9808abc 100644 GIT binary patch delta 7163 zcmc&(d34lOmOl4BvXc!YA!MP#zJ{u-RjdIa0clxe6+{vU2oaM&5EpC>N-K&qu~9B( z6sWY?s0ai^oCa!QHFpO!UmZuLSr)kvvQQby4- zVl>6dg8kH5o_>xJ`czbw&C2T5qqKTq)=je(-npP+{5@5(x@TQqIj^!}{OuLJqNDH^ z8j;dRsZEA=TGlnznbop+870XxMHEjyIl7Eo(z~2u$u0g#oG$ZzLviF;y^PvPS3eDx z(pXBCsya%L)qX0H3O}`#h6qZR#5#;p8)tN)Os)$K{7^^5lrM>Usl8lD;4ppLA89{} zf2m5AQ^geJbWVDn9%ssy#5nFCdq#4aba(+9ezE}@e%+H&#J^reNy|#rT6VlZBjmzG zXy^*7x8>s(uWCkaq~VlnkJD8fX&`gHSL)n+n~eGs#moBdAjbWFqBt4&6(n?JV8g;5 zjJ>u|l>Xyp%3>M25ehj{g4q}AA;Xb+G((b>Zly$GcYz$Or%tkF8)j5*!;IR^)JjLb zLR$&$V8&g7bEY9U!~kymO);wyu=tE_*Ms+@z&sK)3ydxKQ5vp;^9 zW=LbEY9|e|sHJrz+2T@hGUgrZux~$9z49G6@y~yu-^&v-aPh)@v_u+Th7TF9YnuFb z&ht5LVz;c{3E%MVfoAsaqi@;m(|g~gqr}Hs!{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v`O@w#X=4hc2I_c44)DC2&T(vW zK@rs5C{vxh$_4IXVBnE%qYvOkx9}JRv|cBx1fNWmInoWyQQv;dj^$`+^u0}<<&bnU z+dSLwG#SO?N5~+xE?urBtJ$lkDhLY&FO8-+g#Aj6b!wy>B&?dTax|`$>Z>1c zM2=5BHdp4Urjc@%Z#;C2%(Ij=4fGqY2LnuI6|Io#OcQJyi?wN;oQUI9W1;z$b~NYA zik5t=uqdKeJfWdBSbj2I=3Z91$8u2t?u2?p!;2dvaLNSKyI@4NKef0|eJlpiM$6fzn*O>J~Xlox53XLW4g|VdNmT&5*(T zudC3LeE(Kip;e2VA*y{JX>j-X(`2PuIz#?9T)n%qInax5FU74u%uMR1PL|3s zCST2NKyPZ+Yyj&qeTHEQ{t>k+n#rBaP+&$1yt!!wJ@YYs)L2WsSVf>M2LKg5%bYQzGGx+9JIeJ&~$BrJ7EK~mnI zf1V-&Rs14}7LZpP%JM;ffnOCe!{Jpk7Rwd5pF@3ix121=llF`7#Ry;TaoQij1Y_6g zdN}Pz|0quod0py*2XG 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) + $$ = &ast.StmtClassMethod{ + Node: ast.Node{ + Position: pos, + }, + Modifiers: $1, + FunctionTkn: $2, + AmpersandTkn: $3, + MethodName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + OpenParenthesisTkn: $6, + Params: $7, + CloseParenthesisTkn: $8, + ColonTkn: $9.(*ast.ReturnType).ColonTkn, + ReturnType: $9.(*ast.ReturnType).Type, + Stmt: $10, } - if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.SkippedTokens) } ; @@ -3624,74 +3616,55 @@ expr_without_variable: } | T_STATIC inline_function { - $$ = $2; - - switch n := $$.(type) { + switch n := $2.(type) { case *ast.ExprClosure : - n.Static = true; + n.Position = position.NewTokenNodePosition($1, $2) + n.StaticTkn = $1; case *ast.ExprArrowFunction : - n.Static = true; + n.Position = position.NewTokenNodePosition($1, $2) + n.StaticTkn = $1; }; - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens); + $$ = $2 } ; inline_function: T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ast.Node{}, $2 != nil, false, $5, $7, $8, $10} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $11) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) - } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.SkippedTokens) - - // normalize - if $8 == nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.LexicalVars, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) - } - if $7 == nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) + $$ = &ast.ExprClosure{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $11), + }, + FunctionTkn: $1, + AmpersandTkn: $2, + OpenParenthesisTkn: $4, + Params: $5, + CloseParenthesisTkn: $6, + ClosureUse: $7, + ColonTkn: $8.(*ast.ReturnType).ColonTkn, + ReturnType: $8.(*ast.ReturnType).Type, + OpenCurlyBracketTkn: $9, + Stmts: $10, + CloseCurlyBracketTkn: $11, } } | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr { - $$ = &ast.ExprArrowFunction{ast.Node{}, $2 != nil, false, $4, $6, $9} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $9) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.SkippedTokens) - }; - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.SkippedTokens) - - // normalize - if $6 == nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) - }; + $$ = &ast.ExprArrowFunction{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $9), + }, + FnTkn: $1, + AmpersandTkn: $2, + OpenParenthesisTkn: $3, + Params: $4, + CloseParenthesisTkn: $5, + ColonTkn: $6.(*ast.ReturnType).ColonTkn, + ReturnType: $6.(*ast.ReturnType).Type, + DoubleArrowTkn: $8, + Expr: $9, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 3c64e3d..fb50e7f 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -292,12 +292,16 @@ func (n *StmtClassImplements) Accept(v NodeVisitor) { // StmtClassMethod node type StmtClassMethod struct { Node - ReturnsRef bool - MethodName Vertex - Modifiers []Vertex - Params []Vertex - ReturnType Vertex - Stmt Vertex + Modifiers []Vertex + FunctionTkn *token.Token + AmpersandTkn *token.Token + MethodName Vertex + OpenParenthesisTkn *token.Token + Params []Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + ReturnType Vertex + Stmt Vertex } func (n *StmtClassMethod) Accept(v NodeVisitor) { @@ -501,11 +505,17 @@ func (n *StmtForeach) Accept(v NodeVisitor) { // StmtFunction node type StmtFunction struct { Node - ReturnsRef bool - FunctionName Vertex - Params []Vertex - ReturnType Vertex - Stmts []Vertex + FunctionTkn *token.Token + AmpersandTkn *token.Token + FunctionName Vertex + OpenParenthesisTkn *token.Token + Params []Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + ReturnType Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtFunction) Accept(v NodeVisitor) { @@ -951,11 +961,16 @@ func (n *ExprArrayItem) Accept(v NodeVisitor) { // ExprArrowFunction node type ExprArrowFunction struct { Node - ReturnsRef bool - Static bool - Params []Vertex - ReturnType Vertex - Expr Vertex + StaticTkn *token.Token + FnTkn *token.Token + AmpersandTkn *token.Token + OpenParenthesisTkn *token.Token + Params []Vertex + CloseParenthesisTkn *token.Token + ColonTkn *token.Token + ReturnType Vertex + DoubleArrowTkn *token.Token + Expr Vertex } func (n *ExprArrowFunction) Accept(v NodeVisitor) { @@ -1006,12 +1021,18 @@ func (n *ExprClone) Accept(v NodeVisitor) { // ExprClosure node type ExprClosure struct { Node - ReturnsRef bool - Static bool - Params []Vertex - ClosureUse *ExprClosureUse - ReturnType Vertex - Stmts []Vertex + StaticTkn *token.Token + FunctionTkn *token.Token + AmpersandTkn *token.Token + OpenParenthesisTkn *token.Token + Params []Vertex + CloseParenthesisTkn *token.Token + ClosureUse *ExprClosureUse + ColonTkn *token.Token + ReturnType Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *ExprClosure) Accept(v NodeVisitor) { @@ -1947,6 +1968,8 @@ func (n *NameNamePart) Accept(v NodeVisitor) { v.NameNamePart(n) } +// TODO: move to private section + type ParserBrackets struct { Node OpenBracketTkn *token.Token @@ -1967,3 +1990,13 @@ type ParserSeparatedList struct { func (n *ParserSeparatedList) Accept(v NodeVisitor) { v.ParserSeparatedList(n) } + +type ReturnType struct { + Node + ColonTkn *token.Token + Type Vertex +} + +func (n *ReturnType) Accept(v NodeVisitor) { + // do nothing +} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 15c3226..6586d8c 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -288,11 +288,6 @@ func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassMethod{\n") v.printNode(n.GetNode()) - - if n.ReturnsRef { - v.printIndent(v.indent) - v.print("ReturnsRef: true,\n") - } } func (v *Dump) StmtConstList(n *ast.StmtConstList) { @@ -397,11 +392,6 @@ func (v *Dump) StmtFunction(n *ast.StmtFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFunction{\n") v.printNode(n.GetNode()) - - if n.ReturnsRef { - v.printIndent(v.indent) - v.print("ReturnsRef: true,\n") - } } func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { @@ -641,16 +631,6 @@ func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrowFunction{\n") v.printNode(n.GetNode()) - - 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) { @@ -681,16 +661,6 @@ func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosure{\n") v.printNode(n.GetNode()) - - 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) { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 65c4cf6..fdd297f 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1015,13 +1015,13 @@ func (p *PrettyPrinter) printExprClosureUse(n ast.Vertex) { func (p *PrettyPrinter) printExprClosure(n ast.Vertex) { nn := n.(*ast.ExprClosure) - if nn.Static { + if nn.StaticTkn != nil { io.WriteString(p.w, "static ") } io.WriteString(p.w, "function ") - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { io.WriteString(p.w, "&") } @@ -1432,7 +1432,7 @@ func (p *PrettyPrinter) printStmtClassMethod(n ast.Vertex) { } io.WriteString(p.w, "function ") - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { io.WriteString(p.w, "&") } @@ -1785,7 +1785,7 @@ func (p *PrettyPrinter) printStmtFunction(n ast.Vertex) { io.WriteString(p.w, "function ") - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { io.WriteString(p.w, "&") } diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 5848f39..ea131e5 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1405,18 +1405,18 @@ func (p *Printer) printExprArrowFunction(n ast.Vertex) { nn := n.(*ast.ExprArrowFunction) p.printFreeFloating(nn, token.Start) - if nn.Static { + if nn.StaticTkn != nil { p.write([]byte("static")) } p.printFreeFloating(nn, token.Static) - if nn.Static && n.GetNode().Tokens.IsEmpty() { + if nn.StaticTkn != nil && n.GetNode().Tokens.IsEmpty() { p.write([]byte(" ")) } p.write([]byte("fn")) p.printFreeFloating(nn, token.Function) - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) @@ -1496,18 +1496,18 @@ func (p *Printer) printExprClosure(n ast.Vertex) { nn := n.(*ast.ExprClosure) p.printFreeFloating(nn, token.Start) - if nn.Static { + if nn.StaticTkn != nil { p.write([]byte("static")) } p.printFreeFloating(nn, token.Static) - if nn.Static && n.GetNode().Tokens.IsEmpty() { + if nn.StaticTkn != nil && n.GetNode().Tokens.IsEmpty() { p.write([]byte(" ")) } p.write([]byte("function")) p.printFreeFloating(nn, token.Function) - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { p.write([]byte("&")) } p.printFreeFloating(nn, token.Ampersand) @@ -2040,7 +2040,7 @@ func (p *Printer) printStmtClassMethod(n ast.Vertex) { p.write([]byte("function")) p.printFreeFloating(nn, token.Function) - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { if nn.GetNode().Tokens.IsEmpty() { p.write([]byte(" ")) } @@ -2384,7 +2384,7 @@ func (p *Printer) printStmtFunction(n ast.Vertex) { p.write([]byte("function")) p.printFreeFloating(nn, token.Function) - if nn.ReturnsRef { + if nn.AmpersandTkn != nil { if nn.GetNode().Tokens.IsEmpty() { p.write([]byte(" ")) } From 5bd63d90ba1e18037440e7f0fb95792200e03cf0 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 22 Nov 2020 18:54:13 +0200 Subject: [PATCH 079/140] [refactoring] update ast structure of "StmtExpression", "StmtInterface" and "StmtProperty" nodes --- internal/php5/php5.go | Bin 284993 -> 282471 bytes internal/php5/php5.y | 190 +++++++++++++++++++++--------------------- internal/php7/php7.go | Bin 235322 -> 233655 bytes internal/php7/php7.y | 99 +++++++++++----------- pkg/ast/node.go | 17 ++-- 5 files changed, 158 insertions(+), 148 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index ce30db867ccecb49004ea901c769fcd89258f458..a65caae372cb5edbc0136f211d9b1be4d2620d44 100644 GIT binary patch delta 12081 zcmbVScYM`Fw*Sn`F9|&fEtDkpA|${=;Pw()C@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(I=kOS4jW97|U*07(&sl!NQ z(}LC%q(8@$dg9xvhsMhRo_O6*+dEOtQPsbaF)mn)kW@*NBKRWn}(GD8XO@(f-h`s4LSprbmsTAKERhJjik zzwn7$(I@U7c@bucrgdT0TNnin)yPIyK9wQEC^TsIR^;9p-W>f(OqjaCt17l*(@o|o zveZ;WeRGqX;cq(?imIixGU=a({_y4+;%C+82TP=>KDF&B`tdE{chI@ZSg3#WOQBj diff --git a/internal/php7/php7.y b/internal/php7/php7.y index c6bc108..e8ed084 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -989,15 +989,13 @@ statement: } | expr ';' { - $$ = &ast.StmtExpression{ast.Node{}, $1} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = &ast.StmtExpression{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $2), + }, + Expr: $1, + SemiColonTkn: $2, + } } | T_UNSET '(' unset_variables possible_comma ')' ';' { @@ -1366,22 +1364,23 @@ trait_declaration_statement: interface_declaration_statement: T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' { - name := &ast.Identifier{ + $$ = &ast.StmtInterface{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $7), }, - IdentifierTkn: $2, - Value: $2.Value, + InterfaceTkn: $1, + InterfaceName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + Extends: $3, + OpenCurlyBracketTkn: $5, + Stmts: $6, + CloseCurlyBracketTkn: $7, } - $$ = &ast.StmtInterface{ast.Node{}, name, $3, $6} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.SkippedTokens) } ; @@ -2609,42 +2608,46 @@ property_list: property: T_VARIABLE backup_doc_comment { - identifier := &ast.Identifier{ + $$ = &ast.StmtProperty{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + Expr: nil, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtProperty{ast.Node{}, variable, nil} - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' expr backup_doc_comment { - identifier := &ast.Identifier{ + $$ = &ast.StmtProperty{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokenNodePosition($1, $3), }, - IdentifierTkn: $1, - Value: $1.Value, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + EqualTkn: $2, + Expr: $3, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtProperty{ast.Node{}, variable, $3} - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index fb50e7f..c6311fd 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -438,7 +438,8 @@ func (n *StmtElseIf) Accept(v NodeVisitor) { // StmtExpression node type StmtExpression struct { Node - Expr Vertex + Expr Vertex + SemiColonTkn *token.Token } func (n *StmtExpression) Accept(v NodeVisitor) { @@ -594,9 +595,12 @@ func (n *StmtInlineHtml) Accept(v NodeVisitor) { // StmtInterface node type StmtInterface struct { Node - InterfaceName Vertex - Extends Vertex - Stmts []Vertex + InterfaceTkn *token.Token + InterfaceName Vertex + Extends Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtInterface) Accept(v NodeVisitor) { @@ -654,8 +658,9 @@ func (n *StmtNop) Accept(v NodeVisitor) { // StmtProperty node type StmtProperty struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *StmtProperty) Accept(v NodeVisitor) { From 43f6fab862d4c00f221c05203361624d2374afce Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 29 Nov 2020 21:50:33 +0200 Subject: [PATCH 080/140] [refactoring] update ast structure of "StmtPropertyList", "StmtTraitAdaptationList", "StmtTraitMethodRef" and "StmtTraitUseAlias" nodes --- internal/php5/php5.go | Bin 282471 -> 282363 bytes internal/php5/php5.y | 184 +++++++++++++++++++++------------------- internal/php7/php7.go | Bin 233655 -> 233605 bytes internal/php7/php7.y | 189 +++++++++++++++++++++--------------------- pkg/ast/node.go | 18 ++-- 5 files changed, 204 insertions(+), 187 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a65caae372cb5edbc0136f211d9b1be4d2620d44..e0f706672208dfb76d0b02449f6d5e4e66d5ffad 100644 GIT binary patch delta 9125 zcmbVS33ye-z5izBaAOj(fNUWFF8k61&bj+#3tQM^3lg+!O@ts(APL5bl@_G6cA*lu zy!=HG(r2xr6+)v7QrT3fN&&IZDvBm50akXJm$H)lzLb=zdn;o3GOIqbw()^6$fM)W zO-T;>@a_*dvBq#O6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?MXEn&g)d92h`o50V trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation static_var_list global_var_list -%type ctor_arguments function_call_parameter_list echo_expr_list +%type ctor_arguments function_call_parameter_list echo_expr_list class_variable_declaration %type trait_adaptations unset_variables declare_list %type switch_case_list non_empty_function_call_parameter_list %type method_body trait_reference_list @@ -253,7 +253,7 @@ import ( %type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list -%type class_statement_list variable_modifiers method_modifiers class_variable_declaration +%type class_statement_list variable_modifiers method_modifiers %type trait_adaptation_list non_empty_trait_adaptation_list %type non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list @@ -2456,15 +2456,15 @@ class_statement_list: class_statement: variable_modifiers class_variable_declaration ';' { - $$ = &ast.StmtPropertyList{ast.Node{}, $1, nil, $2} - - // save position - $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtPropertyList{ + Node: ast.Node{ + Position: position.NewNodeListTokenPosition($1, $3), + }, + Modifiers: $1, + Properties: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $3, + } } | class_constant_declaration ';' { @@ -2548,13 +2548,14 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.SkippedTokens) + $$ = &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenParenthesisTkn: $1, + Adaptations: $2, + CloseParenthesisTkn: $3, + } } ; @@ -2633,20 +2634,18 @@ trait_reference_list: trait_method_reference: T_STRING { - name := &ast.Identifier{ + $$ = &ast.StmtTraitMethodRef{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | trait_method_reference_fully_qualified { @@ -2657,53 +2656,52 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := &ast.Identifier{ + $$ = &ast.StmtTraitMethodRef{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Trait: $1, + DoubleColonTkn: $2, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { - alias := &ast.Identifier{ + $$ = &ast.StmtTraitUseAlias{ Node: ast.Node{ - Position: position.NewTokenPosition($4), + Position: position.NewNodeTokenPosition($1, $4), + }, + Ref: $1, + AsTkn: $2, + Modifier: $3, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, }, - IdentifierTkn: $4, - Value: $4.Value, } - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } | trait_method_reference T_AS member_modifier { - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + $$ = &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Ref: $1, + AsTkn: $2, + Modifier: $3, + } } ; @@ -2848,7 +2846,7 @@ member_modifier: class_variable_declaration: class_variable_declaration ',' T_VARIABLE { - $$ = append($1, &ast.StmtProperty{ + item := &ast.StmtProperty{ Node: ast.Node{ Position: position.NewTokenPosition($3), }, @@ -2864,11 +2862,16 @@ class_variable_declaration: Value: $3.Value, }, }, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + + $$ = $1 } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { - $$ = append($1, &ast.StmtProperty{ + item := &ast.StmtProperty{ Node: ast.Node{ Position: position.NewTokenNodePosition($3, $5), }, @@ -2886,52 +2889,61 @@ class_variable_declaration: }, EqualTkn: $4, Expr: $5, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + + $$ = $1 } | T_VARIABLE { - $$ = []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, - Var: &ast.ExprVariable{ + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.StmtProperty{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, }, + Expr: nil, }, - Expr: nil, }, } } | T_VARIABLE '=' static_scalar { - $$ = []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, - Var: &ast.ExprVariable{ + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.StmtProperty{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokenNodePosition($1, $3), }, - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, }, + EqualTkn: $2, + Expr: $3, }, - EqualTkn: $2, - Expr: $3, }, } } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 3ef5b9f973f4390cd66e436ff85ff2a04db5603b..f1be513b8e453605caa05a0e97a6a11db0fb3400 100644 GIT binary patch delta 11890 zcmb7K33yf2wf^?rCLswKm_w#}Ntgn;a_4g{2n4WH<^&YQfD8hPjX)Swh5|vcBC}Vz ziUlNA1T95qgbm13qN0GvpgcbW&{HYkOYNdM$ki8g@b{_@2Sh3Po}~uXmS})q;iIm5v4=k z$TdZ5hAE^FDw7c-h^!!TBAQLE$drx%tM4sElyDT6SzhMWBbY6AzV8l@b3&;(O$$3o{lUx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4eg zDVMKg?cmf;nlXTTrl6dCinqnyMCRH0(4zKTL!d z+}4BD*IL0XaAP_eOxM0Ts|J12=c4M2Y|uj)E_#k{P>?N_$v4`G`Re*O0QYfGMBo%U z*XF{`cDQ~sI*55%OAJoOycST>)SqRPm6&WqEZE?8r|M0WnfgT$PQ?p&wJ!+6lw#zf`*_@%G`CY9Ulk!6WmiEx6LxUV|45^*{4Hu(k;AHr9ki7nv0nQT^8h9>EY`w^tM7s3pS3 z;J>02L=?v(D&KzjYq`KrLCC>0|1M4$#6b+nrWVX0_QMYHM4ZBrb(678p6)_8h&?3{u4D{Dd3e6!>7K=qC4;iK`fF8|co)ore0%qH%Q$ z9xOL@@u>MqBmSsyGOC=!0~R&iHG`;*$b+cvoLGhFjg#)AtM<)H`JSEdut{i!o!U9B8uM=Jhg@3sbNMEkLncThsQ_7 zln2N;d5e|N4uuA; z#Ernf@gj}Hr@)7oi!)kBEaJ#BmEsvwN-?|}z}Ep#{V;wAbH|B2u4wQ3sLbpv`&}vU zPZ=utG5o|%t`f6l>Ua?q21{5Hv7b2oISYG?`V5(?g^gE>ehOw5eu%orz%`<;{<9Y@ z7JX{H7gs@ZHF~XPN7M$O4DgF}0Di6!!!#U?(<=C!!N{pDXFLM<{eKU3UMmt%St|xX za4s)uOvU@2{iYbsk-XVm+u=H@-Un(n>hyltg+}qI|syh0-c$XMzTup@3WJ{+VzsjoI z6xSp72;AjTKzPC&q>5IYoruNi=6aCfig|aZ&%#G5%?c3->@C?>unS;pg9!gGVENC| diff --git a/internal/php7/php7.y b/internal/php7/php7.y index e8ed084..062068b 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -247,7 +247,7 @@ import ( %type variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list -%type if_stmt const_list non_empty_argument_list +%type if_stmt const_list non_empty_argument_list property_list %type alt_if_stmt %type if_stmt_without_else %type class_const_decl @@ -274,7 +274,7 @@ import ( %type encaps_list backticks_expr namespace_name catch_list class_const_list %type for_exprs non_empty_for_exprs -%type unprefixed_use_declarations inline_use_declarations property_list +%type unprefixed_use_declarations inline_use_declarations %type case_list trait_adaptation_list %type use_declarations lexical_var_list isset_variables non_empty_array_pair_list %type array_pair_list top_statement_list @@ -2193,15 +2193,16 @@ class_statement_list: class_statement: variable_modifiers optional_type property_list ';' { - $$ = &ast.StmtPropertyList{ast.Node{}, $1, $2, $3} - - // save position - $$.GetNode().Position = position.NewNodeListTokenPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) + $$ = &ast.StmtPropertyList{ + Node: ast.Node{ + Position: position.NewNodeListTokenPosition($1, $4), + }, + Modifiers: $1, + Type: $2, + Properties: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $4, + } } | method_modifiers T_CONST class_const_list ';' { @@ -2286,23 +2287,24 @@ trait_adaptations: } | '{' '}' { - $$ = &ast.StmtTraitAdaptationList{ast.Node{}, nil} - - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.SkippedTokens) + $$ = &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + OpenParenthesisTkn: $1, + CloseParenthesisTkn: $2, + } } | '{' trait_adaptation_list '}' { - $$ = &ast.StmtTraitAdaptationList{ast.Node{}, $2} - - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.SkippedTokens) + $$ = &ast.StmtTraitAdaptationList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenParenthesisTkn: $1, + Adaptations: $2, + CloseParenthesisTkn: $3, + } } ; @@ -2354,88 +2356,84 @@ trait_precedence: trait_alias: trait_method_reference T_AS T_STRING { - alias := &ast.Identifier{ + $$ = &ast.StmtTraitUseAlias{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Ref: $1, + AsTkn: $2, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } | trait_method_reference T_AS reserved_non_modifiers { - alias := &ast.Identifier{ + $$ = &ast.StmtTraitUseAlias{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Ref: $1, + AsTkn: $2, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, nil, alias} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } | trait_method_reference T_AS member_modifier identifier { - alias := &ast.Identifier{ + $$ = &ast.StmtTraitUseAlias{ Node: ast.Node{ - Position: position.NewTokenPosition($4), + Position: position.NewNodeTokenPosition($1, $4), + }, + Ref: $1, + AsTkn: $2, + Modifier: $3, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, }, - IdentifierTkn: $4, - Value: $4.Value, } - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, alias} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } | trait_method_reference T_AS member_modifier { - $$ = &ast.StmtTraitUseAlias{ast.Node{}, $1, $3, nil} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + $$ = &ast.StmtTraitUseAlias{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Ref: $1, + AsTkn: $2, + Modifier: $3, + } } ; trait_method_reference: identifier { - name := &ast.Identifier{ + $$ = &ast.StmtTraitMethodRef{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.StmtTraitMethodRef{ast.Node{}, nil, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | absolute_trait_method_reference { @@ -2446,21 +2444,20 @@ trait_method_reference: absolute_trait_method_reference: name T_PAAMAYIM_NEKUDOTAYIM identifier { - target := &ast.Identifier{ + $$ = &ast.StmtTraitMethodRef{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Trait: $1, + DoubleColonTkn: $2, + Method: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.StmtTraitMethodRef{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -2594,14 +2591,16 @@ member_modifier: property_list: property_list ',' property { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | property { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index c6311fd..de467de 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -670,9 +670,11 @@ func (n *StmtProperty) Accept(v NodeVisitor) { // StmtPropertyList node type StmtPropertyList struct { Node - Modifiers []Vertex - Type Vertex - Properties []Vertex + Modifiers []Vertex + Type Vertex + Properties []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtPropertyList) Accept(v NodeVisitor) { @@ -780,7 +782,9 @@ func (n *StmtTrait) Accept(v NodeVisitor) { // StmtTraitAdaptationList node type StmtTraitAdaptationList struct { Node - Adaptations []Vertex + OpenParenthesisTkn *token.Token + Adaptations []Vertex + CloseParenthesisTkn *token.Token } func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { @@ -790,8 +794,9 @@ func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { // StmtTraitMethodRef node type StmtTraitMethodRef struct { Node - Trait Vertex - Method Vertex + Trait Vertex + DoubleColonTkn *token.Token + Method Vertex } func (n *StmtTraitMethodRef) Accept(v NodeVisitor) { @@ -815,6 +820,7 @@ func (n *StmtTraitUse) Accept(v NodeVisitor) { type StmtTraitUseAlias struct { Node Ref Vertex + AsTkn *token.Token Modifier Vertex Alias Vertex } From 47b974a3a4b06eb7ed69763ef6eff5eeac006e98 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 30 Nov 2020 23:42:56 +0200 Subject: [PATCH 081/140] [refactoring] update ast structure of "array" and "list" nodes --- internal/php5/php5.go | Bin 282363 -> 285766 bytes internal/php5/php5.y | 256 ++++++++++++++++++++++------------ internal/php7/php7.go | Bin 233605 -> 233306 bytes internal/php7/php7.y | 167 ++++++++++++---------- pkg/ast/ast.go | 2 - pkg/ast/node.go | 32 ++--- pkg/ast/traverser/dfs.go | 28 ---- pkg/ast/visitor/dump.go | 12 -- pkg/ast/visitor/null.go | 8 -- pkg/printer/pretty_printer.go | 20 --- pkg/printer/printer.go | 28 ---- 11 files changed, 267 insertions(+), 286 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e0f706672208dfb76d0b02449f6d5e4e66d5ffad..02fee28e28b405cb478392fb497f54438f618a99 100644 GIT binary patch delta 16509 zcmeHudw5kvlK9u%H-rR22oM5LlK_{pn4hX?TQF%rbQ4zt}9mc`Yt*SovoWtzw@7taI&G-HO_klI* zf0$(Q1qlJ0!61#qa)$6%D2l>HVnh;;vkX3B6+`r32w#4hOd#&tS{T25**zqg-xsBR zUo?Pt{KItOEd4a5FMvBKw~omj=7>g}jshPzn?pyYYns+y6-8^!Ra9dL{1K z_nS_H7{C{q13iA!0y1D-1jrf!kwnS+!{dG*VbY5PF%#lh@uc|0>f;yLi=Wok?+YaU z`Td-GP+xI;NUQjuwc!tX;>gVX_ya^_zsQhySff(}`H{%H0xT@P!YCy_QN#|DBxHKl zi$n~>5`Fh~OF_=@U}F0I_!yGFPo_(TaM?rLeKc!&#Sn@Q;s$BX=0)-a@fAgp_@Nmf zay*jw^L}qJvgo@sTj8lu?}zDaxh!8kE5jYpjB)`p`K2lFNf;efPb z$(D=BcD+H8k+ffo46zFZV1y9yXX|7CVDQ6R?>|<@9Ira@P!pOoQX^3$@$rcg8mR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al/php5/php5.y @@ -238,9 +238,9 @@ import ( %type trait_method_reference_fully_qualified trait_method_reference trait_modifiers member_modifier method %type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list echo_expr_list class_variable_declaration -%type trait_adaptations unset_variables declare_list -%type switch_case_list non_empty_function_call_parameter_list -%type method_body trait_reference_list +%type trait_adaptations unset_variables declare_list non_empty_array_pair_list array_pair_list +%type switch_case_list non_empty_function_call_parameter_list assignment_list +%type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list %type foreach_statement for_statement while_statement %type foreach_variable foreach_optional_arg %type extends_from interface_list trait_list @@ -249,13 +249,13 @@ import ( %type lexical_vars %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations -%type inner_statement_list encaps_list isset_variables non_empty_array_pair_list -%type array_pair_list assignment_list lexical_var_list elseif_list new_elseif_list non_empty_for_expr +%type inner_statement_list encaps_list isset_variables +%type lexical_var_list elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers %type trait_adaptation_list non_empty_trait_adaptation_list -%type non_empty_member_modifiers backticks_expr static_array_pair_list non_empty_static_array_pair_list +%type non_empty_member_modifiers backticks_expr %type chaining_dereference chaining_instance_call chaining_method_or_property instance_call variable_property %type method_or_not array_method_dereference object_property object_dim_list dynamic_class_name_variable_property @@ -1620,15 +1620,23 @@ foreach_variable: } | T_LIST '(' assignment_list ')' { - $$ = &ast.ExprList{ast.Node{}, $3} + pairList := $3.(*ast.ParserSeparatedList) + fistPair := pairList.Items[0].(*ast.ExprArrayItem) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) + if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { + pairList.Items = nil + } - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) + $$ = &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } } ; @@ -3129,7 +3137,23 @@ new_expr: expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { - listNode := &ast.ExprList{ast.Node{}, $3} + pairList := $3.(*ast.ParserSeparatedList) + fistPair := pairList.Items[0].(*ast.ExprArrayItem) + + if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { + pairList.Items = nil + } + + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position @@ -4051,26 +4075,28 @@ combined_scalar_offset: combined_scalar: T_ARRAY '(' array_pair_list ')' { - $$ = &ast.ExprArray{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ArrayTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } } | '[' array_pair_list ']' { - $$ = &ast.ExprShortArray{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + } } ; @@ -4710,26 +4736,28 @@ static_scalar_value: } | T_ARRAY '(' static_array_pair_list ')' { - $$ = &ast.ExprArray{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ArrayTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } } | '[' static_array_pair_list ']' { - $$ = &ast.ExprShortArray{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + } } | static_class_constant { @@ -5229,16 +5257,16 @@ scalar: static_array_pair_list: /* empty */ { - $$ = nil + $$ = &ast.ParserSeparatedList{} } | non_empty_static_array_pair_list possible_comma { - $$ = $1 - - // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) } + + $$ = $1 } ; @@ -5257,32 +5285,41 @@ non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) } | non_empty_static_array_pair_list ',' static_scalar_value { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position arrayItem.GetNode().Position = position.NewNodesPosition($1, $3) @@ -5294,7 +5331,10 @@ non_empty_static_array_pair_list: | static_scalar_value { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position arrayItem.GetNode().Position = position.NewNodePosition($1) @@ -5804,21 +5844,15 @@ simple_indirect_reference: assignment_list: assignment_list ',' assignment_list_element { - if len($1) == 0 { - $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} - } + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | assignment_list_element { - if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { - $$ = []ast.Vertex{} - } else { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, } } ; @@ -5837,7 +5871,23 @@ assignment_list_element: } | T_LIST '(' assignment_list ')' { - listNode := &ast.ExprList{ast.Node{}, $3} + pairList := $3.(*ast.ParserSeparatedList) + fistPair := pairList.Items[0].(*ast.ExprArrayItem) + + if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { + pairList.Items = nil + } + + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} // save position @@ -5859,20 +5909,16 @@ assignment_list_element: array_pair_list: /* empty */ { - $$ = []ast.Vertex{} + $$ = &ast.ParserSeparatedList{} } | non_empty_array_pair_list possible_comma { + if $2 != nil { + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) + } + $$ = $1 - - if $2 != nil { - $$ = append($1, &ast.ExprArrayItem{ast.Node{}, false, nil, nil}) - } - - // save comments - if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - } } ; @@ -5880,32 +5926,41 @@ non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, $5} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) } | non_empty_array_pair_list ',' expr { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $3} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) } | expr T_DOUBLE_ARROW expr { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, $3} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position arrayItem.GetNode().Position = position.NewNodesPosition($1, $3) @@ -5917,7 +5972,10 @@ non_empty_array_pair_list: | expr { arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, $1} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position arrayItem.GetNode().Position = position.NewNodePosition($1) @@ -5929,14 +5987,17 @@ non_empty_array_pair_list: { reference := &ast.ExprReference{ast.Node{}, $6} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $3, reference} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position reference.GetNode().Position = position.NewTokenNodePosition($5, $6) arrayItem.GetNode().Position = position.NewNodesPosition($3, $6) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) yylex.(*Parser).setFreeFloating(reference, token.Start, $5.SkippedTokens) @@ -5945,21 +6006,27 @@ non_empty_array_pair_list: { reference := &ast.ExprReference{ast.Node{}, $4} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} - $$ = append($1, arrayItem) + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + + $$ = $1 // save position reference.GetNode().Position = position.NewTokenNodePosition($3, $4) arrayItem.GetNode().Position = position.NewTokenNodePosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.SkippedTokens) } | expr T_DOUBLE_ARROW '&' w_variable { reference := &ast.ExprReference{ast.Node{}, $4} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, $1, reference} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position reference.GetNode().Position = position.NewTokenNodePosition($3, $4) @@ -5974,7 +6041,10 @@ non_empty_array_pair_list: { reference := &ast.ExprReference{ast.Node{}, $2} arrayItem := &ast.ExprArrayItem{ast.Node{}, false, nil, reference} - $$ = []ast.Vertex{arrayItem} + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{arrayItem}, + } // save position reference.GetNode().Position = position.NewTokenNodePosition($1, $2) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index f1be513b8e453605caa05a0e97a6a11db0fb3400..ba1e751d6b2de139a2f9582bec51db57003c4523 100644 GIT binary patch delta 9135 zcmb_id3;nww*FOB5=a9f5FtPU>4Y89p>OYvWJqL5SOP&*kTqcySqvcVn&61SC>m_# zxFS545mW>bNlw7li(Zwc=O&Lb^F$KmhUWe>Lv?T zBpq9pwC2IqGVEEmxb=6b<$g~n+ZpolBjCp)7|wPidU??A^=3Og0XIJ^%=mfQhqpj5 zfHCd{!+7(C{JbS-)`YX2mKTEoKOP~!2VKjT?F@VI2n5g#`3#pJwuHj&>~d!)%o{^Y z(i6;f`oPr3>%!)Np2d_5kB}E)dAwNV_kvN#&$CP}jG<5%lR+=U4Vg#K0~VH_<#mHX zkU4}{-mshXVsU-p?0j@Vf%W%TER@H>YuIfB2Q5F-#g#zW8|gsHF_FNT4~AKB^| zBt8ChO}q!nyRn+A7WS}!{L7+YfPrH|jzmVr7mkQ^se^+oJj-Rk3%VJU0CrhSA;7eF zw}FlA5b`rc2Hs+D{61dKAoxHdGJaj#a_E5}AMfHZ3v(eK(_vWswgp)jkT5I(Bi1vl zSRM30Mh~X_K4!)^GZ-PZXUK~!c;VHU^l%R(c}>UzRs9C@2F95@fp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(3s7W ze3OXxd8QAK(t!`L*G7RkEiR_1A7SG26MDkGQqQ@nh-y9+Df;QZ$)SL{m(a4`L@TS+ z9{uCTGC`sY7~gJbL*qu1&LG653=G!0&&a>PLmNWMyf+9cZ0)n{A#ge^2AZabzMHL1P{Rlu5r6vz=k}XlyVn*JoPRcJKYU&O#b+9 zVF1d#!PnMrWkUNY{=eVTyP7kLM$bV7ZNI$##5KLyuafAJ@6pCQfa;%Y&R2J9{APZ( zWBlK&eWdWLG5hG?cG(5L>Z>3e63>R2&8#*{Wl_$j;5)L=;~B; zCl?xCps@fqrw$Xa_FgJWRsCs&7k94fR^vB|9_eZ|r#mC9AqyVapAMl8V?9Q=q?amJ z-dHWtf9R!xI6u6)wYSRUADJ2%^HFkRA!6eGT=~JFUHzss(fT15{Nhai*B%%R4pyMu~L&zfM931fe;J zf9X#(*P{;3o2+t8OLy%wRic}wsE4Es+8Q%&{B&#IlCGPsQrC-;us`mo5hJWCCto^w zq&22;>C);t>lS#JJykf=s;sqY>nfMduUt~Sw92Z&g{i8xc2V_GdiYwEYfg^DpzBs@ zx>_yixcHS&=_Xu+8fK_Ibi77+x#jBO{#x;y88{)id7b)fSLBQPoUji2DPG`SCVL8)gE4w)u(DP!jd`Gu3!*6mk16rMqVX zE0@hg!C;)ZKck>yC`AJlq?t?9g7)fkouKq;Rc+=p;wE%Ujfpa!Z--q8g=K(#X1+?1 zD&&}-+P;J$sUGye4*Z_bw+<$S(O$>Tz~AH87b=V^*e`EUzm~M}7L}}f z->#-8>9;Rv?+ESPDVn|g)#}IZ(gISOh(}rldI3&rxtM?rpmSI9zNVUx=(8z4v-N4jyIeN IA5gyk0U&d-dH?_b diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 062068b..4591ec7 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -242,7 +242,7 @@ import ( %type static_var_list static_var class_statement trait_adaptation trait_precedence trait_alias %type absolute_trait_method_reference trait_method_reference property echo_expr %type new_expr anonymous_class class_name class_name_reference simple_variable -%type internal_functions_in_yacc +%type internal_functions_in_yacc non_empty_array_pair_list array_pair_list %type exit_expr scalar lexical_var function_call member_name property_name %type variable_class_name dereferencable_scalar constant dereferencable %type callable_expr callable_variable static_member new_variable @@ -276,8 +276,8 @@ import ( %type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations %type case_list trait_adaptation_list -%type use_declarations lexical_var_list isset_variables non_empty_array_pair_list -%type array_pair_list top_statement_list +%type use_declarations lexical_var_list isset_variables +%type top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers %type non_empty_member_modifiers class_modifiers @@ -1454,26 +1454,28 @@ foreach_variable: } | T_LIST '(' array_pair_list ')' { - $$ = &ast.ExprList{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) + $$ = &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } } | '[' array_pair_list ']' { - $$ = &ast.ExprShortList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save commentsc - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) + $$ = &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + } } ; @@ -2802,31 +2804,41 @@ new_expr: expr_without_variable: T_LIST '(' array_pair_list ')' '=' expr { - listNode := &ast.ExprList{ast.Node{}, $3} + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} // save position - listNode.GetNode().Position = position.NewTokensPosition($1, $4) $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) } | '[' array_pair_list ']' '=' expr { - shortList := &ast.ExprShortList{ast.Node{}, $2} - $$ = &ast.ExprAssign{ast.Node{}, shortList, $5} + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + } + $$ = &ast.ExprAssign{ast.Node{}, listNode, $5} // save position - shortList.GetNode().Position = position.NewTokensPosition($1, $3) $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.SkippedTokens) yylex.(*Parser).setFreeFloating($$, token.Var, $4.SkippedTokens) } | variable '=' expr @@ -3890,26 +3902,28 @@ ctor_arguments: dereferencable_scalar: T_ARRAY '(' array_pair_list ')' { - $$ = &ast.ExprArray{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ArrayTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } } | '[' array_pair_list ']' { - $$ = &ast.ExprShortArray{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) + $$ = &ast.ExprArray{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + } } | T_CONSTANT_ENCAPSED_STRING { @@ -4474,6 +4488,13 @@ property_name: array_pair_list: non_empty_array_pair_list { + pairList := $1.(*ast.ParserSeparatedList) + fistPair := pairList.Items[0].(*ast.ExprArrayItem) + + if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { + pairList.Items = nil + } + $$ = $1 } ; @@ -4481,7 +4502,7 @@ array_pair_list: possible_array_pair: /* empty */ { - $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} + $$ = &ast.ExprArrayItem{} } | array_pair { @@ -4492,21 +4513,15 @@ possible_array_pair: non_empty_array_pair_list: non_empty_array_pair_list ',' possible_array_pair { - if len($1) == 0 { - $1 = []ast.Vertex{&ast.ExprArrayItem{ast.Node{}, false, nil, nil}} - } + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | possible_array_pair { - if $1.(*ast.ExprArrayItem).Key == nil && $1.(*ast.ExprArrayItem).Val == nil { - $$ = []ast.Vertex{} - } else { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, } } ; @@ -4571,35 +4586,41 @@ array_pair: } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { - // TODO: Cannot use list() as standalone expression - listNode := &ast.ExprList{ast.Node{}, $5} + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($3, $6), + }, + ListTkn: $3, + OpenBracketTkn: $4, + Items: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $6, + } $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, listNode} // save position - listNode.GetNode().Position = position.NewTokensPosition($3, $6) $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) // save comments yylex.(*Parser).MoveFreeFloating($1, $$) yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.SkippedTokens) } | T_LIST '(' array_pair_list ')' { - // TODO: Cannot use list() as standalone expression - listNode := &ast.ExprList{ast.Node{}, $3} + listNode := &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + } $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} // save position - listNode.GetNode().Position = position.NewTokensPosition($1, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) } ; diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 7e02236..c0e84c2 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -113,8 +113,6 @@ type NodeVisitor interface { ExprRequire(n *ExprRequire) ExprRequireOnce(n *ExprRequireOnce) ExprShellExec(n *ExprShellExec) - ExprShortArray(n *ExprShortArray) - ExprShortList(n *ExprShortList) ExprStaticCall(n *ExprStaticCall) ExprStaticPropertyFetch(n *ExprStaticPropertyFetch) ExprTernary(n *ExprTernary) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index de467de..9322ae3 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -939,7 +939,11 @@ func (n *StmtWhile) Accept(v NodeVisitor) { // ExprArray node type ExprArray struct { Node - Items []Vertex + ArrayTkn *token.Token + OpenBracketTkn *token.Token + Items []Vertex + SeparatorTkns []*token.Token + CloseBracketTkn *token.Token } func (n *ExprArray) Accept(v NodeVisitor) { @@ -1166,7 +1170,11 @@ func (n *ExprIsset) Accept(v NodeVisitor) { // ExprList node type ExprList struct { Node - Items []Vertex + ListTkn *token.Token + OpenBracketTkn *token.Token + Items []Vertex + SeparatorTkns []*token.Token + CloseBracketTkn *token.Token } func (n *ExprList) Accept(v NodeVisitor) { @@ -1297,26 +1305,6 @@ func (n *ExprShellExec) Accept(v NodeVisitor) { v.ExprShellExec(n) } -// ExprShortArray node -type ExprShortArray struct { - Node - Items []Vertex -} - -func (n *ExprShortArray) Accept(v NodeVisitor) { - v.ExprShortArray(n) -} - -// ExprShortList node -type ExprShortList struct { - Node - Items []Vertex -} - -func (n *ExprShortList) Accept(v NodeVisitor) { - v.ExprShortList(n) -} - // ExprStaticCall node type ExprStaticCall struct { Node diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 8a6cdec..3da2562 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -1543,34 +1543,6 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Parts", false) } - case *ast.ExprShortArray: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Items != nil { - t.visitor.Enter("Items", false) - for _, c := range nn.Items { - t.Traverse(c) - } - t.visitor.Leave("Items", false) - } - case *ast.ExprShortList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Items != nil { - t.visitor.Enter("Items", false) - for _, c := range nn.Items { - t.Traverse(c) - } - t.visitor.Leave("Items", false) - } case *ast.ExprStaticCall: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 6586d8c..45dc2c2 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -812,18 +812,6 @@ func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { v.printNode(n.GetNode()) } -func (v *Dump) ExprShortArray(n *ast.ExprShortArray) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprShortArray{\n") - v.printNode(n.GetNode()) -} - -func (v *Dump) ExprShortList(n *ast.ExprShortList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprShortList{\n") - v.printNode(n.GetNode()) -} - func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticCall{\n") diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index f5e1467..724f4a1 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -394,14 +394,6 @@ func (v *Null) ExprShellExec(_ *ast.ExprShellExec) { // do nothing } -func (v *Null) ExprShortArray(_ *ast.ExprShortArray) { - // do nothing -} - -func (v *Null) ExprShortList(_ *ast.ExprShortList) { - // do nothing -} - func (v *Null) ExprStaticCall(_ *ast.ExprStaticCall) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index fdd297f..4f51213 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -274,10 +274,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printExprRequireOnce(n) case *ast.ExprShellExec: p.printExprShellExec(n) - case *ast.ExprShortArray: - p.printExprShortArray(n) - case *ast.ExprShortList: - p.printExprShortList(n) case *ast.ExprStaticCall: p.printExprStaticCall(n) case *ast.ExprStaticPropertyFetch: @@ -1240,22 +1236,6 @@ func (p *PrettyPrinter) printExprShellExec(n ast.Vertex) { io.WriteString(p.w, "`") } -func (p *PrettyPrinter) printExprShortArray(n ast.Vertex) { - nn := n.(*ast.ExprShortArray) - - io.WriteString(p.w, "[") - p.joinPrint(", ", nn.Items) - io.WriteString(p.w, "]") -} - -func (p *PrettyPrinter) printExprShortList(n ast.Vertex) { - nn := n.(*ast.ExprShortList) - - io.WriteString(p.w, "[") - p.joinPrint(", ", nn.Items) - io.WriteString(p.w, "]") -} - func (p *PrettyPrinter) printExprStaticCall(n ast.Vertex) { nn := n.(*ast.ExprStaticCall) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index ea131e5..0080044 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -363,10 +363,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printExprRequireOnce(n) case *ast.ExprShellExec: p.printExprShellExec(n) - case *ast.ExprShortArray: - p.printExprShortArray(n) - case *ast.ExprShortList: - p.printExprShortList(n) case *ast.ExprStaticCall: p.printExprStaticCall(n) case *ast.ExprStaticPropertyFetch: @@ -1837,30 +1833,6 @@ func (p *Printer) printExprShellExec(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printExprShortArray(n ast.Vertex) { - nn := n.(*ast.ExprShortArray) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("[")) - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, token.ArrayPairList) - p.write([]byte("]")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprShortList(n ast.Vertex) { - nn := n.(*ast.ExprShortList) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("[")) - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, token.ArrayPairList) - p.write([]byte("]")) - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printExprStaticCall(n ast.Vertex) { nn := n.(*ast.ExprStaticCall) p.printFreeFloating(nn, token.Start) From 4b8d4317679420b45fefa677ab983ab09dce7e93 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 1 Dec 2020 00:42:45 +0200 Subject: [PATCH 082/140] [refactoring] update ast structure of "ArrayDimFetch" and "ArrayItem" nodes --- internal/php5/php5.go | Bin 285766 -> 281709 bytes internal/php5/php5.y | 604 +++++++++++++++++++++------------------- internal/php7/php7.go | Bin 233306 -> 230494 bytes internal/php7/php7.y | 288 ++++++++++--------- pkg/ast/node.go | 15 +- pkg/ast/visitor/dump.go | 5 - pkg/printer/printer.go | 2 +- 7 files changed, 476 insertions(+), 438 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 02fee28e28b405cb478392fb497f54438f618a99..15333e8fb87dd725d30af520cc36111d63cb8e2a 100644 GIT binary patch delta 7452 zcmcIpd34l8wmwz$%hDlx0wE;OO$f3Ex;sgCCx{7RNEjUmm;_mrFobOkkOWks7=ojW z8-~b`%M(Wsb)GDdu#AOFfUq7HFhK-?VX#4uGN>WLfrt1UeP2~CX>{J1H|H^brR!Gx zs_wmY@BO~IIlMFGo7FK*9f=`!M_Aax>WY;)Jn=WtJ$@VAgURR~yn7LCKgSBlJ&4Cq z?cZ4x<-Wo~sHKPpQP>(5F6PZCr>Tqh5OL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iGSCh0Ntxh2Q6cs_*S7kzjLj_wJe_+S~tVMTAKgOkf378CQN z$w(pFhV|uXn4T|(Cx11@7ZX_>T$C@%e`ha<##i#?-lwuqOQz?x`s0N&XXRnPv2trt z=K^G7d0qZzIe%@iZaxo$dtmv7Usxd)q9>AOHy-S(Or)y6d>wvyNuBi_@j)KORmzV7SaOwpis|EcDwbE5%Vf5)w@30= z>@t?6;t|ez;UBNbqONEsdp_BM=luI~bIx#`t~x(>PI{FNYKsp?aQ)3#8HDC!lo#kF=1*+~-TS*V@M^=W0!O6!zIC z%RnaHiR?BFmvyu98XJfU=F4iid5ty0w+^uoT=)-p5_e4G`RWc3={_KJtlPlOS@N0m z#jzN*LuSensT?8asd9oDCd-ir?p;}m!Ts(RwGwoI=H#j^G655(@@U*y$j=599!Sp; z#gn-HAV`xH$jBDSPw*VN7weX+3?au_2{>hj=?(&Tc`^5ivorW1GcSQaK$I5o4DvoI zk2kqjsv}q=&2_GNsuBAwmHz>@Z65Eg3r#k$403D@;(-O6Q9yF{ll!J6JX9=O#M`^} zkVV42B_@UsOVikcxMQhPsWLlhC2Kkd*It1Qc;G2l@ZyA}a(T*^%LVB;K+ajqWjy15 E0SR8ui2wiq diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 4591ec7..ffe6f94 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4236,36 +4236,39 @@ callable_variable: } | dereferencable '[' optional_expr ']' { - $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) + $$ = &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $4), + }, + Var: $1, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, + } } | constant '[' optional_expr ']' { - $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) + $$ = &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $4), + }, + Var: $1, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, + } } | dereferencable '{' expr '}' { - $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) + $$ = &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $4), + }, + Var: $1, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, + } } | dereferencable T_OBJECT_OPERATOR property_name argument_list { @@ -4380,25 +4383,27 @@ new_variable: } | new_variable '[' optional_expr ']' { - $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) + $$ = &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $4), + }, + Var: $1, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, + } } | new_variable '{' expr '}' { - $$ = &ast.ExprArrayDimFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) + $$ = &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $4), + }, + Var: $1, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, + } } | new_variable T_OBJECT_OPERATOR property_name { @@ -4529,98 +4534,101 @@ non_empty_array_pair_list: array_pair: expr T_DOUBLE_ARROW expr { - $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprArrayItem{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Key: $1, + DoubleArrowTkn: $2, + Val: $3, + } } | expr { - $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) + $$ = &ast.ExprArrayItem{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Val: $1, + } } | expr T_DOUBLE_ARROW '&' variable { - reference := &ast.ExprReference{ast.Node{}, $4} - $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, reference} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - reference.GetNode().Position = position.NewTokenNodePosition($3, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.SkippedTokens) + $$ = &ast.ExprArrayItem{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Key: $1, + DoubleArrowTkn: $2, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $4), + }, + Var: $4, + }, + } } | '&' variable { - reference := &ast.ExprReference{ast.Node{}, $2} - $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, reference} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - reference.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprArrayItem{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + Val: &ast.ExprReference{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + Var: $2, + }, + } } | T_ELLIPSIS expr { - $$ = &ast.ExprArrayItem{ast.Node{}, true, nil, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprArrayItem{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + EllipsisTkn: $1, + Val: $2, + } } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { - listNode := &ast.ExprList{ + $$ = &ast.ExprArrayItem{ Node: ast.Node{ - Position: position.NewTokensPosition($3, $6), + Position: position.NewNodeTokenPosition($1, $6), + }, + Key: $1, + DoubleArrowTkn: $2, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($3, $6), + }, + ListTkn: $3, + OpenBracketTkn: $4, + Items: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $6, }, - ListTkn: $3, - OpenBracketTkn: $4, - Items: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, - CloseBracketTkn: $6, } - $$ = &ast.ExprArrayItem{ast.Node{}, false, $1, listNode} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | T_LIST '(' array_pair_list ')' { - listNode := &ast.ExprList{ + $$ = &ast.ExprArrayItem{ Node: ast.Node{ Position: position.NewTokensPosition($1, $4), }, - ListTkn: $1, - OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, - CloseBracketTkn: $4, + Val: &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + }, } - $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, listNode} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) } ; @@ -4681,23 +4689,26 @@ encaps_var: } | T_VARIABLE '[' encaps_var_offset ']' { - identifier := &ast.Identifier{ + $$ = &ast.ExprArrayDimFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokensPosition($1, $4), }, - IdentifierTkn: $1, - Value: $1.Value, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + OpenBracketTkn: $2, + Dim: $3, + CloseBracketTkn: $4, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $3} - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { @@ -4760,25 +4771,28 @@ encaps_var: } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { - identifier := &ast.Identifier{ + $$ = &ast.ExprArrayDimFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $6), }, - IdentifierTkn: $2, - Value: $2.Value, + OpenCurlyBracketTkn: $1, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + }, + OpenBracketTkn: $3, + Dim: $4, + CloseBracketTkn: $5, + CloseCurlyBracketTkn: $6, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.ExprArrayDimFetch{ast.Node{}, variable, $4} - - // save position - variable.GetNode().Position = position.NewTokenPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $6) - - // save comments - yylex.(*Parser).setToken(variable, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.SkippedTokens) } | T_CURLY_OPEN variable '}' { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 9322ae3..990171c 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -953,8 +953,12 @@ func (n *ExprArray) Accept(v NodeVisitor) { // ExprArrayDimFetch node type ExprArrayDimFetch struct { Node - Var Vertex - Dim Vertex + Var Vertex + OpenCurlyBracketTkn *token.Token + OpenBracketTkn *token.Token + Dim Vertex + CloseBracketTkn *token.Token + CloseCurlyBracketTkn *token.Token } func (n *ExprArrayDimFetch) Accept(v NodeVisitor) { @@ -964,9 +968,10 @@ func (n *ExprArrayDimFetch) Accept(v NodeVisitor) { // ExprArrayItem node type ExprArrayItem struct { Node - Unpack bool - Key Vertex - Val Vertex + EllipsisTkn *token.Token + Key Vertex + DoubleArrowTkn *token.Token + Val Vertex } func (n *ExprArrayItem) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 45dc2c2..5ae65a5 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -620,11 +620,6 @@ func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayItem{\n") v.printNode(n.GetNode()) - - if n.Unpack { - v.printIndent(v.indent) - v.print("Unpack: true,\n") - } } func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0080044..4e86c48 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1369,7 +1369,7 @@ func (p *Printer) printExprArrayItem(n ast.Vertex) { nn := n.(*ast.ExprArrayItem) p.printFreeFloating(nn, token.Start) - if nn.Unpack { + if nn.EllipsisTkn != nil { p.write([]byte("...")) } From b90400d993e3792158d9964916113bb0b6f950c6 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 1 Dec 2020 09:51:47 +0200 Subject: [PATCH 083/140] [refactoring] update ast structure of "BitwiseNot", "BooleanNot", "ClassConstFetch" and "Clone" nodes --- internal/php5/php5.go | Bin 281709 -> 279588 bytes internal/php5/php5.y | 185 ++++++++++++++++++++---------------------- internal/php7/php7.go | Bin 230494 -> 229978 bytes internal/php7/php7.y | 88 ++++++++++---------- pkg/ast/node.go | 14 ++-- 5 files changed, 142 insertions(+), 145 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 15333e8fb87dd725d30af520cc36111d63cb8e2a..400b6321ab4933a50290f567732a20071c11e3c0 100644 GIT binary patch delta 8218 zcmbtZd3aStvj4jJkdTm&1Vb<(gaHJ?VuC?|Kp+rVL?uBH z9DN8;Q#d0Ej01uO2|^kkDj@J&*n%vAAO=N16bS>kjWSccoCEXT_r1mU2YkQ#>#FMN zs_yFQlgrCvURxZq@oIdCH$1#_?)2xoL;Mrb2_iay?dBL00!iXp3pRvlSm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_echwb;*WRVRwrOdAq<$-iK8urp>|@eh-K~Nlp`Ijij?dN0l8HcwtUEB-Jm{DJ zT>0vGA|J?f*ax9_=R?Mx2mNp+$g*K>*e-_%`ZLwK3Bg@mSsYY7!&}3OnRw&u zFo4yDssxd}$cyjg6&+pbfvm=W7cG2o(IMXqk~-O*P@caUPqTSOln@NkepMajA9$zx zU~LyWTtYB2!|GoDi0@t54&PaJXZ$C8TiSVd2K`afBj_Hd<}%l|+2 CKZP*> diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 6989c2c..e06b9ac 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3220,13 +3220,13 @@ expr_without_variable: } | T_CLONE expr { - $$ = &ast.ExprClone{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprClone{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CloneTkn: $1, + Expr: $2, + } } | variable T_PLUS_EQUAL expr { @@ -3609,23 +3609,23 @@ expr_without_variable: } | '!' expr { - $$ = &ast.ExprBooleanNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBooleanNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ExclamationTkn: $1, + Expr: $2, + } } | '~' expr { - $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBitwiseNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + TildaTkn: $1, + Expr: $2, + } } | expr T_IS_IDENTICAL expr { @@ -4665,21 +4665,20 @@ common_scalar: static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -4867,23 +4866,23 @@ static_operation: } | '!' static_scalar_value { - $$ = &ast.ExprBooleanNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBooleanNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ExclamationTkn: $1, + Expr: $2, + } } | '~' static_scalar_value { - $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBitwiseNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + TildaTkn: $1, + Expr: $2, + } } | static_scalar_value '|' static_scalar_value { @@ -6445,81 +6444,77 @@ isset_variable: class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index a4b4d5db4675dcb044fc92c950f5610a23b62155..387a16334850235098a4fd2b51ca2f4a6243ed3c 100644 GIT binary patch delta 1671 zcmbtUTTE0}6wN-{0fxW;J_d1M?toDXRGkONpjD@UK&cj_q(&;?p;Re|fHYAn@kP}S zjc6N|O{>ME#-El9HT8tXHW>B8q>a=zHnk7b#-vRX%A}FscHfx+NyA_N?!J4kb=KK? z?eptN+k;+P@KhS*9Xp+N;&dA6(`o9?dVH5h`FMC;d2ld9iI(EFJ?+gn8=|FHQLL;m z_EG}whA2U|)~Y7~EKXH3%B>srZEtJb-PqlNBTvbR!GMZ~{(zF6;n4h{>iiGPQq$75 zqjA<#{=A@uyRc}I=E60iEXbbENmyoZ9nLtF9Rn{Z3$4Z_gIzdO!7*rkPG!aw?`hxL z-PqoZ;3=v{z)(GSI+x4Pxj{MpA5H&)2#p;sC#NIH&ZW3(68NxiJpb6eJkux&zxsx~Gv-LvSSH@QDG`N*051y^cz(hG)^q`B|2tysp z1$Q&AMMIV<#ur&Ufk%hg(03N|1De*Hf%{8@FBCsT|H@JcMRW8aTM-PDREQ zxJq*((D9p!2*Isv#oU$Aj_E27_YfxBqUOdGW$2ImTuS)T%|3kNZ`26u!>)QyNp%oA_+jX#kKOypHS(K|$yPM1U zjI-w;Sus{A7jCGaSd3JwI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yy*+qL4LDQ!0{HP>AlX<>DC$+Y}r} zDRFK|c4P7~#pH)$WDN@*`H{iIgu z(Rx0sf^zM~6Nc0EoP|?EDpvPz<9-s|$ig)1;qAOZN{Y~ZyR2oG1K1>Vj(9D)N%GN| zfXEh}kAhaJ!{5!^ONIK}9)4M=T)R%$%bS?;{hAm^=S++RsxS=QP}k8SkFANGZ;!^j z{GB4F?mxsej5A@vhT%tFD_iu^7r24oEShm@aqb~AIh(YrjZ>BRn8=YJ-FA$3nq=$0 mUNRE%OrYOy7oZCbLJH7*o!-Q!9n!+_=VaYwxL9NyXXn4;5+$wx diff --git a/internal/php7/php7.y b/internal/php7/php7.y index ffe6f94..7b12137 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -2866,13 +2866,13 @@ expr_without_variable: } | T_CLONE expr { - $$ = &ast.ExprClone{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprClone{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CloneTkn: $1, + Expr: $2, + } } | variable T_PLUS_EQUAL expr { @@ -3267,23 +3267,23 @@ expr_without_variable: } | '!' expr { - $$ = &ast.ExprBooleanNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBooleanNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + ExclamationTkn: $1, + Expr: $2, + } } | '~' expr { - $$ = &ast.ExprBitwiseNot{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprBitwiseNot{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + TildaTkn: $1, + Expr: $2, + } } | expr T_IS_IDENTICAL expr { @@ -4112,39 +4112,37 @@ constant: } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier { - target := &ast.Identifier{ + $$ = &ast.ExprClassConstFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($3), + Position: position.NewNodeTokenPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + ConstantName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprClassConstFetch{ast.Node{}, $1, target} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 990171c..31f5458 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1000,7 +1000,8 @@ func (n *ExprArrowFunction) Accept(v NodeVisitor) { // ExprBitwiseNot node type ExprBitwiseNot struct { Node - Expr Vertex + TildaTkn *token.Token + Expr Vertex } func (n *ExprBitwiseNot) Accept(v NodeVisitor) { @@ -1010,7 +1011,8 @@ func (n *ExprBitwiseNot) Accept(v NodeVisitor) { // ExprBooleanNot node type ExprBooleanNot struct { Node - Expr Vertex + ExclamationTkn *token.Token + Expr Vertex } func (n *ExprBooleanNot) Accept(v NodeVisitor) { @@ -1020,8 +1022,9 @@ func (n *ExprBooleanNot) Accept(v NodeVisitor) { // ExprClassConstFetch node type ExprClassConstFetch struct { Node - Class Vertex - ConstantName Vertex + Class Vertex + DoubleColonTkn *token.Token + ConstantName Vertex } func (n *ExprClassConstFetch) Accept(v NodeVisitor) { @@ -1031,7 +1034,8 @@ func (n *ExprClassConstFetch) Accept(v NodeVisitor) { // ExprClone node type ExprClone struct { Node - Expr Vertex + CloneTkn *token.Token + Expr Vertex } func (n *ExprClone) Accept(v NodeVisitor) { From 2d240e9475f4cf3061eb9f93d9abdbd1dd2a9c28 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 1 Dec 2020 11:12:56 +0200 Subject: [PATCH 084/140] [refactoring] update ast structure of "ClosureUse", "ConstFetch", "Empty" and "ErrorSuppress" nodes --- internal/php5/php5.go | Bin 279588 -> 278207 bytes internal/php5/php5.y | 293 +++++++++++++++++++++--------------------- internal/php7/php7.go | Bin 229978 -> 229440 bytes internal/php7/php7.y | 80 ++++++------ pkg/ast/node.go | 14 +- 5 files changed, 194 insertions(+), 193 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 400b6321ab4933a50290f567732a20071c11e3c0..f22f3388817b3244709fc02c5000a8c71a482f22 100644 GIT binary patch delta 5809 zcmcIoYjjmbvR>W2^M>RE0wLjqoCLx%C)xX)eO?j>7!m{pkCBIfh6E-va0LvHK>;6u zJIrzh(ZE@zMwfyps4SINge|&8f`B-HgrLA31WAy=D6fFyjCw`x*S$jmcg??hXRVxG z-LDO~zULzQ}Cz#93$f97M zE`}$N8y{!tUVI4Ux_kj&WOL9pJOn~~oM8rXU53w)gD=-*>X>=Gn1xIXh984JC_e;( zpoM&Li>^aV$W!MCy}D|q?#IHALUg~>V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s=L~el>Kt>6@bWC0Yjsom_)daX6|R8ow6a_R`jqD0+J_mtNGSiP#;n z4ov2D+*+nLty5t^o!7aAEJ35X3_%n=Doyd*N4^d4oIM!J?LU#pv~hzP3mf&74eED@ z6fc#%fLeNDBl@^E6y#MZ9e4qbyZJ>Xg?)PUi|R=!?J!|7iK|K{YX4g_v% zH0J`^==M!&IfuMyKU*wo9o5yzSXy*ht)t)7qb8JZQP1*m4`tP(Q00H8f^=ystO>YX zp!#K)j5!y#bC@?5=Sea_FWIKv5p?}FHB9$yP~Qlu(rCQsV8&O+HJH(I)2LCaEE@kB z8s$c<{InM{HwjZsBda|sEIsgbRT3kMj61#bUyWc1QGK55&#kO8mF+;h_(SAOcNjx^GSKS0%_-}QO8Ue_}Z{)U@bEBfFqfXKzpdQ8I6Ysy>JN^ZE5_=hO;R;{ah|>qkCSd6He_IV|3xy3P1Zd1w=0N= z*S`H>LNBla;c$?}E!MrSDw5JE;?)Eyz7?U~@`2KxYR03Az=SB8^o5GkGo;m1QpeZ1 zhE0+KDep3w zN}jW*_7&4*BIWD=Lq(m4r;Ip@gAcDvvmc`uF@XykvOm?$&FBPcI8$1(KaKGGJWOSY z)*aF@9}OlTQ)NqoM8*ult6r5*-=E3Ox~_v|NkFZy6SIgvru4Q>7TgfBX-Ws&MR8|* zG|^Y8oxZt?H38ojsTO}f`MBkz5Zb_4`u}}I_0h#$tZn@IMN|7bM9K88w;(!33~o|IL`MkHU{>#@G|G(vbMK%E1tzX z&C9p$z(bJ5j8QJ>JG*6jop zPwSD?F94REhf!x<=9%dYy@Qw;?08;(3xO-~gg7<8+KiWWP(;z>e%SvZasB`h<$RH$ O8~a%ef}R{?dH)I1-mxnH diff --git a/internal/php5/php5.y b/internal/php5/php5.y index e06b9ac..d38e937 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -239,7 +239,7 @@ import ( %type static_scalar_value static_operation static_var_list global_var_list %type ctor_arguments function_call_parameter_list echo_expr_list class_variable_declaration %type trait_adaptations unset_variables declare_list non_empty_array_pair_list array_pair_list -%type switch_case_list non_empty_function_call_parameter_list assignment_list +%type switch_case_list non_empty_function_call_parameter_list assignment_list lexical_var_list %type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list %type foreach_statement for_statement while_statement %type foreach_variable foreach_optional_arg @@ -250,7 +250,7 @@ import ( %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list encaps_list isset_variables -%type lexical_var_list elseif_list new_elseif_list non_empty_for_expr +%type elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list %type class_statement_list variable_modifiers method_modifiers @@ -3890,13 +3890,13 @@ expr_without_variable: } | '@' expr { - $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprErrorSuppress{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + AtTkn: $1, + Expr: $2, + } } | scalar { @@ -4121,98 +4121,107 @@ lexical_vars: } | T_USE '(' lexical_var_list ')' { - $$ = &ast.ExprClosureUse{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.SkippedTokens) + $$ = &ast.ExprClosureUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + UseTkn: $1, + OpenParenthesisTkn: $2, + Uses: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseParenthesisTkn: $4, + } } ; lexical_var_list: lexical_var_list ',' T_VARIABLE { - identifier := &ast.Identifier{ + variable := &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($3), }, - IdentifierTkn: $3, - Value: $3.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, + }, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = append($1, variable) - // save position - variable.GetNode().Position = position.NewTokenPosition($3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) + $$ = $1 } | lexical_var_list ',' '&' T_VARIABLE { - identifier := &ast.Identifier{ + reference := &ast.ExprReference{ Node: ast.Node{ - Position: position.NewTokenPosition($4), + Position: position.NewTokensPosition($3, $4), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, }, - IdentifierTkn: $4, - Value: $4.Value, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - reference := &ast.ExprReference{ast.Node{}, variable} - $$ = append($1, reference) - // save position - variable.GetNode().Position = position.NewTokenPosition($4) - reference.GetNode().Position = position.NewTokensPosition($3, $4) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, reference) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) + $$ = $1 } | T_VARIABLE { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, }, - IdentifierTkn: $1, - Value: $1.Value, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = []ast.Vertex{variable} - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } | '&' T_VARIABLE { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.ExprReference{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $2), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + }, + }, }, - IdentifierTkn: $2, - Value: $2.Value, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - reference := &ast.ExprReference{ast.Node{}, variable} - $$ = []ast.Vertex{reference} - - // save position - variable.GetNode().Position = position.NewTokenPosition($2) - reference.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating(reference, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } ; @@ -4700,45 +4709,48 @@ static_scalar_value: } | namespace_name { - name := &ast.NameName{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewNodeListPosition($1), }, - Parts: $1, + Const: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewNodePosition(name) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := &ast.NameRelative{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewTokenNodeListPosition($1, $3), }, - NsTkn: $1, - NsSeparatorTkn: $2, - Parts: $3, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $3), + }, + NsTkn: $1, + NsSeparatorTkn: $2, + Parts: $3, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) } | T_NS_SEPARATOR namespace_name { - name := &ast.NameFullyQualified{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewTokenNodeListPosition($1, $2), }, - NsSeparatorTkn: $1, - Parts: $2, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2), + }, + NsSeparatorTkn: $1, + Parts: $2, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) } | T_ARRAY '(' static_array_pair_list ')' { @@ -5155,45 +5167,48 @@ general_constant: } | namespace_name { - name := &ast.NameName{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewNodeListPosition($1), }, - Parts: $1, + Const: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewNodePosition(name) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { - name := &ast.NameRelative{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewTokenNodeListPosition($1, $3), }, - NsTkn: $1, - NsSeparatorTkn: $2, - Parts: $3, + Const: &ast.NameRelative{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $3), + }, + NsTkn: $1, + NsSeparatorTkn: $2, + Parts: $3, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewNodePosition(name) } | T_NS_SEPARATOR namespace_name { - name := &ast.NameFullyQualified{ - Node: ast.Node{ + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ Position: position.NewTokenNodeListPosition($1, $2), }, - NsSeparatorTkn: $1, - Parts: $2, + Const: &ast.NameFullyQualified{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2), + }, + NsSeparatorTkn: $1, + Parts: $2, + }, } - $$ = &ast.ExprConstFetch{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewNodePosition(name) } ; @@ -6316,43 +6331,27 @@ internal_functions_in_yacc: } | T_EMPTY '(' variable ')' { - exprBrackets := &ast.ParserBrackets{ + $$ = &ast.ExprEmpty{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), + Position: position.NewTokensPosition($1, $4), }, - OpenBracketTkn: $2, - Child: $3, - CloseBracketTkn: $4, + EmptyTkn: $1, + OpenParenthesisTkn: $2, + Expr: $3, + CloseParenthesisTkn: $4, } - $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_EMPTY '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ + $$ = &ast.ExprEmpty{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), + Position: position.NewTokensPosition($1, $4), }, - OpenBracketTkn: $2, - Child: $3, - CloseBracketTkn: $4, + EmptyTkn: $1, + OpenParenthesisTkn: $2, + Expr: $3, + CloseParenthesisTkn: $4, } - $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_INCLUDE expr { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 387a16334850235098a4fd2b51ca2f4a6243ed3c..c397bc814103acf0b0fc9db803b1ad29b7147dc6 100644 GIT binary patch delta 4022 zcmZ`*Yj9Q76`s9!9^?Xn@CZT@azjAUZgW%M{P-qBMS_?|QwNDa~*8bT0?zPwJ zTaUfYJ^z#Rx);-TztlG=>Ns}oy1w`NtV}qeV8pURfiyd6hJvw3Bowsb25%tkSS%Eb zC*mOalyGp0*f>QJCRE}v&~^+a%!oc&p`a6qf;6$k;~?!Qq%A9fQzF4$9N4xUwrxYD za}@rfEEkW}W?IFoR@yPvw^%d=o*lIzz;59s%DBJ<8IQvxD+3KJ1t( zhHh(pj)8&O5m>b&P=ZRr0vd}2Vc)_v?o7?sdIscmbQTa;xZ)JCs*SWEVMcArpDINP zE=(igR_!ew4!&vd#)evqu|bHi6wn3Ic*l{W@i&$;#ryK*6F8Y~Y?Sb;PPOkNJu zorJq%U*SreY&OQx0+R!AEZ8-mq&Ej}d6@>wbleLXx(gBwH3{FdM94Bawn8m~F)4y|Uw@3Yu6h>=D-SYa86x1jI9G2Qp;`-`Z1t-gTM;b+&>7J)tg%(HC9x8)aJ2cR9|o~I)4 z0KP90fhV}L+*4CbP8JTG!m?(9h$$BAil>8Qx0a97!luAUKN z)T4{%Qu9X9e^WpXqg&&pMcZ;@4_Y}{rqJJ>6n*L55p3^&A}fUDnWgF>AtN@4f6G#t zuxR@}kwr6XIiBWRhJ;O9uZl&~y;Llu-Gfz#8j@uf@8GAhKmeQO)m5oYe4R%nwW6Ol z;4|4I$b4Mpdd3y`w11=t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H7dK+MfB&M$kyS1|aXp6Vw*Dd_ z`%XZfmcn=S7m;o|exGldtbU7C>dKbJVxFa*nJnI?>5P_`k@9z~pDG3*eot^W~l4G5|6XAxy_50s^X>M93wEE5;fel;)6kds-i_qXZQy7sL(gRSt4dI y9@hG!1@KL>($%zOVj4pucHexlTr@H6*zpHh`zjtJrrKW>Ijrk{%a_@$!ulW1++VZ+ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 7b12137..9c95662 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -248,7 +248,7 @@ import ( %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list %type if_stmt const_list non_empty_argument_list property_list -%type alt_if_stmt +%type alt_if_stmt lexical_var_list %type if_stmt_without_else %type class_const_decl %type alt_if_stmt_without_else @@ -276,7 +276,7 @@ import ( %type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations %type case_list trait_adaptation_list -%type use_declarations lexical_var_list isset_variables +%type use_declarations isset_variables %type top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers @@ -3551,13 +3551,13 @@ expr_without_variable: } | '@' expr { - $$ = &ast.ExprErrorSuppress{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprErrorSuppress{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + AtTkn: $1, + Expr: $2, + } } | scalar { @@ -3704,29 +3704,32 @@ lexical_vars: } | T_USE '(' lexical_var_list ')' { - $$ = &ast.ExprClosureUse{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.SkippedTokens) + $$ = &ast.ExprClosureUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + UseTkn: $1, + OpenParenthesisTkn: $2, + Uses: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseParenthesisTkn: $4, + } } ; lexical_var_list: lexical_var_list ',' lexical_var { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | lexical_var { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -4102,13 +4105,12 @@ scalar: constant: name { - $$ = &ast.ExprConstFetch{ast.Node{}, $1} - - // save position - $$.GetNode().Position = position.NewNodePosition($1) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) + $$ = &ast.ExprConstFetch{ + Node: ast.Node{ + Position: position.NewNodePosition($1), + }, + Const: $1, + } } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier { @@ -4898,23 +4900,15 @@ internal_functions_in_yacc: } | T_EMPTY '(' expr ')' { - exprBrackets := &ast.ParserBrackets{ + $$ = &ast.ExprEmpty{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), + Position: position.NewTokensPosition($1, $4), }, - OpenBracketTkn: $2, - Child: $3, - CloseBracketTkn: $4, + EmptyTkn: $1, + OpenParenthesisTkn: $2, + Expr: $3, + CloseParenthesisTkn: $4, } - $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_INCLUDE expr { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 31f5458..fb314cc 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1066,7 +1066,11 @@ func (n *ExprClosure) Accept(v NodeVisitor) { // ExprClosureUse node type ExprClosureUse struct { Node - Uses []Vertex + UseTkn *token.Token + OpenParenthesisTkn *token.Token + Uses []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token } func (n *ExprClosureUse) Accept(v NodeVisitor) { @@ -1086,7 +1090,10 @@ func (n *ExprConstFetch) Accept(v NodeVisitor) { // ExprEmpty node type ExprEmpty struct { Node - Expr Vertex + EmptyTkn *token.Token + OpenParenthesisTkn *token.Token + Expr Vertex + CloseParenthesisTkn *token.Token } func (n *ExprEmpty) Accept(v NodeVisitor) { @@ -1096,7 +1103,8 @@ func (n *ExprEmpty) Accept(v NodeVisitor) { // ExprErrorSuppress node type ExprErrorSuppress struct { Node - Expr Vertex + AtTkn *token.Token + Expr Vertex } func (n *ExprErrorSuppress) Accept(v NodeVisitor) { From 9b122de8bf290a30c98832b93a1129bc832e7519 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 1 Dec 2020 11:58:09 +0200 Subject: [PATCH 085/140] [refactoring] update ast structure of "Eval", "Exit", "FunctionCall", "Include" and "IncludeOnce" nodes --- internal/php5/php5.go | Bin 278207 -> 278293 bytes internal/php5/php5.y | 148 +++++++++++++++++----------------- internal/php7/php7.go | Bin 229440 -> 229039 bytes internal/php7/php7.y | 98 +++++++++++----------- pkg/ast/node.go | 23 ++++-- pkg/ast/traverser/dfs.go | 10 ++- pkg/ast/visitor/dump.go | 5 -- pkg/printer/pretty_printer.go | 8 +- pkg/printer/printer.go | 10 +-- 9 files changed, 151 insertions(+), 151 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f22f3388817b3244709fc02c5000a8c71a482f22..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xSd#XkUp50^wWSgdQaRfxASfXkIWfcF63H_}B z5?E8BTxyu*9Z}#%2b~}t9N$Lv3^M@Q-1s9jT7F4w*^8wYfUcwT%Bt@_xm*x01KMw1z- zn8Yiat<9cP>}0ClADwEG1LxMk#hWL}-v9C3PI--oRv@q86nI^DwVMSeyMkl$cdYWO zYCFq;c9S^12lS}FA!_-_o}f?=V>qBEE}ADN$xfWTMps@-|9-;wPvpy9hU${6bK5L*+wOIyNsz>AYf;I4Qs>%D6p>mrs?=-P!*Ik(#Oe zr^uCpQq=lsa+FkSE{mJQ7bX>7K}EF8V83xPtWDk{CDWU Date: Tue, 1 Dec 2020 12:16:46 +0200 Subject: [PATCH 086/140] [refactoring] update ast structure of "InstanceOf" and "Isset" nodes --- internal/php5/php5.go | Bin 278293 -> 278293 bytes internal/php5/php5.y | 49 ++++++++++++++++++++------------------ internal/php7/php7.go | Bin 229039 -> 230024 bytes internal/php7/php7.y | 53 ++++++++++++++++++++++-------------------- pkg/ast/node.go | 11 ++++++--- 5 files changed, 62 insertions(+), 51 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 9b23a936fa097a36e46c7c6eacf87e3e1bfc6081..850176840611132505326f0705771b3163ac2778 100644 GIT binary patch delta 1414 zcmYjQUu+a*5YOx`*XwcORp44^DSHuA${p-?yL-C_g>a=%Ni?Mf8y_?+LX8imsaz9m ze6YqCUv0mT35gHHL?4JD#04(C_%DhHr5NL>4`L7PS!-!8@lSZDiq3r7qb7Hg`DT7I z^PAuI?U}oYGj|gg=Ql;YSZs7`WXQy(8+volu-R#k+QLtpws7P@ze5*UPmcK8njFhc z#~NMFrBps`<}KN`KPms+v$n;t1Z9NdrA^@qHiU6lLH$Pq1tG}Dqt{y^%v*TD@bxuN;IKtTHD@A1v0-+WG7PqqaTRg33Xirz6I_~J z4-wK&Sbi{lUk&yOFkWRh}q#YD>~aem*-5St+ZjB)`H{QuSH#TJ<4n z@LRP%>V;%H+57X`53)8S1nWZ+iI~g$l|C#i#XPxTE<>eVa}!_(<+&aft8M;WmB5btcK%?T&gxpYI@tbe3L@M-?@v}Y$iamZZ6p&v^RSwhWpOOlj;=#i7Pf$p z|150ceQ)1suIocdekuGRs6pEnpQihIb#Y%@Awo?(d2MlL69>Wz;$^sLWT|h9^668g zxvF9%w}Kd58Us((mioyasaA$Kt{Hr`0sl-J-QZ#28!d_ByNpC>AY;S;d=)8Cq#aQFt(m0{ zcN?bx3um>hrDMW4x#E78HJ%4>QJmLzq4~SMm;I=|84vV8hwj*-RIs#10pE0u!}wxa zZ$@i?2t;$l>e((m86L-T#$hVt=2!B@6~MQA;}GOARiSCEdyPwgm-i54HL?u9(E6wZ0`nCXmN4A5zdly-`s6lUnV@7?z^rVYlGa#`1R)%?d9_3z^kH5VwEN($-cvceT?++0>#BAg9w7LQWa=A`A(s7)1NxdcGg z*4EOq5i0E!mef_LXB_Hr3gmi1XC0xMCnwWf6WTC_u+`s_9g^UMU?v{5*FGU6r^yhH z+DBvs6A`ZJz1AG3W+A-rwQC#TsfZsDrJSW#Y7=m%4L4ibNG5JEJd08@;f1Nq5N9bY zKb-pMIU~-85?1)w^puh2ym-JUvwS2W7+3`1@$y%35MkoR6#!dZpLy{BvyikQ&nGb?W&itXD|qkBR!g&0_^wjg{&MUjyf<1lN~7i2oj$aOj7-8gvG??= z!y{O{Ydnj+Gth~%pF#nDo`5bq|6$D8aAR{!9~e5!y$g*-J3iT9)Z^9; zvjA9U|$Ecp!Kd{;(XprlrHAX6o8Ls|1sK1l*s@D zQIP56_P2eb5!089B<{7T{Ts_X0eEbj;3$3tK;pnNu trait_adaptations unset_variables declare_list non_empty_array_pair_list array_pair_list %type switch_case_list non_empty_function_call_parameter_list assignment_list lexical_var_list %type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list -%type foreach_statement for_statement while_statement +%type foreach_statement for_statement while_statement isset_variables %type foreach_variable foreach_optional_arg %type extends_from interface_list trait_list %type implements_list @@ -248,7 +248,7 @@ import ( %type lexical_vars %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations -%type inner_statement_list encaps_list isset_variables +%type inner_statement_list encaps_list %type elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list catch_statement additional_catches %type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list @@ -3717,14 +3717,14 @@ expr_without_variable: } | expr T_INSTANCEOF class_name_reference { - $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Expr: $1, + InstanceOfTkn: $2, + Class: $3, + } } | parenthesis_expr { @@ -6331,15 +6331,16 @@ encaps_var_offset: internal_functions_in_yacc: T_ISSET '(' isset_variables ')' { - $$ = &ast.ExprIsset{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.SkippedTokens) + $$ = &ast.ExprIsset{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + IssetTkn: $1, + OpenParenthesisTkn: $2, + Vars: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseParenthesisTkn: $4, + } } | T_EMPTY '(' variable ')' { @@ -6422,14 +6423,16 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | isset_variables ',' isset_variable { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 25bfa123bdd459a0cf91215d8b4fcb80d1dcb3bd..9fde4cddde8eef921a529c2d60898311a84abda5 100644 GIT binary patch delta 8708 zcmZ`;33wGnw*IO*BqR`)kPs5cy*EGzU@qP@w=Ya!GRP*IfUF9#$fn>Z0a-*g0Z|c= zW~{*n3@9!*hzubXi;RdMAO;CAjtnx$s0fN9D4-F6ch2d)U1h%azK`zoU;o+bbXDEv ztsCh}7S-GGL=KCVFU+};-NcN=i+pCpEb@gza5E#pqO{cFSh2M{*m!g(8ZGk0;>AFk z@Dz>(i+sh=VvsPSArOv&ZZHgVJRAY07{-D@crqg(9SX&Ye33AqSPV7d0eFmq1=9qL z2*^f5W_j&UkNFv9Gz=0!G>MUzk(f22JZ~<#K?LGvgv^4qAXIH`wV)QE-y<$POTmJDn# zU|NGKIweCG!9c`XU6I=~f-z&dL5#_{f$v~2W>r;e_F{1YaEpO^xYAP5C|+@}7dNf7 zZ?~O`v7mLd0{-J54j0%BK-|s^)Pn)KVf2CD+~TN&na9BbUYG@5aVVyK1<^d-FlKl} z$3;Fb&MjWp1$2R04CevczzkaV%RoMs6ED@`R=$*kgX2J@TxcFqlLP7(2H8zYq9YI-V2JqQPRE8W4w<2;&67<_G(w zV6HG3)~ti4Ai6<^VhzCzEEzCLC4inTUwdd6Pr>4YU+dQ4oVxUkW%HX6tKg%_4Jc_) zOoU^-^wDFr9X|o9Wo0)iY>4u~Byi>Nn_+8S<;c1iHZYW*b+Iy!#jUg>?UFGAGir4_ z(s3@nxPB@Kt_%=5RvSxh#~6g_`26@*Kqknbs%?=P4xfPsm-aj*c!1>Ft`+n%PC9f8 zEN(t5Rxpa*LQ(7bk@^`JHBLIXv||WZO+TJG*M8B-j!99W94h-U60`(KpivSD+ttQV zv|{G~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3&J_i^SqzGT|9!|C^Tf}_$0zr}nJKduh?_>^Cyg3aDu(JP9tp_Bcu3xS+&sZ9 z9tmny=|a)N@e0Y+zw$=1D4n;G{mMi(<%1#NEK8L|Ygn4}e#2gn7Z)27kA!9a6o}|l HE_(bwRcoou diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 5fe9dd0..2e1cdb4 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -247,7 +247,7 @@ import ( %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list %type if_stmt const_list non_empty_argument_list property_list -%type alt_if_stmt lexical_var_list +%type alt_if_stmt lexical_var_list isset_variables %type if_stmt_without_else %type class_const_decl %type alt_if_stmt_without_else @@ -275,7 +275,7 @@ import ( %type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations %type case_list trait_adaptation_list -%type use_declarations isset_variables +%type use_declarations %type top_statement_list %type inner_statement_list parameter_list non_empty_parameter_list class_statement_list %type method_modifiers variable_modifiers @@ -3386,14 +3386,14 @@ expr_without_variable: } | expr T_INSTANCEOF class_name_reference { - $$ = &ast.ExprInstanceOf{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprInstanceOf{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Expr: $1, + InstanceOfTkn: $2, + Class: $3, + } } | '(' expr ')' { @@ -4886,18 +4886,19 @@ encaps_var_offset: internal_functions_in_yacc: T_ISSET '(' isset_variables possible_comma ')' { - $$ = &ast.ExprIsset{ast.Node{}, $3} + if $4 != nil { + $3.(*ast.ParserSeparatedList).SeparatorTkns = append($3.(*ast.ParserSeparatedList).SeparatorTkns, $4) + } - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.SkippedTokens) - if $4 == nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.SkippedTokens, $5.SkippedTokens...)) + $$ = &ast.ExprIsset{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $5), + }, + IssetTkn: $1, + OpenParenthesisTkn: $2, + Vars: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseParenthesisTkn: $5, } } | T_EMPTY '(' expr ')' @@ -4969,14 +4970,16 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | isset_variables ',' isset_variable { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 93d9001..54ae3de 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1175,8 +1175,9 @@ func (n *ExprIncludeOnce) Accept(v NodeVisitor) { // ExprInstanceOf node type ExprInstanceOf struct { Node - Expr Vertex - Class Vertex + Expr Vertex + InstanceOfTkn *token.Token + Class Vertex } func (n *ExprInstanceOf) Accept(v NodeVisitor) { @@ -1186,7 +1187,11 @@ func (n *ExprInstanceOf) Accept(v NodeVisitor) { // ExprIsset node type ExprIsset struct { Node - Vars []Vertex + IssetTkn *token.Token + OpenParenthesisTkn *token.Token + Vars []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token } func (n *ExprIsset) Accept(v NodeVisitor) { From b1e9f5e167716f79940418517ae61065c7532fe8 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 3 Dec 2020 21:42:16 +0200 Subject: [PATCH 087/140] [refactoring] update ast structure of "ExprMethodCall" and "ExprPropertyFetch" nodes --- internal/php5/parser_test.go | 2 + internal/php5/php5.go | Bin 278293 -> 279591 bytes internal/php5/php5.y | 176 ++++++++++++++++++++++------------ internal/php7/php7.go | Bin 230024 -> 229807 bytes internal/php7/php7.y | 91 +++++++++--------- pkg/ast/node.go | 14 ++- pkg/ast/traverser/dfs.go | 10 +- pkg/printer/pretty_printer.go | 2 +- pkg/printer/printer.go | 6 +- 9 files changed, 182 insertions(+), 119 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 0eb1d67..a2b90ea 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -17236,6 +17236,8 @@ func TestExprPrint(t *testing.T) { assert.DeepEqual(t, expected, actual) } +// TODO add test for `echo $a->b["c"]()->d["e"]();` + func TestExprPropertyFetch(t *testing.T) { src := `foo;` diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 850176840611132505326f0705771b3163ac2778..040152df5ef97c2523d9bcc8f0a116856255b177 100644 GIT binary patch delta 5658 zcmcgwdvui55kL3NmxSFwSRP5pgJc6H7zoQ|H@llnc_ab}SRv6MQbHsTB1ZF)gr_Ko zt<`ecl6v4*dkVs_6ns>`2e%k0puwsIF|8n03sGn-t!U7;a1>(ae&6mI1^f6%4kzcE zxpU{votZoHn_b`Q*mnP*o$n{v0s*_dZFx(b6J2L1@!pu^@5dwy6_YHR_o6W1Vjf4!)5X{(1ZmgOwb0WOLD@c9x8{$nN zsZruC-13&3Edn?&)<{?Hyd|9yMGwhz@Mo54dXRo8@cy4<3A&C_F6N)$uiR}iT^&3j z_Xyl`UOLsLZuy)L9!tZr_hg3s$QL5>S~!`yM^ zGwBd${Y*}^Toh*B7`h|VuZQobk7fD?V*N2H#<^vbj>194M0DRP#^N{Ug>6F&{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mA?a_Q^qGJuRiI%i1ofnU%#7ZnvC;u}G=1yDiZCRnEI9 z;;uL0o>p7T;O{WkCUt>D8$v^ek^Zwb{(3J2nP=MN94Qq>m7HfTUSk@{bO|corYf^{ zzno@Y;?Ts)(6do-@utXG{L-alXip@gB3J@3|D4L(b4XUH&@^|;DW)RxeUG#V7dcJz z4}6=DJ77OBPIF{HzGO@$OMsazCk0b|0FYqmn>4d_m*eGc1Dy puVQ6ZUyx1>&Sost439{cFJT)TaIy1Vv=)!qI{AyP=21qzkY6j~YtTLgrr zO`{g8aQscs7gHq`6O%8Rn9vxF4{93UG$yvO5e=F^Q{~B@xw~wOi4XVY&U`a-X68HR zUYfFBDB)CGT&;RD_GncPsoL;qSd{!__vPn2PjizJ`W zau;tTAMMnbD`RpK174}obnWH=^MhAD)~HI(j&(A>!dooo5TU3b5#~y3*DQ0z#JWZHbVNX0U08gV-A)!fL<3N;Vn`$h2Bp=xg$_NFoVqCjZ zHYHAkr~s?KD6f_}#BR3lm7Aok`y#rc!3*Sqr^PzUr)`+=aWXnub<|>{wMw?R+$!}% zLCd%sgIUVM`X}|&8*?%zLhA0%%nMK^_Y!w%&5_@*C1FybC_St#e>_@$FfGw7}akWy4 zQQjpBa2!^4T4I^?sKS2yi$6hezf#I)PW8)KR%#_4l{VpEsY$!eYlP+@spZmA^ZJl{ z$w=!HCuSNs#XL7GqeMPS2yQ$+DoG}HL{f?TQIAoN)4Epc*qnYwMreb2=AKj1L&`gg mhfpKQTpY80Ls7~6v!9wUJg$(TQj6p>QQAfSaTyq!6#u_O0G+P@ diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 2e1cdb4..ca0a1c2 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4274,14 +4274,17 @@ callable_variable: } | dereferencable T_OBJECT_OPERATOR property_name argument_list { - $$ = &ast.ExprMethodCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprMethodCall{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Var: $1, + ObjectOperatorTkn: $2, + Method: $3, + OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ast.ArgumentList).Arguments, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + } } | function_call { @@ -4300,14 +4303,14 @@ variable: } | dereferencable T_OBJECT_OPERATOR property_name { - $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + ObjectOperatorTkn: $2, + Property: $3, + } } ; @@ -4409,14 +4412,14 @@ new_variable: } | new_variable T_OBJECT_OPERATOR property_name { - $$ = &ast.ExprPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + ObjectOperatorTkn: $2, + Property: $3, + } } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -4714,29 +4717,31 @@ encaps_var: } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { - identifier := &ast.Identifier{ + $$ = &ast.ExprPropertyFetch{ Node: ast.Node{ - Position: position.NewTokenPosition($1), + Position: position.NewTokensPosition($1, $3), }, - IdentifierTkn: $1, - Value: $1.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} - fetch := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, + ObjectOperatorTkn: $2, + Property: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, }, - IdentifierTkn: $3, - Value: $3.Value, } - $$ = &ast.ExprPropertyFetch{ast.Node{}, variable, fetch} - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 54ae3de..9f90db7 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1215,9 +1215,12 @@ func (n *ExprList) Accept(v NodeVisitor) { // ExprMethodCall node type ExprMethodCall struct { Node - Var Vertex - Method Vertex - ArgumentList *ArgumentList + Var Vertex + ObjectOperatorTkn *token.Token + Method Vertex + OpenParenthesisTkn *token.Token + Arguments []Vertex + CloseParenthesisTkn *token.Token } func (n *ExprMethodCall) Accept(v NodeVisitor) { @@ -1288,8 +1291,9 @@ func (n *ExprPrint) Accept(v NodeVisitor) { // ExprPropertyFetch node type ExprPropertyFetch struct { Node - Var Vertex - Property Vertex + Var Vertex + ObjectOperatorTkn *token.Token + Property Vertex } func (n *ExprPropertyFetch) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 95f2d4a..fecf672 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -1396,10 +1396,12 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Method) t.visitor.Leave("Method", true) } - if nn.ArgumentList != nil { - t.visitor.Enter("ArgumentList", true) - t.Traverse(nn.ArgumentList) - t.visitor.Leave("ArgumentList", true) + if nn.Arguments != nil { + t.visitor.Enter("Arguments", false) + for _, c := range nn.Arguments { + t.Traverse(c) + } + t.visitor.Leave("Arguments", false) } case *ast.ExprNew: if nn == nil { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 79782fe..ef01e44 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1133,7 +1133,7 @@ func (p *PrettyPrinter) printExprMethodCall(n ast.Vertex) { io.WriteString(p.w, "->") p.Print(nn.Method) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(", ", nn.Arguments) io.WriteString(p.w, ")") } diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index dfbe5f1..8791841 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1695,9 +1695,9 @@ func (p *Printer) printExprMethodCall(n ast.Vertex) { p.write([]byte("->")) p.Print(nn.Method) - 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) } From 45e959056b126e2d57be3e90dfbb66b0783a3a9b Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 3 Dec 2020 22:04:59 +0200 Subject: [PATCH 088/140] [refactoring] update ast structure of "PostDec", "PostInc", "PreDec", "PreInc" and "New" nodes --- internal/php5/php5.go | Bin 279591 -> 279808 bytes internal/php5/php5.y | 105 ++++++++++++++++++++-------------- internal/php7/php7.go | Bin 229807 -> 228447 bytes internal/php7/php7.y | 96 +++++++++++++++++-------------- pkg/ast/node.go | 19 ++++-- pkg/ast/traverser/dfs.go | 10 ++-- pkg/printer/pretty_printer.go | 4 +- pkg/printer/printer.go | 8 +-- 8 files changed, 140 insertions(+), 102 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 040152df5ef97c2523d9bcc8f0a116856255b177..5cc24595fa7d880d35b6fcd5a228215c7bd7aab9 100644 GIT binary patch delta 5896 zcmZ`-dtB93w*TyhAjIQ9Di{O@1T-Ib-Ul=h6fCn6Cf{L#Xk{wk+wz5u-kJs#b6{y& zYBQ$ksA%aZwfEV3z1Mf`O)tb$ zy%pyEU9g6cPeuaPW^ zzFaDjX-6#&p<6R~q_RE7*D{t(d8>JVeQ`eTLX~s5O&wh+B&%Dcx!cT?2wSX*igks;I& zD#MHhFi1k(17J68Wg)FB6E%WIP+1wX)Aec?s$xEmq~!^sBNcuOxm)qN37ci31Cv-- z>jk~JQx_Ra%UTPOKs&aH5Zdw?3)lYG@EA+9TQ=)uw?F%Ae#N9orBfgGj?OHv7&qQB z={#C-M#NG5k0PAvYk3<5%j5}i9%hNg6Y8Nw{4U14^jpoeslHgL_xLE~6_Kpq^S2qLd}K)%q)fv4!h z^*_wv`lI#Xi`Vf1%w?TjxQU0TrghMUyM4rV@iYPzs*Y{o+Zgxw4NF~`FD5gxZR7)} zbe70ab2sw07%l1r58K}1(aJwZlruWG8S61~u1lrJFmdIbtWgs4bY)As76tZYlkuHW+*9Q=#R>ZK&rrS7Ar!5z%f(+w9>ls= zhgZ6)Jg9AvyPDfA%?kfZR6?^4u*2U<;qEW!yO$ltISsWeQ8gXrv7BcI^y*nHCNf%i zgck_EBcR>SN4R3#@3hoA^D*DaxGSI@s8F^4I9Rm2mfKbJ-*_(_-Wz7J4peiMC(`v# zp{18fdrK!(p5OzxH(OnM8E#R@C;0`goo82_PxB;>FfZ*Rth6O?GF0^!{1V((%;K%H zww~qrBFmYrlQBuz&gs-OnU+i-q`KS)NrUNTI3N67a{}pRIIo@OdjjcZSI_>7?`ugn zX`M3s0^hB3E^j0x>+x^C7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qqud2i=4{rYHC1EVAxp=d&PlRmV}N zD7lW@;Tze34}L5~(ac1m$#CNrE5jWI4F57F4JtUJT}|Uck~HqpZ>71)k2O7!}&t z8e{J5NQVqw)x{dkzlpK{A-alNvjdd%Gj8l^&6ciozlQLEq$^uLjKSq?Zfgp+wHQK_ z4KSJ8@V&jP{xZ~?7Q8;Cn5&|~RdJuDRGHD%9CjR&xb5Vk;t6pDd7 zVHa{5*SBcZkZ3I;&bxqKkJLhRuHv!E`IdZvMHM<|$A0Ot)rhg0TPq diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 1502664..bcdf386 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3123,17 +3123,25 @@ instance_call: new_expr: T_NEW class_name_reference ctor_arguments { - if $3 != nil { - $$ = &ast.ExprNew{ast.Node{}, $2, $3.(*ast.ArgumentList)} - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) + $$ = &ast.ExprNew{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + NewTkn: $1, + Class: $2, + OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ast.ArgumentList).Arguments, + CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, + } } else { - $$ = &ast.ExprNew{ast.Node{}, $2, nil} - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) + $$ = &ast.ExprNew{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + Class: $2, + } } - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -3195,12 +3203,27 @@ expr_without_variable: | variable '=' '&' T_NEW class_name_reference ctor_arguments { var _new *ast.ExprNew - - if $6 != nil { - _new = &ast.ExprNew{ast.Node{}, $5, $6.(*ast.ArgumentList)} + if $3 != nil { + _new = &ast.ExprNew{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($4, $6), + }, + NewTkn: $4, + Class: $5, + OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $6.(*ast.ArgumentList).Arguments, + CloseParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, + } } else { - _new = &ast.ExprNew{ast.Node{}, $5, nil} + _new = &ast.ExprNew{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($4, $5), + }, + NewTkn: $4, + Class: $5, + } } + $$ = &ast.ExprAssignReference{ast.Node{}, $1, _new} // save position @@ -3360,45 +3383,43 @@ expr_without_variable: } | rw_variable T_INC { - $$ = &ast.ExprPostInc{ast.Node{}, $1} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprPostInc{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $2), + }, + Var: $1, + IncTkn: $2, + } } | T_INC rw_variable { - $$ = &ast.ExprPreInc{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprPreInc{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + IncTkn: $1, + Var: $2, + } } | rw_variable T_DEC { - $$ = &ast.ExprPostDec{ast.Node{}, $1} - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprPostDec{ + Node: ast.Node{ + Position: position.NewNodeTokenPosition($1, $2), + }, + Var: $1, + DecTkn: $2, + } } | T_DEC rw_variable { - $$ = &ast.ExprPreDec{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprPreDec{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + DecTkn: $1, + Var: $2, + } } | expr T_BOOLEAN_OR expr { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 39792017fb1d95617ea04fc61f3f68030c014552..cfb8eb3a80060c65557adbcd379bee9d626ca2fe 100644 GIT binary patch delta 8321 zcmZ`;d3cmX(toO&oRE{7B$G)H0t#d%Gn0c$A|M2a1TYfrLjgG?;gA>t5)c(x5h8|C zR1CPvq9Wo4w5*>(6t4v#xQMraqORgWWC3+o+3Mq+%zWRo`6JJ-e^p&wU0q$>{m!nt z;!ph&_rhHrA^(3?cii<4nl>BL<&6k4fNCRQG{v=mE(YBbL|207jtEEE6hw0(4OeNp zO^kxB3Z>JESn$&aQATQ;3u8q`Iv)kCLR1b%hp7yX32Pn*Zx+OcNXLa(>De+w;HT}O zO&_^ig?Qzo&Ed^9agKCkJo~&p&M~E%G4UZyJERu;9xCutWkQIapPIs(a}z_PK02Ei zGNg|tCxtaX3^vn~!4ApDPwyr>R&;Yn>#$}+c(YHNFzMd#W_DXg`cqrByd$(}htz_{ z+c|m%IK1@Mg;nVbZ(9n^(e{RUJc=?T|c%kLGo9qM@5#hc~CDgh@YE&7^8{ z(}pzeTbjy7o14eNn?-3M(y|b}ey$LKk7Q^whdk*aW8}~?s;P5)N(P6di`$upZaxv- z?3fWEwX@WEahV|kKiwPNY)&7oT-`ZD*+>8E%pQ2xV>@Mufw^y;A(+m}S z)+I#Xr?FkbnmTiwZhjh`Wkz$+hAbGbrs|^DZWhVa-C(IM7cO#L4L51AeCTRO2ikf9 z-SYiwU^39ObL`!XJ>fVl_=RiC^}S#aP{SV#pUsBOK*u9QI{oC~{)}8S!wY2weWp-D z21{?sfw2m?=~xcy6=pFS;$xJQEz;$yKDd*I$z?bx06Vlrm+YDch;)1svqc545Xifd z;itXfYM_kkfED_}Fbg;IgMJqN&|j56t*~$a>;%cMt0iU)glLcp2En^%G$s#$U8ts= zCVLEnH5UGT1iWA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u|hD^n0dl+Z56#vN;3rs$T3aBOu{UJQ?SPPkfprzH(OY9_ zq3?jctDUJ170Rc0!P*6K*2F_QLChk7gNjV@F-?2S6<3FRQ;~0vD$V~F^xba0(;J5l zM;`ufo6|2UJv}IiaO8C$&Ud#X03}g#EXcEA0*{V|Fy@wep(dVFA{Rs7QJZ+QP!4jG zeu?`^_$_@ zsCsa69UtV+D`U~vzjO_E4)zs*ngQPBronQtYYSq|^OLqFO|2OsJ9`cweV*>7w=4}w zp2Tf$hyt86RPvV`9U9a7`8QRH*1HyK4p5u%-rFKmO&%uA$3CqMbnR50q!%D5#V~Xc zZA1A>VgQaDE~!kLx(KnP=`-C~eZ_%zc!cEdY5GS-s!#lAcJ-2qp5j$}3WyG!OU7{R zTcS*z9!2-Ro=F?P-S3l)+WjI8LtUUf_AfVq(wt6)NTJA6Ysw{mcH|M-H|`bI4yU`d z_gG(_%0=V?{c`?^+Uu2L?J;pay&0}!K|I=ut{C$AF1LOJARggHA1UVt=(v=rzx0O* zLcKLnM!e0C@sha8tdO5ulF~3zX_)3WcZ!<39M7((`B5$dl^Z*SofdD1a_$L z(@rLm#j2u4uH*UjufXnWlH2sbbEWBhG-EoS-SgyWJu&M#IZLv(n0=$ Date: Thu, 3 Dec 2020 22:20:50 +0200 Subject: [PATCH 089/140] [refactoring] update ast structure of "Print", "Reference", "Require" and "RequireOnce" nodes --- internal/php5/php5.go | Bin 279808 -> 279756 bytes internal/php5/php5.y | 70 +++++++++++++++++--------------- internal/php7/php7.go | Bin 228447 -> 228025 bytes internal/php7/php7.y | 91 ++++++++++++++++++++++-------------------- pkg/ast/node.go | 12 ++++-- 5 files changed, 93 insertions(+), 80 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 5cc24595fa7d880d35b6fcd5a228215c7bd7aab9..8aa85e6a3badd5a7044a8548daf487dc81b5ebe4 100644 GIT binary patch delta 3957 zcmZu!c~sR^9zXYfFFYUX!v&Q^9w_7r50K4;9x7sKN>VO_BWSp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iG;J{^xMCTKO^^K{0~eZc)y9TK{~I|9tS=xlU7_d~AmDHm?^mWhW#LRp;mp QvZ;?WdycTuvVn5`1!;e=oB#j- diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 581403b..bd1fe44 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1443,13 +1443,13 @@ foreach_variable: } | '&' variable { - $$ = &ast.ExprReference{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprReference{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + AmpersandTkn: $1, + Var: $2, + } } | T_LIST '(' array_pair_list ')' { @@ -3581,13 +3581,13 @@ expr_without_variable: } | T_PRINT expr { - $$ = &ast.ExprPrint{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprPrint{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + PrintTkn: $1, + Expr: $2, + } } | T_YIELD { @@ -3759,23 +3759,24 @@ lexical_var: } | '&' T_VARIABLE { - identifier := &ast.Identifier{ + $$ = &ast.ExprReference{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $2), + }, + AmpersandTkn: $1, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, }, - IdentifierTkn: $2, - Value: $2.Value, } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.ExprReference{ast.Node{}, variable} - - // save position - variable.GetNode().Position = position.NewTokenPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } ; @@ -4577,7 +4578,8 @@ array_pair: Node: ast.Node{ Position: position.NewTokenNodePosition($3, $4), }, - Var: $4, + AmpersandTkn: $3, + Var: $4, }, } } @@ -4591,7 +4593,8 @@ array_pair: Node: ast.Node{ Position: position.NewTokenNodePosition($1, $2), }, - Var: $2, + AmpersandTkn: $1, + Var: $2, }, } } @@ -4960,23 +4963,23 @@ internal_functions_in_yacc: } | T_REQUIRE expr { - $$ = &ast.ExprRequire{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprRequire{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + RequireTkn: $1, + Expr: $2, + } } | T_REQUIRE_ONCE expr { - $$ = &ast.ExprRequireOnce{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprRequireOnce{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + RequireOnceTkn: $1, + Expr: $2, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index cadaa12..c6d4c8d 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1288,7 +1288,8 @@ func (n *ExprPreInc) Accept(v NodeVisitor) { // ExprPrint node type ExprPrint struct { Node - Expr Vertex + PrintTkn *token.Token + Expr Vertex } func (n *ExprPrint) Accept(v NodeVisitor) { @@ -1310,7 +1311,8 @@ func (n *ExprPropertyFetch) Accept(v NodeVisitor) { // ExprReference node type ExprReference struct { Node - Var Vertex + AmpersandTkn *token.Token + Var Vertex } func (n *ExprReference) Accept(v NodeVisitor) { @@ -1320,7 +1322,8 @@ func (n *ExprReference) Accept(v NodeVisitor) { // ExprRequire node type ExprRequire struct { Node - Expr Vertex + RequireTkn *token.Token + Expr Vertex } func (n *ExprRequire) Accept(v NodeVisitor) { @@ -1330,7 +1333,8 @@ func (n *ExprRequire) Accept(v NodeVisitor) { // ExprRequireOnce node type ExprRequireOnce struct { Node - Expr Vertex + RequireOnceTkn *token.Token + Expr Vertex } func (n *ExprRequireOnce) Accept(v NodeVisitor) { From 13436b88a7350765829d2c5caa133ffa408f1192 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Thu, 3 Dec 2020 22:41:08 +0200 Subject: [PATCH 090/140] [refactoring] update ast structure of "ShellExec", "StaticCall", "StaticPropertyFetch" and "Ternary" nodes --- internal/php5/php5.go | Bin 279756 -> 279157 bytes internal/php5/php5.y | 197 ++++++++++++++++++---------------- internal/php7/php7.go | Bin 228025 -> 227356 bytes internal/php7/php7.y | 154 +++++++++++++------------- pkg/ast/node.go | 26 +++-- pkg/ast/traverser/dfs.go | 10 +- pkg/printer/pretty_printer.go | 2 +- pkg/printer/printer.go | 6 +- 8 files changed, 214 insertions(+), 181 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8aa85e6a3badd5a7044a8548daf487dc81b5ebe4..e289a39460857f0382b93f1310b412be43a4b2bc 100644 GIT binary patch delta 5201 zcmb_gYj~B#5q@@Olam~BIRp%t3rV=77(~t`ITr|*KtiC_h6EHT+T=*0a!Ufns90+d zrD`puPbFhT5sKPn% z@y_?LUWD`wAIJvD*Q}yE{n z-9V}Mz8>l3S?gs9$LhqSq{-2F3tQ&TTgd6HBA3&AfZ6qQN7}n93#1A3uUv#VK>hI zLV5(B_=l`;Jn*HN%j0e_LXGA7;%@03-z)eEK^3yZUP7Kub){#n5b^$1xTn=SDUloJNWUJCNskL&GFDFG89OLl=MJW2@*IzJ6;T;`gFqAK&A3GMvI9)d9H$| z^Jxg~EJNn;Ukj-pk9eJmIW~+&^J8wD)Hp?XxaxM9#%(i^gKyU(x|)ZHL^UP4Xc1S} zBRq7W7{cR*!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sT}{{J``B24?-BcZ5Ipj)_XCVA^qR{@`k zmsTyhEz@RqGOZVYCIN;+2xKqd=WOIQ970d8VI-@8U$+Z^KXrhqlqcWZN)=W-L+Owe z|HzR}*{Ww!%W?=-y)Kf;@s~8IYpIhg+%%m+c|p2_wQD7t;Y77AgP`Uwarm2NVC6Em zFBPS${^?XQ3|J~Qj$fWh#c1~^{^m?kTB_q|ZyyExN|s=W3zreTcMCnw)>#r7BnvD4 z-0dbSTN5yg1GDLrrZ>r4EBY9wa7hkr_?pd0hIgw4x%4`qOUkD`=}|tVx8zeEzne>y z+}a{Mw^ox6Ps@`tw5Nz$esl%K@{KkzxB@pV6B&t-#_HnuD}gZ@xOJCVEDx-v5-C96 zXOP6vy<&B(D`j#B%3|K1OMblmDEO;ObLgTrnc++typubMDT{xZD;A=6vFviU)Wf)8 z%k<%v2S}R7p%qQ>Ge=X)ki| zIhik7fGh&cVoN6E@GL@awQUA21{Jo1ionO|^7r%m4i|XKkSv-+;p*U0+AprFy_!ablF@k;H58^N!pNT8wN$UClD<-M>1Og(&Q0VG!m)A5l$B_a go=cnPI=;4rW_vj@GX6{a(sZ2d{;g#H57pD2(EtDd diff --git a/internal/php7/php7.y b/internal/php7/php7.y index bd1fe44..b61b9cc 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3424,27 +3424,28 @@ expr_without_variable: } | expr '?' expr ':' expr { - $$ = &ast.ExprTernary{ast.Node{}, $1, $3, $5} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $5) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.SkippedTokens) + $$ = &ast.ExprTernary{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $5), + }, + Condition: $1, + QuestionTkn: $2, + IfTrue: $3, + ColonTkn: $4, + IfFalse: $5, + } } | expr '?' ':' expr { - $$ = &ast.ExprTernary{ast.Node{}, $1, nil, $4} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.SkippedTokens) + $$ = &ast.ExprTernary{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Condition: $1, + QuestionTkn: $2, + ColonTkn: $3, + IfFalse: $4, + } } | expr T_COALESCE expr { @@ -3571,13 +3572,14 @@ expr_without_variable: } | '`' backticks_expr '`' { - $$ = &ast.ExprShellExec{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprShellExec{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBacktickTkn: $1, + Parts: $2, + CloseBacktickTkn: $3, + } } | T_PRINT expr { @@ -3795,25 +3797,31 @@ function_call: } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + $$ = &ast.ExprStaticCall{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Class: $1, + DoubleColonTkn: $2, + Call: $3, + OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ast.ArgumentList).Arguments, + CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = &ast.ExprStaticCall{ast.Node{}, $1, $3, $4.(*ast.ArgumentList)} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + $$ = &ast.ExprStaticCall{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Class: $1, + DoubleColonTkn: $2, + Call: $3, + OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ast.ArgumentList).Arguments, + CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + } } | callable_expr argument_list { @@ -4368,25 +4376,25 @@ simple_variable: static_member: class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { - $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + $$ = &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + Property: $3, + } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { - $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + $$ = &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + Property: $3, + } } ; @@ -4432,25 +4440,25 @@ new_variable: } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { - $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + Property: $3, + } } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { - $$ = &ast.ExprStaticPropertyFetch{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprStaticPropertyFetch{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Class: $1, + DoubleColonTkn: $2, + Property: $3, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index c6d4c8d..d65527a 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1344,7 +1344,9 @@ func (n *ExprRequireOnce) Accept(v NodeVisitor) { // ExprShellExec node type ExprShellExec struct { Node - Parts []Vertex + OpenBacktickTkn *token.Token + Parts []Vertex + CloseBacktickTkn *token.Token } func (n *ExprShellExec) Accept(v NodeVisitor) { @@ -1354,9 +1356,12 @@ func (n *ExprShellExec) Accept(v NodeVisitor) { // ExprStaticCall node type ExprStaticCall struct { Node - Class Vertex - Call Vertex - ArgumentList *ArgumentList + Class Vertex + DoubleColonTkn *token.Token + Call Vertex + OpenParenthesisTkn *token.Token + Arguments []Vertex + CloseParenthesisTkn *token.Token } func (n *ExprStaticCall) Accept(v NodeVisitor) { @@ -1366,8 +1371,9 @@ func (n *ExprStaticCall) Accept(v NodeVisitor) { // ExprStaticPropertyFetch node type ExprStaticPropertyFetch struct { Node - Class Vertex - Property Vertex + Class Vertex + DoubleColonTkn *token.Token + Property Vertex } func (n *ExprStaticPropertyFetch) Accept(v NodeVisitor) { @@ -1377,9 +1383,11 @@ func (n *ExprStaticPropertyFetch) Accept(v NodeVisitor) { // ExprTernary node type ExprTernary struct { Node - Condition Vertex - IfTrue Vertex - IfFalse Vertex + Condition Vertex + QuestionTkn *token.Token + IfTrue Vertex + ColonTkn *token.Token + IfFalse Vertex } func (n *ExprTernary) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index ad492b0..bc119f8 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -1566,10 +1566,12 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Call) t.visitor.Leave("Call", true) } - if nn.ArgumentList != nil { - t.visitor.Enter("ArgumentList", true) - t.Traverse(nn.ArgumentList) - t.visitor.Leave("ArgumentList", true) + if nn.Arguments != nil { + t.visitor.Enter("Arguments", false) + for _, c := range nn.Arguments { + t.Traverse(c) + } + t.visitor.Leave("Arguments", false) } case *ast.ExprStaticPropertyFetch: if nn == nil { diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index a840cea..b046302 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1239,7 +1239,7 @@ func (p *PrettyPrinter) printExprStaticCall(n ast.Vertex) { io.WriteString(p.w, "::") p.Print(nn.Call) io.WriteString(p.w, "(") - p.joinPrint(", ", nn.ArgumentList.Arguments) + p.joinPrint(", ", nn.Arguments) io.WriteString(p.w, ")") } diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 58ac6eb..fc63109 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1842,9 +1842,9 @@ func (p *Printer) printExprStaticCall(n ast.Vertex) { p.write([]byte("::")) p.Print(nn.Call) - 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) } From 01d695c41641bd6b59bee4d6a0d06f4a94efa0be Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 00:13:28 +0200 Subject: [PATCH 091/140] [refactoring] update ast structure of "ArrayDimFetch", "UnaryMinus", "ExprUnaryPlus" and "Variable" nodes --- internal/php5/php5.go | Bin 279157 -> 276089 bytes internal/php5/php5.y | 580 ++++++++++++++++++++---------------------- internal/php7/php7.go | Bin 227356 -> 226870 bytes internal/php7/php7.y | 368 ++++++++++++++------------- pkg/ast/node.go | 19 +- 5 files changed, 477 insertions(+), 490 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e289a39460857f0382b93f1310b412be43a4b2bc..e6a9141b2d7608c887850fbc0a6f48b3854bf5d2 100644 GIT binary patch delta 11344 zcmd5?X?Rpc)_zXa%}U4yNq_|Cum%w5?xeG@gg`<-7Fh%Y!jh;sY?8362(pQfIAT!D z0a+4|RY8IxCCIKgZb$$TH#F#|BMO9NL`TK%t-9TvFatBs_dWCD`;+vos#|sH)H&~Y z&#C+Og;Br!7+Jo8I**$)Ei`0O;k{!Vj)JMv+6@^qW!jhrLPMq%P8c)E(c1iLH%LE( zhD;ncb(+JGH?n%%EB(asIN?lLkkdfrG@$2YU}{EaNXRUvK~z^!BN|Mqa47!riw?>r zCl~ajCfucz!nk1~e_?QHZK+MbD6)AfBDsWSO247uKnL8(s6i5vE$SrF7zh(IP>Q3t~Kv*yW-E;!Gzb znB2jhz~8Zf_-r!8aPbC;Q17^@9#INU>_OXkX$p0>^^nOi9_sFYH=E~nr6jKO&?R0w z15#I|Qoi8mY|)tUvkMm;AP-kKWd@y(gB~o9*decpq`g9?-m5_^Q3T1vgo4 zE64VN9KPk^1wY#d&$n1^1NXiIz2?|%*e3}}QLX{BSMq$9Xsp5p)4h_?)#Ra6LLxn* zhLNQWhYr%T5lyoVrb!;A^chS%FUKR~Jyapx965rr`Ove_JWMA87CX}PT^dQ#?dC^E z(SEX}eeoiNtD<}i3rI2cUhq4)Rb>HX%4%y;oyX81$@>;kGd?(ug4Euz)K&QGGhqV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XiPb zt8z8fE$g;0o>L_RKun9=)Y3q9v~?qokf&Q2jr2cua9rj_QcfG#iT&=&+^cP|d!2ze zN)>tSG{IfnIIjr$fuKdA0P;4Y+wBd+W=BR=tZO3m>>$C>=p+rKUvRmAUvo1}gmk diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 35a1e60..3990144 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -15,7 +15,6 @@ import ( node ast.Vertex token *token.Token list []ast.Vertex - simpleIndirectReference simpleIndirectReference ClosureUse *ast.ExprClosureUse } @@ -260,7 +259,7 @@ import ( %type method_or_not array_method_dereference object_property object_dim_list dynamic_class_name_variable_property %type dynamic_class_name_variable_properties variable_properties -%type simple_indirect_reference +%type simple_indirect_reference %type is_reference is_variadic %% @@ -1206,34 +1205,31 @@ catch_statement: } | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} catch := &ast.StmtCatch{ Node: ast.Node{ Position: position.NewTokensPosition($1, $8), }, - CatchTkn: $1, - OpenParenthesisTkn: $2, - Types: []ast.Vertex{$3}, - Var: variable, + CatchTkn: $1, + OpenParenthesisTkn: $2, + Types: []ast.Vertex{$3}, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, CloseParenthesisTkn: $5, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, } $$ = append([]ast.Vertex{catch}, $9...) - - // save position - variable.GetNode().Position = position.NewTokenPosition($4) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) } ; @@ -1281,33 +1277,30 @@ non_empty_additional_catches: additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} $$ = &ast.StmtCatch{ Node: ast.Node{ Position: position.NewTokensPosition($1, $8), }, - CatchTkn: $1, - OpenParenthesisTkn: $2, - Types: []ast.Vertex{$3}, - Var: variable, + CatchTkn: $1, + OpenParenthesisTkn: $2, + Types: []ast.Vertex{$3}, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, CloseParenthesisTkn: $5, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, } - - // save position - variable.GetNode().Position = position.NewTokenPosition($4) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) } ; @@ -2032,19 +2025,20 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - identifier := &ast.Identifier{ + var variable ast.Vertex + variable = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($4), }, - IdentifierTkn: $4, - Value: $4.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, } - var variable ast.Vertex - variable = &ast.ExprVariable{ast.Node{}, identifier} - variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) - if $3 != nil { variable = &ast.Variadic{ Node: ast.Node{ @@ -2084,20 +2078,20 @@ parameter: } | optional_class_type is_reference is_variadic T_VARIABLE '=' expr { - identifier := &ast.Identifier{ + var variable ast.Vertex + variable = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($4), }, - IdentifierTkn: $4, - Value: $4.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, } - var variable ast.Vertex - variable = &ast.ExprVariable{ast.Node{}, identifier} - variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating(variable, token.End, $5.SkippedTokens) - if $3 != nil { variable = &ast.Variadic{ Node: ast.Node{ @@ -2290,42 +2284,45 @@ global_var_list: global_var: T_VARIABLE { - name := &ast.Identifier{ + $$ = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.ExprVariable{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' r_variable { - $$ = &ast.ExprVariable{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + DollarTkn: $1, + VarName: $2, + } } | '$' '{' expr '}' { - $$ = &ast.ExprVariable{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.SkippedTokens, $3.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.SkippedTokens...)) + $$ = &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + DollarTkn: $1, + VarName: &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + }, + } } ; @@ -2333,117 +2330,101 @@ global_var: static_var_list: static_var_list ',' T_VARIABLE { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, - IdentifierTkn: $3, - Value: $3.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ Node: ast.Node{ Position: position.NewTokenPosition($3), }, - Var: variable, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, + }, + }, }) $1.(*ast.StmtStatic).SeparatorTkns = append($1.(*ast.StmtStatic).SeparatorTkns, $2) $$ = $1 - - // save position - variable.GetNode().Position = position.NewTokenPosition($3) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } | static_var_list ',' T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, - IdentifierTkn: $3, - Value: $3.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ Node: ast.Node{ Position: position.NewTokenNodePosition($3, $5), }, - Var: variable, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + IdentifierTkn: $3, + Value: $3.Value, + }, + }, EqualTkn: $4, Expr: $5, }) $1.(*ast.StmtStatic).SeparatorTkns = append($1.(*ast.StmtStatic).SeparatorTkns, $2) $$ = $1 - - // save position - variable.GetNode().Position = position.NewTokenPosition($3) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } | T_VARIABLE { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, - IdentifierTkn: $1, - Value: $1.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - Var: variable, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, }, }, } - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' static_scalar { - identifier := &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, - IdentifierTkn: $1, - Value: $1.Value, - } - variable := &ast.ExprVariable{ast.Node{}, identifier} - $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ Node: ast.Node{ Position: position.NewTokenNodePosition($1, $3), }, - Var: variable, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, + }, EqualTkn: $2, Expr: $3, }, }, } - - // save position - variable.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } ; @@ -3609,23 +3590,23 @@ expr_without_variable: } | '+' expr %prec T_INC { - $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprUnaryPlus{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + PlusTkn: $1, + Expr: $2, + } } | '-' expr %prec T_INC { - $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + MinusTkn: $1, + Expr: $2, + } } | '!' expr { @@ -5184,23 +5165,23 @@ static_operation: } | '+' static_scalar_value { - $$ = &ast.ExprUnaryPlus{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprUnaryPlus{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + PlusTkn: $1, + Expr: $2, + } } | '-' static_scalar_value { - $$ = &ast.ExprUnaryMinus{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprUnaryMinus{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + MinusTkn: $1, + Expr: $2, + } } | '(' static_scalar_value ')' { @@ -5267,20 +5248,18 @@ general_constant: scalar: T_STRING_VARNAME { - name := &ast.Identifier{ + $$ = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.ExprVariable{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | general_constant { @@ -5676,13 +5655,13 @@ variable_without_objects: } | simple_indirect_reference reference_variable { - $1.last.VarName = $2 - - for _, n := range($1.all) { - n.GetNode().Position = position.NewNodesPosition(n, $2) + for i := len($1)-1; i>=0; i-- { + $1[i].(*ast.ExprVariable).VarName = $2 + $1[i].(*ast.ExprVariable).Node.Position = position.NewNodesPosition($1[i], $2) + $2 = $1[i] } - $$ = $1.all[0] + $$ = $1[0] } ; @@ -5768,13 +5747,13 @@ base_variable: } | simple_indirect_reference reference_variable { - $1.last.VarName = $2 - - for _, n := range($1.all) { - n.GetNode().Position = position.NewNodesPosition(n, $2) + for i := len($1)-1; i>=0; i-- { + $1[i].(*ast.ExprVariable).VarName = $2 + $1[i].(*ast.ExprVariable).Node.Position = position.NewNodesPosition($1[i], $2) + $2 = $1[i] } - $$ = $1.all[0] + $$ = $1[0] } | static_member { @@ -5817,32 +5796,35 @@ reference_variable: compound_variable: T_VARIABLE { - name := &ast.Identifier{ + $$ = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.ExprVariable{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' '{' expr '}' { - $$ = &ast.ExprVariable{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.SkippedTokens, $3.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.SkippedTokens...)) + $$ = &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + DollarTkn: $1, + VarName: &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $4), + }, + OpenBracketTkn: $2, + Child: $3, + CloseBracketTkn: $4, + }, + } } ; @@ -5945,29 +5927,23 @@ variable_name: simple_indirect_reference: '$' { - n := &ast.ExprVariable{ast.Node{}, nil} - $$ = simpleIndirectReference{[]*ast.ExprVariable{n}, n} - - // save position - n.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $1.SkippedTokens) + $$ = []ast.Vertex{ + &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + DollarTkn: $1, + }, + } } | simple_indirect_reference '$' { - n := &ast.ExprVariable{ast.Node{}, nil} - - $1.last.VarName = n - $1.all = append($1.all, n) - $1.last = n - $$ = $1 - - // save position - n.GetNode().Position = position.NewTokenPosition($2) - - // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $2.SkippedTokens) + $$ = append($1, &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + DollarTkn: $2, + }) } ; @@ -6229,20 +6205,18 @@ encaps_list: encaps_var: T_VARIABLE { - name := &ast.Identifier{ + $$ = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.ExprVariable{ast.Node{}, name} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '[' encaps_var_offset ']' { @@ -6297,45 +6271,28 @@ encaps_var: } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - variable := &ast.ExprVariable{ast.Node{}, $2} - - $$ = variable - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewNodePosition($2), + }, + VarName: $2, + }, + CloseBracketTkn: $3, + } } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { - name := &ast.Identifier{ + $$ = &ast.ParserBrackets{ Node: ast.Node{ - Position: position.NewTokenPosition($2), + Position: position.NewTokensPosition($1, $3), }, - IdentifierTkn: $2, - Value: $2.Value, - } - variable := &ast.ExprVariable{ast.Node{}, name} - - $$ = variable - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) - } - | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' - { - $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $6), - }, - OpenCurlyBracketTkn: $1, - Var: &ast.ExprVariable{ + OpenBracketTkn: $1, + Child: &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($2), }, @@ -6347,19 +6304,49 @@ encaps_var: Value: $2.Value, }, }, - OpenBracketTkn: $3, - Dim: $4, - CloseBracketTkn: $5, - CloseCurlyBracketTkn: $6, + CloseBracketTkn: $3, + } + } + | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' + { + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $6), + }, + OpenBracketTkn: $1, + Child: &ast.ExprArrayDimFetch{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $5), + }, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + IdentifierTkn: $2, + Value: $2.Value, + }, + }, + OpenBracketTkn: $3, + Dim: $4, + CloseBracketTkn: $5, + }, + CloseBracketTkn: $6, } } | T_CURLY_OPEN variable '}' { - $$ = $2; - - // save comments - yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } } ; @@ -6403,20 +6390,18 @@ encaps_var_offset: } | T_VARIABLE { - identifier := &ast.Identifier{ + $$ = &ast.ExprVariable{ Node: ast.Node{ Position: position.NewTokenPosition($1), }, - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + IdentifierTkn: $1, + Value: $1.Value, + }, } - $$ = &ast.ExprVariable{ast.Node{}, identifier} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -6617,8 +6602,3 @@ class_name_scalar: ; %% - -type simpleIndirectReference struct { - all []*ast.ExprVariable - last *ast.ExprVariable -} diff --git a/internal/php7/php7.go b/internal/php7/php7.go index db2863b83e139ce0a0aeaa1c50950a308a864e97..351c5c167838cd6f69c547a5c24abcad62bd400e 100644 GIT binary patch delta 12051 zcmb_id3@Eywg1da$OeRjB|t)QZwLX|?@jK_y%!Jy2vtCcA|S{XHf7%*w>{`@HuDd@|>I=FFKh z=bSlne)p-m#{14Su7033FOI(Qlh(Wc&ePI}74dv|3un`q8m&xbw^CXXh~8j@J-B2K z<}|R_KDP&BlYQiFU(lcw*4`ZiXiW+mZ4V;UGu59HpyjFc;m&CmJU6XAoSSaJ6VmI$ z4I5hUu!a`grxAwi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uz7Kg5bONcyn6g#m}%&VscdcR5~z9OpA6KQ^g3;j%sceKU2q& zMthQxjEkORi4^XMK)mgJY;*ZvxQi+Vh(vm)JFtuas3hVaAdRViHR#4%k4SrJl2spN zO-8Vno+@rjnl*dj z9k=LzrG(4k_OrbVX$QyAoTe1xaes9hZY3Sck%ev?j!NB5Jow`t0+!FxCP}oS1h;JG zj-Mn~mE#XW+6FQTBRZhL4u16UGbWwJ@ojjB(2pM&OKJYC*t7a?7x(()YqyH6C=a0L zQ~{FYmfOWR{JRJkk^w@loBG`$E*T>Iaz@uhcg+^HhDaA4-SYW4;wC-KV={KpTssMe yqEk2k7u`Kid}F5B4=o72CG`D#C>?(s%XJkL{3ijtY9aQZ= Date: Fri, 4 Dec 2020 09:42:45 +0200 Subject: [PATCH 092/140] [refactoring] update ast structure of "Yield", "YieldFrom" and "Cast" nodes --- internal/php5/php5.go | Bin 276089 -> 274372 bytes internal/php5/php5.y | 180 ++++++++++++++++++++---------------------- internal/php7/php7.go | Bin 226870 -> 224287 bytes internal/php7/php7.y | 163 ++++++++++++++++++-------------------- pkg/ast/node.go | 30 ++++--- 5 files changed, 185 insertions(+), 188 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index e6a9141b2d7608c887850fbc0a6f48b3854bf5d2..8664f6e873cc4c4c2334631f2933283cce0e1d19 100644 GIT binary patch delta 4573 zcmbtYdsvoL5`WH_7Z5})f*^rh#4j;#+~Gq7xhVFmxmvpFW(a0Rrbrjsvdv5Ds+q1> z4~%6N6}d~+3T2)wdeXAo)^yRWwVMKAX^En4QKZKH&iUSti(UTNe?H#xo_S~H%>3pz zbLeOd*w+|PyEu$eoauim4O>$hCRAyd41a@HO%uQ2b8#Yw19po6lv{Kc7kw#*aKvu> zv>%ldMFOvEmVukiJ~7fqXfk-44M2 zuPXX`1UHeVl~5D|Iv%`Zfpl{G@97NJb;t=KiT66JpKN7cloMpKld}cI@|)h)DmD6& zTq{KC&q~WqgbDdHYKl1EkO)_@lI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vLWRTXF=)U&H-7 zKZIb0X#*zl_xumd;?hc5CllfnO!gtm^boH22BW1O&lQ}{(1S@`qGAx$gqn8Y#dbq_ zapYq&IH7V2*|Wfg3`G*a})V0V8Xjg@0KyEo_#MB>eM zA32z9VWK&^h{mXN!$=VtPIl&EYQ*_vfcXAAaxjXb+e5e5J&gmVANntpI+SVS`Nxqr z+cDW#6?+-Y-F0B+>_*0z8p^##i=owzZG{3f?QpxKpKR1Tsjn|EpKHTCYb>fOG6rq+kHnJot z`5_H~(GUi(qdfrWXl9rnq``XpZpxRBO9$s|6z%zTGh-S0t6J(~4A~Cqr2wohFJh;<%E7)jOlhcS$!@p*c zZa4lYtO-;94W@2{X-#t&3sLP_8$m+Gxv3Ym?Bw!>_|`9KW2AAm2Qpj@P*1^0Z6U;$ zqWNVN$f_-Fikb<~A6kJN)y}|-r{3*gd@HzL2h@`}44Y?S?*EUwUskU-34Ws!4AfC7 K61*tNaQ+vM5boUo diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 3990144..7ff468a 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3799,80 +3799,73 @@ expr_without_variable: } | T_INT_CAST expr { - $$ = &ast.ExprCastInt{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastInt{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_DOUBLE_CAST expr { - $$ = &ast.ExprCastDouble{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastDouble{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_STRING_CAST expr { - $$ = &ast.ExprCastString{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastString{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_ARRAY_CAST expr { - $$ = &ast.ExprCastArray{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastArray{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_OBJECT_CAST expr { - $$ = &ast.ExprCastObject{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastObject{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_BOOL_CAST expr { - $$ = &ast.ExprCastBool{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastBool{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_UNSET_CAST expr { - $$ = &ast.ExprCastUnset{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastUnset{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_EXIT exit_expr { @@ -3936,13 +3929,12 @@ expr_without_variable: } | T_YIELD { - $$ = &ast.ExprYield{ast.Node{}, nil, nil} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + YieldTkn: $1, + } } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { @@ -3984,45 +3976,47 @@ expr_without_variable: yield_expr: T_YIELD expr_without_variable { - $$ = &ast.ExprYield{ast.Node{}, nil, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + YieldTkn: $1, + Value: $2, + } } | T_YIELD variable { - $$ = &ast.ExprYield{ast.Node{}, nil, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + YieldTkn: $1, + Value: $2, + } } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { - $$ = &ast.ExprYield{ast.Node{}, $2, $4} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $4), + }, + YieldTkn: $1, + Key: $2, + DoubleArrowTkn: $3, + Value: $4, + } } | T_YIELD expr T_DOUBLE_ARROW variable { - $$ = &ast.ExprYield{ast.Node{}, $2, $4} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $4), + }, + YieldTkn: $1, + Key: $2, + DoubleArrowTkn: $3, + Value: $4, + } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 351c5c167838cd6f69c547a5c24abcad62bd400e..8788ab26ffc89584dd54141cf98f8c93947dea7d 100644 GIT binary patch delta 7547 zcmZ`;d3?=R+W$Py$s!1eB8epT-q@ESH@R7fhM>k$Vyj)0qW0LSRur|=6r~=jG;JBG z490TWGM1@Kr&G1GI@T)H_ESqqjHRvOea`Z`?tS0aKlk%J-)BABbI$qQ-Pa=DITg9> zl{oZf?wAv|^=E215Z$sn!t+2&!=NighCm&IUiG7gel#`Ik(T+HgqmR`~#F?|>MMD+CC9v>~vWN}h@V38m6o!Og0X zjrH{8M6p z)P~f0Ij#VKk7Qsom6F{~NLEgzP5$P9ZX8T#u!c9ZH@T@`S6&e)FT+b8-9r2^KsmxvU2)Epq z3NLFnF4->)HUZ7bW42xf04nD$*)9tv06`(M=dz(8P*N*!$-2#mu!Zrixz0UBAmQ&>}(9fWS zUEs7qujIpUgCe>*9CUNI`Q03@sJp|3_b{`ND2sYPxE{tt`Iny1*FsM(80>`Z zg%~T(?+4=zr0@H~G96ql9{@9Wcn0y@CKvFaYP6w%mlLBY>c>s12AQUtsyt_qixxh| zB}prb!4}CGgQ3Xyk_pelpRC)tLmkZr4w6%b!4<1H>jn7L!c`;T2Rn>!kAX6q_U3Vr zX`vVo%`EIc0kSOIH4*w-=$-6`Tc$t{%O*{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A}DF z6HMfJ!0Q*UOyC)C3+4J!sH(2frNhf(3$AT-E7G6Zv-`hU!dN zdgxAis)CQUtm*F*=$&jE^6S!EK861xZP0Ji9{kj!JMJR<_f#DfIZQEI_#s{X*VT{+ W!1>el(&P{4B=cwvWMb`fp7S3cg-Iv? diff --git a/internal/php7/php7.y b/internal/php7/php7.y index bdd808a..7390dd6 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3455,80 +3455,73 @@ expr_without_variable: } | T_INT_CAST expr { - $$ = &ast.ExprCastInt{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastInt{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_DOUBLE_CAST expr { - $$ = &ast.ExprCastDouble{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastDouble{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_STRING_CAST expr { - $$ = &ast.ExprCastString{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastString{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_ARRAY_CAST expr { - $$ = &ast.ExprCastArray{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastArray{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_OBJECT_CAST expr { - $$ = &ast.ExprCastObject{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastObject{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_BOOL_CAST expr { - $$ = &ast.ExprCastBool{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastBool{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_UNSET_CAST expr { - $$ = &ast.ExprCastUnset{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) + $$ = &ast.ExprCastUnset{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + CastTkn: $1, + Expr: $2, + } } | T_EXIT exit_expr { @@ -3584,44 +3577,44 @@ expr_without_variable: } | T_YIELD { - $$ = &ast.ExprYield{ast.Node{}, nil, nil} - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + YieldTkn: $1, + } } | T_YIELD expr { - $$ = &ast.ExprYield{ast.Node{}, nil, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + YieldTkn: $1, + Value: $2, + } } | T_YIELD expr T_DOUBLE_ARROW expr { - $$ = &ast.ExprYield{ast.Node{}, $2, $4} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + $$ = &ast.ExprYield{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $4), + }, + YieldTkn: $1, + Key: $2, + DoubleArrowTkn: $3, + Value: $4, + } } | T_YIELD_FROM expr { - $$ = &ast.ExprYieldFrom{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.ExprYieldFrom{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $2), + }, + YieldFromTkn: $1, + Expr: $2, + } } | inline_function { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 4bd9737..a4599b4 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1428,8 +1428,10 @@ func (n *ExprVariable) Accept(v NodeVisitor) { // ExprYield node type ExprYield struct { Node - Key Vertex - Value Vertex + YieldTkn *token.Token + Key Vertex + DoubleArrowTkn *token.Token + Value Vertex } func (n *ExprYield) Accept(v NodeVisitor) { @@ -1439,7 +1441,8 @@ func (n *ExprYield) Accept(v NodeVisitor) { // ExprYieldFrom node type ExprYieldFrom struct { Node - Expr Vertex + YieldFromTkn *token.Token + Expr Vertex } func (n *ExprYieldFrom) Accept(v NodeVisitor) { @@ -1449,7 +1452,8 @@ func (n *ExprYieldFrom) Accept(v NodeVisitor) { // ExprCastArray node type ExprCastArray struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastArray) Accept(v NodeVisitor) { @@ -1459,7 +1463,8 @@ func (n *ExprCastArray) Accept(v NodeVisitor) { // ExprCastBool node type ExprCastBool struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastBool) Accept(v NodeVisitor) { @@ -1469,7 +1474,8 @@ func (n *ExprCastBool) Accept(v NodeVisitor) { // ExprCastDouble node type ExprCastDouble struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastDouble) Accept(v NodeVisitor) { @@ -1479,7 +1485,8 @@ func (n *ExprCastDouble) Accept(v NodeVisitor) { // ExprCastInt node type ExprCastInt struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastInt) Accept(v NodeVisitor) { @@ -1489,7 +1496,8 @@ func (n *ExprCastInt) Accept(v NodeVisitor) { // ExprCastObject node type ExprCastObject struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastObject) Accept(v NodeVisitor) { @@ -1499,7 +1507,8 @@ func (n *ExprCastObject) Accept(v NodeVisitor) { // ExprCastString node type ExprCastString struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastString) Accept(v NodeVisitor) { @@ -1509,7 +1518,8 @@ func (n *ExprCastString) Accept(v NodeVisitor) { // ExprCastUnset node type ExprCastUnset struct { Node - Expr Vertex + CastTkn *token.Token + Expr Vertex } func (n *ExprCastUnset) Accept(v NodeVisitor) { From d19b3f609ed8f1a8c6b81a9cca1e51424fba4c75 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 10:40:48 +0200 Subject: [PATCH 093/140] [refactoring] update ast structure of "Assign" and "Binary" nodes --- internal/php5/php5.go | Bin 274372 -> 264006 bytes internal/php5/php5.y | 1085 ++++++++++++++++++++--------------------- internal/php7/php7.go | Bin 224287 -> 219046 bytes internal/php7/php7.y | 728 +++++++++++++-------------- pkg/ast/node.go | 103 ++-- 5 files changed, 972 insertions(+), 944 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 8664f6e873cc4c4c2334631f2933283cce0e1d19..58de3b2e1c6f46459be94bb3c6f2155036d8db7c 100644 GIT binary patch delta 8762 zcmbtZdwk7Tw*TzCevub)hzJsLLMY>rb52f99;lFqx-LSE(UwX|s7ED3(8o1pe6$nK z$Y4<}p<1Jzj_6fCRVs{gbGCm=5=5JnnbzbCR5RCizu2+D+zyEwrn=eNS8}B+QBTRF? z3>0in6yaP^AOno_8FOay^}o>*yr7?aOtBbH&u#lI0Ar2>9=Tq2;^I8%YfPQlSQK|Ir5SW)t=_(p*MmL9TQEst8_T|`YzF)t;=Ok zX^*Snl!vU8f&AxVu+hdl-=2J^!=a5^JF(xB&rhA4`|nwko2C)PW#(>~OffMY6W5WU zvOor|Np6y6rmO~ovAiV@-gjcP^cOHaJ-E3>`UzN)9&}WPL1T7lMUV;}Nt#Amn~isc-j?ttwtDkXE-S zS8QvFC_8Thk@Eduq3~U}DTp*$khkALEs z4(IRx1gT&DNOtDJJ<_Nh>g(F~VG$0DaR+IoFG`s@w_ShJV7rC_UHS7x0FAR<3}` ztZX5;;Avpy;+{r;dHzd`5m>ah=;Z-lsXq>{KXK<|OMzHWvnK0n*<8TKYyPY{k6kj> zWfoqLlcYz7ruCw1rE>BvCpeqQ<+nn!++DZ*WU*KZHwRUm6Yq|B>W?~S5*LnkZwuhk3b~Q5T$9O0 zOhOeZfE~bvm&wr7Oi*(OmbXwH?W~mJ*z&muHBStqFu|#nkeNn6R=vT*f_DVxRmxVp z@@)~tD{doD*c@DTTV_j}%N%@1hDhmfn9tsmUrFh7n2C}$5L_5ZGK@?Ahx(blo6&oM z?9ki7_0)%ZU!wM0eo_RQ(S9^vO1lRz_qR}gmCyY6jV`h~e;k3Y41d|e93DvL1xFsh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ki+PwfyjpNZ|J(qwsKkx57JfHq3Lw$}dT1b=v@rM97d(rM5%_*h zyo~S6F1E*qcvYIbnlgARC5*sK^S3OO>dedrzd$zr)NFY8f_ zA>HYmHz3c8Z$Ka_TB&bsT*&8`=r5hSJ54x(Pxlry0QY`(pBTjxVyNj5`%#)%GF2qA z6s`I%;%f;S!-T@A_JDX);wrmL2xs;%q2g4gA>M3Gk}>KH)#JB{LEtYCefLp|D?Y@2j1ATV!#W z0ctKm)aKb@GJtzu3LmdWy)0UBQsh>3kl6GIaR#mojIBk6WfIBkr=p;??4(FX>S~EZ z-T;Qf8#Dua?V?jz0DLdNbaMMBEi%3!nsO~S&VSm;LaTR}J80gh)rfFR`k zsTfX~Zb03P2EZr1@i`%_?0~1c&x@+t5a8SPXxMX7g4}lXPNA?`9db6dKG{gyC*iwK zcvEjOtr5Mnu+PN|u09gfYQGS_u>s)<%krZMp<)M}yaCB{hvT1GP|g`tc- zzJjP6E58_!5izw{e982WWz>tDjIRJo!DHY^;Ti^3MxDNq`M~zVW5>5hYm2`Tws#^L z#sRm=3+=*pVg|FrBMJkabxpLF@l_RbYUYpEMW{6KR<>qy9m@~kEzTSx{p&Z3>TiHy zy#2007EJmPDzxbDli=V0d*p-)y!z`84Y=K2w)VK;7LujNsag7*W7-A}+NY5|Wyvh} L?PTQdW{CMeYx-5= diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 7ff468a..3f5ef26 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3129,57 +3129,46 @@ new_expr: expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { - pairList := $3.(*ast.ParserSeparatedList) - fistPair := pairList.Items[0].(*ast.ExprArrayItem) - - if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { - pairList.Items = nil - } - - listNode := &ast.ExprList{ + $$ = &ast.ExprAssign{ Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), + Position: position.NewTokenNodePosition($1, $6), }, - ListTkn: $1, - OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, - CloseBracketTkn: $4, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + }, + EqualTkn: $5, + Expr: $6, } - $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} - - // save position - listNode.GetNode().Position = position.NewTokensPosition($1, $4) - $$.GetNode().Position = position.NewTokenNodePosition($1, $6) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) } | variable '=' expr { - $$ = &ast.ExprAssign{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssign{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable '=' '&' variable { - $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) + $$ = &ast.ExprAssignReference{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Var: $1, + EqualTkn: $2, + AmpersandTkn: $3, + Expr: $4, + } } | variable '=' '&' T_NEW class_name_reference ctor_arguments { @@ -3205,21 +3194,15 @@ expr_without_variable: } } - $$ = &ast.ExprAssignReference{ast.Node{}, $1, _new} - - // save position - if $6 != nil { - _new.GetNode().Position = position.NewTokenNodePosition($4, $6) - } else { - _new.GetNode().Position = position.NewTokenNodePosition($4, $5) + $$ = &ast.ExprAssignReference{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, _new), + }, + Var: $1, + EqualTkn: $2, + AmpersandTkn: $3, + Expr: _new, } - $$.GetNode().Position = position.NewNodesPosition($1, _new) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(_new, token.Start, $4.SkippedTokens) } | T_CLONE expr { @@ -3233,134 +3216,135 @@ expr_without_variable: } | variable T_PLUS_EQUAL expr { - $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignPlus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MINUS_EQUAL expr { - $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMinus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MUL_EQUAL expr { - $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMul{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_POW_EQUAL expr { - $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignPow{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_DIV_EQUAL expr { - $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignDiv{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_CONCAT_EQUAL expr { - $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignConcat{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MOD_EQUAL expr { - $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMod{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_AND_EQUAL expr { - $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_OR_EQUAL expr { - $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_XOR_EQUAL expr { - $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_SL_EQUAL expr { - $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignShiftLeft{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_SR_EQUAL expr { - $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | rw_variable T_INC { @@ -3404,189 +3388,190 @@ expr_without_variable: } | expr T_BOOLEAN_OR expr { - $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_BOOLEAN_AND expr { - $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_OR expr { - $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_AND expr { - $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_XOR expr { - $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '|' expr { - $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '&' expr { - $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '^' expr { - $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '.' expr { - $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryConcat{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '+' expr { - $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPlus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '-' expr { - $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMinus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '*' expr { - $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMul{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_POW expr { - $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPow{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '/' expr { - $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryDiv{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '%' expr { - $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMod{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_SL expr { - $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_SR expr { - $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | '+' expr %prec T_INC { @@ -3630,92 +3615,92 @@ expr_without_variable: } | expr T_IS_IDENTICAL expr { - $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_NOT_IDENTICAL expr { - $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_EQUAL expr { - $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_NOT_EQUAL expr { - $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | expr '<' expr { - $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_SMALLER_OR_EQUAL expr { - $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '>' expr { - $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_GREATER_OR_EQUAL expr { - $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_INSTANCEOF class_name_reference { @@ -4838,69 +4823,69 @@ static_operation: } | static_scalar_value '+' static_scalar_value { - $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPlus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '-' static_scalar_value { - $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMinus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '*' static_scalar_value { - $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMul{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_POW static_scalar_value { - $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPow{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '/' static_scalar_value { - $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryDiv{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '%' static_scalar_value { - $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMod{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | '!' static_scalar_value { @@ -4924,213 +4909,213 @@ static_operation: } | static_scalar_value '|' static_scalar_value { - $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '&' static_scalar_value { - $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '^' static_scalar_value { - $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_SL static_scalar_value { - $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_SR static_scalar_value { - $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '.' static_scalar_value { - $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryConcat{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_LOGICAL_XOR static_scalar_value { - $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_LOGICAL_AND static_scalar_value { - $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_LOGICAL_OR static_scalar_value { - $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_BOOLEAN_AND static_scalar_value { - $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_BOOLEAN_OR static_scalar_value { - $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_IDENTICAL static_scalar_value { - $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { - $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_EQUAL static_scalar_value { - $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { - $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | static_scalar_value '<' static_scalar_value { - $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '>' static_scalar_value { - $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { - $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { - $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | static_scalar_value '?' ':' static_scalar_value { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 8788ab26ffc89584dd54141cf98f8c93947dea7d..37040523cff8d26e06598ac596857d229308ba41 100644 GIT binary patch delta 8893 zcmb7}d3?@S_Qzl6UXe{=i3lOj^9YF&TNZ1O5UM1Ilo-2&grL$`s|L|(FsQ9{#&k@o zs;%1B+iBG@I{kH8W9_1~x6{(vWwbT4e)oIs^W1xzdZqP`cz-|VoO|xM+xL5)(vu;t zZ3!vf35kpa2I7Sw%q_AQ}wl_RMyHg9jK>2#CpMv zOZ;J=4M~_BpncppJD|KA7ih_af#v18L6$r`sJt8;Y{`9sEjgtMB;j3KmQPG-Bwwy# zdAA6$WC=-lD#ViAq2=X|LM^#!)$;N?RW13xEnlxDgKwy2$?}OwjpUcATk^T;mMkF& z7uK-kBQ?s)Gr}x+Us!p0Tun>fQqz)4!)5Tn;g&3)nAAv4uVu+gYFV-bIo=VLJUgPi z99P?t3u~8`>(;U4;dLyzPoxYU9BIk&iAjy*ySAKC*OFV*liru>THf-B@h16HJxg{+ zm6tz?vgE2ROTO=t!QXLNvV3BKUw2D+gWHnjlXCJ)9!oywDK9UqZ^=jMmzQTmTk^i> zU&@I%wt-rqo#!$)ZfT%o2_Ag8Atd79hRWOb&?bsD1$OJ@7l?_3&cnxlRH68|d&DK08eYqUF&g6fT1x#ar5qa~Yx{Z@oOH|xRzD7-HAMGQ6Us(w(J zIzsere;8z_)d0w)^eD!zftFj-K~T$Q=oUGH;YlBDmFE?=qurkdA%+@H zhe)FM7i8~po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dIf(qiO_0YA;w?H)@~5WF3!m~f;;xj!4s%Z4nyxsE{BlIXC7&a|9FcJJ z5kw8=9YssS4aaQw(U%ya*=xsbnD7;cjA!6S+u|aYEjx+)U|z!NZ){k5%7$&ev*BH* z(W$RkA3K8%-Rz5hA-_zO8Qee0b6au2``AzXIdalT&Cc?kNVMcEel8K4|1} za|Y5IznRF?8iTgg@DY)%BhDLcl}7wb_&mDU;tLpw>f-prS{@^>kh@>fh`n`5jJ_nV zT~VZq%CBNB;~bwH!o%kMfh8I?|I>yW{=!>zQv^$Ao+S{!h<4FsuyPqk<3U|aAGa(% zuf!eo#zhS+ROBW?~4tA=g?GFgG{qKcY!&p?fmCFyr!}+f6 z@z&Nzg+e2EL4sq;BSb;c9pkW;EAoiL5|`(qO{&ZKRFUyf)@6Qo9&H@}Ruf~T>UuKb ztatQ`iM!e2cdw#KV(qLlRd3(+Vi+X(atCXiB0DEonY#VPj@A+l2PawUb*h#rR$G3e zFUBb^&3aP@+?H-l*8!j3YOT@%i~nI|=zyB87GEc_S@SzAek&p2+8)+BI`;nFLQVc} zpj{tp6DnBS&zh#$NBUcQvB-cu11x^|DdCkYtDOH$V4#(xiRwWXUmU_mI7AGa`1`>t OL&OsmkTQl^dH)9Q(g&ab diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 7390dd6..25adcd7 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -2804,65 +2804,65 @@ new_expr: expr_without_variable: T_LIST '(' array_pair_list ')' '=' expr { - listNode := &ast.ExprList{ + $$ = &ast.ExprAssign{ Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), + Position: position.NewTokenNodePosition($1, $6), }, - ListTkn: $1, - OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, - CloseBracketTkn: $4, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + ListTkn: $1, + OpenBracketTkn: $2, + Items: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $4, + }, + EqualTkn: $5, + Expr: $6, } - $$ = &ast.ExprAssign{ast.Node{}, listNode, $6} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $6) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) } | '[' array_pair_list ']' '=' expr { - listNode := &ast.ExprList{ + $$ = &ast.ExprAssign{ Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), + Position: position.NewTokenNodePosition($1, $5), }, - OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, - CloseBracketTkn: $3, + Var: &ast.ExprList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Items: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + CloseBracketTkn: $3, + }, + EqualTkn: $4, + Expr: $5, } - $$ = &ast.ExprAssign{ast.Node{}, listNode, $5} - - // save position - $$.GetNode().Position = position.NewTokenNodePosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $4.SkippedTokens) } | variable '=' expr { - $$ = &ast.ExprAssign{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssign{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable '=' '&' expr { - $$ = &ast.ExprAssignReference{ast.Node{}, $1, $4} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $4) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) + $$ = &ast.ExprAssignReference{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $4), + }, + Var: $1, + EqualTkn: $2, + AmpersandTkn: $3, + Expr: $4, + } } | T_CLONE expr { @@ -2876,146 +2876,146 @@ expr_without_variable: } | variable T_PLUS_EQUAL expr { - $$ = &ast.ExprAssignPlus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignPlus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MINUS_EQUAL expr { - $$ = &ast.ExprAssignMinus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMinus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MUL_EQUAL expr { - $$ = &ast.ExprAssignMul{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMul{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_POW_EQUAL expr { - $$ = &ast.ExprAssignPow{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignPow{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_DIV_EQUAL expr { - $$ = &ast.ExprAssignDiv{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignDiv{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_CONCAT_EQUAL expr { - $$ = &ast.ExprAssignConcat{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignConcat{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_MOD_EQUAL expr { - $$ = &ast.ExprAssignMod{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignMod{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_AND_EQUAL expr { - $$ = &ast.ExprAssignBitwiseAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_OR_EQUAL expr { - $$ = &ast.ExprAssignBitwiseOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_XOR_EQUAL expr { - $$ = &ast.ExprAssignBitwiseXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignBitwiseXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_SL_EQUAL expr { - $$ = &ast.ExprAssignShiftLeft{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignShiftLeft{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_SR_EQUAL expr { - $$ = &ast.ExprAssignShiftRight{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignShiftRight{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_COALESCE_EQUAL expr { - $$ = &ast.ExprAssignCoalesce{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + $$ = &ast.ExprAssignCoalesce{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Var: $1, + EqualTkn: $2, + Expr: $3, + } } | variable T_INC { @@ -3059,189 +3059,190 @@ expr_without_variable: } | expr T_BOOLEAN_OR expr { - $$ = &ast.ExprBinaryBooleanOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_BOOLEAN_AND expr { - $$ = &ast.ExprBinaryBooleanAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBooleanAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_OR expr { - $$ = &ast.ExprBinaryLogicalOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_AND expr { - $$ = &ast.ExprBinaryLogicalAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_LOGICAL_XOR expr { - $$ = &ast.ExprBinaryLogicalXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryLogicalXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '|' expr { - $$ = &ast.ExprBinaryBitwiseOr{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseOr{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '&' expr { - $$ = &ast.ExprBinaryBitwiseAnd{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseAnd{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '^' expr { - $$ = &ast.ExprBinaryBitwiseXor{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryBitwiseXor{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '.' expr { - $$ = &ast.ExprBinaryConcat{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryConcat{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '+' expr { - $$ = &ast.ExprBinaryPlus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPlus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '-' expr { - $$ = &ast.ExprBinaryMinus{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMinus{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '*' expr { - $$ = &ast.ExprBinaryMul{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMul{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_POW expr { - $$ = &ast.ExprBinaryPow{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryPow{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '/' expr { - $$ = &ast.ExprBinaryDiv{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryDiv{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '%' expr { - $$ = &ast.ExprBinaryMod{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryMod{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_SL expr { - $$ = &ast.ExprBinaryShiftLeft{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftLeft{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_SR expr { - $$ = &ast.ExprBinaryShiftRight{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryShiftRight{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | '+' expr %prec T_INC { @@ -3285,103 +3286,102 @@ expr_without_variable: } | expr T_IS_IDENTICAL expr { - $$ = &ast.ExprBinaryIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_NOT_IDENTICAL expr { - $$ = &ast.ExprBinaryNotIdentical{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotIdentical{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_EQUAL expr { - $$ = &ast.ExprBinaryEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_NOT_EQUAL expr { - $$ = &ast.ExprBinaryNotEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) + $$ = &ast.ExprBinaryNotEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '<' expr { - $$ = &ast.ExprBinarySmaller{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmaller{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_SMALLER_OR_EQUAL expr { - $$ = &ast.ExprBinarySmallerOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySmallerOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr '>' expr { - $$ = &ast.ExprBinaryGreater{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreater{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_IS_GREATER_OR_EQUAL expr { - $$ = &ast.ExprBinaryGreaterOrEqual{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryGreaterOrEqual{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_SPACESHIP expr { - $$ = &ast.ExprBinarySpaceship{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinarySpaceship{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | expr T_INSTANCEOF class_name_reference { @@ -3440,14 +3440,14 @@ expr_without_variable: } | expr T_COALESCE expr { - $$ = &ast.ExprBinaryCoalesce{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $3) - - // save comments - yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + $$ = &ast.ExprBinaryCoalesce{ + Node: ast.Node{ + Position: position.NewNodesPosition($1, $3), + }, + Left: $1, + OpTkn: $2, + Right: $3, + } } | internal_functions_in_yacc { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index a4599b4..ccea997 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1529,8 +1529,9 @@ func (n *ExprCastUnset) Accept(v NodeVisitor) { // ExprAssign node type ExprAssign struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssign) Accept(v NodeVisitor) { @@ -1540,8 +1541,10 @@ func (n *ExprAssign) Accept(v NodeVisitor) { // ExprAssignReference node type ExprAssignReference struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + AmpersandTkn *token.Token + Expr Vertex } func (n *ExprAssignReference) Accept(v NodeVisitor) { @@ -1551,8 +1554,9 @@ func (n *ExprAssignReference) Accept(v NodeVisitor) { // ExprAssignBitwiseAnd node type ExprAssignBitwiseAnd struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) { @@ -1562,8 +1566,9 @@ func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) { // ExprAssignBitwiseOr node type ExprAssignBitwiseOr struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) { @@ -1573,8 +1578,9 @@ func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) { // ExprAssignBitwiseXor node type ExprAssignBitwiseXor struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) { @@ -1584,8 +1590,9 @@ func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) { // ExprAssignCoalesce node type ExprAssignCoalesce struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignCoalesce) Accept(v NodeVisitor) { @@ -1595,8 +1602,9 @@ func (n *ExprAssignCoalesce) Accept(v NodeVisitor) { // ExprAssignConcat node type ExprAssignConcat struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignConcat) Accept(v NodeVisitor) { @@ -1606,8 +1614,9 @@ func (n *ExprAssignConcat) Accept(v NodeVisitor) { // ExprAssignDiv node type ExprAssignDiv struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignDiv) Accept(v NodeVisitor) { @@ -1617,8 +1626,9 @@ func (n *ExprAssignDiv) Accept(v NodeVisitor) { // ExprAssignMinus node type ExprAssignMinus struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignMinus) Accept(v NodeVisitor) { @@ -1628,8 +1638,9 @@ func (n *ExprAssignMinus) Accept(v NodeVisitor) { // ExprAssignMod node type ExprAssignMod struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignMod) Accept(v NodeVisitor) { @@ -1639,8 +1650,9 @@ func (n *ExprAssignMod) Accept(v NodeVisitor) { // ExprAssignMul node type ExprAssignMul struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignMul) Accept(v NodeVisitor) { @@ -1650,8 +1662,9 @@ func (n *ExprAssignMul) Accept(v NodeVisitor) { // ExprAssignPlus node type ExprAssignPlus struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignPlus) Accept(v NodeVisitor) { @@ -1661,8 +1674,9 @@ func (n *ExprAssignPlus) Accept(v NodeVisitor) { // ExprAssignPow node type ExprAssignPow struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignPow) Accept(v NodeVisitor) { @@ -1672,8 +1686,9 @@ func (n *ExprAssignPow) Accept(v NodeVisitor) { // ExprAssignShiftLeft node type ExprAssignShiftLeft struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) { @@ -1683,8 +1698,9 @@ func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) { // ExprAssignShiftRight node type ExprAssignShiftRight struct { Node - Var Vertex - Expr Vertex + Var Vertex + EqualTkn *token.Token + Expr Vertex } func (n *ExprAssignShiftRight) Accept(v NodeVisitor) { @@ -1695,6 +1711,7 @@ func (n *ExprAssignShiftRight) Accept(v NodeVisitor) { type ExprBinaryBitwiseAnd struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1706,6 +1723,7 @@ func (n *ExprBinaryBitwiseAnd) Accept(v NodeVisitor) { type ExprBinaryBitwiseOr struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1717,6 +1735,7 @@ func (n *ExprBinaryBitwiseOr) Accept(v NodeVisitor) { type ExprBinaryBitwiseXor struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1728,6 +1747,7 @@ func (n *ExprBinaryBitwiseXor) Accept(v NodeVisitor) { type ExprBinaryBooleanAnd struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1739,6 +1759,7 @@ func (n *ExprBinaryBooleanAnd) Accept(v NodeVisitor) { type ExprBinaryBooleanOr struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1750,6 +1771,7 @@ func (n *ExprBinaryBooleanOr) Accept(v NodeVisitor) { type ExprBinaryCoalesce struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1761,6 +1783,7 @@ func (n *ExprBinaryCoalesce) Accept(v NodeVisitor) { type ExprBinaryConcat struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1772,6 +1795,7 @@ func (n *ExprBinaryConcat) Accept(v NodeVisitor) { type ExprBinaryDiv struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1783,6 +1807,7 @@ func (n *ExprBinaryDiv) Accept(v NodeVisitor) { type ExprBinaryEqual struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1794,6 +1819,7 @@ func (n *ExprBinaryEqual) Accept(v NodeVisitor) { type ExprBinaryGreater struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1805,6 +1831,7 @@ func (n *ExprBinaryGreater) Accept(v NodeVisitor) { type ExprBinaryGreaterOrEqual struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1816,6 +1843,7 @@ func (n *ExprBinaryGreaterOrEqual) Accept(v NodeVisitor) { type ExprBinaryIdentical struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1827,6 +1855,7 @@ func (n *ExprBinaryIdentical) Accept(v NodeVisitor) { type ExprBinaryLogicalAnd struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1838,6 +1867,7 @@ func (n *ExprBinaryLogicalAnd) Accept(v NodeVisitor) { type ExprBinaryLogicalOr struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1849,6 +1879,7 @@ func (n *ExprBinaryLogicalOr) Accept(v NodeVisitor) { type ExprBinaryLogicalXor struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1860,6 +1891,7 @@ func (n *ExprBinaryLogicalXor) Accept(v NodeVisitor) { type ExprBinaryMinus struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1871,6 +1903,7 @@ func (n *ExprBinaryMinus) Accept(v NodeVisitor) { type ExprBinaryMod struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1882,6 +1915,7 @@ func (n *ExprBinaryMod) Accept(v NodeVisitor) { type ExprBinaryMul struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1893,6 +1927,7 @@ func (n *ExprBinaryMul) Accept(v NodeVisitor) { type ExprBinaryNotEqual struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1904,6 +1939,7 @@ func (n *ExprBinaryNotEqual) Accept(v NodeVisitor) { type ExprBinaryNotIdentical struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1915,6 +1951,7 @@ func (n *ExprBinaryNotIdentical) Accept(v NodeVisitor) { type ExprBinaryPlus struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1926,6 +1963,7 @@ func (n *ExprBinaryPlus) Accept(v NodeVisitor) { type ExprBinaryPow struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1937,6 +1975,7 @@ func (n *ExprBinaryPow) Accept(v NodeVisitor) { type ExprBinaryShiftLeft struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1948,6 +1987,7 @@ func (n *ExprBinaryShiftLeft) Accept(v NodeVisitor) { type ExprBinaryShiftRight struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1959,6 +1999,7 @@ func (n *ExprBinaryShiftRight) Accept(v NodeVisitor) { type ExprBinarySmaller struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1970,6 +2011,7 @@ func (n *ExprBinarySmaller) Accept(v NodeVisitor) { type ExprBinarySmallerOrEqual struct { Node Left Vertex + OpTkn *token.Token Right Vertex } @@ -1981,6 +2023,7 @@ func (n *ExprBinarySmallerOrEqual) Accept(v NodeVisitor) { type ExprBinarySpaceship struct { Node Left Vertex + OpTkn *token.Token Right Vertex } From df1626b7dc92424ebdbb147ba8169eea4653bcb2 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 11:02:38 +0200 Subject: [PATCH 094/140] [refactoring] update ast structure of "Root" and "Class" nodes --- internal/php5/php5.go | Bin 264006 -> 264971 bytes internal/php5/php5.y | 11 +++++--- internal/php7/php7.go | Bin 219046 -> 219158 bytes internal/php7/php7.y | 29 +++++++++++--------- pkg/ast/ast.go | 1 - pkg/ast/node.go | 49 ++++++++++++++++++---------------- pkg/ast/traverser/dfs.go | 24 +++++------------ pkg/ast/visitor/dump.go | 6 ----- pkg/ast/visitor/null.go | 4 --- pkg/printer/pretty_printer.go | 4 +-- pkg/printer/printer.go | 8 +++--- 11 files changed, 61 insertions(+), 75 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 58de3b2e1c6f46459be94bb3c6f2155036d8db7c..77d735f17fe72f66daf0d99cb947605c2f560427 100644 GIT binary patch delta 14292 zcmZ`=d3aXE)qiFtA*?YVvWC2GSQG{1-IvG`uti%af{LZhQg3sgUm?>A@ey>p{}|KxcxXPGnSo;ll`_vIxe zzppE)pWRtx7FKuG)t$v6C0n$hwtYo6YS&G~DD{YpQLKgPUv%EDXZ`x>iYVQg79ERz ze&y8jFTb*anwJ4F-A}ZoDKCm%KB-FN5_;u@;ygj`Mnq44StjyS`L*al1EV5t78|C@ z2*qc}4it-uHdG%K-+H)ZGM=Er`$SS7D;KAUU^S7U$H$5ObZrm2+lEClBI2~+Vf;DR z!)|5PXlPH>fp+x}U8$<4L#6HuRGjwo6ek;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>EE^8E><*Zgzg&(vImfiivfQBQrJcxt#EWV)2N+uFH7h8;J{f43iseBR6Xsf+B@-{ z@^U=q%7lIFQf(Sq_8VG;EQ

BJa1!wWs*9F|8_+K z>jQG;`rugd>n);ABz?6>C!lC1juRiZQE0A8Y4+xTm|W=CQ~B2cR0qfRUv4pYw*EyA zBAaaAqL&+z_-8)c)r4s47G0IQ?dnNW-qri%hm#=RqaVzp1zYte2I{g`;;3`HQ%v7& z(@W^KZO|S6(gH7(Dd0B6)v(?vP?|Im4z%DyT}Rut8%)&Q<;ZpdYwv`gT7&Phf2Za#h)n)7rEHhK?8?J231E3uFJ5!|g?11q*AsI-NL5{;KHl zZvr4Xd`qq3pOz~Qa0H@D5B<}!6%-LZ?pX?3zq1thIKuZ>qOvjHV+DTs3v=>}(fZ&M zwMzn{v_D*Y`yPD;J$evl4Ec>vnq{QfRut-wS1|hq?f-$@j()aCEnNTJK4}v45Okw2%yT&&Z&0JxPlJ@?y#Cl;&xf0rgxcxKC!}y z%Dt>VqMK7}rGz6$L&JrLqGb*a_yHP~_i(Pav~9a|1Qxi%MV&vOr{kGl+cmDFeva6V z{%R0m&sMawr!&%@Q|U~%45r*f?#A_OvsDULvyLwF{~B?623R-%$Zvxe^a*U0ic2NN zSz<}l87?akm3&O$P6Yu~9Scm9!hP})siTsFq2Njww?D5XoTu#W_O=0z+@E&b1-={5 z{OYt5vuaD*Um;<^IsQ!@6;#_2O@8EyT_-%$duNhK& z8zgBY>N+D8jXOEe2L2c)Rk^3^D($b2F@2bU2A6dL6; zqY0-uUmAWfh2H`ES)-jQD}Sc(!K7lWv)>4eC}}u(j2-73wqWagxj3K?#s?P8q;P%l UA8)r2S-S#0 group_use_declaration inline_use_declaration %type mixed_group_use_declaration use_declaration unprefixed_use_declaration %type const_decl inner_statement -%type expr optional_expr +%type expr optional_expr parameter_list non_empty_parameter_list %type declare_statement finally_statement unset_variable variable %type parameter optional_type argument expr_without_variable global_var_list global_var %type static_var_list static_var class_statement trait_adaptation trait_precedence trait_alias @@ -277,7 +277,7 @@ import ( %type case_list trait_adaptation_list %type use_declarations %type top_statement_list -%type inner_statement_list parameter_list non_empty_parameter_list class_statement_list +%type inner_statement_list class_statement_list %type method_modifiers variable_modifiers %type non_empty_member_modifiers class_modifiers @@ -1222,7 +1222,8 @@ function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $5, - Params: $6, + Params: $6.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, ColonTkn: $8.(*ast.ReturnType).ColonTkn, ReturnType: $8.(*ast.ReturnType).Type, @@ -1828,21 +1829,23 @@ parameter_list: } | /* empty */ { - $$ = nil + $$ = &ast.ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | non_empty_parameter_list ',' parameter { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; @@ -2201,7 +2204,8 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $6, - Params: $7, + Params: $7.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $7.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $8, ColonTkn: $9.(*ast.ReturnType).ColonTkn, ReturnType: $9.(*ast.ReturnType).Type, @@ -3608,7 +3612,8 @@ inline_function: FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $4, - Params: $5, + Params: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $6, ClosureUse: $7, ColonTkn: $8.(*ast.ReturnType).ColonTkn, @@ -3627,7 +3632,8 @@ inline_function: FnTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, - Params: $4, + Params: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, ColonTkn: $6.(*ast.ReturnType).ColonTkn, ReturnType: $6.(*ast.ReturnType).Type, diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 6283064..c231894 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -269,6 +269,7 @@ type StmtClassMethod struct { MethodName Vertex OpenParenthesisTkn *token.Token Params []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ColonTkn *token.Token ReturnType Vertex @@ -482,6 +483,7 @@ type StmtFunction struct { FunctionName Vertex OpenParenthesisTkn *token.Token Params []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ColonTkn *token.Token ReturnType Vertex @@ -955,6 +957,7 @@ type ExprArrowFunction struct { AmpersandTkn *token.Token OpenParenthesisTkn *token.Token Params []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ColonTkn *token.Token ReturnType Vertex @@ -1019,6 +1022,7 @@ type ExprClosure struct { AmpersandTkn *token.Token OpenParenthesisTkn *token.Token Params []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ClosureUse *ExprClosureUse ColonTkn *token.Token From ea3c5298e2e65321a1f72b98d0ab85737be8e2de Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 12:49:13 +0200 Subject: [PATCH 097/140] [refactoring] update ast structure of "For", "TraitUseAlias" and "TraitUsePrecedence" nodes --- internal/php5/php5.go | Bin 264589 -> 265977 bytes internal/php5/php5.y | 44 +++++++++++++++++++++--------------------- internal/php7/php7.go | Bin 219415 -> 219796 bytes internal/php7/php7.y | 36 +++++++++++++++++----------------- pkg/ast/node.go | 13 +++++++++---- 5 files changed, 49 insertions(+), 44 deletions(-) diff --git a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ql^Kv?ix-4r4J8v>wnQ~&?~ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index e58d0cf..8c4c536 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -240,7 +240,7 @@ import ( %type switch_case_list non_empty_function_call_parameter_list assignment_list lexical_var_list %type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list %type foreach_statement for_statement while_statement isset_variables -%type foreach_variable foreach_optional_arg +%type foreach_variable foreach_optional_arg for_expr non_empty_for_expr %type extends_from interface_list trait_list %type implements_list %type interface_extends_list @@ -248,8 +248,8 @@ import ( %type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations %type inner_statement_list encaps_list -%type elseif_list new_elseif_list non_empty_for_expr -%type for_expr case_list catch_statement additional_catches +%type elseif_list new_elseif_list +%type case_list catch_statement additional_catches %type non_empty_additional_catches class_statement_list %type class_statement_list variable_modifiers method_modifiers %type trait_adaptation_list non_empty_trait_adaptation_list @@ -938,11 +938,14 @@ unticked_statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3 + $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5 + $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7 + $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Node.Position = position.NewTokenNodePosition($1, $9) @@ -2537,19 +2540,15 @@ non_empty_trait_adaptation_list: trait_adaptation_statement: trait_precedence ';' { - $$ = $1; + $1.(*ast.StmtTraitUsePrecedence).SemiColonTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = $1; } | trait_alias ';' { - $$ = $1; + $1.(*ast.StmtTraitUseAlias).SemiColonTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = $1; } ; @@ -2976,7 +2975,7 @@ echo_expr_list: for_expr: /* empty */ { - $$ = nil + $$ = &ast.ParserSeparatedList{} } | non_empty_for_expr { @@ -2987,14 +2986,16 @@ for_expr: non_empty_for_expr: non_empty_for_expr ',' expr { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | expr { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -4461,10 +4462,9 @@ dynamic_class_name_variable_properties: dynamic_class_name_variable_property: T_OBJECT_OPERATOR object_property { - $$ = $2 + $2[0].(*ast.ExprPropertyFetch).ObjectOperatorTkn = $1 - // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.SkippedTokens) + $$ = $2 } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 4eb37848a20a7b3a6b5af32abbbeab70a995845e..35f39c1cc9ba8bda32d70573fa4134f23d812f32 100644 GIT binary patch delta 9356 zcmcIod6-qjmH$pPG;{+kYqNAiH#DpCZQgzR1HlGl^NX^Gl1T(<7L|y~D7b;?jvANA z#O;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J0PH`=|hhkriE**j-AF9IjU08)~)~5-QzZ+$%nh+I! z(y(7|(lnrPZwYatQ~p-k!!7Y64&R$Fe2qKU1t|x+YKzEK zDF8O#CvMB4>2`U>4AD80@W48dEIL{At=mkA_R5;GEmTA7nQ8c_K0MsKr*(Xa^cw-g z`8lJpW+@JD8DSwA8Gu{NQzc75A@uolR zeKV$AJRP(KyheXD#*8h>#EyFMbkj?|G#MGJtENhCoyKp0o0g(FSl~8}#T9Ya<@z_r Mn()oBMUQv?U;H30*8l(j diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 8248833..845fa18 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -234,7 +234,7 @@ import ( %type interface_declaration_statement %type group_use_declaration inline_use_declaration %type mixed_group_use_declaration use_declaration unprefixed_use_declaration -%type const_decl inner_statement +%type const_decl inner_statement for_exprs non_empty_for_exprs %type expr optional_expr parameter_list non_empty_parameter_list %type declare_statement finally_statement unset_variable variable %type parameter optional_type argument expr_without_variable global_var_list global_var @@ -272,7 +272,6 @@ import ( %type encaps_list backticks_expr namespace_name catch_list class_const_list -%type for_exprs non_empty_for_exprs %type unprefixed_use_declarations inline_use_declarations %type case_list trait_adaptation_list %type use_declarations @@ -900,11 +899,14 @@ statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3 + $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5 + $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7 + $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Node.Position = position.NewTokenNodePosition($1, $9) @@ -2277,19 +2279,15 @@ trait_adaptation_list: trait_adaptation: trait_precedence ';' { - $$ = $1; + $1.(*ast.StmtTraitUsePrecedence).SemiColonTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = $1; } | trait_alias ';' { - $$ = $1; + $1.(*ast.StmtTraitUseAlias).SemiColonTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) + $$ = $1; } ; @@ -2688,7 +2686,7 @@ echo_expr: for_exprs: /* empty */ { - $$ = nil; + $$ = &ast.ParserSeparatedList{} } | non_empty_for_exprs { @@ -2699,14 +2697,16 @@ for_exprs: non_empty_for_exprs: non_empty_for_exprs ',' expr { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } | expr { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index c231894..5a71e3d 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -438,10 +438,13 @@ type StmtFor struct { ForTkn *token.Token OpenParenthesisTkn *token.Token Init []Vertex + InitSeparatorTkns []*token.Token InitSemiColonTkn *token.Token Cond []Vertex + CondSeparatorTkns []*token.Token CondSemiColonTkn *token.Token Loop []Vertex + LoopSeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ColonTkn *token.Token Stmt Vertex @@ -792,10 +795,11 @@ func (n *StmtTraitUse) Accept(v NodeVisitor) { // StmtTraitUseAlias node type StmtTraitUseAlias struct { Node - Ref Vertex - AsTkn *token.Token - Modifier Vertex - Alias Vertex + Ref Vertex + AsTkn *token.Token + Modifier Vertex + Alias Vertex + SemiColonTkn *token.Token } func (n *StmtTraitUseAlias) Accept(v NodeVisitor) { @@ -809,6 +813,7 @@ type StmtTraitUsePrecedence struct { InsteadofTkn *token.Token Insteadof []Vertex SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { From af968a7c3b92885a537eda6d952d6cb2f035e9e4 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 12:58:56 +0200 Subject: [PATCH 098/140] [refactoring] update "ParserBrackets" nodes --- internal/php5/php5.y | 57 +++++++++++++++++++------------------------- internal/php7/php7.y | 42 +++++++++++++------------------- 2 files changed, 41 insertions(+), 58 deletions(-) diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 8c4c536..48045f0 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3691,11 +3691,14 @@ expr_without_variable: } | '(' new_expr ')' instance_call { - $$ = $2 - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } for _, n := range($4) { switch nn := n.(type) { @@ -4405,8 +4408,7 @@ dynamic_class_name_reference: { $$ = $1 - // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.SkippedTokens) + $3[0].(*ast.ExprPropertyFetch).ObjectOperatorTkn = $2 for _, n := range($3) { switch nn := n.(type) { @@ -4482,10 +4484,6 @@ exit_expr: OpenBracketTkn: $1, CloseBracketTkn: $2, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) } | parenthesis_expr { @@ -5141,11 +5139,14 @@ static_operation: } | '(' static_scalar_value ')' { - $$ = $2 - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } } ; @@ -5373,10 +5374,6 @@ parenthesis_expr: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | '(' yield_expr ')' { @@ -5388,10 +5385,6 @@ parenthesis_expr: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -5872,14 +5865,14 @@ variable_name: } | '{' expr '}' { - $$ = $2 - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } } ; diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 845fa18..338a084 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3371,10 +3371,6 @@ expr_without_variable: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | new_expr { @@ -3835,10 +3831,6 @@ exit_expr: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -4166,10 +4158,6 @@ dereferencable: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | dereferencable_scalar { @@ -4192,10 +4180,6 @@ callable_expr: Child: $2, CloseBracketTkn: $3, } - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | dereferencable_scalar { @@ -4434,11 +4418,14 @@ member_name: } | '{' expr '}' { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } } | simple_variable { @@ -4459,11 +4446,14 @@ property_name: } | '{' expr '}' { - $$ = $2; - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) + $$ = &ast.ParserBrackets{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenBracketTkn: $1, + Child: $2, + CloseBracketTkn: $3, + } } | simple_variable { From 94897d8c6682ad30f43eb09db680b73ab0526bf5 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 13:10:12 +0200 Subject: [PATCH 099/140] [refactoring] remove *FreeFloating* functions --- internal/php5/parser.go | 109 ---------------------------------------- internal/php5/php5.go | Bin 265977 -> 262882 bytes internal/php5/php5.y | 34 ------------- internal/php7/parser.go | 109 ---------------------------------------- internal/php7/php7.go | Bin 219796 -> 218067 bytes internal/php7/php7.y | 14 ------ 6 files changed, 266 deletions(-) diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 5b06343..ee75429 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -1,8 +1,6 @@ package php5 import ( - "bytes" - "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -62,110 +60,3 @@ func lastNode(nn []ast.Vertex) ast.Vertex { } return nn[len(nn)-1] } - -func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if _, ok := src.GetNode().Tokens[token.Start]; !ok { - return - } - - if src.GetNode().Tokens == nil { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - (*dstCollection)[token.Start] = src.GetNode().Tokens[token.Start] - delete(src.GetNode().Tokens, token.Start) -} - -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - l := len(tokens) - for _, v := range tokens[0 : l-1] { - (*dstCollection)[pos] = append((*dstCollection)[pos], v) - } -} - -func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - (*dstCollection)[pos] = make([]*token.Token, 0) - - for _, v := range tokens { - (*dstCollection)[pos] = append((*dstCollection)[pos], v) - } -} - -func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - l := len(tokens) - (*dstCollection)[pos] = append((*dstCollection)[pos], tokens[l-1]) -} - -func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if _, ok := prevNode.GetNode().Tokens[token.SemiColon]; !ok { - return - } - - semiColon := prevNode.GetNode().Tokens[token.SemiColon] - delete(prevNode.GetNode().Tokens, token.SemiColon) - if len(semiColon) == 0 { - return - } - - if semiColon[0].Value[0] == ';' { - p.setFreeFloatingTokens(prevNode, token.SemiColon, []*token.Token{ - { - ID: token.ID(';'), - Value: semiColon[0].Value[0:1], - }, - }) - } - - vlen := len(semiColon[0].Value) - tlen := 2 - if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { - tlen = 3 - } - - phpCloseTag := []*token.Token{} - if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, &token.Token{ - ID: token.T_WHITESPACE, - Value: semiColon[0].Value[1 : vlen-tlen], - }) - } - - phpCloseTag = append(phpCloseTag, &token.Token{ - ID: T_CLOSE_TAG, - Value: semiColon[0].Value[vlen-tlen:], - }) - - p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) -} diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 626fc16ccbf360ff1988ca8972dc6a6a12f02b40..bff63f66f0d496776932345fd98e5ebfcf1777ac 100644 GIT binary patch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`w1_T8 z11<6Awnt?-KKqvJYb84Fc*F6#wKT@4N||yJa`=0&e0*#fXIF8r{Eob0?TGJw$=f}> zPp&2zYd40-6qMZgC+*f$(SC`yMkrkwPPkh+%wur`vTb$t+Z1H6|r7#A>=L3h_2t{dY>cqk9NkW z^v|VB1eHyL+;1JqX-gQ=`z{;uPo(~TJ?Z~TkGTr|Y{Cwc#kL-eJb1;RK@-_&5L$Fa zUc2Maj$D;fwL>#;HX6}zLD%utBu2lFu(;cq>NNN{5Sas zTJB<*_(q2v?qZqiTZw`c-g_D}$dIG5FEZL7#DSSbItk^W9}xYUqHU)iL8=9*be-LQUFyo6ZX?Tj8b4`JQRpi3^37^M3*D-Ij>} diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 48045f0..2a24915 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -280,11 +280,6 @@ start: top_statement_list: top_statement_list top_statement { - if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - if $2 != nil { $$ = append($1, $2) } @@ -744,8 +739,6 @@ constant_declaration: }) $$ = $1 - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtConstList).Consts).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { @@ -771,19 +764,12 @@ constant_declaration: }, }, } - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtConstList).Consts).(*ast.StmtConstant).Name, token.Start, $2.SkippedTokens) } ; inner_statement_list: inner_statement_list inner_statement { - if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - if $2 != nil { $$ = append($1, $2) } @@ -1752,8 +1738,6 @@ declare_list: }, }, } - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.ParserSeparatedList).Items).(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } | declare_list ',' T_STRING '=' static_scalar { @@ -1777,8 +1761,6 @@ declare_list: ) $$ = $1 - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.ParserSeparatedList).Items).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } ; @@ -2923,8 +2905,6 @@ class_constant_declaration: }) $$ = $1 - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { @@ -2950,8 +2930,6 @@ class_constant_declaration: }, }, } - - yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).Name, token.Start, $2.SkippedTokens) } ; @@ -3624,7 +3602,6 @@ expr_without_variable: OpTkn: $2, Right: $3, } - yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | expr '<' expr { @@ -4416,13 +4393,11 @@ dynamic_class_name_reference: nn.Var = $$ $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } @@ -4432,13 +4407,11 @@ dynamic_class_name_reference: nn.Var = $$ $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Var, $$) case *ast.ExprPropertyFetch: nn.Var = $$ $$.GetNode().Position = position.NewNodesPosition($$, nn) $$ = nn - yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } } @@ -5046,7 +5019,6 @@ static_operation: OpTkn: $2, Right: $3, } - yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | static_scalar_value '<' static_scalar_value { @@ -6333,12 +6305,6 @@ encaps_var_offset: Value: $1.Value, } } - - // save position - $$.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE { diff --git a/internal/php7/parser.go b/internal/php7/parser.go index 32f3fa5..f49ecd8 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -1,8 +1,6 @@ package php7 import ( - "bytes" - "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -62,110 +60,3 @@ func lastNode(nn []ast.Vertex) ast.Vertex { } return nn[len(nn)-1] } - -func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { - if _, ok := src.GetNode().Tokens[token.Start]; !ok { - return - } - - if src.GetNode().Tokens == nil { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - (*dstCollection)[token.Start] = src.GetNode().Tokens[token.Start] - delete(src.GetNode().Tokens, token.Start) -} - -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - l := len(tokens) - for _, v := range tokens[0 : l-1] { - (*dstCollection)[pos] = append((*dstCollection)[pos], v) - } -} - -func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - (*dstCollection)[pos] = make([]*token.Token, 0) - - for _, v := range tokens { - (*dstCollection)[pos] = append((*dstCollection)[pos], v) - } -} - -func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []*token.Token) { - if len(tokens) == 0 { - return - } - - dstCollection := &dst.GetNode().Tokens - if *dstCollection == nil { - *dstCollection = make(token.Collection) - } - - l := len(tokens) - (*dstCollection)[pos] = append((*dstCollection)[pos], tokens[l-1]) -} - -func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast.Vertex) { - if _, ok := prevNode.GetNode().Tokens[token.SemiColon]; !ok { - return - } - - semiColon := prevNode.GetNode().Tokens[token.SemiColon] - delete(prevNode.GetNode().Tokens, token.SemiColon) - if len(semiColon) == 0 { - return - } - - if semiColon[0].Value[0] == ';' { - p.setFreeFloatingTokens(prevNode, token.SemiColon, []*token.Token{ - { - ID: token.ID(';'), - Value: semiColon[0].Value[0:1], - }, - }) - } - - vlen := len(semiColon[0].Value) - tlen := 2 - if bytes.HasSuffix(semiColon[0].Value, []byte("?>\n")) { - tlen = 3 - } - - phpCloseTag := []*token.Token{} - if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, &token.Token{ - ID: token.T_WHITESPACE, - Value: semiColon[0].Value[1 : vlen-tlen], - }) - } - - phpCloseTag = append(phpCloseTag, &token.Token{ - ID: T_CLOSE_TAG, - Value: semiColon[0].Value[vlen-tlen:], - }) - - p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) -} diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 35f39c1cc9ba8bda32d70573fa4134f23d812f32..c592f8c04798e7589fac0f7c8c8baddd64fe49ac 100644 GIT binary patch delta 7212 zcmZu$d0dud*8ZLIu*oK3fC|bB;zBOG3)`zEkP4=gpt+lgC8as3VVPy-QkFI<_$3^) zG^;6#ri2{5Cu=lXw8=zmG0O_foHkP#_4`^(zw5rA=LMTz|LFUidpq|z*SXHQ59@bC zeYiEMZh2?U&VBHq&g!Ag^kTH6PNOnekWPj2l-o*^=5)G&G9_g!rOK8MIb4-qO&y4` z#5I=UrR06;rk?9Ve;^sMz;Bu5w#@j*-dG8AGX&$*nFG>i;v< zf$Qiw{Xf1}vRoWR!#FEfJWo;&nOO|e6og{m6U9`>*?#FzMOR5)34O&mS=x8`a?5B~ zvt$D9$o<(81ovZ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{%E$nqV3het%Fh z{il;$Z5SknSm=>l*KkNKGeeh!TQ^ITHl>UhFrSUE#!BJnSvaqqm8;U7(g}3vJ-e2U`u|R2pUSKu?Kl&Z~;H+`J>odfe-ESTIep{V;tl+N$=}LB@L+ zi_`6f?)ffOkZ$L&P`iU`$8V<($6BjQEZ0jrS?}VryQxQYc^9h^T`&9DMc}x}ApS-T6sxZI4{(dqfUh1n z#F{5&W77Jd8!caba;O!6mW7mO253Qy5TG>`*q~upZWlx$`B;2 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - if $2 != nil { $$ = append($1, $2) } @@ -796,11 +791,6 @@ const_list: inner_statement_list: inner_statement_list inner_statement { - if inlineHtmlNode, ok := $2.(*ast.StmtInlineHtml); ok && len($1) > 0 { - prevNode := lastNode($1) - yylex.(*Parser).splitSemiColonAndPhpCloseTag(inlineHtmlNode, prevNode) - } - if $2 != nil { $$ = append($1, $2) } @@ -2633,8 +2623,6 @@ class_const_decl: EqualTkn: $2, Expr: $3, } - - yylex.(*Parser).setFreeFloating($$.(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } ; @@ -2655,8 +2643,6 @@ const_decl: EqualTkn: $2, Expr: $3, } - - yylex.(*Parser).setFreeFloating($$.(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } ; From 40b944a272261f750050dda40cdb3275ba0b899e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 14:38:47 +0200 Subject: [PATCH 100/140] [refactoring] update ast structure of "ClassConstList", "Constant", "Use", "GroupUse", "UseDeclaration", "Closure", "Name", "FullyQualified", "Relative" and "NamePart" nodes --- internal/php5/php5.go | Bin 262882 -> 267837 bytes internal/php5/php5.y | 253 +++--- internal/php7/php7.go | Bin 218067 -> 220826 bytes internal/php7/php7.y | 177 ++-- pkg/ast/node.go | 38 +- pkg/ast/visitor/dump.go | 1 - pkg/ast/visitor/filter_parser_nodes.go | 1077 ------------------------ pkg/ast/visitor/filter_tokens.go | 276 ------ pkg/printer/printer.go | 11 - 9 files changed, 271 insertions(+), 1562 deletions(-) delete mode 100644 pkg/ast/visitor/filter_parser_nodes.go delete mode 100644 pkg/ast/visitor/filter_tokens.go diff --git a/internal/php5/php5.go b/internal/php5/php5.go index bff63f66f0d496776932345fd98e5ebfcf1777ac..7f98c4875cbb683aff626e774209541b44786463 100644 GIT binary patch delta 22041 zcmch837AyHwf|RD!!pA*fU*tDG`qkw^zFTo)eTn`7eqt>4Voy*fEzA2VDv>2m(hkf zE(i=RyqE-WfvboJE`%5r6b%tn22rB2I2e5qMfv~Esk+?*VxIZOyzk>)`ktyfb?WS= zs^)`Ril6&^@zPD|$*N>_Q&GIQlg#KvJj|Pjp=*+HBw~007{jP|B$hppyv!t0 ziR_eAZLvdz!G{M|JZ%~g1)1_Hp z(ImiW9-c^oj#QKx9f|UQ6uzS=;7s!RqA5%nWjS~}ERL@fz}(66m~J5_%1C%Eyu4_J z7ojuhZ1E#UW`_^z-i>*X;3*&n3`sFJFn=tHQ8FG3%x=i^XqRF1csviU1UDy{Be868 z{~jhCi#(a?zwGutpxX183Qzz#vCdG8#T&&(hQ9!}t?_KLb)}V1J4S~m?V&Xqv0Z?M zIg8Gq#q(H&@y72s^8r738I0RD$RJ+7=ds@7jp;m#0g3{EB|`eefQHFuu~d4(e(9Qu z^17ur6eYym@I00`-ar?Xsbt-NF#&NPL7N>Rbb>Wlstob)7G`)%3dp zG|Xcy^;iZFM27oBGUy{#EFaRqBJ?6@#u!OkTT6p1rbBcR<82$GkEHDwUNn;w0q^jJ zC17C@)*>%bDasNNfkjd>ExQJ`HgvIXjOV3Cpx``^#fmqt+Wz83!JL%wEK4uKvO+WT z8OF;LL|9y)0ju606$Ly1+{NG zNHi#sz2%keDYi+-17xvH!piZ3e}ncI23u#wRA*StGVo(qU^<%p=#^fTtPGyK#5nnd zA;CWwO8z4U!tehEMwv_Ta<*-x3}Z%VS(jKVI2ge{NT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fg(txgMSRyCfz{bT9$)|W60V>CZ44_-;m2|K-hI=$Fk!*;YaZ=2;8z%bbD>Q-` zscR&fhP@Dqgz5Xzx&WC@jxL&&m23_0Q0+Q+O*B1-!a<9GFBQmraj+C)$ODQ#J*q@X SwZaHoq4YubDQeuNB>6u!nH&rN diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 2a24915..4027440 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -15,8 +15,6 @@ import ( node ast.Vertex token *token.Token list []ast.Vertex - - ClosureUse *ast.ExprClosureUse } %token T_INCLUDE @@ -219,6 +217,7 @@ import ( %type function interface_entry %type possible_comma %type case_separator +%type is_reference is_variadic %type top_statement use_declaration use_function_declaration use_const_declaration common_scalar %type static_class_constant compound_variable reference_variable class_name variable_class_name @@ -241,12 +240,12 @@ import ( %type method_body trait_reference_list static_array_pair_list non_empty_static_array_pair_list %type foreach_statement for_statement while_statement isset_variables %type foreach_variable foreach_optional_arg for_expr non_empty_for_expr -%type extends_from interface_list trait_list -%type implements_list +%type extends_from interface_list trait_list namespace_name +%type implements_list use_declarations use_function_declarations use_const_declarations %type interface_extends_list -%type lexical_vars +%type lexical_vars -%type top_statement_list namespace_name use_declarations use_function_declarations use_const_declarations +%type top_statement_list %type inner_statement_list encaps_list %type elseif_list new_elseif_list %type case_list catch_statement additional_catches @@ -260,7 +259,6 @@ import ( %type dynamic_class_name_variable_properties variable_properties %type simple_indirect_reference -%type is_reference is_variadic %% @@ -293,26 +291,32 @@ top_statement_list: namespace_name: T_STRING { - $$ = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, }, - StringTkn: $1, - Value: $1.Value, }, } } | namespace_name T_NS_SEPARATOR T_STRING { - $$ = append($1, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $3), + Position: position.NewTokenPosition($3), }, - NsSeparatorTkn: $2, StringTkn: $3, Value: $3.Value, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + + $$ = $1 } ; @@ -355,9 +359,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -371,9 +376,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: $3, Stmts: $4, @@ -399,7 +405,8 @@ top_statement: Position: position.NewTokensPosition($1, $3), }, UseTkn: $1, - UseDeclarations: $2, + UseDeclarations: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -417,7 +424,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -435,7 +443,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -450,13 +459,16 @@ top_statement: use_declarations: use_declarations ',' use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -465,13 +477,14 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -479,13 +492,14 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -501,14 +515,15 @@ use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -521,9 +536,10 @@ use_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -540,13 +556,16 @@ use_declaration: use_function_declarations: use_function_declarations ',' use_function_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_function_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -555,13 +574,14 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -569,13 +589,14 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -591,14 +612,15 @@ use_function_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -611,9 +633,10 @@ use_function_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -630,13 +653,16 @@ use_function_declaration: use_const_declarations: use_const_declarations ',' use_const_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_const_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -645,13 +671,14 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -659,13 +686,14 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -681,14 +709,15 @@ use_const_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -701,9 +730,10 @@ use_const_declaration: NsSeparatorTkn: $1, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -2888,7 +2918,7 @@ class_constant_declaration: { constList := $1.(*ast.StmtClassConstList) constList.Node.Position = position.NewNodesPosition($1, $5) - lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).CommaTkn = $2 + constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ Node: ast.Node{ Position: position.NewTokenNodePosition($3, $5), @@ -4165,13 +4195,14 @@ function_call: { $$ = &ast.ExprFunctionCall{ Node: ast.Node{ - Position: position.NewNodeListNodePosition($1, $2), + Position: position.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), }, Function: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -4187,11 +4218,12 @@ function_call: }, Function: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, @@ -4207,10 +4239,11 @@ function_call: }, Function: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, @@ -4308,30 +4341,33 @@ class_name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -4341,30 +4377,33 @@ fully_qualified_class_name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -4670,13 +4709,14 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -4684,15 +4724,16 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -4700,14 +4741,15 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5131,13 +5173,14 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5145,15 +5188,16 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -5161,14 +5205,15 @@ general_constant: { $$ = &ast.ExprConstFetch{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, Const: &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, } } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index c592f8c04798e7589fac0f7c8c8baddd64fe49ac..e224ae31333e59f00639df1252ae5449931eeed9 100644 GIT binary patch delta 13859 zcmdU0d3aUTwg2`$8OQ)60!bt!xnU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%p+X<|jO8Vsx>4EZW$^4i!OmaUJMrNmcot0NyHLdVm%ujUFeNIg^gI@>5HMpxW>|>M6$ztVk2}Ua6w3Z9MPF zg&-FUtbZqO!f`y{LRBs$M;02=K9&c790#1y4Mi^&S%U)}!0}uxjTXBw9835Rvbflg zvYok6h*^g*dlej~%>hdn!Qw90U7m?jPmqp<%^ORNgs3;K1V!!{ck?}dnbC)>6JERN zZ!K-ylsE|Q?Md?vo*6iLIf@LYS8YV79Fpg8y@m~*cB1b(8Rt4^8rcCc4DE8w>dwYCu%WDV)vq{DA!o@z9A(e_I~8QsFu zt_s7t0pN9DJqIi?!Tyl9)Nn~C*Qg>?F3PI;86+gj)|PVOyn~MQHZHLi13cfHY6juaY0aHD zGA%k4FN9HEWzvRT#?_8V8a;1mF(YUfn_%ARs%a#!OO=jA=L~`;nA7?iP2DkZd*|Vf z(T4t>>WFm|hlNylwqf T_INCLUDE @@ -247,9 +244,9 @@ import ( %type callable_expr callable_variable static_member new_variable %type encaps_var encaps_var_offset echo_expr_list catch_name_list name_list %type if_stmt const_list non_empty_argument_list property_list -%type alt_if_stmt lexical_var_list isset_variables -%type if_stmt_without_else -%type class_const_decl +%type alt_if_stmt lexical_var_list isset_variables class_const_list +%type if_stmt_without_else unprefixed_use_declarations inline_use_declarations use_declarations +%type class_const_decl namespace_name %type alt_if_stmt_without_else %type array_pair possible_array_pair %type isset_variable type return_type type_expr @@ -264,17 +261,15 @@ import ( %type extends_from %type implements_list %type interface_extends_list -%type lexical_vars +%type lexical_vars %type member_modifier %type use_type %type foreach_variable -%type encaps_list backticks_expr namespace_name catch_list class_const_list -%type unprefixed_use_declarations inline_use_declarations +%type encaps_list backticks_expr catch_list %type case_list trait_adaptation_list -%type use_declarations %type top_statement_list %type inner_statement_list class_statement_list %type method_modifiers variable_modifiers @@ -342,26 +337,32 @@ top_statement_list: namespace_name: T_STRING { - $$ = []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, }, - StringTkn: $1, - Value: $1.Value, }, } } | namespace_name T_NS_SEPARATOR T_STRING { - $$ = append($1, &ast.NameNamePart{ + part := &ast.NameNamePart{ Node: ast.Node{ - Position: position.NewTokensPosition($2, $3), + Position: position.NewTokenPosition($3), }, - NsSeparatorTkn: $2, StringTkn: $3, Value: $3.Value, - }) + } + + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + + $$ = $1 } ; @@ -370,30 +371,33 @@ name: { $$ = &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), }, NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3, + Parts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2), + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), }, NsSeparatorTkn: $1, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -445,9 +449,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -461,9 +466,10 @@ top_statement: NsTkn: $1, Name: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracket: $3, Stmts: $4, @@ -510,7 +516,8 @@ top_statement: Position: position.NewTokensPosition($1, $3), }, UseTkn: $1, - UseDeclarations: $2, + UseDeclarations: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -522,7 +529,8 @@ top_statement: }, UseTkn: $1, Type: $2, - UseDeclarations: $3, + UseDeclarations: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -566,29 +574,29 @@ use_type: group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - if len($4) > 0 { - $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 - } + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $6), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4, + UseDeclarations: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ Node: ast.Node{ @@ -597,13 +605,15 @@ group_use_declaration: LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5, + UseDeclarations: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -612,27 +622,29 @@ group_use_declaration: mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $6), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), }, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4, + UseDeclarations: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ Node: ast.Node{ @@ -641,13 +653,15 @@ mixed_group_use_declaration: LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($2), + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), }, - Parts: $2, + Parts: $2.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5, + UseDeclarations: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -667,39 +681,48 @@ possible_comma: inline_use_declarations: inline_use_declarations ',' inline_use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | inline_use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | unprefixed_use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; use_declarations: use_declarations ',' use_declaration { - $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | use_declaration { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; @@ -723,13 +746,14 @@ unprefixed_use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, } } @@ -737,13 +761,14 @@ unprefixed_use_declaration: { $$ = &ast.StmtUseDeclaration{ Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), }, Use: &ast.NameName{ Node: ast.Node{ - Position: position.NewNodeListPosition($1), + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), }, - Parts: $1, + Parts: $1.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -2156,10 +2181,11 @@ class_statement: Node: ast.Node{ Position: position.NewOptionalListTokensPosition($1, $2, $4), }, - Modifiers: $1, - ConstTkn: $2, - Consts: $3, - SemiColonTkn: $4, + Modifiers: $1, + ConstTkn: $2, + Consts: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $4, } } | T_USE name_list trait_adaptations @@ -2596,13 +2622,16 @@ property: class_const_list: class_const_list ',' class_const_decl { - lastNode($1).(*ast.StmtConstant).CommaTkn = $2 + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - $$ = append($1, $3) + $$ = $1 } | class_const_decl { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 5a71e3d..b375c45 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -227,10 +227,11 @@ func (n *StmtClass) Accept(v NodeVisitor) { // StmtClassConstList node type StmtClassConstList struct { Node - Modifiers []Vertex - ConstTkn *token.Token - Consts []Vertex - SemiColonTkn *token.Token + Modifiers []Vertex + ConstTkn *token.Token + Consts []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } func (n *StmtClassConstList) Accept(v NodeVisitor) { @@ -299,7 +300,6 @@ type StmtConstant struct { Name Vertex EqualTkn *token.Token Expr Vertex - CommaTkn *token.Token } func (n *StmtConstant) Accept(v NodeVisitor) { @@ -856,6 +856,7 @@ type StmtUse struct { UseTkn *token.Token Type Vertex UseDeclarations []Vertex + SeparatorTkns []*token.Token SemiColonTkn *token.Token } @@ -873,6 +874,7 @@ type StmtGroupUse struct { NsSeparatorTkn *token.Token OpenCurlyBracketTkn *token.Token UseDeclarations []Vertex + SeparatorTkns []*token.Token CloseCurlyBracketTkn *token.Token SemiColonTkn *token.Token } @@ -889,7 +891,6 @@ type StmtUseDeclaration struct { Use Vertex AsTkn *token.Token Alias Vertex - CommaTkn *token.Token } func (n *StmtUseDeclaration) Accept(v NodeVisitor) { @@ -1029,7 +1030,7 @@ type ExprClosure struct { Params []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token - ClosureUse *ExprClosureUse + ClosureUse Vertex ColonTkn *token.Token ReturnType Vertex OpenCurlyBracketTkn *token.Token @@ -2017,8 +2018,8 @@ func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { type NameName struct { Node - Parts []Vertex - ListSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameName) Accept(v NodeVisitor) { @@ -2027,9 +2028,9 @@ func (n *NameName) Accept(v NodeVisitor) { type NameFullyQualified struct { Node - NsSeparatorTkn *token.Token - Parts []Vertex - ListSeparatorTkn *token.Token + NsSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameFullyQualified) Accept(v NodeVisitor) { @@ -2038,10 +2039,10 @@ func (n *NameFullyQualified) Accept(v NodeVisitor) { type NameRelative struct { Node - NsTkn *token.Token - NsSeparatorTkn *token.Token - Parts []Vertex - ListSeparatorTkn *token.Token + NsTkn *token.Token + NsSeparatorTkn *token.Token + Parts []Vertex + SeparatorTkns []*token.Token } func (n *NameRelative) Accept(v NodeVisitor) { @@ -2050,9 +2051,8 @@ func (n *NameRelative) Accept(v NodeVisitor) { type NameNamePart struct { Node - NsSeparatorTkn *token.Token - StringTkn *token.Token - Value []byte + StringTkn *token.Token + Value []byte } func (n *NameNamePart) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index d6546f3..abcf932 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -572,7 +572,6 @@ func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { 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) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go deleted file mode 100644 index 6ccd522..0000000 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ /dev/null @@ -1,1077 +0,0 @@ -package visitor - -import ( - "github.com/z7zmey/php-parser/pkg/ast" -) - -type FilterParserNodes struct { - Null -} - -func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { - n.Accept(v) - return true -} - -func (v *FilterParserNodes) ExprExit(n *ast.ExprExit) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtContinue(n *ast.StmtContinue) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtBreak(n *ast.StmtBreak) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprClone(n *ast.ExprClone) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprPrint(n *ast.ExprPrint) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtExpression(n *ast.StmtExpression) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtEcho(n *ast.StmtEcho) { - for k, v := range n.Exprs { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Exprs[k] = v - } -} - -func (v *FilterParserNodes) ExprIsset(n *ast.ExprIsset) { - for k, v := range n.Vars { - for { - if nn, ok := v.(*ast.ParserBrackets); ok { - v = nn.Child - } else { - break - } - } - - n.Vars[k] = v - } -} - -func (v *FilterParserNodes) StmtReturn(n *ast.StmtReturn) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprYield(n *ast.ExprYield) { - for { - if nn, ok := n.Key.(*ast.ParserBrackets); ok { - n.Key = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Value.(*ast.ParserBrackets); ok { - n.Value = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) Argument(n *ast.Argument) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtThrow(n *ast.StmtThrow) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) StmtCase(n *ast.StmtCase) { - for { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprVariable(n *ast.ExprVariable) { - for { - if nn, ok := n.VarName.(*ast.ParserBrackets); ok { - n.VarName = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssign(n *ast.ExprAssign) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignConcat(n *ast.ExprAssignConcat) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignDiv(n *ast.ExprAssignDiv) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMinus(n *ast.ExprAssignMinus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMod(n *ast.ExprAssignMod) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignMul(n *ast.ExprAssignMul) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignPlus(n *ast.ExprAssignPlus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignPow(n *ast.ExprAssignPow) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} -func (v *FilterParserNodes) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryConcat(n *ast.ExprBinaryConcat) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryDiv(n *ast.ExprBinaryDiv) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryEqual(n *ast.ExprBinaryEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryGreater(n *ast.ExprBinaryGreater) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMinus(n *ast.ExprBinaryMinus) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMod(n *ast.ExprBinaryMod) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryMul(n *ast.ExprBinaryMul) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryPlus(n *ast.ExprBinaryPlus) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryPow(n *ast.ExprBinaryPow) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySmaller(n *ast.ExprBinarySmaller) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { - for { - if nn, ok := n.Left.(*ast.ParserBrackets); ok { - n.Left = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Right.(*ast.ParserBrackets); ok { - n.Right = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprUnaryMinus(n *ast.ExprUnaryMinus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprUnaryPlus(n *ast.ExprUnaryPlus) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBooleanNot(n *ast.ExprBooleanNot) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprBitwiseNot(n *ast.ExprBitwiseNot) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprInstanceOf(n *ast.ExprInstanceOf) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprTernary(n *ast.ExprTernary) { - for { - if nn, ok := n.Condition.(*ast.ParserBrackets); ok { - n.Condition = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.IfTrue.(*ast.ParserBrackets); ok { - n.IfTrue = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.IfFalse.(*ast.ParserBrackets); ok { - n.IfFalse = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastArray(n *ast.ExprCastArray) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastBool(n *ast.ExprCastBool) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastDouble(n *ast.ExprCastDouble) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastInt(n *ast.ExprCastInt) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastObject(n *ast.ExprCastObject) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastString(n *ast.ExprCastString) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprCastUnset(n *ast.ExprCastUnset) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprErrorSuppress(n *ast.ExprErrorSuppress) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { - for { - if nn, ok := n.Dim.(*ast.ParserBrackets); ok { - n.Dim = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprArrayItem(n *ast.ExprArrayItem) { - for { - if nn, ok := n.Key.(*ast.ParserBrackets); ok { - n.Key = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Val.(*ast.ParserBrackets); ok { - n.Val = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprEmpty(n *ast.ExprEmpty) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprInclude(n *ast.ExprInclude) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprEval(n *ast.ExprEval) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprRequire(n *ast.ExprRequire) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprRequireOnce(n *ast.ExprRequireOnce) { - for { - if nn, ok := n.Expr.(*ast.ParserBrackets); ok { - n.Expr = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprPropertyFetch(n *ast.ExprPropertyFetch) { - for { - if nn, ok := n.Var.(*ast.ParserBrackets); ok { - n.Var = nn.Child - } else { - break - } - } - - for { - if nn, ok := n.Property.(*ast.ParserBrackets); ok { - n.Property = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprFunctionCall(n *ast.ExprFunctionCall) { - for { - if nn, ok := n.Function.(*ast.ParserBrackets); ok { - n.Function = nn.Child - } else { - break - } - } -} - -func (v *FilterParserNodes) ExprStaticCall(n *ast.ExprStaticCall) { - for { - if nn, ok := n.Call.(*ast.ParserBrackets); ok { - n.Call = nn.Child - } else { - break - } - } -} diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go deleted file mode 100644 index 579bb8d..0000000 --- a/pkg/ast/visitor/filter_tokens.go +++ /dev/null @@ -1,276 +0,0 @@ -package visitor - -import ( - "github.com/z7zmey/php-parser/pkg/ast" -) - -type FilterTokens struct { - Null -} - -func (v *FilterTokens) EnterNode(n ast.Vertex) bool { - n.GetNode().Tokens = nil - n.Accept(v) - return true -} - -func (v *FilterTokens) StmtUse(n *ast.StmtUse) { - n.UseTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGroupUse(n *ast.StmtGroupUse) { - n.UseTkn = nil - n.LeadingNsSeparatorTkn = nil - n.NsSeparatorTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - n.NsSeparatorTkn = nil - n.AsTkn = nil - n.CommaTkn = nil -} - -func (v *FilterTokens) NameNamePart(n *ast.NameNamePart) { - n.NsSeparatorTkn = nil - n.StringTkn = nil -} - -func (v *FilterTokens) NameName(n *ast.NameName) { - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) NameFullyQualified(n *ast.NameFullyQualified) { - n.NsSeparatorTkn = nil - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) NameRelative(n *ast.NameRelative) { - n.NsTkn = nil - n.NsSeparatorTkn = nil - n.ListSeparatorTkn = nil -} - -func (v *FilterTokens) StmtNamespace(n *ast.StmtNamespace) { - n.NsTkn = nil - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtHaltCompiler(n *ast.StmtHaltCompiler) { - n.HaltCompilerTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtConstList(n *ast.StmtConstList) { - n.ConstTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtClassConstList(n *ast.StmtClassConstList) { - n.ConstTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtConstant(n *ast.StmtConstant) { - n.EqualTkn = nil - n.CommaTkn = nil -} - -func (v *FilterTokens) StmtStmtList(n *ast.StmtStmtList) { - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil -} - -func (v *FilterTokens) StmtIf(n *ast.StmtIf) { - n.IfTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndIfTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtElseIf(n *ast.StmtElseIf) { - n.ElseIfTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil -} - -func (v *FilterTokens) StmtElse(n *ast.StmtElse) { - n.ElseTkn = nil - n.ColonTkn = nil -} - -func (v *FilterTokens) ParserBrackets(n *ast.ParserBrackets) { - n.OpenBracketTkn = nil - n.CloseBracketTkn = nil -} - -func (v *FilterTokens) StmtWhile(n *ast.StmtWhile) { - n.WhileTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndWhileTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtDo(n *ast.StmtDo) { - n.DoTkn = nil - n.WhileTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtFor(n *ast.StmtFor) { - n.ForTkn = nil - n.OpenParenthesisTkn = nil - n.InitSemiColonTkn = nil - n.CondSemiColonTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndForTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtSwitch(n *ast.StmtSwitch) { - n.SwitchTkn = nil - n.OpenParenthesisTkn = nil - n.CloseParenthesisTkn = nil - n.OpenCurlyBracketTkn = nil - n.CaseSeparatorTkn = nil - n.ColonTkn = nil - n.CloseCurlyBracketTkn = nil - n.EndSwitchTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtCase(n *ast.StmtCase) { - n.CaseTkn = nil - n.CaseSeparatorTkn = nil -} - -func (v *FilterTokens) StmtDefault(n *ast.StmtDefault) { - n.DefaultTkn = nil - n.CaseSeparatorTkn = nil -} - -func (v *FilterTokens) StmtBreak(n *ast.StmtBreak) { - n.BreakTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtContinue(n *ast.StmtContinue) { - n.ContinueTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtReturn(n *ast.StmtReturn) { - n.ReturnTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGlobal(n *ast.StmtGlobal) { - n.GlobalTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtStatic(n *ast.StmtStatic) { - n.StaticTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtStaticVar(n *ast.StmtStaticVar) { - n.EqualTkn = nil -} - -func (v *FilterTokens) StmtEcho(n *ast.StmtEcho) { - n.EchoTkn = nil - n.SeparatorTkns = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtInlineHtml(n *ast.StmtInlineHtml) { - n.InlineHtmlTkn = nil -} - -func (v *FilterTokens) StmtUnset(n *ast.StmtUnset) { - n.UnsetTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.SemiColonTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtForeach(n *ast.StmtForeach) { - n.ForeachTkn = nil - n.OpenParenthesisTkn = nil - n.AsTkn = nil - n.DoubleArrowTkn = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndForeachTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtDeclare(n *ast.StmtDeclare) { - n.DeclareTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.ColonTkn = nil - n.EndDeclareTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtNop(n *ast.StmtNop) { - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtTry(n *ast.StmtTry) { - n.TryTkn = nil - n.OpenCurlyBracket = nil - n.CloseCurlyBracket = nil -} - -func (v *FilterTokens) StmtCatch(n *ast.StmtCatch) { - n.CatchTkn = nil - n.OpenParenthesisTkn = nil - n.SeparatorTkns = nil - n.CloseParenthesisTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil -} - -func (v *FilterTokens) StmtFinally(n *ast.StmtFinally) { - n.FinallyTkn = nil - n.OpenCurlyBracketTkn = nil - n.CloseCurlyBracketTkn = nil -} - -func (v *FilterTokens) StmtThrow(n *ast.StmtThrow) { - n.ThrowTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtGoto(n *ast.StmtGoto) { - n.GotoTkn = nil - n.SemiColonTkn = nil -} - -func (v *FilterTokens) StmtLabel(n *ast.StmtLabel) { - n.ColonTkn = nil -} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0109652..026708e 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -550,7 +550,6 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { // name func (p *Printer) printNameNamePart(n *ast.NameNamePart) { - p.printToken(n.NsSeparatorTkn, "") p.printToken(n.StringTkn, string(n.Value)) } @@ -558,8 +557,6 @@ func (p *Printer) printNameName(n *ast.NameName) { p.printFreeFloating(n, token.Start) p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { @@ -567,8 +564,6 @@ func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { p.printToken(n.NsSeparatorTkn, "\\") p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } func (p *Printer) printNameRelative(n *ast.NameRelative) { @@ -577,8 +572,6 @@ func (p *Printer) printNameRelative(n *ast.NameRelative) { p.printToken(n.NsSeparatorTkn, "\\") p.joinPrintRefactored("\\", n.Parts) - - p.printToken(n.ListSeparatorTkn, "") } // scalar @@ -2099,7 +2092,6 @@ func (p *Printer) printStmtConstant(n *ast.StmtConstant) { p.Print(n.Name) p.printToken(n.EqualTkn, "=") p.Print(n.Expr) - p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtContinue(n *ast.StmtContinue) { @@ -2795,7 +2787,6 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.Print(n.Use) if n.Alias == nil { - p.printToken(n.CommaTkn, "") return } @@ -2804,8 +2795,6 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.bufStart = " " p.Print(n.Alias) - - p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtWhile(n *ast.StmtWhile) { From 997f7bc6e4898c9935ac9b2d0674cd029a801e34 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 22:13:12 +0200 Subject: [PATCH 101/140] refactoring: fix panic when empty return type --- internal/php5/php5.go | Bin 267837 -> 268877 bytes internal/php7/php7.go | Bin 220826 -> 221826 bytes internal/php7/php7.y | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 7f98c4875cbb683aff626e774209541b44786463..9995ca6065740c2e0b1b043341002b24b7ca03ee 100644 GIT binary patch delta 6971 zcmYkAd03Xk8pf}g`9#nxQCw2|J`hk6mr8R9y;5`E5HS}D4~h#aVvwn1YKkj?3KbKE zo?H^iEdd)nE=j1kq_`_qo?IX7MRh+Z zLRb8;j}Og!g52z(Kk`BjQGYk08qT=UI|6*;v4{2cprPQqHkDIR01CxI={?HuI8!?C&dM6eg(@q*5hjK)p zg^}KilP?Zn!g%?v0IrNjqqS}51PhK>z`9OEpFlkzsC<&~v50tdP)n@!6x82P)>Jgg zbg<@hG{VqF$tXg1msQR{F@|Diq17&@TddK?e6nggED zJJ3=s9o&KX>XFiroqCqIX|4_R3oIqA01b9B(CPy8u7<=yODQij3L930l5`)~HHMZr zv&GF8??dx+rD)&}=%SO5H8_ZVgZ`mXUJ}0_(FGw1VBRIRRP!(zq^0D;YEp4y0L?ps zqLnmNTRtsCyG`P8$E@g+#}G5ph7%}DM-Bf8C4scy9PiG}lQIe*;uP8{d;m?#WVr;e ztTH({L1M>FqunrAuH9Av0W9M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TXlsf$< z>tNdQ{v~^>(jNWIrW(WYYPP}{q8`a@s|+Ro%A;Q4$r_ewyd%NoG*O4SZW%-KS}ysx z%i)yx81#rJUza@f>(ke@?Ak8*4MO6!I<72(G4;qGNbR8o{!Ihd679-p=%NLY3Ebu9 jqPHbU*$#dAgiq3kAt^*RcLDw%WE@r) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e224ae31333e59f00639df1252ae5449931eeed9..e67e0952de7bac9570e19e3c9ccf3623a465dd66 100644 GIT binary patch delta 6819 zcmZXYdstP)7QnwX8&MPlRD2|y10pKs3k7_e@}>Bq$W%nUY9^TwC6>=jsni>WrFLx; zwd`S~89^Eom06g2Ei*G8fcjmrOf5>iSItM}omsQb%uX9?_IRpdnu3KqAj|AkOF2l}rkWJTu_0I*}jz+m+OM{xP5Z?MhOh zf6UfEXlMGm7zpDjB=HUPNrO}M{q^z&L?3M6ub&Dc`tu-vo!5})(uPEDYy?UCAB~8X zS8Qph(}Ia!5lpm%B;G%S=zX##A?j6mnl^0B5DBp|F@`2gR%cnP&_g!4` zzh1%n&gzI3L}#|px24tfS`t01rN6#Hb?;V0OGxBrT9MZAclhfgcMu&EDI27<_P?^* z?}{xS8+;f^8eESgJ)qtcMfCY7q9r8q)gGd&Jw!`LjLaV+X-Plmhy)WMO6>0sBP=D}1@9Xw9|Xq?h|4KZVrl2y5M=4h zU`mZr;hduefE|R5fD4u)@1-v0e&TrN47kVFjIYUn2|f_vlLY!pq|fqM9ySrh7%@x@QC$OAktT}hab(>Hw>z@ zhoHHyS(GT4W_yp~q0?<)eCKp1_EpJe=jc_$`hUqW`J(s(xq350Q$^w4M~K-&p?{t= zVtXDuZ3`Op7z{VWD`wb0-YwsPcsn0{F>&Jk$Kg6set{hQo>@>Fph`ztI3F%rSF`|n zTB>~t`dI3{2zn_JvfX@pIp`UfVCmUsVYH{-uZE&?g)qy~ zf+DzOY0ZnU%n%>63aW6px%vc9w z^_?JzfBgy+x*0uU=BvJ`R;p$rq!~5%H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|np4^sNT>2i)1U_$*Oxxt|I0%Hq?ndA@Hp?jO z8ufwPO9q#2QB%|Ep{)*YZ^NpjdfT0vz60f@M#s+HsRCq4Pi)aqqppf?yc)^INA6ZdM{}{(o=pXx0-kNl1VzEqBeoRhjM=|b^Zx4m9 zAH+=g@=?e>MKs9ckIC~!iG0N|lsA`SI7xlPik#1|TwcOISC79=TK`M=fa<3H`6Vu) zqVrB*8cpTLQ_q6@(?_ZL z(KY{9ISJ+G4;;<-4bPh~Q+}8K1X1V{dH3l$NJFB=C^l?+p;6uNU45KVNK;LSH*Vh z%8DtrW;ZsI0(N(2D=A=HFFSW}vNw~@k{R}Uxut>snLs<;rxeWFS;iO?M;BUj3&;2qv$Cs@?od`vvm`qgdwu0I==^MF0Q* diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 6dd4946..afa2f69 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1993,7 +1993,7 @@ type: return_type: /* empty */ { - $$ = nil + $$ = &ast.ReturnType{} } | ':' type_expr { From dfe89821212fdd82087d37bd249d131dbc3a53f5 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 22:37:06 +0200 Subject: [PATCH 102/140] refactoring: fix panic when missed arguments list --- internal/php7/php7.go | Bin 221826 -> 221842 bytes internal/php7/php7.y | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index e67e0952de7bac9570e19e3c9ccf3623a465dd66..03984ad6a16a5d97cac1d014af27d0e501edc5b7 100644 GIT binary patch delta 31 ncmZoV$~);OZ$k^?7N&LgrwceRvQBScX5wY6-M;ZY)5RtL#A^&O delta 24 gcmbPql(*?9Z$k^?7N&Lgr*GKD$hZB>eWqhg0FAE;!2kdN diff --git a/internal/php7/php7.y b/internal/php7/php7.y index afa2f69..9b99da7 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3875,7 +3875,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = nil + $$ = &ast.ArgumentList{} } | argument_list { From f6f86bf99bfcf6dfc3e4d9d179d4d44b744ce85c Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 22:38:26 +0200 Subject: [PATCH 103/140] refactoring: fix panic when missed arguments list --- internal/php5/php5.go | Bin 268877 -> 267853 bytes internal/php5/php5.y | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 9995ca6065740c2e0b1b043341002b24b7ca03ee..0ad9abe8f26346bdad8ef41905c48a44ff45fb40 100644 GIT binary patch delta 5424 zcmX|_d03Uz7RH~o_L0jVDr#sc=NuIb1#{r489AkfA$T295YZwWfYbs+)RZeZAPy-` zJ5x)WGzAi;tz9vv#3423sjS2yOD(mO)OhaN!?*u{=l8tpU2BiuKKuKQZmDy$xX!dK zaIrB@i9xS;(imL8%btLnd)>e_opZw=MIz1v{ekC4fLoM%p#>`BKFwgTrYX%JLDPLp z8KIEK^FK$As0@WXlbzojdgyF%H5^u;pqfR%Q>xG{+O>jGg&qN|AqTa(tSwAHo*B+O zqSe14#CS8>!`mA9qYhBSGrLf{xFggxS(iIOBgRv5m{&CF4E>O=8OPjWZda+oYVuaR z1aE;-`QV;ZV9$0EeS66QP4*E+$G|gGAkgI&Ik7N+%1XQuCkq4xyF8*7u1Q@6W9U@*zg2qOjIt-Y>k6wpE+Q17^VY$lUT}S9S4dGiy z$eE-{JaQxq(e$aM#-ofTmW+aFYMw)QRGK4hNQ2#46mv4*6@&NQgha;oWYL0Vyaj`p zARL2Qh|hs!gNJfqxl60>PJvgA`XCSLf>y()K?jC)HB#) zCUi8oVwT1G1<=r_k%e&FVB@(KYtDy(AgGC!z=Kv%L&XbZhQezL;SYlk7QtFt8fnoEqV?o`xCSn3A#b$~`ekTXYnp4|YWG?i|EEIAu)(XAL#Y5x%NeP2R>7Be zM?AU@em3Hny-oBO4kFq3Ax+)h`VT0?CW3c1~Y*P5940*+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z2u zq6^O83t}^XkKv@V_$;&q^u`5@#b_{2vXk(5=Vf~Z1D*d7%li}1gexXp`M14k!H4kd ztM+*Z^yC^gK8w3vH?_kx_!3kI&i%DmUgZSQ)i>}&QLliU-{n~Yw#47@JstGUEqoYy z0@}Dccp1D`pt^gwRy!Zn;Uew);XaPn&X~uzNYPjRBufE1O^Dq1A?2d_CRv^)9cyG# zLSxcHH}`c@B5z@k<(fB1(uE~8Cl@tMZAs)M9-O^eo6e(cOebq=IBA9tfxDatqptQE z*gNe>x#|y{?x!XClOI{=3^GmWK;Rk#8EQKaxIO?de*zauD5*mLaXaP0ImDm((&|70 zKi+U~v*AG`#Id;PwvGg@GeV;6f=O#y=}(%_=wK3Lx6QBM!P>(bKSziNXWpF%>`!76 zxLHhRf>l=b=JP~e3PIb}#iTP`ZMrIcvmq~<)T5h8aotUNzlTXBJ&7gWAmdrWpq#43b$xQZ)0o+g=t`i!icd7ZucR%dTxBym%jw(EwJ7Lh_NQR40jqlr8VA?NMah`d1qg^V?6={VDQe7vc7y-wuq5aOaInp$qGNmnP?S>VUD z;K{ZIG;fNjv8g6KjU)0-0?xtH?QsEmZw8T99H6S1L|!j}TFo-)^#mgCGN9!rnshIT zjD=AGEq)GJtZ4r{B2N&Ix+L2J2o#$_UR6eV^iBC@K?_?mC?_Gq|i z&qD-0fqA)Z`tc#Ttpc<@Y`})Y zmpm7_=4Kz%bG35f+^np=YoVq$JfxFxr`+~L2(4)7f{$*9U)snee>nlEv6l<3G61U$ dU{AeV@>akli?wd*dhE1gv2M*wifrM+`2QOTi17db diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 4027440..d15a4f1 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -4529,7 +4529,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = nil + $$ = &ast.ArgumentList{} } | function_call_parameter_list { From 20a42da7c9453c5e3b88b8e2151d95088c744892 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 8 Dec 2020 00:04:12 +0200 Subject: [PATCH 104/140] [refactoring] remove general Node struct --- cmd/php-parser/main.go | 14 +- internal/php5/php5.go | Bin 267853 -> 257350 bytes internal/php5/php5.y | 1942 ++++++++-------------------- internal/php7/php7.go | Bin 221842 -> 213588 bytes internal/php7/php7.y | 1405 ++++++-------------- internal/position/position.go | 4 +- internal/position/position_test.go | 298 ++--- pkg/ast/ast.go | 4 +- pkg/ast/node.go | 1207 +++++++++++++---- pkg/ast/visitor/dump.go | 230 ---- pkg/ast/visitor/dump_test.go | 6 - pkg/token/position.go | 74 -- pkg/token/position_string.go | 75 -- 13 files changed, 1932 insertions(+), 3327 deletions(-) delete mode 100644 pkg/token/position.go delete mode 100644 pkg/token/position_string.go diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 1cd927c..554dcf9 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -1,7 +1,6 @@ package main import ( - "bytes" "flag" "io" "io/ioutil" @@ -21,7 +20,6 @@ import ( "github.com/z7zmey/php-parser/pkg/ast/visitor" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/parser" - "github.com/z7zmey/php-parser/pkg/printer" ) var wg sync.WaitGroup @@ -165,12 +163,12 @@ func printerWorker(r <-chan result) { } if *printBack { - o := bytes.NewBuffer([]byte{}) - p := printer.NewPrinter(o) - p.Print(res.rootNode) - - err := ioutil.WriteFile(res.path, o.Bytes(), 0644) - checkErr(err) + //o := bytes.NewBuffer([]byte{}) + //p := printer.NewPrinter(o) + //p.Print(res.rootNode) + // + //err := ioutil.WriteFile(res.path, o.Bytes(), 0644) + //checkErr(err) } if *showResolvedNs { diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 0ad9abe8f26346bdad8ef41905c48a44ff45fb40..cf203cfb7976024ee7a247f7f0c322ab2a0ddf55 100644 GIT binary patch delta 28470 zcmd5_cXU<7_Fgk{Qwb>$5J*Tay-2x9ZW;QBUL5z&W2ga9g}P~;&ZAgHL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1rpvswdRsptX20jpDyc9 zL+R#naZ2NiE?aO)YQ)*)Q}=``NMmWldwT16daA50&^0-=SM#hiCrza%-WSi?F@e{7 z*%}F5_zDCdNQ{pf5%qNywg5*}$uWBFmg{A{Oi()vS z@^;9sPeo`AZDjO^87luK&l29Dpi!o^@8#i0#p{;%;-5>ZUpR zwR|S-G#_PX<9E*AEs=+Qx~kBp{O<^)Y5J(xS#!dpIJ*6uwNGeTgAi&09XVGmXou~s zYXQ=18u^7qRoxVm8ovllee_&4NpeN-v%d1eN6m-&(8#reuUeAD$*ZBNY0I^#%DSDJ IekW4?9|guvlmGw# diff --git a/internal/php5/php5.y b/internal/php5/php5.y index d15a4f1..95abd7e 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -266,9 +266,7 @@ start: top_statement_list { yylex.(*Parser).rootNode = &ast.Root{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1), - }, + Position: position.NewNodeListPosition($1), Stmts: $1, EndTkn: yylex.(*Parser).currentToken, } @@ -294,9 +292,7 @@ namespace_name: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, }, @@ -306,9 +302,7 @@ namespace_name: | namespace_name T_NS_SEPARATOR T_STRING { part := &ast.NameNamePart{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), StringTkn: $3, Value: $3.Value, } @@ -341,9 +335,7 @@ top_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = &ast.StmtHaltCompiler{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), HaltCompilerTkn: $1, OpenParenthesisTkn: $2, CloseParenthesisTkn: $3, @@ -353,14 +345,10 @@ top_statement: | T_NAMESPACE namespace_name ';' { $$ = &ast.StmtNamespace{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -370,14 +358,10 @@ top_statement: | T_NAMESPACE namespace_name '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $5), - }, + Position: position.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -389,9 +373,7 @@ top_statement: | T_NAMESPACE '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), NsTkn: $1, OpenCurlyBracket: $2, Stmts: $3, @@ -401,9 +383,7 @@ top_statement: | T_USE use_declarations ';' { $$ = &ast.StmtUse{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), UseTkn: $1, UseDeclarations: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -413,14 +393,10 @@ top_statement: | T_USE T_FUNCTION use_function_declarations ';' { $$ = &ast.StmtUse{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), UseTkn: $1, Type: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -432,14 +408,10 @@ top_statement: | T_USE T_CONST use_const_declarations ';' { $$ = &ast.StmtUse{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), UseTkn: $1, Type: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -451,7 +423,7 @@ top_statement: | constant_declaration ';' { $1.(*ast.StmtConstList).SemiColonTkn = $2 - $1.(*ast.StmtConstList).Node.Position = position.NewNodeTokenPosition($1, $2) + $1.(*ast.StmtConstList).Position = position.NewNodeTokenPosition($1, $2) $$ = $1 } ; @@ -476,13 +448,9 @@ use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -491,21 +459,15 @@ use_declaration: | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), - }, + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -514,14 +476,10 @@ use_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -530,22 +488,16 @@ use_declaration: | T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -573,13 +525,9 @@ use_function_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -588,21 +536,15 @@ use_function_declaration: | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), - }, + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -611,14 +553,10 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -627,22 +565,16 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -670,13 +602,9 @@ use_const_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -685,21 +613,15 @@ use_const_declaration: | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), - }, + Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -708,14 +630,10 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -724,22 +642,16 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -751,16 +663,12 @@ constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { constList := $1.(*ast.StmtConstList) - constList.Node.Position = position.NewNodesPosition($1, $5) + constList.Position = position.NewNodesPosition($1, $5) constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, + Position: position.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -773,19 +681,13 @@ constant_declaration: | T_CONST T_STRING '=' static_scalar { $$ = &ast.StmtConstList{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), ConstTkn: $1, Consts: []ast.Vertex{ &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($2, $4), - }, + Position: position.NewTokenNodePosition($2, $4), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -832,9 +734,7 @@ inner_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = &ast.StmtHaltCompiler{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), HaltCompilerTkn: $1, OpenParenthesisTkn: $2, CloseParenthesisTkn: $3, @@ -852,13 +752,9 @@ statement: | T_STRING ':' { $$ = &ast.StmtLabel{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), LabelName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -871,9 +767,7 @@ unticked_statement: '{' inner_statement_list '}' { $$ = &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenCurlyBracket: $1, Stmts: $2, CloseCurlyBracket: $3, @@ -889,9 +783,7 @@ unticked_statement: } $$ = &ast.StmtIf{ - Node: ast.Node{ - Position: pos, - }, + Position: pos, IfTkn: $1, OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, Cond: $2.(*ast.ParserBrackets).Child, @@ -904,9 +796,7 @@ unticked_statement: | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { $$ = &ast.StmtIf{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $8), - }, + Position: position.NewTokensPosition($1, $8), Alt: true, IfTkn: $1, OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, @@ -914,9 +804,7 @@ unticked_statement: CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, ColonTkn: $3, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($4), - }, + Position: position.NewNodeListPosition($4), Stmts: $4, }, ElseIf: $5, @@ -931,16 +819,14 @@ unticked_statement: $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn $3.(*ast.StmtWhile).Cond = $2.(*ast.ParserBrackets).Child $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn - $3.(*ast.StmtWhile).Node.Position = position.NewTokenNodePosition($1, $3) + $3.(*ast.StmtWhile).Position = position.NewTokenNodePosition($1, $3) $$ = $3 } | T_DO statement T_WHILE parenthesis_expr ';' { $$ = &ast.StmtDo{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $5), - }, + Position: position.NewTokensPosition($1, $5), DoTkn: $1, Stmt: $2, WhileTkn: $3, @@ -963,7 +849,7 @@ unticked_statement: $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 - $9.(*ast.StmtFor).Node.Position = position.NewTokenNodePosition($1, $9) + $9.(*ast.StmtFor).Position = position.NewTokenNodePosition($1, $9) $$ = $9 } @@ -973,16 +859,14 @@ unticked_statement: $3.(*ast.StmtSwitch).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn $3.(*ast.StmtSwitch).Cond = $2.(*ast.ParserBrackets).Child $3.(*ast.StmtSwitch).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn - $3.(*ast.StmtSwitch).Node.Position = position.NewTokenNodePosition($1, $3) + $3.(*ast.StmtSwitch).Position = position.NewTokenNodePosition($1, $3) $$ = $3 } | T_BREAK ';' { $$ = &ast.StmtBreak{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), BreakTkn: $1, SemiColonTkn: $2, } @@ -990,9 +874,7 @@ unticked_statement: | T_BREAK expr ';' { $$ = &ast.StmtBreak{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), BreakTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1001,9 +883,7 @@ unticked_statement: | T_CONTINUE ';' { $$ = &ast.StmtContinue{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), ContinueTkn: $1, SemiColonTkn: $2, } @@ -1011,9 +891,7 @@ unticked_statement: | T_CONTINUE expr ';' { $$ = &ast.StmtContinue{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), ContinueTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1022,9 +900,7 @@ unticked_statement: | T_RETURN ';' { $$ = &ast.StmtReturn{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), ReturnTkn: $1, SemiColonTkn: $2, } @@ -1032,9 +908,7 @@ unticked_statement: | T_RETURN expr_without_variable ';' { $$ = &ast.StmtReturn{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), ReturnTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1043,9 +917,7 @@ unticked_statement: | T_RETURN variable ';' { $$ = &ast.StmtReturn{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), ReturnTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1054,9 +926,7 @@ unticked_statement: | yield_expr ';' { $$ = &ast.StmtExpression{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $2), - }, + Position: position.NewNodeTokenPosition($1, $2), Expr: $1, SemiColonTkn: $2, } @@ -1066,7 +936,7 @@ unticked_statement: $2.(*ast.StmtGlobal).GlobalTkn = $1 $2.(*ast.StmtGlobal).SemiColonTkn = $3 $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) - $2.(*ast.StmtGlobal).Node.Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtGlobal).Position = position.NewTokensPosition($1, $3) $$ = $2 } @@ -1075,7 +945,7 @@ unticked_statement: $2.(*ast.StmtStatic).StaticTkn = $1 $2.(*ast.StmtStatic).SemiColonTkn = $3 $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) - $2.(*ast.StmtStatic).Node.Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtStatic).Position = position.NewTokensPosition($1, $3) $$ = $2 } @@ -1083,16 +953,14 @@ unticked_statement: { $2.(*ast.StmtEcho).EchoTkn = $1 $2.(*ast.StmtEcho).SemiColonTkn = $3 - $2.(*ast.StmtEcho).Node.Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtEcho).Position = position.NewTokensPosition($1, $3) $$ = $2 } | T_INLINE_HTML { $$ = &ast.StmtInlineHtml{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), InlineHtmlTkn: $1, Value: $1.Value, } @@ -1100,9 +968,7 @@ unticked_statement: | expr ';' { $$ = &ast.StmtExpression{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $2), - }, + Position: position.NewNodeTokenPosition($1, $2), Expr: $1, SemiColonTkn: $2, } @@ -1113,7 +979,7 @@ unticked_statement: $3.(*ast.StmtUnset).OpenParenthesisTkn = $2 $3.(*ast.StmtUnset).CloseParenthesisTkn = $4 $3.(*ast.StmtUnset).SemiColonTkn = $5 - $3.(*ast.StmtUnset).Node.Position = position.NewTokensPosition($1, $5) + $3.(*ast.StmtUnset).Position = position.NewTokensPosition($1, $5) $$ = $3 } @@ -1131,7 +997,7 @@ unticked_statement: $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) + $8.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $8) $$ = $8 } @@ -1149,7 +1015,7 @@ unticked_statement: $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Node.Position = position.NewTokenNodePosition($1, $8) + $8.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $8) $$ = $8 } @@ -1160,22 +1026,26 @@ unticked_statement: $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 - $5.(*ast.StmtDeclare).Node.Position = position.NewTokenNodePosition($1, $5) + $5.(*ast.StmtDeclare).Position = position.NewTokenNodePosition($1, $5) $$ = $5 } | ';' { $$ = &ast.StmtNop{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), SemiColonTkn: $1, } } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { + pos := position.NewTokenNodeListPosition($1, $5) + if $6 != nil { + pos = position.NewTokenNodePosition($1, $6) + } + $$ = &ast.StmtTry{ + Position: pos, TryTkn: $1, OpenCurlyBracket: $2, Stmts: $3, @@ -1183,19 +1053,11 @@ unticked_statement: Catches: $5, Finally: $6, } - - if $6 == nil { - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $5) - } else { - $$.GetNode().Position = position.NewTokenNodePosition($1, $6) - } } | T_THROW expr ';' { $$ = &ast.StmtThrow{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), ThrowTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1204,14 +1066,10 @@ unticked_statement: | T_GOTO T_STRING ';' { $$ = &ast.StmtGoto{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), GotoTkn: $1, Label: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1228,20 +1086,14 @@ catch_statement: | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { catch := &ast.StmtCatch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $8), - }, + Position: position.NewTokensPosition($1, $8), CatchTkn: $1, OpenParenthesisTkn: $2, Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1263,9 +1115,7 @@ finally_statement: | T_FINALLY '{' inner_statement_list '}' { $$ = &ast.StmtFinally{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), FinallyTkn: $1, OpenCurlyBracketTkn: $2, Stmts: $3, @@ -1300,20 +1150,14 @@ additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { $$ = &ast.StmtCatch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $8), - }, + Position: position.NewTokensPosition($1, $8), CatchTkn: $1, OpenParenthesisTkn: $2, Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1389,15 +1233,11 @@ unticked_function_declaration_statement: function is_reference T_STRING '(' parameter_list ')' '{' inner_statement_list '}' { $$ = &ast.StmtFunction{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $9), - }, + Position: position.NewTokensPosition($1, $9), FunctionTkn: $1, AmpersandTkn: $2, FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1419,9 +1259,7 @@ unticked_class_declaration_statement: case *ast.StmtClass : n.Position = position.NewNodeTokenPosition($1, $7) n.ClassName = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } @@ -1433,9 +1271,7 @@ unticked_class_declaration_statement: case *ast.StmtTrait : n.Position = position.NewNodeTokenPosition($1, $7) n.TraitName = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } @@ -1451,14 +1287,10 @@ unticked_class_declaration_statement: | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { $$ = &ast.StmtInterface{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $6), - }, + Position: position.NewTokensPosition($1, $6), InterfaceTkn: $1, InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1475,23 +1307,17 @@ class_entry_type: T_CLASS { $$ = &ast.StmtClass{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), ClassTkn: $1, } } | T_ABSTRACT T_CLASS { $$ = &ast.StmtClass{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), Modifiers: []ast.Vertex{ &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1502,23 +1328,17 @@ class_entry_type: | T_TRAIT { $$ = &ast.StmtTrait{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), TraitTkn: $1, } } | T_FINAL T_CLASS { $$ = &ast.StmtClass{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), Modifiers: []ast.Vertex{ &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1536,9 +1356,7 @@ extends_from: | T_EXTENDS fully_qualified_class_name { $$ = &ast.StmtClassExtends{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), ExtendTkn: $1, ClassName: $2, } @@ -1560,9 +1378,7 @@ interface_extends_list: | T_EXTENDS interface_list { $$ = &ast.StmtInterfaceExtends{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ExtendsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1578,9 +1394,7 @@ implements_list: | T_IMPLEMENTS interface_list { $$ = &ast.StmtClassImplements{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ImplementsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1626,9 +1440,7 @@ foreach_variable: | '&' variable { $$ = &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, } @@ -1643,9 +1455,7 @@ foreach_variable: } $$ = &ast.ExprList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -1659,24 +1469,18 @@ for_statement: statement { $$ = &ast.StmtFor{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOR ';' { $$ = &ast.StmtFor{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2), - }, + Position: position.NewNodeListPosition($2), Stmts: $2, }, EndForTkn: $3, @@ -1689,24 +1493,18 @@ foreach_statement: statement { $$ = &ast.StmtForeach{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOREACH ';' { $$ = &ast.StmtForeach{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2), - }, + Position: position.NewNodeListPosition($2), Stmts: $2, }, EndForeachTkn: $3, @@ -1720,24 +1518,18 @@ declare_statement: statement { $$ = &ast.StmtDeclare{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDDECLARE ';' { $$ = &ast.StmtDeclare{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2), - }, + Position: position.NewNodeListPosition($2), Stmts: $2, }, EndDeclareTkn: $3, @@ -1753,13 +1545,9 @@ declare_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1775,13 +1563,9 @@ declare_list: $1.(*ast.ParserSeparatedList).Items = append( $1.(*ast.ParserSeparatedList).Items, &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, + Position: position.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1799,9 +1583,7 @@ switch_case_list: '{' case_list '}' { $$ = &ast.StmtSwitch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, CaseList: $2, CloseCurlyBracketTkn: $3, @@ -1810,9 +1592,7 @@ switch_case_list: | '{' ';' case_list '}' { $$ = &ast.StmtSwitch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), OpenCurlyBracketTkn: $1, CaseSeparatorTkn: $2, CaseList: $3, @@ -1822,9 +1602,7 @@ switch_case_list: | ':' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, CaseList: $2, @@ -1835,9 +1613,7 @@ switch_case_list: | ':' ';' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $5), - }, + Position: position.NewTokensPosition($1, $5), Alt: true, ColonTkn: $1, CaseSeparatorTkn: $2, @@ -1857,9 +1633,7 @@ case_list: | case_list T_CASE expr case_separator inner_statement_list { $$ = append($1, &ast.StmtCase{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($2, $5), - }, + Position: position.NewTokenNodeListPosition($2, $5), CaseTkn: $2, Cond: $3, CaseSeparatorTkn: $4, @@ -1869,9 +1643,7 @@ case_list: | case_list T_DEFAULT case_separator inner_statement_list { $$ = append($1, &ast.StmtDefault{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($2, $4), - }, + Position: position.NewTokenNodeListPosition($2, $4), DefaultTkn: $2, CaseSeparatorTkn: $3, Stmts: $4, @@ -1896,24 +1668,18 @@ while_statement: statement { $$ = &ast.StmtWhile{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDWHILE ';' { $$ = &ast.StmtWhile{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($2), - }, + Position: position.NewNodeListPosition($2), Stmts: $2, }, EndWhileTkn: $3, @@ -1932,9 +1698,7 @@ elseif_list: | elseif_list T_ELSEIF parenthesis_expr statement { $$ = append($1, &ast.StmtElseIf{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($2, $4), - }, + Position: position.NewTokenNodePosition($2, $4), ElseIfTkn: $2, OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, Cond: $3.(*ast.ParserBrackets).Child, @@ -1953,9 +1717,7 @@ new_elseif_list: | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { $$ = append($1, &ast.StmtElseIf{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($2, $5), - }, + Position: position.NewTokenNodeListPosition($2, $5), Alt: true, ElseIfTkn: $2, OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, @@ -1963,9 +1725,7 @@ new_elseif_list: CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, ColonTkn: $4, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($5), - }, + Position: position.NewNodeListPosition($5), Stmts: $5, }, }) @@ -1981,9 +1741,7 @@ else_single: | T_ELSE statement { $$ = &ast.StmtElse{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), ElseTkn: $1, Stmt: $2, } @@ -1999,16 +1757,12 @@ new_else_single: | T_ELSE ':' inner_statement_list { $$ = &ast.StmtElse{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3), - }, + Position: position.NewTokenNodeListPosition($1, $3), Alt: true, ElseTkn: $1, ColonTkn: $2, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewNodeListPosition($3), - }, + Position: position.NewNodeListPosition($3), Stmts: $3, }, } @@ -2056,20 +1810,14 @@ parameter: } $$ = &ast.Parameter{ - Node: ast.Node{ - Position: pos, - }, + Position: pos, Type: $1, AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2088,20 +1836,14 @@ parameter: } $$ = &ast.Parameter{ - Node: ast.Node{ - Position: pos, - }, + Position: pos, Type: $1, AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2121,9 +1863,7 @@ optional_class_type: | T_ARRAY { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2131,9 +1871,7 @@ optional_class_type: | T_CALLABLE { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2149,9 +1887,7 @@ function_call_parameter_list: '(' ')' { $$ = &ast.ArgumentList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, } @@ -2168,15 +1904,11 @@ function_call_parameter_list: | '(' yield_expr ')' { $$ = &ast.ArgumentList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Arguments: []ast.Vertex{ &ast.Argument{ - Node: ast.Node{ - Position: position.NewNodePosition($2), - }, + Position: position.NewNodePosition($2), Expr: $2, }, }, @@ -2206,27 +1938,21 @@ function_call_parameter: expr_without_variable { $$ = &ast.Argument{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Expr: $1, } } | variable { $$ = &ast.Argument{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Expr: $1, } } | '&' w_variable { $$ = &ast.Argument{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Expr: $2, } @@ -2234,9 +1960,7 @@ function_call_parameter: | T_ELLIPSIS expr { $$ = &ast.Argument{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), VariadicTkn: $1, Expr: $2, } @@ -2264,13 +1988,9 @@ global_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2279,9 +1999,7 @@ global_var: | '$' r_variable { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), DollarTkn: $1, VarName: $2, } @@ -2289,14 +2007,10 @@ global_var: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -2310,17 +2024,11 @@ static_var_list: static_var_list ',' T_VARIABLE { $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2333,17 +2041,11 @@ static_var_list: | static_var_list ',' T_VARIABLE '=' static_scalar { $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, + Position: position.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2360,17 +2062,11 @@ static_var_list: $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2384,17 +2080,11 @@ static_var_list: $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2424,9 +2114,7 @@ class_statement: variable_modifiers class_variable_declaration ';' { $$ = &ast.StmtPropertyList{ - Node: ast.Node{ - Position: position.NewNodeListTokenPosition($1, $3), - }, + Position: position.NewNodeListTokenPosition($1, $3), Modifiers: $1, Properties: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -2436,7 +2124,7 @@ class_statement: | class_constant_declaration ';' { $1.(*ast.StmtClassConstList).SemiColonTkn = $2 - $1.(*ast.StmtClassConstList).Node.Position = position.NewNodeTokenPosition($1, $2) + $1.(*ast.StmtClassConstList).Position = position.NewNodeTokenPosition($1, $2) $$ = $1 } | trait_use_statement @@ -2447,20 +2135,16 @@ class_statement: { pos := position.NewTokenNodePosition($2, $8) if $1 != nil { - $$.GetNode().Position = position.NewNodeListNodePosition($1, $8) + pos = position.NewNodeListNodePosition($1, $8) } $$ = &ast.StmtClassMethod{ - Node: ast.Node{ - Position: pos, - }, + Position: pos, Modifiers: $1, FunctionTkn: $2, AmpersandTkn: $3, MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2477,9 +2161,7 @@ trait_use_statement: T_USE trait_list trait_adaptations { $$ = &ast.StmtTraitUse{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), UseTkn: $1, Traits: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -2508,18 +2190,14 @@ trait_adaptations: ';' { $$ = &ast.StmtNop{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' trait_adaptation_list '}' { $$ = &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Adaptations: $2, CloseParenthesisTkn: $3, @@ -2568,9 +2246,7 @@ trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { $$ = &ast.StmtTraitUsePrecedence{ - Node: ast.Node{ - Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Ref: $1, InsteadofTkn: $2, Insteadof: $3.(*ast.ParserSeparatedList).Items, @@ -2599,13 +2275,9 @@ trait_method_reference: T_STRING { $$ = &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), Method: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2621,15 +2293,11 @@ trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, Method: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2641,16 +2309,12 @@ trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { $$ = &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Ref: $1, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2659,9 +2323,7 @@ trait_alias: | trait_method_reference T_AS member_modifier { $$ = &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Ref: $1, AsTkn: $2, Modifier: $3, @@ -2684,18 +2346,14 @@ method_body: ';' /* abstract method */ { $$ = &ast.StmtNop{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' inner_statement_list '}' { $$ = &ast.StmtStmtList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenCurlyBracket: $1, Stmts: $2, CloseCurlyBracket: $3, @@ -2712,9 +2370,7 @@ variable_modifiers: { $$ = []ast.Vertex{ &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2748,9 +2404,7 @@ member_modifier: T_PUBLIC { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2758,9 +2412,7 @@ member_modifier: | T_PROTECTED { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2768,9 +2420,7 @@ member_modifier: | T_PRIVATE { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2778,9 +2428,7 @@ member_modifier: | T_STATIC { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2788,9 +2436,7 @@ member_modifier: | T_ABSTRACT { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2798,9 +2444,7 @@ member_modifier: | T_FINAL { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2811,17 +2455,11 @@ class_variable_declaration: class_variable_declaration ',' T_VARIABLE { item := &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2836,17 +2474,11 @@ class_variable_declaration: | class_variable_declaration ',' T_VARIABLE '=' static_scalar { item := &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, + Position: position.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2865,17 +2497,11 @@ class_variable_declaration: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2890,17 +2516,11 @@ class_variable_declaration: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2917,16 +2537,12 @@ class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { constList := $1.(*ast.StmtClassConstList) - constList.Node.Position = position.NewNodesPosition($1, $5) + constList.Position = position.NewNodesPosition($1, $5) constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $5), - }, + Position: position.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2939,19 +2555,13 @@ class_constant_declaration: | T_CONST T_STRING '=' static_scalar { $$ = &ast.StmtClassConstList{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), ConstTkn: $1, Consts: []ast.Vertex{ &ast.StmtConstant{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($2, $4), - }, + Position: position.NewTokenNodePosition($2, $4), Name: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -3022,9 +2632,7 @@ chaining_dereference: chaining_dereference '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -3036,9 +2644,7 @@ chaining_dereference: | '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), Var: nil, OpenBracketTkn: $1, Dim: $2, @@ -3080,9 +2686,7 @@ new_expr: { if $3 != nil { $$ = &ast.ExprNew{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, @@ -3092,9 +2696,7 @@ new_expr: } } else { $$ = &ast.ExprNew{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), Class: $2, } } @@ -3105,13 +2707,9 @@ expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { $$ = &ast.ExprAssign{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $6), - }, + Position: position.NewTokenNodePosition($1, $6), Var: &ast.ExprList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -3125,9 +2723,7 @@ expr_without_variable: | variable '=' expr { $$ = &ast.ExprAssign{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3136,9 +2732,7 @@ expr_without_variable: | variable '=' '&' variable { $$ = &ast.ExprAssignReference{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Var: $1, EqualTkn: $2, AmpersandTkn: $3, @@ -3150,9 +2744,7 @@ expr_without_variable: var _new *ast.ExprNew if $3 != nil { _new = &ast.ExprNew{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($4, $6), - }, + Position: position.NewTokenNodePosition($4, $6), NewTkn: $4, Class: $5, OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, @@ -3162,18 +2754,14 @@ expr_without_variable: } } else { _new = &ast.ExprNew{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($4, $5), - }, + Position: position.NewTokenNodePosition($4, $5), NewTkn: $4, Class: $5, } } $$ = &ast.ExprAssignReference{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, _new), - }, + Position: position.NewNodesPosition($1, _new), Var: $1, EqualTkn: $2, AmpersandTkn: $3, @@ -3183,9 +2771,7 @@ expr_without_variable: | T_CLONE expr { $$ = &ast.ExprClone{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CloneTkn: $1, Expr: $2, } @@ -3193,9 +2779,7 @@ expr_without_variable: | variable T_PLUS_EQUAL expr { $$ = &ast.ExprAssignPlus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3204,9 +2788,7 @@ expr_without_variable: | variable T_MINUS_EQUAL expr { $$ = &ast.ExprAssignMinus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3215,9 +2797,7 @@ expr_without_variable: | variable T_MUL_EQUAL expr { $$ = &ast.ExprAssignMul{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3226,9 +2806,7 @@ expr_without_variable: | variable T_POW_EQUAL expr { $$ = &ast.ExprAssignPow{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3237,9 +2815,7 @@ expr_without_variable: | variable T_DIV_EQUAL expr { $$ = &ast.ExprAssignDiv{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3248,9 +2824,7 @@ expr_without_variable: | variable T_CONCAT_EQUAL expr { $$ = &ast.ExprAssignConcat{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3259,9 +2833,7 @@ expr_without_variable: | variable T_MOD_EQUAL expr { $$ = &ast.ExprAssignMod{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3270,9 +2842,7 @@ expr_without_variable: | variable T_AND_EQUAL expr { $$ = &ast.ExprAssignBitwiseAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3281,9 +2851,7 @@ expr_without_variable: | variable T_OR_EQUAL expr { $$ = &ast.ExprAssignBitwiseOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3292,9 +2860,7 @@ expr_without_variable: | variable T_XOR_EQUAL expr { $$ = &ast.ExprAssignBitwiseXor{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3303,9 +2869,7 @@ expr_without_variable: | variable T_SL_EQUAL expr { $$ = &ast.ExprAssignShiftLeft{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3314,9 +2878,7 @@ expr_without_variable: | variable T_SR_EQUAL expr { $$ = &ast.ExprAssignShiftRight{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -3325,9 +2887,7 @@ expr_without_variable: | rw_variable T_INC { $$ = &ast.ExprPostInc{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $2), - }, + Position: position.NewNodeTokenPosition($1, $2), Var: $1, IncTkn: $2, } @@ -3335,9 +2895,7 @@ expr_without_variable: | T_INC rw_variable { $$ = &ast.ExprPreInc{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), IncTkn: $1, Var: $2, } @@ -3345,9 +2903,7 @@ expr_without_variable: | rw_variable T_DEC { $$ = &ast.ExprPostDec{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $2), - }, + Position: position.NewNodeTokenPosition($1, $2), Var: $1, DecTkn: $2, } @@ -3355,9 +2911,7 @@ expr_without_variable: | T_DEC rw_variable { $$ = &ast.ExprPreDec{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), DecTkn: $1, Var: $2, } @@ -3365,9 +2919,7 @@ expr_without_variable: | expr T_BOOLEAN_OR expr { $$ = &ast.ExprBinaryBooleanOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3376,9 +2928,7 @@ expr_without_variable: | expr T_BOOLEAN_AND expr { $$ = &ast.ExprBinaryBooleanAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3387,9 +2937,7 @@ expr_without_variable: | expr T_LOGICAL_OR expr { $$ = &ast.ExprBinaryLogicalOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3398,9 +2946,7 @@ expr_without_variable: | expr T_LOGICAL_AND expr { $$ = &ast.ExprBinaryLogicalAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3409,9 +2955,7 @@ expr_without_variable: | expr T_LOGICAL_XOR expr { $$ = &ast.ExprBinaryLogicalXor{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3420,9 +2964,7 @@ expr_without_variable: | expr '|' expr { $$ = &ast.ExprBinaryBitwiseOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3431,9 +2973,7 @@ expr_without_variable: | expr '&' expr { $$ = &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3442,9 +2982,7 @@ expr_without_variable: | expr '^' expr { $$ = &ast.ExprBinaryBitwiseXor{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3453,9 +2991,7 @@ expr_without_variable: | expr '.' expr { $$ = &ast.ExprBinaryConcat{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3464,9 +3000,7 @@ expr_without_variable: | expr '+' expr { $$ = &ast.ExprBinaryPlus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3475,9 +3009,7 @@ expr_without_variable: | expr '-' expr { $$ = &ast.ExprBinaryMinus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3486,9 +3018,7 @@ expr_without_variable: | expr '*' expr { $$ = &ast.ExprBinaryMul{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3497,9 +3027,7 @@ expr_without_variable: | expr T_POW expr { $$ = &ast.ExprBinaryPow{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3508,9 +3036,7 @@ expr_without_variable: | expr '/' expr { $$ = &ast.ExprBinaryDiv{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3519,9 +3045,7 @@ expr_without_variable: | expr '%' expr { $$ = &ast.ExprBinaryMod{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3530,9 +3054,7 @@ expr_without_variable: | expr T_SL expr { $$ = &ast.ExprBinaryShiftLeft{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3541,9 +3063,7 @@ expr_without_variable: | expr T_SR expr { $$ = &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3552,9 +3072,7 @@ expr_without_variable: | '+' expr %prec T_INC { $$ = &ast.ExprUnaryPlus{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), PlusTkn: $1, Expr: $2, } @@ -3562,9 +3080,7 @@ expr_without_variable: | '-' expr %prec T_INC { $$ = &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), MinusTkn: $1, Expr: $2, } @@ -3572,9 +3088,7 @@ expr_without_variable: | '!' expr { $$ = &ast.ExprBooleanNot{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), ExclamationTkn: $1, Expr: $2, } @@ -3582,9 +3096,7 @@ expr_without_variable: | '~' expr { $$ = &ast.ExprBitwiseNot{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), TildaTkn: $1, Expr: $2, } @@ -3592,9 +3104,7 @@ expr_without_variable: | expr T_IS_IDENTICAL expr { $$ = &ast.ExprBinaryIdentical{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3603,9 +3113,7 @@ expr_without_variable: | expr T_IS_NOT_IDENTICAL expr { $$ = &ast.ExprBinaryNotIdentical{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3614,9 +3122,7 @@ expr_without_variable: | expr T_IS_EQUAL expr { $$ = &ast.ExprBinaryEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3625,9 +3131,7 @@ expr_without_variable: | expr T_IS_NOT_EQUAL expr { $$ = &ast.ExprBinaryNotEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3636,9 +3140,7 @@ expr_without_variable: | expr '<' expr { $$ = &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3647,9 +3149,7 @@ expr_without_variable: | expr T_IS_SMALLER_OR_EQUAL expr { $$ = &ast.ExprBinarySmallerOrEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3658,9 +3158,7 @@ expr_without_variable: | expr '>' expr { $$ = &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3669,9 +3167,7 @@ expr_without_variable: | expr T_IS_GREATER_OR_EQUAL expr { $$ = &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3680,9 +3176,7 @@ expr_without_variable: | expr T_INSTANCEOF class_name_reference { $$ = &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Expr: $1, InstanceOfTkn: $2, Class: $3, @@ -3699,9 +3193,7 @@ expr_without_variable: | '(' new_expr ')' instance_call { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3711,22 +3203,22 @@ expr_without_variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn } } @@ -3734,9 +3226,7 @@ expr_without_variable: | expr '?' expr ':' expr { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $5), - }, + Position: position.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -3747,9 +3237,7 @@ expr_without_variable: | expr '?' ':' expr { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -3763,9 +3251,7 @@ expr_without_variable: | T_INT_CAST expr { $$ = &ast.ExprCastInt{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3773,9 +3259,7 @@ expr_without_variable: | T_DOUBLE_CAST expr { $$ = &ast.ExprCastDouble{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3783,9 +3267,7 @@ expr_without_variable: | T_STRING_CAST expr { $$ = &ast.ExprCastString{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3793,9 +3275,7 @@ expr_without_variable: | T_ARRAY_CAST expr { $$ = &ast.ExprCastArray{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3803,9 +3283,7 @@ expr_without_variable: | T_OBJECT_CAST expr { $$ = &ast.ExprCastObject{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3813,9 +3291,7 @@ expr_without_variable: | T_BOOL_CAST expr { $$ = &ast.ExprCastBool{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3823,9 +3299,7 @@ expr_without_variable: | T_UNSET_CAST expr { $$ = &ast.ExprCastUnset{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3837,9 +3311,9 @@ expr_without_variable: } if $2 == nil { - exit.Node.Position = position.NewTokenPosition($1) + exit.Position = position.NewTokenPosition($1) } else { - exit.Node.Position = position.NewTokenNodePosition($1, $2) + exit.Position = position.NewTokenNodePosition($1, $2) exit.OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn exit.Expr = $2.(*ast.ParserBrackets).Child exit.CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn @@ -3850,9 +3324,7 @@ expr_without_variable: | '@' expr { $$ = &ast.ExprErrorSuppress{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AtTkn: $1, Expr: $2, } @@ -3872,9 +3344,7 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = &ast.ExprShellExec{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBacktickTkn: $1, Parts: $2, CloseBacktickTkn: $3, @@ -3883,9 +3353,7 @@ expr_without_variable: | T_PRINT expr { $$ = &ast.ExprPrint{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), PrintTkn: $1, Expr: $2, } @@ -3893,18 +3361,14 @@ expr_without_variable: | T_YIELD { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), YieldTkn: $1, } } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $9), - }, + Position: position.NewTokensPosition($1, $9), FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, @@ -3920,9 +3384,7 @@ expr_without_variable: | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $10), - }, + Position: position.NewTokensPosition($1, $10), StaticTkn: $1, FunctionTkn: $2, AmpersandTkn: $3, @@ -3942,9 +3404,7 @@ yield_expr: T_YIELD expr_without_variable { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3952,9 +3412,7 @@ yield_expr: | T_YIELD variable { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3962,9 +3420,7 @@ yield_expr: | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3974,9 +3430,7 @@ yield_expr: | T_YIELD expr T_DOUBLE_ARROW variable { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3989,9 +3443,7 @@ combined_scalar_offset: combined_scalar '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4001,9 +3453,7 @@ combined_scalar_offset: | combined_scalar_offset '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4013,13 +3463,9 @@ combined_scalar_offset: | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Var: &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, }, @@ -4031,9 +3477,7 @@ combined_scalar_offset: | general_constant '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4046,9 +3490,7 @@ combined_scalar: T_ARRAY '(' array_pair_list ')' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -4059,9 +3501,7 @@ combined_scalar: | '[' array_pair_list ']' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4085,9 +3525,7 @@ lexical_vars: | T_USE '(' lexical_var_list ')' { $$ = &ast.ExprClosureUse{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), UseTkn: $1, OpenParenthesisTkn: $2, Uses: $3.(*ast.ParserSeparatedList).Items, @@ -4101,13 +3539,9 @@ lexical_var_list: lexical_var_list ',' T_VARIABLE { variable := &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4121,18 +3555,12 @@ lexical_var_list: | lexical_var_list ',' '&' T_VARIABLE { reference := &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $4), - }, + Position: position.NewTokensPosition($3, $4), AmpersandTkn: $3, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, + Position: position.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -4149,13 +3577,9 @@ lexical_var_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4168,18 +3592,12 @@ lexical_var_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), AmpersandTkn: $1, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -4194,13 +3612,9 @@ function_call: namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), - }, + Position: position.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), Function: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -4213,13 +3627,9 @@ function_call: | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), Function: &ast.NameRelative{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4234,13 +3644,9 @@ function_call: | T_NS_SEPARATOR namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $3), - }, + Position: position.NewTokenNodePosition($1, $3), Function: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4254,9 +3660,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -4269,9 +3673,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -4284,9 +3686,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -4299,9 +3699,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -4314,9 +3712,7 @@ function_call: | variable_without_objects function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $2), - }, + Position: position.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -4330,9 +3726,7 @@ class_name: T_STATIC { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -4340,9 +3734,7 @@ class_name: | namespace_name { $$ = &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } @@ -4350,9 +3742,7 @@ class_name: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4362,9 +3752,7 @@ class_name: | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4376,9 +3764,7 @@ fully_qualified_class_name: namespace_name { $$ = &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } @@ -4386,9 +3772,7 @@ fully_qualified_class_name: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4398,9 +3782,7 @@ fully_qualified_class_name: | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4430,12 +3812,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - $$.GetNode().Position = position.NewNodesPosition($$, nn) + *$$.GetPosition() = *position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - $$.GetNode().Position = position.NewNodesPosition($$, nn) + *$$.GetPosition() = *position.NewNodesPosition($$, nn) $$ = nn } } @@ -4444,12 +3826,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - $$.GetNode().Position = position.NewNodesPosition($$, nn) + *$$.GetPosition() = *position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - $$.GetNode().Position = position.NewNodesPosition($$, nn) + *$$.GetPosition() = *position.NewNodesPosition($$, nn) $$ = nn } } @@ -4490,9 +3872,7 @@ exit_expr: | '(' ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), OpenBracketTkn: $1, CloseBracketTkn: $2, } @@ -4512,9 +3892,7 @@ backticks_expr: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -4541,9 +3919,7 @@ common_scalar: T_LNUMBER { $$ = &ast.ScalarLnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -4551,9 +3927,7 @@ common_scalar: | T_DNUMBER { $$ = &ast.ScalarDnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -4561,9 +3935,7 @@ common_scalar: | T_CONSTANT_ENCAPSED_STRING { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -4571,9 +3943,7 @@ common_scalar: | T_LINE { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4581,9 +3951,7 @@ common_scalar: | T_FILE { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4591,9 +3959,7 @@ common_scalar: | T_DIR { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4601,9 +3967,7 @@ common_scalar: | T_TRAIT_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4611,9 +3975,7 @@ common_scalar: | T_METHOD_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4621,9 +3983,7 @@ common_scalar: | T_FUNC_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4631,9 +3991,7 @@ common_scalar: | T_NS_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4641,15 +3999,11 @@ common_scalar: | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -4660,9 +4014,7 @@ common_scalar: | T_START_HEREDOC T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), OpenHeredocTkn: $1, CloseHeredocTkn: $2, } @@ -4673,15 +4025,11 @@ static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4708,13 +4056,9 @@ static_scalar_value: | namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Const: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -4723,13 +4067,9 @@ static_scalar_value: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Const: &ast.NameRelative{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4740,13 +4080,9 @@ static_scalar_value: | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4756,9 +4092,7 @@ static_scalar_value: | T_ARRAY '(' static_array_pair_list ')' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -4769,9 +4103,7 @@ static_scalar_value: | '[' static_array_pair_list ']' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4785,9 +4117,7 @@ static_scalar_value: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4802,9 +4132,7 @@ static_operation: static_scalar_value '[' static_scalar_value ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4814,9 +4142,7 @@ static_operation: | static_scalar_value '+' static_scalar_value { $$ = &ast.ExprBinaryPlus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4825,9 +4151,7 @@ static_operation: | static_scalar_value '-' static_scalar_value { $$ = &ast.ExprBinaryMinus{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4836,9 +4160,7 @@ static_operation: | static_scalar_value '*' static_scalar_value { $$ = &ast.ExprBinaryMul{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4847,9 +4169,7 @@ static_operation: | static_scalar_value T_POW static_scalar_value { $$ = &ast.ExprBinaryPow{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4858,9 +4178,7 @@ static_operation: | static_scalar_value '/' static_scalar_value { $$ = &ast.ExprBinaryDiv{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4869,9 +4187,7 @@ static_operation: | static_scalar_value '%' static_scalar_value { $$ = &ast.ExprBinaryMod{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4880,9 +4196,7 @@ static_operation: | '!' static_scalar_value { $$ = &ast.ExprBooleanNot{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), ExclamationTkn: $1, Expr: $2, } @@ -4890,9 +4204,7 @@ static_operation: | '~' static_scalar_value { $$ = &ast.ExprBitwiseNot{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), TildaTkn: $1, Expr: $2, } @@ -4900,9 +4212,7 @@ static_operation: | static_scalar_value '|' static_scalar_value { $$ = &ast.ExprBinaryBitwiseOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4911,9 +4221,7 @@ static_operation: | static_scalar_value '&' static_scalar_value { $$ = &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4922,9 +4230,7 @@ static_operation: | static_scalar_value '^' static_scalar_value { $$ = &ast.ExprBinaryBitwiseXor{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4933,9 +4239,7 @@ static_operation: | static_scalar_value T_SL static_scalar_value { $$ = &ast.ExprBinaryShiftLeft{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4944,9 +4248,7 @@ static_operation: | static_scalar_value T_SR static_scalar_value { $$ = &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4955,9 +4257,7 @@ static_operation: | static_scalar_value '.' static_scalar_value { $$ = &ast.ExprBinaryConcat{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4966,9 +4266,7 @@ static_operation: | static_scalar_value T_LOGICAL_XOR static_scalar_value { $$ = &ast.ExprBinaryLogicalXor{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4977,9 +4275,7 @@ static_operation: | static_scalar_value T_LOGICAL_AND static_scalar_value { $$ = &ast.ExprBinaryLogicalAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4988,9 +4284,7 @@ static_operation: | static_scalar_value T_LOGICAL_OR static_scalar_value { $$ = &ast.ExprBinaryLogicalOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4999,9 +4293,7 @@ static_operation: | static_scalar_value T_BOOLEAN_AND static_scalar_value { $$ = &ast.ExprBinaryBooleanAnd{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5010,9 +4302,7 @@ static_operation: | static_scalar_value T_BOOLEAN_OR static_scalar_value { $$ = &ast.ExprBinaryBooleanOr{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5021,9 +4311,7 @@ static_operation: | static_scalar_value T_IS_IDENTICAL static_scalar_value { $$ = &ast.ExprBinaryIdentical{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5032,9 +4320,7 @@ static_operation: | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { $$ = &ast.ExprBinaryNotIdentical{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5043,9 +4329,7 @@ static_operation: | static_scalar_value T_IS_EQUAL static_scalar_value { $$ = &ast.ExprBinaryEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5054,9 +4338,7 @@ static_operation: | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { $$ = &ast.ExprBinaryNotEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5065,9 +4347,7 @@ static_operation: | static_scalar_value '<' static_scalar_value { $$ = &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5076,9 +4356,7 @@ static_operation: | static_scalar_value '>' static_scalar_value { $$ = &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5087,9 +4365,7 @@ static_operation: | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { $$ = &ast.ExprBinarySmallerOrEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5098,9 +4374,7 @@ static_operation: | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { $$ = &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -5109,9 +4383,7 @@ static_operation: | static_scalar_value '?' ':' static_scalar_value { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -5121,9 +4393,7 @@ static_operation: | static_scalar_value '?' static_scalar_value ':' static_scalar_value { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $5), - }, + Position: position.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -5134,9 +4404,7 @@ static_operation: | '+' static_scalar_value { $$ = &ast.ExprUnaryPlus{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), PlusTkn: $1, Expr: $2, } @@ -5144,9 +4412,7 @@ static_operation: | '-' static_scalar_value { $$ = &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), MinusTkn: $1, Expr: $2, } @@ -5154,9 +4420,7 @@ static_operation: | '(' static_scalar_value ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5172,13 +4436,9 @@ general_constant: | namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Const: &ast.NameName{ - Node: ast.Node{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -5187,13 +4447,9 @@ general_constant: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Const: &ast.NameRelative{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -5204,13 +4460,9 @@ general_constant: | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - }, + Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -5223,13 +4475,9 @@ scalar: T_STRING_VARNAME { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -5250,9 +4498,7 @@ scalar: | '"' encaps_list '"' { $$ = &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, CloseQoteTkn: $1, @@ -5261,9 +4507,7 @@ scalar: | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: $2, CloseHeredocTkn: $3, @@ -5272,9 +4516,7 @@ scalar: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -5312,9 +4554,7 @@ non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($3, $5), - }, + Position: position.NewNodesPosition($3, $5), Key: $3, DoubleArrowTkn: $4, Val: $5, @@ -5328,9 +4568,7 @@ non_empty_static_array_pair_list: | non_empty_static_array_pair_list ',' static_scalar_value { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($3), - }, + Position: position.NewNodePosition($3), Val: $3, } @@ -5344,9 +4582,7 @@ non_empty_static_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -5359,9 +4595,7 @@ non_empty_static_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Val: $1, }, }, @@ -5384,9 +4618,7 @@ parenthesis_expr: '(' expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5395,9 +4627,7 @@ parenthesis_expr: | '(' yield_expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5441,9 +4671,7 @@ variable: case *ast.ExprArrayDimFetch: mc := $4[0].(*ast.ExprMethodCall) $3 = append($3, &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodePosition(mc), - }, + Position: position.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, SeparatorTkns: mc.SeparatorTkns, @@ -5462,22 +4690,22 @@ variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn } } @@ -5486,22 +4714,22 @@ variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Node.Position = position.NewNodesPosition($$, nn) + nn.Position = position.NewNodesPosition($$, nn) $$ = nn } } @@ -5535,9 +4763,7 @@ variable_property: case *ast.ExprArrayDimFetch: mc := $3[0].(*ast.ExprMethodCall) $2 = append($2, &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodePosition(mc), - }, + Position: position.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, SeparatorTkns: mc.SeparatorTkns, @@ -5560,9 +4786,7 @@ array_method_dereference: array_method_dereference '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5574,9 +4798,7 @@ array_method_dereference: | method '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5591,9 +4813,7 @@ method: function_call_parameter_list { $$ = &ast.ExprMethodCall{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $1.(*ast.ArgumentList).Arguments, SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns, @@ -5626,7 +4846,7 @@ variable_without_objects: { for i := len($1)-1; i>=0; i-- { $1[i].(*ast.ExprVariable).VarName = $2 - $1[i].(*ast.ExprVariable).Node.Position = position.NewNodesPosition($1[i], $2) + $1[i].(*ast.ExprVariable).Position = position.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -5638,9 +4858,7 @@ static_member: class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -5649,9 +4867,7 @@ static_member: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -5670,9 +4886,7 @@ array_function_dereference: array_function_dereference '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -5682,9 +4896,7 @@ array_function_dereference: | function_call '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -5718,7 +4930,7 @@ base_variable: { for i := len($1)-1; i>=0; i-- { $1[i].(*ast.ExprVariable).VarName = $2 - $1[i].(*ast.ExprVariable).Node.Position = position.NewNodesPosition($1[i], $2) + $1[i].(*ast.ExprVariable).Position = position.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -5734,9 +4946,7 @@ reference_variable: reference_variable '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -5746,9 +4956,7 @@ reference_variable: | reference_variable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -5766,13 +4974,9 @@ compound_variable: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -5781,14 +4985,10 @@ compound_variable: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -5818,9 +5018,7 @@ object_property: { $$ = []ast.Vertex{ &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Property: $1, }, } @@ -5831,9 +5029,7 @@ object_dim_list: object_dim_list '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5845,9 +5041,7 @@ object_dim_list: | object_dim_list '{' expr '}' { fetch := &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5860,9 +5054,7 @@ object_dim_list: { $$ = []ast.Vertex{ &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Property: $1, }, } @@ -5873,9 +5065,7 @@ variable_name: T_STRING { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -5883,9 +5073,7 @@ variable_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5898,9 +5086,7 @@ simple_indirect_reference: { $$ = []ast.Vertex{ &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), DollarTkn: $1, }, } @@ -5908,9 +5094,7 @@ simple_indirect_reference: | simple_indirect_reference '$' { $$ = append($1, &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), DollarTkn: $2, }) } @@ -5937,9 +5121,7 @@ assignment_list_element: variable { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Val: $1, } } @@ -5953,13 +5135,9 @@ assignment_list_element: } $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Val: &ast.ExprList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -5995,9 +5173,7 @@ non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($3, $5), - }, + Position: position.NewNodesPosition($3, $5), Key: $3, DoubleArrowTkn: $4, Val: $5, @@ -6011,9 +5187,7 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' expr { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($3), - }, + Position: position.NewNodePosition($3), Val: $3, } @@ -6027,9 +5201,7 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -6042,9 +5214,7 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Val: $1, }, }, @@ -6053,15 +5223,11 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($3, $6), - }, + Position: position.NewNodesPosition($3, $6), Key: $3, DoubleArrowTkn: $4, Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($5, $6), - }, + Position: position.NewTokenNodePosition($5, $6), AmpersandTkn: $5, Var: $6, }, @@ -6075,13 +5241,9 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $4), - }, + Position: position.NewTokenNodePosition($3, $4), Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $4), - }, + Position: position.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -6097,15 +5259,11 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $4), - }, + Position: position.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -6118,13 +5276,9 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, }, @@ -6144,9 +5298,7 @@ encaps_list: $$ = append( $1, &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -6160,9 +5312,7 @@ encaps_list: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -6175,13 +5325,9 @@ encaps_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -6190,17 +5336,11 @@ encaps_var: | T_VARIABLE '[' encaps_var_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -6213,26 +5353,18 @@ encaps_var: | T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, Property: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -6241,14 +5373,10 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewNodePosition($2), - }, + Position: position.NewNodePosition($2), VarName: $2, }, CloseBracketTkn: $3, @@ -6257,18 +5385,12 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -6279,22 +5401,14 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $6), - }, + Position: position.NewTokensPosition($1, $6), OpenBracketTkn: $1, Child: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $5), - }, + Position: position.NewTokensPosition($2, $5), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -6309,9 +5423,7 @@ encaps_var: | T_CURLY_OPEN variable '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -6323,9 +5435,7 @@ encaps_var_offset: T_STRING { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -6335,17 +5445,13 @@ encaps_var_offset: // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { $$ = &ast.ScalarLnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } } else { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -6354,13 +5460,9 @@ encaps_var_offset: | T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -6372,9 +5474,7 @@ internal_functions_in_yacc: T_ISSET '(' isset_variables ')' { $$ = &ast.ExprIsset{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), IssetTkn: $1, OpenParenthesisTkn: $2, Vars: $3.(*ast.ParserSeparatedList).Items, @@ -6385,9 +5485,7 @@ internal_functions_in_yacc: | T_EMPTY '(' variable ')' { $$ = &ast.ExprEmpty{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -6397,9 +5495,7 @@ internal_functions_in_yacc: | T_EMPTY '(' expr ')' { $$ = &ast.ExprEmpty{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -6409,9 +5505,7 @@ internal_functions_in_yacc: | T_INCLUDE expr { $$ = &ast.ExprInclude{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -6419,9 +5513,7 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -6429,9 +5521,7 @@ internal_functions_in_yacc: | T_EVAL '(' expr ')' { $$ = &ast.ExprEval{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), EvalTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -6441,9 +5531,7 @@ internal_functions_in_yacc: | T_REQUIRE expr { $$ = &ast.ExprRequire{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), RequireTkn: $1, Expr: $2, } @@ -6451,9 +5539,7 @@ internal_functions_in_yacc: | T_REQUIRE_ONCE expr { $$ = &ast.ExprRequireOnce{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), RequireOnceTkn: $1, Expr: $2, } @@ -6491,15 +5577,11 @@ class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -6508,15 +5590,11 @@ class_constant: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -6528,15 +5606,11 @@ static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -6548,15 +5622,11 @@ class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 03984ad6a16a5d97cac1d014af27d0e501edc5b7..d8af320f3eb8cfe29869d82366f872690453138f 100644 GIT binary patch delta 18369 zcmcIs30#%cw*T$D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z7XW-SI+$*Rv|D%?BocYC1Ud4Vu7CaS=#buRVBIE%DZ6;GmO*2%WHtvi;v%e*Nx0|Awqg-VDL@Ql zr#DVK^`W;T6@Vsq{OAQA0PhXGDZahZzrk>rmU#P($WdYfuCGma(Bfl2Y>U<)tnloh zjKSkaEx)y>gHnWFT9SDSH`LY*rYt2vPL>fkr+9GjCDa(b26)^hC;rh8)~Lp$+(1`LAX z`_lZ&2yNWz0QqJ`eA7?URBatRHmH7U2|`?H5g zDXsIROCXtTsQNItSY%OdR#FkVd~Q)pUN}na)rG{P7eDOI8+22+rjr4@*@{t{?OOz_}$=@kS3dks=cL zdHHj4-DBgLdG496JS{*qc~$y-y3*E+FIU?M^j90czA`xjABs(qox(EjG`*R3A@I6> z5Dm%NoAspXqrmiJ1af#HAdW+QlnvS|(r9|PuVRAf8Mh_h^;Mn*&IWHkMl|)N?fn$f v&unNsx9YDvC-N' expr { $$ = &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3346,9 +2936,7 @@ expr_without_variable: | expr T_IS_GREATER_OR_EQUAL expr { $$ = &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3357,9 +2945,7 @@ expr_without_variable: | expr T_SPACESHIP expr { $$ = &ast.ExprBinarySpaceship{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3368,9 +2954,7 @@ expr_without_variable: | expr T_INSTANCEOF class_name_reference { $$ = &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Expr: $1, InstanceOfTkn: $2, Class: $3, @@ -3379,9 +2963,7 @@ expr_without_variable: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3394,9 +2976,7 @@ expr_without_variable: | expr '?' expr ':' expr { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $5), - }, + Position: position.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -3407,9 +2987,7 @@ expr_without_variable: | expr '?' ':' expr { $$ = &ast.ExprTernary{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -3419,9 +2997,7 @@ expr_without_variable: | expr T_COALESCE expr { $$ = &ast.ExprBinaryCoalesce{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3434,9 +3010,7 @@ expr_without_variable: | T_INT_CAST expr { $$ = &ast.ExprCastInt{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3444,9 +3018,7 @@ expr_without_variable: | T_DOUBLE_CAST expr { $$ = &ast.ExprCastDouble{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3454,9 +3026,7 @@ expr_without_variable: | T_STRING_CAST expr { $$ = &ast.ExprCastString{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3464,9 +3034,7 @@ expr_without_variable: | T_ARRAY_CAST expr { $$ = &ast.ExprCastArray{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3474,9 +3042,7 @@ expr_without_variable: | T_OBJECT_CAST expr { $$ = &ast.ExprCastObject{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3484,9 +3050,7 @@ expr_without_variable: | T_BOOL_CAST expr { $$ = &ast.ExprCastBool{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3494,9 +3058,7 @@ expr_without_variable: | T_UNSET_CAST expr { $$ = &ast.ExprCastUnset{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3508,9 +3070,9 @@ expr_without_variable: } if $2 == nil { - exit.Node.Position = position.NewTokenPosition($1) + exit.Position = position.NewTokenPosition($1) } else { - exit.Node.Position = position.NewTokenNodePosition($1, $2) + exit.Position = position.NewTokenNodePosition($1, $2) exit.OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn exit.Expr = $2.(*ast.ParserBrackets).Child exit.CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn @@ -3521,9 +3083,7 @@ expr_without_variable: | '@' expr { $$ = &ast.ExprErrorSuppress{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AtTkn: $1, Expr: $2, } @@ -3535,9 +3095,7 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = &ast.ExprShellExec{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBacktickTkn: $1, Parts: $2, CloseBacktickTkn: $3, @@ -3546,9 +3104,7 @@ expr_without_variable: | T_PRINT expr { $$ = &ast.ExprPrint{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), PrintTkn: $1, Expr: $2, } @@ -3556,18 +3112,14 @@ expr_without_variable: | T_YIELD { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), YieldTkn: $1, } } | T_YIELD expr { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3575,9 +3127,7 @@ expr_without_variable: | T_YIELD expr T_DOUBLE_ARROW expr { $$ = &ast.ExprYield{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $4), - }, + Position: position.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3587,9 +3137,7 @@ expr_without_variable: | T_YIELD_FROM expr { $$ = &ast.ExprYieldFrom{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), YieldFromTkn: $1, Expr: $2, } @@ -3617,9 +3165,7 @@ inline_function: T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $11), - }, + Position: position.NewTokensPosition($1, $11), FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $4, @@ -3637,9 +3183,7 @@ inline_function: | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr { $$ = &ast.ExprArrowFunction{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $9), - }, + Position: position.NewTokenNodePosition($1, $9), FnTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, @@ -3677,9 +3221,7 @@ lexical_vars: | T_USE '(' lexical_var_list ')' { $$ = &ast.ExprClosureUse{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), UseTkn: $1, OpenParenthesisTkn: $2, Uses: $3.(*ast.ParserSeparatedList).Items, @@ -3709,13 +3251,9 @@ lexical_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -3724,18 +3262,12 @@ lexical_var: | '&' T_VARIABLE { $$ = &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), AmpersandTkn: $1, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -3748,9 +3280,7 @@ function_call: name argument_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $2), - }, + Position: position.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -3761,9 +3291,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3776,9 +3304,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { $$ = &ast.ExprStaticCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3791,9 +3317,7 @@ function_call: | callable_expr argument_list { $$ = &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $2), - }, + Position: position.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -3807,9 +3331,7 @@ class_name: T_STATIC { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -3839,9 +3361,7 @@ exit_expr: | '(' optional_expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3858,9 +3378,7 @@ backticks_expr: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -3887,9 +3405,7 @@ dereferencable_scalar: T_ARRAY '(' array_pair_list ')' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -3900,9 +3416,7 @@ dereferencable_scalar: | '[' array_pair_list ']' { $$ = &ast.ExprArray{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3912,9 +3426,7 @@ dereferencable_scalar: | T_CONSTANT_ENCAPSED_STRING { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -3925,9 +3437,7 @@ scalar: T_LNUMBER { $$ = &ast.ScalarLnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3935,9 +3445,7 @@ scalar: | T_DNUMBER { $$ = &ast.ScalarDnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3945,9 +3453,7 @@ scalar: | T_LINE { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3955,9 +3461,7 @@ scalar: | T_FILE { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3965,9 +3469,7 @@ scalar: | T_DIR { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3975,9 +3477,7 @@ scalar: | T_TRAIT_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3985,9 +3485,7 @@ scalar: | T_METHOD_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3995,9 +3493,7 @@ scalar: | T_FUNC_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4005,9 +3501,7 @@ scalar: | T_NS_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4015,9 +3509,7 @@ scalar: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4025,15 +3517,11 @@ scalar: | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -4044,9 +3532,7 @@ scalar: | T_START_HEREDOC T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), OpenHeredocTkn: $1, CloseHeredocTkn: $2, } @@ -4054,9 +3540,7 @@ scalar: | '"' encaps_list '"' { $$ = &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, CloseQoteTkn: $1, @@ -4065,9 +3549,7 @@ scalar: | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: $2, CloseHeredocTkn: $3, @@ -4087,24 +3569,18 @@ constant: name { $$ = &ast.ExprConstFetch{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Const: $1, } } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4113,15 +3589,11 @@ constant: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier { $$ = &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $3), - }, + Position: position.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4166,9 +3638,7 @@ dereferencable: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4188,9 +3658,7 @@ callable_expr: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4210,9 +3678,7 @@ callable_variable: | dereferencable '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4222,9 +3688,7 @@ callable_variable: | constant '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4234,9 +3698,7 @@ callable_variable: | dereferencable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4246,9 +3708,7 @@ callable_variable: | dereferencable T_OBJECT_OPERATOR property_name argument_list { $$ = &ast.ExprMethodCall{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Var: $1, ObjectOperatorTkn: $2, Method: $3, @@ -4276,9 +3736,7 @@ variable: | dereferencable T_OBJECT_OPERATOR property_name { $$ = &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, @@ -4290,13 +3748,9 @@ simple_variable: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4305,14 +3759,10 @@ simple_variable: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, + Position: position.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -4322,9 +3772,7 @@ simple_variable: | '$' simple_variable { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), DollarTkn: $1, VarName: $2, } @@ -4335,9 +3783,7 @@ static_member: class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4346,9 +3792,7 @@ static_member: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4364,9 +3808,7 @@ new_variable: | new_variable '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4376,9 +3818,7 @@ new_variable: | new_variable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $4), - }, + Position: position.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4388,9 +3828,7 @@ new_variable: | new_variable T_OBJECT_OPERATOR property_name { $$ = &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, @@ -4399,9 +3837,7 @@ new_variable: | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4410,9 +3846,7 @@ new_variable: | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4424,9 +3858,7 @@ member_name: identifier { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -4434,9 +3866,7 @@ member_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4452,9 +3882,7 @@ property_name: T_STRING { $$ = &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -4462,9 +3890,7 @@ property_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4521,9 +3947,7 @@ array_pair: expr T_DOUBLE_ARROW expr { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $3), - }, + Position: position.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -4532,24 +3956,18 @@ array_pair: | expr { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodePosition($1), - }, + Position: position.NewNodePosition($1), Val: $1, } } | expr T_DOUBLE_ARROW '&' variable { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodesPosition($1, $4), - }, + Position: position.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($3, $4), - }, + Position: position.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -4558,13 +3976,9 @@ array_pair: | '&' variable { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), Val: &ast.ExprReference{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, }, @@ -4573,9 +3987,7 @@ array_pair: | T_ELLIPSIS expr { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), EllipsisTkn: $1, Val: $2, } @@ -4583,15 +3995,11 @@ array_pair: | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewNodeTokenPosition($1, $6), - }, + Position: position.NewNodeTokenPosition($1, $6), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprList{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $6), - }, + Position: position.NewTokensPosition($3, $6), ListTkn: $3, OpenBracketTkn: $4, Items: $5.(*ast.ParserSeparatedList).Items, @@ -4603,13 +4011,9 @@ array_pair: | T_LIST '(' array_pair_list ')' { $$ = &ast.ExprArrayItem{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Val: &ast.ExprList{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -4630,9 +4034,7 @@ encaps_list: $$ = append( $1, &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -4646,9 +4048,7 @@ encaps_list: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -4661,13 +4061,9 @@ encaps_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4676,17 +4072,11 @@ encaps_var: | T_VARIABLE '[' encaps_var_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4699,26 +4089,18 @@ encaps_var: | T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, Property: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($3), - }, + Position: position.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4727,14 +4109,10 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewNodePosition($2), - }, + Position: position.NewNodePosition($2), VarName: $2, }, CloseBracketTkn: $3, @@ -4743,18 +4121,12 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -4765,22 +4137,14 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $6), - }, + Position: position.NewTokensPosition($1, $6), OpenBracketTkn: $1, Child: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $5), - }, + Position: position.NewTokensPosition($2, $5), Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -4795,9 +4159,7 @@ encaps_var: | T_CURLY_OPEN variable '}' { $$ = &ast.ParserBrackets{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $3), - }, + Position: position.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4809,9 +4171,7 @@ encaps_var_offset: T_STRING { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -4821,17 +4181,13 @@ encaps_var_offset: // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { $$ = &ast.ScalarLnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } } else { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -4844,24 +4200,17 @@ encaps_var_offset: if isInt { $$ = &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), MinusTkn: $1, Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: position.NewTokenPosition($2), - }, + Position: position.NewTokenPosition($2), NumberTkn: $2, Value: $2.Value, }, } - $$.GetNode().Position = position.NewTokensPosition($1, $2) } else { $$ = &ast.ScalarString{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $2), - }, + Position: position.NewTokensPosition($1, $2), MinusTkn: $1, StringTkn: $2, Value: append([]byte("-"), $2.Value...), @@ -4871,13 +4220,9 @@ encaps_var_offset: | T_VARIABLE { $$ = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($1), - }, + Position: position.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4893,9 +4238,7 @@ internal_functions_in_yacc: } $$ = &ast.ExprIsset{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $5), - }, + Position: position.NewTokensPosition($1, $5), IssetTkn: $1, OpenParenthesisTkn: $2, Vars: $3.(*ast.ParserSeparatedList).Items, @@ -4906,9 +4249,7 @@ internal_functions_in_yacc: | T_EMPTY '(' expr ')' { $$ = &ast.ExprEmpty{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -4918,9 +4259,7 @@ internal_functions_in_yacc: | T_INCLUDE expr { $$ = &ast.ExprInclude{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -4928,9 +4267,7 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -4938,9 +4275,7 @@ internal_functions_in_yacc: | T_EVAL '(' expr ')' { $$ = &ast.ExprEval{ - Node: ast.Node{ - Position: position.NewTokensPosition($1, $4), - }, + Position: position.NewTokensPosition($1, $4), EvalTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -4950,9 +4285,7 @@ internal_functions_in_yacc: | T_REQUIRE expr { $$ = &ast.ExprRequire{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), RequireTkn: $1, Expr: $2, } @@ -4960,9 +4293,7 @@ internal_functions_in_yacc: | T_REQUIRE_ONCE expr { $$ = &ast.ExprRequireOnce{ - Node: ast.Node{ - Position: position.NewTokenNodePosition($1, $2), - }, + Position: position.NewTokenNodePosition($1, $2), RequireOnceTkn: $1, Expr: $2, } diff --git a/internal/position/position.go b/internal/position/position.go index 2603826..888f24b 100644 --- a/internal/position/position.go +++ b/internal/position/position.go @@ -36,7 +36,7 @@ func getNodeStartPos(n ast.Vertex) startPos { return startPos{-1, -1} } - p := n.GetNode().Position + p := n.GetPosition() if p != nil { sl = p.StartLine sp = p.StartPos @@ -65,7 +65,7 @@ func getNodeEndPos(n ast.Vertex) endPos { return endPos{-1, -1} } - p := n.GetNode().Position + p := n.GetPosition() if p != nil { el = p.EndLine ep = p.EndPos diff --git a/internal/position/position_test.go b/internal/position/position_test.go index 1fd6c83..fcd2681 100644 --- a/internal/position/position_test.go +++ b/internal/position/position_test.go @@ -23,9 +23,7 @@ func TestNewTokenPosition(t *testing.T) { pos := builder.NewTokenPosition(tkn) - assert.DeepEqual(t, &position.Position{1, 1, 0, 3}, pos) - - assert.DeepEqual(t, &position.Position{1, 1, 0, 3}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 1, EndPos: 3}, pos) } func TestNewTokensPosition(t *testing.T) { @@ -50,24 +48,22 @@ func TestNewTokensPosition(t *testing.T) { pos := builder.NewTokensPosition(token1, token2) - assert.DeepEqual(t, &position.Position{1, 2, 0, 6}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 6}, pos) } func TestNewNodePosition(t *testing.T) { n := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 3, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 3, }, } pos := builder.NewNodePosition(n) - assert.DeepEqual(t, &position.Position{1, 1, 0, 3}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 1, EndPos: 3}, pos) } func TestNewTokenNodePosition(t *testing.T) { @@ -81,30 +77,26 @@ func TestNewTokenNodePosition(t *testing.T) { }, } n := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 4, - EndPos: 12, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 4, + EndPos: 12, }, } pos := builder.NewTokenNodePosition(tkn, n) - assert.DeepEqual(t, &position.Position{1, 2, 0, 12}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 12}, pos) } func TestNewNodeTokenPosition(t *testing.T) { n := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 9, }, } @@ -120,85 +112,73 @@ func TestNewNodeTokenPosition(t *testing.T) { pos := builder.NewNodeTokenPosition(n, tkn) - assert.DeepEqual(t, &position.Position{1, 2, 0, 12}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 12}, pos) } func TestNewNodeListPosition(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 9, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 19, }, } pos := builder.NewNodeListPosition([]ast.Vertex{n1, n2}) - assert.DeepEqual(t, &position.Position{1, 2, 0, 19}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 19}, pos) } func TestNewNodesPosition(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 9, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 19, }, } pos := builder.NewNodesPosition(n1, n2) - assert.DeepEqual(t, &position.Position{1, 2, 0, 19}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 19}, pos) } func TestNewNodeListTokenPosition(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 9, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 9, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 10, - EndPos: 19, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 10, + EndPos: 19, }, } @@ -214,7 +194,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { pos := builder.NewNodeListTokenPosition([]ast.Vertex{n1, n2}, tkn) - assert.DeepEqual(t, &position.Position{1, 3, 0, 22}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 22}, pos) } func TestNewTokenNodeListPosition(t *testing.T) { @@ -229,106 +209,90 @@ func TestNewTokenNodeListPosition(t *testing.T) { } n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 10, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 3, + EndPos: 10, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 11, - EndPos: 20, - }, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 11, + EndPos: 20, }, } pos := builder.NewTokenNodeListPosition(tkn, []ast.Vertex{n1, n2}) - assert.DeepEqual(t, &position.Position{1, 3, 0, 20}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 20}, pos) } func TestNewNodeNodeListPosition(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 8, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 17, }, } n3 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 18, + EndPos: 26, }, } pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{n2, n3}) - assert.DeepEqual(t, &position.Position{1, 3, 0, 26}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 26}, pos) } func TestNewNodeListNodePosition(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 8, }, } n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 17, }, } n3 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 18, + EndPos: 26, }, } pos := builder.NewNodeListNodePosition([]ast.Vertex{n1, n2}, n3) - assert.DeepEqual(t, &position.Position{1, 3, 0, 26}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 26}, pos) } func TestNewOptionalListTokensPosition(t *testing.T) { @@ -353,28 +317,24 @@ func TestNewOptionalListTokensPosition(t *testing.T) { pos := builder.NewOptionalListTokensPosition(nil, token1, token2) - assert.DeepEqual(t, &position.Position{1, 2, 0, 6}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 6}, pos) } func TestNewOptionalListTokensPosition2(t *testing.T) { n2 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 9, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 9, + EndPos: 17, }, } n3 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 18, - EndPos: 26, - }, + Position: &position.Position{ + StartLine: 3, + EndLine: 3, + StartPos: 18, + EndPos: 26, }, } @@ -399,34 +359,32 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { pos := builder.NewOptionalListTokensPosition([]ast.Vertex{n2, n3}, token1, token2) - assert.DeepEqual(t, &position.Position{2, 5, 9, 32}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 2, EndLine: 5, StartPos: 9, EndPos: 32}, pos) } func TestNilNodePos(t *testing.T) { pos := builder.NewNodesPosition(nil, nil) - assert.DeepEqual(t, &position.Position{-1, -1, -1, -1}, pos) + assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1}, pos) } func TestNilNodeListPos(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 8, }, } pos := builder.NewNodeNodeListPosition(n1, nil) - assert.DeepEqual(t, &position.Position{1, -1, 0, -1}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: -1, EndPos: -1}, pos) } func TestNilNodeListTokenPos(t *testing.T) { - token := &token.Token{ + tkn := &token.Token{ Value: []byte(`foo`), Position: &position.Position{ StartLine: 1, @@ -436,30 +394,28 @@ func TestNilNodeListTokenPos(t *testing.T) { }, } - pos := builder.NewNodeListTokenPosition(nil, token) + pos := builder.NewNodeListTokenPosition(nil, tkn) - assert.DeepEqual(t, &position.Position{-1, 1, -1, 3}, pos) + assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: 1, StartPos: -1, EndPos: 3}, pos) } func TestEmptyNodeListPos(t *testing.T) { n1 := &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 8, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 0, + EndPos: 8, }, } pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{}) - assert.DeepEqual(t, &position.Position{1, -1, 0, -1}, pos) + assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: -1, EndPos: -1}, pos) } func TestEmptyNodeListTokenPos(t *testing.T) { - token := &token.Token{ + tkn := &token.Token{ Value: []byte(`foo`), Position: &position.Position{ StartLine: 1, @@ -469,7 +425,7 @@ func TestEmptyNodeListTokenPos(t *testing.T) { }, } - pos := builder.NewNodeListTokenPosition([]ast.Vertex{}, token) + pos := builder.NewNodeListTokenPosition([]ast.Vertex{}, tkn) - assert.DeepEqual(t, &position.Position{-1, 1, -1, 3}, pos) + assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: 1, StartPos: -1, EndPos: 3}, pos) } diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index b711aaa..c689909 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -1,8 +1,10 @@ package ast +import "github.com/z7zmey/php-parser/pkg/position" + type Vertex interface { Accept(v NodeVisitor) - GetNode() *Node + GetPosition() *position.Position } type Traverser interface { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index b375c45..70655b5 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -5,35 +5,24 @@ import ( "github.com/z7zmey/php-parser/pkg/token" ) -type Node struct { - StartTokens []token.Token - EndTokens []token.Token - Tokens token.Collection - Position *position.Position -} - -func (n *Node) GetNode() *Node { - return n -} - -func (n *Node) GetPosition() *position.Position { - return n.Position -} - // Root node type Root struct { - Node - Stmts []Vertex - EndTkn *token.Token + Position *position.Position + Stmts []Vertex + EndTkn *token.Token } func (n *Root) Accept(v NodeVisitor) { v.Root(n) } +func (n *Root) GetPosition() *position.Position { + return n.Position +} + // Nullable node type Nullable struct { - Node + Position *position.Position QuestionTkn *token.Token Expr Vertex } @@ -42,9 +31,13 @@ func (n *Nullable) Accept(v NodeVisitor) { v.Nullable(n) } +func (n *Nullable) GetPosition() *position.Position { + return n.Position +} + // Parameter node type Parameter struct { - Node + Position *position.Position Type Vertex AmpersandTkn *token.Token VariadicTkn *token.Token @@ -57,9 +50,13 @@ func (n *Parameter) Accept(v NodeVisitor) { v.Parameter(n) } +func (n *Parameter) GetPosition() *position.Position { + return n.Position +} + // Identifier node type Identifier struct { - Node + Position *position.Position IdentifierTkn *token.Token Value []byte } @@ -68,9 +65,13 @@ func (n *Identifier) Accept(v NodeVisitor) { v.Identifier(n) } +func (n *Identifier) GetPosition() *position.Position { + return n.Position +} + // Argument node type Argument struct { - Node + Position *position.Position VariadicTkn *token.Token AmpersandTkn *token.Token Expr Vertex @@ -80,9 +81,13 @@ func (n *Argument) Accept(v NodeVisitor) { v.Argument(n) } +func (n *Argument) GetPosition() *position.Position { + return n.Position +} + // ScalarDnumber node type ScalarDnumber struct { - Node + Position *position.Position NumberTkn *token.Token Value []byte } @@ -91,9 +96,13 @@ func (n *ScalarDnumber) Accept(v NodeVisitor) { v.ScalarDnumber(n) } +func (n *ScalarDnumber) GetPosition() *position.Position { + return n.Position +} + // ScalarEncapsed node type ScalarEncapsed struct { - Node + Position *position.Position OpenQoteTkn *token.Token Parts []Vertex CloseQoteTkn *token.Token @@ -103,9 +112,13 @@ func (n *ScalarEncapsed) Accept(v NodeVisitor) { v.ScalarEncapsed(n) } +func (n *ScalarEncapsed) GetPosition() *position.Position { + return n.Position +} + // ScalarEncapsedStringPart node type ScalarEncapsedStringPart struct { - Node + Position *position.Position EncapsedStrTkn *token.Token Value []byte } @@ -114,9 +127,13 @@ func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { v.ScalarEncapsedStringPart(n) } +func (n *ScalarEncapsedStringPart) GetPosition() *position.Position { + return n.Position +} + // ScalarHeredoc node type ScalarHeredoc struct { - Node + Position *position.Position OpenHeredocTkn *token.Token Parts []Vertex CloseHeredocTkn *token.Token @@ -126,9 +143,13 @@ func (n *ScalarHeredoc) Accept(v NodeVisitor) { v.ScalarHeredoc(n) } +func (n *ScalarHeredoc) GetPosition() *position.Position { + return n.Position +} + // ScalarLnumber node type ScalarLnumber struct { - Node + Position *position.Position NumberTkn *token.Token Value []byte } @@ -137,9 +158,13 @@ func (n *ScalarLnumber) Accept(v NodeVisitor) { v.ScalarLnumber(n) } +func (n *ScalarLnumber) GetPosition() *position.Position { + return n.Position +} + // ScalarMagicConstant node type ScalarMagicConstant struct { - Node + Position *position.Position MagicConstTkn *token.Token Value []byte } @@ -148,9 +173,13 @@ func (n *ScalarMagicConstant) Accept(v NodeVisitor) { v.ScalarMagicConstant(n) } +func (n *ScalarMagicConstant) GetPosition() *position.Position { + return n.Position +} + // ScalarString node type ScalarString struct { - Node + Position *position.Position MinusTkn *token.Token StringTkn *token.Token Value []byte @@ -160,9 +189,13 @@ func (n *ScalarString) Accept(v NodeVisitor) { v.ScalarString(n) } +func (n *ScalarString) GetPosition() *position.Position { + return n.Position +} + // StmtBreak node type StmtBreak struct { - Node + Position *position.Position BreakTkn *token.Token Expr Vertex SemiColonTkn *token.Token @@ -172,9 +205,13 @@ func (n *StmtBreak) Accept(v NodeVisitor) { v.StmtBreak(n) } +func (n *StmtBreak) GetPosition() *position.Position { + return n.Position +} + // StmtCase node type StmtCase struct { - Node + Position *position.Position CaseTkn *token.Token Cond Vertex CaseSeparatorTkn *token.Token @@ -185,9 +222,13 @@ func (n *StmtCase) Accept(v NodeVisitor) { v.StmtCase(n) } +func (n *StmtCase) GetPosition() *position.Position { + return n.Position +} + // StmtCatch node type StmtCatch struct { - Node + Position *position.Position CatchTkn *token.Token OpenParenthesisTkn *token.Token Types []Vertex @@ -203,9 +244,13 @@ func (n *StmtCatch) Accept(v NodeVisitor) { v.StmtCatch(n) } +func (n *StmtCatch) GetPosition() *position.Position { + return n.Position +} + // StmtClass node type StmtClass struct { - Node + Position *position.Position Modifiers []Vertex ClassTkn *token.Token ClassName Vertex @@ -224,9 +269,13 @@ func (n *StmtClass) Accept(v NodeVisitor) { v.StmtClass(n) } +func (n *StmtClass) GetPosition() *position.Position { + return n.Position +} + // StmtClassConstList node type StmtClassConstList struct { - Node + Position *position.Position Modifiers []Vertex ConstTkn *token.Token Consts []Vertex @@ -238,9 +287,13 @@ func (n *StmtClassConstList) Accept(v NodeVisitor) { v.StmtClassConstList(n) } +func (n *StmtClassConstList) GetPosition() *position.Position { + return n.Position +} + // StmtClassExtends node type StmtClassExtends struct { - Node + Position *position.Position ExtendTkn *token.Token ClassName Vertex } @@ -249,9 +302,13 @@ func (n *StmtClassExtends) Accept(v NodeVisitor) { v.StmtClassExtends(n) } +func (n *StmtClassExtends) GetPosition() *position.Position { + return n.Position +} + // StmtClassImplements node type StmtClassImplements struct { - Node + Position *position.Position ImplementsTkn *token.Token InterfaceNames []Vertex SeparatorTkns []*token.Token @@ -261,9 +318,13 @@ func (n *StmtClassImplements) Accept(v NodeVisitor) { v.StmtClassImplements(n) } +func (n *StmtClassImplements) GetPosition() *position.Position { + return n.Position +} + // StmtClassMethod node type StmtClassMethod struct { - Node + Position *position.Position Modifiers []Vertex FunctionTkn *token.Token AmpersandTkn *token.Token @@ -281,9 +342,13 @@ func (n *StmtClassMethod) Accept(v NodeVisitor) { v.StmtClassMethod(n) } +func (n *StmtClassMethod) GetPosition() *position.Position { + return n.Position +} + // StmtConstList node type StmtConstList struct { - Node + Position *position.Position ConstTkn *token.Token Consts []Vertex SeparatorTkns []*token.Token @@ -294,9 +359,13 @@ func (n *StmtConstList) Accept(v NodeVisitor) { v.StmtConstList(n) } +func (n *StmtConstList) GetPosition() *position.Position { + return n.Position +} + // StmtConstant node type StmtConstant struct { - Node + Position *position.Position Name Vertex EqualTkn *token.Token Expr Vertex @@ -306,9 +375,13 @@ func (n *StmtConstant) Accept(v NodeVisitor) { v.StmtConstant(n) } +func (n *StmtConstant) GetPosition() *position.Position { + return n.Position +} + // StmtContinue node type StmtContinue struct { - Node + Position *position.Position ContinueTkn *token.Token Expr Vertex SemiColonTkn *token.Token @@ -318,9 +391,13 @@ func (n *StmtContinue) Accept(v NodeVisitor) { v.StmtContinue(n) } +func (n *StmtContinue) GetPosition() *position.Position { + return n.Position +} + // StmtDeclare node type StmtDeclare struct { - Node + Position *position.Position Alt bool DeclareTkn *token.Token OpenParenthesisTkn *token.Token @@ -337,9 +414,13 @@ func (n *StmtDeclare) Accept(v NodeVisitor) { v.StmtDeclare(n) } +func (n *StmtDeclare) GetPosition() *position.Position { + return n.Position +} + // StmtDefault node type StmtDefault struct { - Node + Position *position.Position DefaultTkn *token.Token CaseSeparatorTkn *token.Token Stmts []Vertex @@ -349,9 +430,13 @@ func (n *StmtDefault) Accept(v NodeVisitor) { v.StmtDefault(n) } +func (n *StmtDefault) GetPosition() *position.Position { + return n.Position +} + // StmtDo node type StmtDo struct { - Node + Position *position.Position DoTkn *token.Token Stmt Vertex WhileTkn *token.Token @@ -365,9 +450,13 @@ func (n *StmtDo) Accept(v NodeVisitor) { v.StmtDo(n) } +func (n *StmtDo) GetPosition() *position.Position { + return n.Position +} + // StmtEcho node type StmtEcho struct { - Node + Position *position.Position EchoTkn *token.Token Exprs []Vertex SeparatorTkns []*token.Token @@ -378,9 +467,13 @@ func (n *StmtEcho) Accept(v NodeVisitor) { v.StmtEcho(n) } +func (n *StmtEcho) GetPosition() *position.Position { + return n.Position +} + // StmtElse node type StmtElse struct { - Node + Position *position.Position Alt bool ElseTkn *token.Token ColonTkn *token.Token @@ -391,9 +484,13 @@ func (n *StmtElse) Accept(v NodeVisitor) { v.StmtElse(n) } +func (n *StmtElse) GetPosition() *position.Position { + return n.Position +} + // StmtElseIf node type StmtElseIf struct { - Node + Position *position.Position Alt bool ElseIfTkn *token.Token OpenParenthesisTkn *token.Token @@ -407,9 +504,13 @@ func (n *StmtElseIf) Accept(v NodeVisitor) { v.StmtElseIf(n) } +func (n *StmtElseIf) GetPosition() *position.Position { + return n.Position +} + // StmtExpression node type StmtExpression struct { - Node + Position *position.Position Expr Vertex SemiColonTkn *token.Token } @@ -418,9 +519,13 @@ func (n *StmtExpression) Accept(v NodeVisitor) { v.StmtExpression(n) } +func (n *StmtExpression) GetPosition() *position.Position { + return n.Position +} + // StmtFinally node type StmtFinally struct { - Node + Position *position.Position FinallyTkn *token.Token OpenCurlyBracketTkn *token.Token Stmts []Vertex @@ -431,9 +536,13 @@ func (n *StmtFinally) Accept(v NodeVisitor) { v.StmtFinally(n) } +func (n *StmtFinally) GetPosition() *position.Position { + return n.Position +} + // StmtFor node type StmtFor struct { - Node + Position *position.Position Alt bool ForTkn *token.Token OpenParenthesisTkn *token.Token @@ -456,9 +565,13 @@ func (n *StmtFor) Accept(v NodeVisitor) { v.StmtFor(n) } +func (n *StmtFor) GetPosition() *position.Position { + return n.Position +} + // StmtForeach node type StmtForeach struct { - Node + Position *position.Position Alt bool ForeachTkn *token.Token OpenParenthesisTkn *token.Token @@ -478,9 +591,13 @@ func (n *StmtForeach) Accept(v NodeVisitor) { v.StmtForeach(n) } +func (n *StmtForeach) GetPosition() *position.Position { + return n.Position +} + // StmtFunction node type StmtFunction struct { - Node + Position *position.Position FunctionTkn *token.Token AmpersandTkn *token.Token FunctionName Vertex @@ -499,9 +616,13 @@ func (n *StmtFunction) Accept(v NodeVisitor) { v.StmtFunction(n) } +func (n *StmtFunction) GetPosition() *position.Position { + return n.Position +} + // StmtGlobal node type StmtGlobal struct { - Node + Position *position.Position GlobalTkn *token.Token Vars []Vertex SeparatorTkns []*token.Token @@ -512,9 +633,13 @@ func (n *StmtGlobal) Accept(v NodeVisitor) { v.StmtGlobal(n) } +func (n *StmtGlobal) GetPosition() *position.Position { + return n.Position +} + // StmtGoto node type StmtGoto struct { - Node + Position *position.Position GotoTkn *token.Token Label Vertex SemiColonTkn *token.Token @@ -524,9 +649,13 @@ func (n *StmtGoto) Accept(v NodeVisitor) { v.StmtGoto(n) } +func (n *StmtGoto) GetPosition() *position.Position { + return n.Position +} + // StmtHaltCompiler node type StmtHaltCompiler struct { - Node + Position *position.Position HaltCompilerTkn *token.Token OpenParenthesisTkn *token.Token CloseParenthesisTkn *token.Token @@ -537,9 +666,13 @@ func (n *StmtHaltCompiler) Accept(v NodeVisitor) { v.StmtHaltCompiler(n) } +func (n *StmtHaltCompiler) GetPosition() *position.Position { + return n.Position +} + // StmtIf node type StmtIf struct { - Node + Position *position.Position Alt bool IfTkn *token.Token OpenParenthesisTkn *token.Token @@ -557,9 +690,13 @@ func (n *StmtIf) Accept(v NodeVisitor) { v.StmtIf(n) } +func (n *StmtIf) GetPosition() *position.Position { + return n.Position +} + // StmtInlineHtml node type StmtInlineHtml struct { - Node + Position *position.Position InlineHtmlTkn *token.Token Value []byte } @@ -568,9 +705,13 @@ func (n *StmtInlineHtml) Accept(v NodeVisitor) { v.StmtInlineHtml(n) } +func (n *StmtInlineHtml) GetPosition() *position.Position { + return n.Position +} + // StmtInterface node type StmtInterface struct { - Node + Position *position.Position InterfaceTkn *token.Token InterfaceName Vertex Extends Vertex @@ -583,9 +724,13 @@ func (n *StmtInterface) Accept(v NodeVisitor) { v.StmtInterface(n) } +func (n *StmtInterface) GetPosition() *position.Position { + return n.Position +} + // StmtInterfaceExtends node type StmtInterfaceExtends struct { - Node + Position *position.Position ExtendsTkn *token.Token InterfaceNames []Vertex SeparatorTkns []*token.Token @@ -595,9 +740,13 @@ func (n *StmtInterfaceExtends) Accept(v NodeVisitor) { v.StmtInterfaceExtends(n) } +func (n *StmtInterfaceExtends) GetPosition() *position.Position { + return n.Position +} + // StmtLabel node type StmtLabel struct { - Node + Position *position.Position LabelName Vertex ColonTkn *token.Token } @@ -606,9 +755,13 @@ func (n *StmtLabel) Accept(v NodeVisitor) { v.StmtLabel(n) } +func (n *StmtLabel) GetPosition() *position.Position { + return n.Position +} + // StmtNamespace node type StmtNamespace struct { - Node + Position *position.Position NsTkn *token.Token Name Vertex OpenCurlyBracket *token.Token @@ -621,9 +774,13 @@ func (n *StmtNamespace) Accept(v NodeVisitor) { v.StmtNamespace(n) } +func (n *StmtNamespace) GetPosition() *position.Position { + return n.Position +} + // StmtNop node type StmtNop struct { - Node + Position *position.Position SemiColonTkn *token.Token } @@ -631,9 +788,13 @@ func (n *StmtNop) Accept(v NodeVisitor) { v.StmtNop(n) } +func (n *StmtNop) GetPosition() *position.Position { + return n.Position +} + // StmtProperty node type StmtProperty struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -643,9 +804,13 @@ func (n *StmtProperty) Accept(v NodeVisitor) { v.StmtProperty(n) } +func (n *StmtProperty) GetPosition() *position.Position { + return n.Position +} + // StmtPropertyList node type StmtPropertyList struct { - Node + Position *position.Position Modifiers []Vertex Type Vertex Properties []Vertex @@ -657,9 +822,13 @@ func (n *StmtPropertyList) Accept(v NodeVisitor) { v.StmtPropertyList(n) } +func (n *StmtPropertyList) GetPosition() *position.Position { + return n.Position +} + // StmtReturn node type StmtReturn struct { - Node + Position *position.Position ReturnTkn *token.Token Expr Vertex SemiColonTkn *token.Token @@ -669,9 +838,13 @@ func (n *StmtReturn) Accept(v NodeVisitor) { v.StmtReturn(n) } +func (n *StmtReturn) GetPosition() *position.Position { + return n.Position +} + // StmtStatic node type StmtStatic struct { - Node + Position *position.Position StaticTkn *token.Token Vars []Vertex SeparatorTkns []*token.Token @@ -682,9 +855,13 @@ func (n *StmtStatic) Accept(v NodeVisitor) { v.StmtStatic(n) } +func (n *StmtStatic) GetPosition() *position.Position { + return n.Position +} + // StmtStaticVar node type StmtStaticVar struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -694,9 +871,13 @@ func (n *StmtStaticVar) Accept(v NodeVisitor) { v.StmtStaticVar(n) } +func (n *StmtStaticVar) GetPosition() *position.Position { + return n.Position +} + // StmtStmtList node type StmtStmtList struct { - Node + Position *position.Position OpenCurlyBracket *token.Token Stmts []Vertex CloseCurlyBracket *token.Token @@ -706,9 +887,13 @@ func (n *StmtStmtList) Accept(v NodeVisitor) { v.StmtStmtList(n) } +func (n *StmtStmtList) GetPosition() *position.Position { + return n.Position +} + // StmtSwitch node type StmtSwitch struct { - Node + Position *position.Position Alt bool SwitchTkn *token.Token OpenParenthesisTkn *token.Token @@ -727,9 +912,13 @@ func (n *StmtSwitch) Accept(v NodeVisitor) { v.StmtSwitch(n) } +func (n *StmtSwitch) GetPosition() *position.Position { + return n.Position +} + // StmtThrow node type StmtThrow struct { - Node + Position *position.Position ThrowTkn *token.Token Expr Vertex SemiColonTkn *token.Token @@ -739,9 +928,13 @@ func (n *StmtThrow) Accept(v NodeVisitor) { v.StmtThrow(n) } +func (n *StmtThrow) GetPosition() *position.Position { + return n.Position +} + // StmtTrait node type StmtTrait struct { - Node + Position *position.Position TraitTkn *token.Token TraitName Vertex Extends Vertex @@ -755,9 +948,13 @@ func (n *StmtTrait) Accept(v NodeVisitor) { v.StmtTrait(n) } +func (n *StmtTrait) GetPosition() *position.Position { + return n.Position +} + // StmtTraitAdaptationList node type StmtTraitAdaptationList struct { - Node + Position *position.Position OpenParenthesisTkn *token.Token Adaptations []Vertex CloseParenthesisTkn *token.Token @@ -767,9 +964,13 @@ func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { v.StmtTraitAdaptationList(n) } +func (n *StmtTraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + // StmtTraitMethodRef node type StmtTraitMethodRef struct { - Node + Position *position.Position Trait Vertex DoubleColonTkn *token.Token Method Vertex @@ -779,9 +980,13 @@ func (n *StmtTraitMethodRef) Accept(v NodeVisitor) { v.StmtTraitMethodRef(n) } +func (n *StmtTraitMethodRef) GetPosition() *position.Position { + return n.Position +} + // StmtTraitUse node type StmtTraitUse struct { - Node + Position *position.Position UseTkn *token.Token Traits []Vertex SeparatorTkns []*token.Token @@ -792,9 +997,13 @@ func (n *StmtTraitUse) Accept(v NodeVisitor) { v.StmtTraitUse(n) } +func (n *StmtTraitUse) GetPosition() *position.Position { + return n.Position +} + // StmtTraitUseAlias node type StmtTraitUseAlias struct { - Node + Position *position.Position Ref Vertex AsTkn *token.Token Modifier Vertex @@ -806,9 +1015,13 @@ func (n *StmtTraitUseAlias) Accept(v NodeVisitor) { v.StmtTraitUseAlias(n) } +func (n *StmtTraitUseAlias) GetPosition() *position.Position { + return n.Position +} + // StmtTraitUsePrecedence node type StmtTraitUsePrecedence struct { - Node + Position *position.Position Ref Vertex InsteadofTkn *token.Token Insteadof []Vertex @@ -820,9 +1033,13 @@ func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { v.StmtTraitUsePrecedence(n) } +func (n *StmtTraitUsePrecedence) GetPosition() *position.Position { + return n.Position +} + // StmtTry node type StmtTry struct { - Node + Position *position.Position TryTkn *token.Token OpenCurlyBracket *token.Token Stmts []Vertex @@ -835,9 +1052,13 @@ func (n *StmtTry) Accept(v NodeVisitor) { v.StmtTry(n) } +func (n *StmtTry) GetPosition() *position.Position { + return n.Position +} + // StmtUnset node type StmtUnset struct { - Node + Position *position.Position UnsetTkn *token.Token OpenParenthesisTkn *token.Token Vars []Vertex @@ -850,9 +1071,13 @@ func (n *StmtUnset) Accept(v NodeVisitor) { v.StmtUnset(n) } +func (n *StmtUnset) GetPosition() *position.Position { + return n.Position +} + // StmtUse node type StmtUse struct { - Node + Position *position.Position UseTkn *token.Token Type Vertex UseDeclarations []Vertex @@ -864,9 +1089,13 @@ func (n *StmtUse) Accept(v NodeVisitor) { v.StmtUse(n) } +func (n *StmtUse) GetPosition() *position.Position { + return n.Position +} + // StmtGroupUse node type StmtGroupUse struct { - Node + Position *position.Position UseTkn *token.Token Type Vertex LeadingNsSeparatorTkn *token.Token @@ -883,9 +1112,13 @@ func (n *StmtGroupUse) Accept(v NodeVisitor) { v.StmtGroupUse(n) } +func (n *StmtGroupUse) GetPosition() *position.Position { + return n.Position +} + // StmtUseDeclaration node type StmtUseDeclaration struct { - Node + Position *position.Position Type Vertex NsSeparatorTkn *token.Token Use Vertex @@ -897,9 +1130,13 @@ func (n *StmtUseDeclaration) Accept(v NodeVisitor) { v.StmtUseDeclaration(n) } +func (n *StmtUseDeclaration) GetPosition() *position.Position { + return n.Position +} + // StmtWhile node type StmtWhile struct { - Node + Position *position.Position Alt bool WhileTkn *token.Token OpenParenthesisTkn *token.Token @@ -915,9 +1152,13 @@ func (n *StmtWhile) Accept(v NodeVisitor) { v.StmtWhile(n) } +func (n *StmtWhile) GetPosition() *position.Position { + return n.Position +} + // ExprArray node type ExprArray struct { - Node + Position *position.Position ArrayTkn *token.Token OpenBracketTkn *token.Token Items []Vertex @@ -929,9 +1170,13 @@ func (n *ExprArray) Accept(v NodeVisitor) { v.ExprArray(n) } +func (n *ExprArray) GetPosition() *position.Position { + return n.Position +} + // ExprArrayDimFetch node type ExprArrayDimFetch struct { - Node + Position *position.Position Var Vertex OpenBracketTkn *token.Token Dim Vertex @@ -942,9 +1187,13 @@ func (n *ExprArrayDimFetch) Accept(v NodeVisitor) { v.ExprArrayDimFetch(n) } +func (n *ExprArrayDimFetch) GetPosition() *position.Position { + return n.Position +} + // ExprArrayItem node type ExprArrayItem struct { - Node + Position *position.Position EllipsisTkn *token.Token Key Vertex DoubleArrowTkn *token.Token @@ -955,9 +1204,13 @@ func (n *ExprArrayItem) Accept(v NodeVisitor) { v.ExprArrayItem(n) } +func (n *ExprArrayItem) GetPosition() *position.Position { + return n.Position +} + // ExprArrowFunction node type ExprArrowFunction struct { - Node + Position *position.Position StaticTkn *token.Token FnTkn *token.Token AmpersandTkn *token.Token @@ -975,9 +1228,13 @@ func (n *ExprArrowFunction) Accept(v NodeVisitor) { v.ExprArrowFunction(n) } +func (n *ExprArrowFunction) GetPosition() *position.Position { + return n.Position +} + // ExprBitwiseNot node type ExprBitwiseNot struct { - Node + Position *position.Position TildaTkn *token.Token Expr Vertex } @@ -986,9 +1243,13 @@ func (n *ExprBitwiseNot) Accept(v NodeVisitor) { v.ExprBitwiseNot(n) } +func (n *ExprBitwiseNot) GetPosition() *position.Position { + return n.Position +} + // ExprBooleanNot node type ExprBooleanNot struct { - Node + Position *position.Position ExclamationTkn *token.Token Expr Vertex } @@ -997,9 +1258,13 @@ func (n *ExprBooleanNot) Accept(v NodeVisitor) { v.ExprBooleanNot(n) } +func (n *ExprBooleanNot) GetPosition() *position.Position { + return n.Position +} + // ExprClassConstFetch node type ExprClassConstFetch struct { - Node + Position *position.Position Class Vertex DoubleColonTkn *token.Token ConstantName Vertex @@ -1009,9 +1274,13 @@ func (n *ExprClassConstFetch) Accept(v NodeVisitor) { v.ExprClassConstFetch(n) } +func (n *ExprClassConstFetch) GetPosition() *position.Position { + return n.Position +} + // ExprClone node type ExprClone struct { - Node + Position *position.Position CloneTkn *token.Token Expr Vertex } @@ -1020,9 +1289,13 @@ func (n *ExprClone) Accept(v NodeVisitor) { v.ExprClone(n) } +func (n *ExprClone) GetPosition() *position.Position { + return n.Position +} + // ExprClosure node type ExprClosure struct { - Node + Position *position.Position StaticTkn *token.Token FunctionTkn *token.Token AmpersandTkn *token.Token @@ -1042,9 +1315,13 @@ func (n *ExprClosure) Accept(v NodeVisitor) { v.ExprClosure(n) } +func (n *ExprClosure) GetPosition() *position.Position { + return n.Position +} + // ExprClosureUse node type ExprClosureUse struct { - Node + Position *position.Position UseTkn *token.Token OpenParenthesisTkn *token.Token Uses []Vertex @@ -1056,19 +1333,27 @@ func (n *ExprClosureUse) Accept(v NodeVisitor) { v.ExprClosureUse(n) } +func (n *ExprClosureUse) GetPosition() *position.Position { + return n.Position +} + // ExprConstFetch node type ExprConstFetch struct { - Node - Const Vertex + Position *position.Position + Const Vertex } func (n *ExprConstFetch) Accept(v NodeVisitor) { v.ExprConstFetch(n) } +func (n *ExprConstFetch) GetPosition() *position.Position { + return n.Position +} + // ExprEmpty node type ExprEmpty struct { - Node + Position *position.Position EmptyTkn *token.Token OpenParenthesisTkn *token.Token Expr Vertex @@ -1079,20 +1364,28 @@ func (n *ExprEmpty) Accept(v NodeVisitor) { v.ExprEmpty(n) } +func (n *ExprEmpty) GetPosition() *position.Position { + return n.Position +} + // ExprErrorSuppress node type ExprErrorSuppress struct { - Node - AtTkn *token.Token - Expr Vertex + Position *position.Position + AtTkn *token.Token + Expr Vertex } func (n *ExprErrorSuppress) Accept(v NodeVisitor) { v.ExprErrorSuppress(n) } +func (n *ExprErrorSuppress) GetPosition() *position.Position { + return n.Position +} + // ExprEval node type ExprEval struct { - Node + Position *position.Position EvalTkn *token.Token OpenParenthesisTkn *token.Token Expr Vertex @@ -1103,9 +1396,13 @@ func (n *ExprEval) Accept(v NodeVisitor) { v.ExprEval(n) } +func (n *ExprEval) GetPosition() *position.Position { + return n.Position +} + // ExprExit node type ExprExit struct { - Node + Position *position.Position DieTkn *token.Token OpenParenthesisTkn *token.Token Expr Vertex @@ -1116,9 +1413,13 @@ func (n *ExprExit) Accept(v NodeVisitor) { v.ExprExit(n) } +func (n *ExprExit) GetPosition() *position.Position { + return n.Position +} + // ExprFunctionCall node type ExprFunctionCall struct { - Node + Position *position.Position Function Vertex OpenParenthesisTkn *token.Token Arguments []Vertex @@ -1130,9 +1431,13 @@ func (n *ExprFunctionCall) Accept(v NodeVisitor) { v.ExprFunctionCall(n) } +func (n *ExprFunctionCall) GetPosition() *position.Position { + return n.Position +} + // ExprInclude node type ExprInclude struct { - Node + Position *position.Position IncludeTkn *token.Token Expr Vertex } @@ -1141,9 +1446,13 @@ func (n *ExprInclude) Accept(v NodeVisitor) { v.ExprInclude(n) } +func (n *ExprInclude) GetPosition() *position.Position { + return n.Position +} + // ExprIncludeOnce node type ExprIncludeOnce struct { - Node + Position *position.Position IncludeTkn *token.Token Expr Vertex } @@ -1152,9 +1461,13 @@ func (n *ExprIncludeOnce) Accept(v NodeVisitor) { v.ExprIncludeOnce(n) } +func (n *ExprIncludeOnce) GetPosition() *position.Position { + return n.Position +} + // ExprInstanceOf node type ExprInstanceOf struct { - Node + Position *position.Position Expr Vertex InstanceOfTkn *token.Token Class Vertex @@ -1164,9 +1477,13 @@ func (n *ExprInstanceOf) Accept(v NodeVisitor) { v.ExprInstanceOf(n) } +func (n *ExprInstanceOf) GetPosition() *position.Position { + return n.Position +} + // ExprIsset node type ExprIsset struct { - Node + Position *position.Position IssetTkn *token.Token OpenParenthesisTkn *token.Token Vars []Vertex @@ -1178,9 +1495,13 @@ func (n *ExprIsset) Accept(v NodeVisitor) { v.ExprIsset(n) } +func (n *ExprIsset) GetPosition() *position.Position { + return n.Position +} + // ExprList node type ExprList struct { - Node + Position *position.Position ListTkn *token.Token OpenBracketTkn *token.Token Items []Vertex @@ -1192,9 +1513,13 @@ func (n *ExprList) Accept(v NodeVisitor) { v.ExprList(n) } +func (n *ExprList) GetPosition() *position.Position { + return n.Position +} + // ExprMethodCall node type ExprMethodCall struct { - Node + Position *position.Position Var Vertex ObjectOperatorTkn *token.Token Method Vertex @@ -1208,9 +1533,13 @@ func (n *ExprMethodCall) Accept(v NodeVisitor) { v.ExprMethodCall(n) } +func (n *ExprMethodCall) GetPosition() *position.Position { + return n.Position +} + // ExprNew node type ExprNew struct { - Node + Position *position.Position NewTkn *token.Token Class Vertex OpenParenthesisTkn *token.Token @@ -1223,53 +1552,73 @@ func (n *ExprNew) Accept(v NodeVisitor) { v.ExprNew(n) } +func (n *ExprNew) GetPosition() *position.Position { + return n.Position +} + // ExprPostDec node type ExprPostDec struct { - Node - Var Vertex - DecTkn *token.Token + Position *position.Position + Var Vertex + DecTkn *token.Token } func (n *ExprPostDec) Accept(v NodeVisitor) { v.ExprPostDec(n) } +func (n *ExprPostDec) GetPosition() *position.Position { + return n.Position +} + // ExprPostInc node type ExprPostInc struct { - Node - Var Vertex - IncTkn *token.Token + Position *position.Position + Var Vertex + IncTkn *token.Token } func (n *ExprPostInc) Accept(v NodeVisitor) { v.ExprPostInc(n) } +func (n *ExprPostInc) GetPosition() *position.Position { + return n.Position +} + // ExprPreDec node type ExprPreDec struct { - Node - DecTkn *token.Token - Var Vertex + Position *position.Position + DecTkn *token.Token + Var Vertex } func (n *ExprPreDec) Accept(v NodeVisitor) { v.ExprPreDec(n) } +func (n *ExprPreDec) GetPosition() *position.Position { + return n.Position +} + // ExprPreInc node type ExprPreInc struct { - Node - IncTkn *token.Token - Var Vertex + Position *position.Position + IncTkn *token.Token + Var Vertex } func (n *ExprPreInc) Accept(v NodeVisitor) { v.ExprPreInc(n) } +func (n *ExprPreInc) GetPosition() *position.Position { + return n.Position +} + // ExprPrint node type ExprPrint struct { - Node + Position *position.Position PrintTkn *token.Token Expr Vertex } @@ -1278,9 +1627,13 @@ func (n *ExprPrint) Accept(v NodeVisitor) { v.ExprPrint(n) } +func (n *ExprPrint) GetPosition() *position.Position { + return n.Position +} + // ExprPropertyFetch node type ExprPropertyFetch struct { - Node + Position *position.Position Var Vertex ObjectOperatorTkn *token.Token Property Vertex @@ -1290,9 +1643,13 @@ func (n *ExprPropertyFetch) Accept(v NodeVisitor) { v.ExprPropertyFetch(n) } +func (n *ExprPropertyFetch) GetPosition() *position.Position { + return n.Position +} + // ExprReference node type ExprReference struct { - Node + Position *position.Position AmpersandTkn *token.Token Var Vertex } @@ -1301,9 +1658,13 @@ func (n *ExprReference) Accept(v NodeVisitor) { v.ExprReference(n) } +func (n *ExprReference) GetPosition() *position.Position { + return n.Position +} + // ExprRequire node type ExprRequire struct { - Node + Position *position.Position RequireTkn *token.Token Expr Vertex } @@ -1312,9 +1673,13 @@ func (n *ExprRequire) Accept(v NodeVisitor) { v.ExprRequire(n) } +func (n *ExprRequire) GetPosition() *position.Position { + return n.Position +} + // ExprRequireOnce node type ExprRequireOnce struct { - Node + Position *position.Position RequireOnceTkn *token.Token Expr Vertex } @@ -1323,9 +1688,13 @@ func (n *ExprRequireOnce) Accept(v NodeVisitor) { v.ExprRequireOnce(n) } +func (n *ExprRequireOnce) GetPosition() *position.Position { + return n.Position +} + // ExprShellExec node type ExprShellExec struct { - Node + Position *position.Position OpenBacktickTkn *token.Token Parts []Vertex CloseBacktickTkn *token.Token @@ -1335,9 +1704,13 @@ func (n *ExprShellExec) Accept(v NodeVisitor) { v.ExprShellExec(n) } +func (n *ExprShellExec) GetPosition() *position.Position { + return n.Position +} + // ExprStaticCall node type ExprStaticCall struct { - Node + Position *position.Position Class Vertex DoubleColonTkn *token.Token Call Vertex @@ -1351,9 +1724,13 @@ func (n *ExprStaticCall) Accept(v NodeVisitor) { v.ExprStaticCall(n) } +func (n *ExprStaticCall) GetPosition() *position.Position { + return n.Position +} + // ExprStaticPropertyFetch node type ExprStaticPropertyFetch struct { - Node + Position *position.Position Class Vertex DoubleColonTkn *token.Token Property Vertex @@ -1363,9 +1740,13 @@ func (n *ExprStaticPropertyFetch) Accept(v NodeVisitor) { v.ExprStaticPropertyFetch(n) } +func (n *ExprStaticPropertyFetch) GetPosition() *position.Position { + return n.Position +} + // ExprTernary node type ExprTernary struct { - Node + Position *position.Position Condition Vertex QuestionTkn *token.Token IfTrue Vertex @@ -1377,9 +1758,13 @@ func (n *ExprTernary) Accept(v NodeVisitor) { v.ExprTernary(n) } +func (n *ExprTernary) GetPosition() *position.Position { + return n.Position +} + // ExprUnaryMinus node type ExprUnaryMinus struct { - Node + Position *position.Position MinusTkn *token.Token Expr Vertex } @@ -1388,20 +1773,28 @@ func (n *ExprUnaryMinus) Accept(v NodeVisitor) { v.ExprUnaryMinus(n) } +func (n *ExprUnaryMinus) GetPosition() *position.Position { + return n.Position +} + // ExprUnaryPlus node type ExprUnaryPlus struct { - Node - PlusTkn *token.Token - Expr Vertex + Position *position.Position + PlusTkn *token.Token + Expr Vertex } func (n *ExprUnaryPlus) Accept(v NodeVisitor) { v.ExprUnaryPlus(n) } +func (n *ExprUnaryPlus) GetPosition() *position.Position { + return n.Position +} + // ExprVariable node type ExprVariable struct { - Node + Position *position.Position DollarTkn *token.Token VarName Vertex } @@ -1410,9 +1803,13 @@ func (n *ExprVariable) Accept(v NodeVisitor) { v.ExprVariable(n) } +func (n *ExprVariable) GetPosition() *position.Position { + return n.Position +} + // ExprYield node type ExprYield struct { - Node + Position *position.Position YieldTkn *token.Token Key Vertex DoubleArrowTkn *token.Token @@ -1423,9 +1820,13 @@ func (n *ExprYield) Accept(v NodeVisitor) { v.ExprYield(n) } +func (n *ExprYield) GetPosition() *position.Position { + return n.Position +} + // ExprYieldFrom node type ExprYieldFrom struct { - Node + Position *position.Position YieldFromTkn *token.Token Expr Vertex } @@ -1434,86 +1835,118 @@ func (n *ExprYieldFrom) Accept(v NodeVisitor) { v.ExprYieldFrom(n) } +func (n *ExprYieldFrom) GetPosition() *position.Position { + return n.Position +} + // ExprCastArray node type ExprCastArray struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastArray) Accept(v NodeVisitor) { v.ExprCastArray(n) } +func (n *ExprCastArray) GetPosition() *position.Position { + return n.Position +} + // ExprCastBool node type ExprCastBool struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastBool) Accept(v NodeVisitor) { v.ExprCastBool(n) } +func (n *ExprCastBool) GetPosition() *position.Position { + return n.Position +} + // ExprCastDouble node type ExprCastDouble struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastDouble) Accept(v NodeVisitor) { v.ExprCastDouble(n) } +func (n *ExprCastDouble) GetPosition() *position.Position { + return n.Position +} + // ExprCastInt node type ExprCastInt struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastInt) Accept(v NodeVisitor) { v.ExprCastInt(n) } +func (n *ExprCastInt) GetPosition() *position.Position { + return n.Position +} + // ExprCastObject node type ExprCastObject struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastObject) Accept(v NodeVisitor) { v.ExprCastObject(n) } +func (n *ExprCastObject) GetPosition() *position.Position { + return n.Position +} + // ExprCastString node type ExprCastString struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastString) Accept(v NodeVisitor) { v.ExprCastString(n) } +func (n *ExprCastString) GetPosition() *position.Position { + return n.Position +} + // ExprCastUnset node type ExprCastUnset struct { - Node - CastTkn *token.Token - Expr Vertex + Position *position.Position + CastTkn *token.Token + Expr Vertex } func (n *ExprCastUnset) Accept(v NodeVisitor) { v.ExprCastUnset(n) } +func (n *ExprCastUnset) GetPosition() *position.Position { + return n.Position +} + // ExprAssign node type ExprAssign struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1523,9 +1956,13 @@ func (n *ExprAssign) Accept(v NodeVisitor) { v.ExprAssign(n) } +func (n *ExprAssign) GetPosition() *position.Position { + return n.Position +} + // ExprAssignReference node type ExprAssignReference struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token AmpersandTkn *token.Token @@ -1536,9 +1973,13 @@ func (n *ExprAssignReference) Accept(v NodeVisitor) { v.ExprAssignReference(n) } +func (n *ExprAssignReference) GetPosition() *position.Position { + return n.Position +} + // ExprAssignBitwiseAnd node type ExprAssignBitwiseAnd struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1548,9 +1989,13 @@ func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) { v.ExprAssignBitwiseAnd(n) } +func (n *ExprAssignBitwiseAnd) GetPosition() *position.Position { + return n.Position +} + // ExprAssignBitwiseOr node type ExprAssignBitwiseOr struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1560,9 +2005,13 @@ func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) { v.ExprAssignBitwiseOr(n) } +func (n *ExprAssignBitwiseOr) GetPosition() *position.Position { + return n.Position +} + // ExprAssignBitwiseXor node type ExprAssignBitwiseXor struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1572,9 +2021,13 @@ func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) { v.ExprAssignBitwiseXor(n) } +func (n *ExprAssignBitwiseXor) GetPosition() *position.Position { + return n.Position +} + // ExprAssignCoalesce node type ExprAssignCoalesce struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1584,9 +2037,13 @@ func (n *ExprAssignCoalesce) Accept(v NodeVisitor) { v.ExprAssignCoalesce(n) } +func (n *ExprAssignCoalesce) GetPosition() *position.Position { + return n.Position +} + // ExprAssignConcat node type ExprAssignConcat struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1596,9 +2053,13 @@ func (n *ExprAssignConcat) Accept(v NodeVisitor) { v.ExprAssignConcat(n) } +func (n *ExprAssignConcat) GetPosition() *position.Position { + return n.Position +} + // ExprAssignDiv node type ExprAssignDiv struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1608,9 +2069,13 @@ func (n *ExprAssignDiv) Accept(v NodeVisitor) { v.ExprAssignDiv(n) } +func (n *ExprAssignDiv) GetPosition() *position.Position { + return n.Position +} + // ExprAssignMinus node type ExprAssignMinus struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1620,9 +2085,13 @@ func (n *ExprAssignMinus) Accept(v NodeVisitor) { v.ExprAssignMinus(n) } +func (n *ExprAssignMinus) GetPosition() *position.Position { + return n.Position +} + // ExprAssignMod node type ExprAssignMod struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1632,9 +2101,13 @@ func (n *ExprAssignMod) Accept(v NodeVisitor) { v.ExprAssignMod(n) } +func (n *ExprAssignMod) GetPosition() *position.Position { + return n.Position +} + // ExprAssignMul node type ExprAssignMul struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1644,9 +2117,13 @@ func (n *ExprAssignMul) Accept(v NodeVisitor) { v.ExprAssignMul(n) } +func (n *ExprAssignMul) GetPosition() *position.Position { + return n.Position +} + // ExprAssignPlus node type ExprAssignPlus struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1656,9 +2133,13 @@ func (n *ExprAssignPlus) Accept(v NodeVisitor) { v.ExprAssignPlus(n) } +func (n *ExprAssignPlus) GetPosition() *position.Position { + return n.Position +} + // ExprAssignPow node type ExprAssignPow struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1668,9 +2149,13 @@ func (n *ExprAssignPow) Accept(v NodeVisitor) { v.ExprAssignPow(n) } +func (n *ExprAssignPow) GetPosition() *position.Position { + return n.Position +} + // ExprAssignShiftLeft node type ExprAssignShiftLeft struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1680,9 +2165,13 @@ func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) { v.ExprAssignShiftLeft(n) } +func (n *ExprAssignShiftLeft) GetPosition() *position.Position { + return n.Position +} + // ExprAssignShiftRight node type ExprAssignShiftRight struct { - Node + Position *position.Position Var Vertex EqualTkn *token.Token Expr Vertex @@ -1692,332 +2181,444 @@ func (n *ExprAssignShiftRight) Accept(v NodeVisitor) { v.ExprAssignShiftRight(n) } +func (n *ExprAssignShiftRight) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryBitwiseAnd node type ExprBinaryBitwiseAnd struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryBitwiseAnd) Accept(v NodeVisitor) { v.ExprBinaryBitwiseAnd(n) } +func (n *ExprBinaryBitwiseAnd) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryBitwiseOr node type ExprBinaryBitwiseOr struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryBitwiseOr) Accept(v NodeVisitor) { v.ExprBinaryBitwiseOr(n) } +func (n *ExprBinaryBitwiseOr) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryBitwiseXor node type ExprBinaryBitwiseXor struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryBitwiseXor) Accept(v NodeVisitor) { v.ExprBinaryBitwiseXor(n) } +func (n *ExprBinaryBitwiseXor) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryBooleanAnd node type ExprBinaryBooleanAnd struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryBooleanAnd) Accept(v NodeVisitor) { v.ExprBinaryBooleanAnd(n) } +func (n *ExprBinaryBooleanAnd) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryBooleanOr node type ExprBinaryBooleanOr struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryBooleanOr) Accept(v NodeVisitor) { v.ExprBinaryBooleanOr(n) } +func (n *ExprBinaryBooleanOr) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryCoalesce node type ExprBinaryCoalesce struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryCoalesce) Accept(v NodeVisitor) { v.ExprBinaryCoalesce(n) } +func (n *ExprBinaryCoalesce) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryConcat node type ExprBinaryConcat struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryConcat) Accept(v NodeVisitor) { v.ExprBinaryConcat(n) } +func (n *ExprBinaryConcat) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryDiv node type ExprBinaryDiv struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryDiv) Accept(v NodeVisitor) { v.ExprBinaryDiv(n) } +func (n *ExprBinaryDiv) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryEqual node type ExprBinaryEqual struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryEqual) Accept(v NodeVisitor) { v.ExprBinaryEqual(n) } +func (n *ExprBinaryEqual) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryGreater node type ExprBinaryGreater struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryGreater) Accept(v NodeVisitor) { v.ExprBinaryGreater(n) } +func (n *ExprBinaryGreater) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryGreaterOrEqual node type ExprBinaryGreaterOrEqual struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryGreaterOrEqual) Accept(v NodeVisitor) { v.ExprBinaryGreaterOrEqual(n) } +func (n *ExprBinaryGreaterOrEqual) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryIdentical node type ExprBinaryIdentical struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryIdentical) Accept(v NodeVisitor) { v.ExprBinaryIdentical(n) } +func (n *ExprBinaryIdentical) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryLogicalAnd node type ExprBinaryLogicalAnd struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryLogicalAnd) Accept(v NodeVisitor) { v.ExprBinaryLogicalAnd(n) } +func (n *ExprBinaryLogicalAnd) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryLogicalOr node type ExprBinaryLogicalOr struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryLogicalOr) Accept(v NodeVisitor) { v.ExprBinaryLogicalOr(n) } +func (n *ExprBinaryLogicalOr) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryLogicalXor node type ExprBinaryLogicalXor struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryLogicalXor) Accept(v NodeVisitor) { v.ExprBinaryLogicalXor(n) } +func (n *ExprBinaryLogicalXor) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryMinus node type ExprBinaryMinus struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryMinus) Accept(v NodeVisitor) { v.ExprBinaryMinus(n) } +func (n *ExprBinaryMinus) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryMod node type ExprBinaryMod struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryMod) Accept(v NodeVisitor) { v.ExprBinaryMod(n) } +func (n *ExprBinaryMod) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryMul node type ExprBinaryMul struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryMul) Accept(v NodeVisitor) { v.ExprBinaryMul(n) } +func (n *ExprBinaryMul) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryNotEqual node type ExprBinaryNotEqual struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryNotEqual) Accept(v NodeVisitor) { v.ExprBinaryNotEqual(n) } +func (n *ExprBinaryNotEqual) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryNotIdentical node type ExprBinaryNotIdentical struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryNotIdentical) Accept(v NodeVisitor) { v.ExprBinaryNotIdentical(n) } +func (n *ExprBinaryNotIdentical) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryPlus node type ExprBinaryPlus struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryPlus) Accept(v NodeVisitor) { v.ExprBinaryPlus(n) } +func (n *ExprBinaryPlus) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryPow node type ExprBinaryPow struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryPow) Accept(v NodeVisitor) { v.ExprBinaryPow(n) } +func (n *ExprBinaryPow) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryShiftLeft node type ExprBinaryShiftLeft struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryShiftLeft) Accept(v NodeVisitor) { v.ExprBinaryShiftLeft(n) } +func (n *ExprBinaryShiftLeft) GetPosition() *position.Position { + return n.Position +} + // ExprBinaryShiftRight node type ExprBinaryShiftRight struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinaryShiftRight) Accept(v NodeVisitor) { v.ExprBinaryShiftRight(n) } +func (n *ExprBinaryShiftRight) GetPosition() *position.Position { + return n.Position +} + // ExprBinarySmaller node type ExprBinarySmaller struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinarySmaller) Accept(v NodeVisitor) { v.ExprBinarySmaller(n) } +func (n *ExprBinarySmaller) GetPosition() *position.Position { + return n.Position +} + // ExprBinarySmallerOrEqual node type ExprBinarySmallerOrEqual struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinarySmallerOrEqual) Accept(v NodeVisitor) { v.ExprBinarySmallerOrEqual(n) } +func (n *ExprBinarySmallerOrEqual) GetPosition() *position.Position { + return n.Position +} + // ExprBinarySpaceship node type ExprBinarySpaceship struct { - Node - Left Vertex - OpTkn *token.Token - Right Vertex + Position *position.Position + Left Vertex + OpTkn *token.Token + Right Vertex } func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { v.ExprBinarySpaceship(n) } +func (n *ExprBinarySpaceship) GetPosition() *position.Position { + return n.Position +} + type NameName struct { - Node + Position *position.Position Parts []Vertex SeparatorTkns []*token.Token } @@ -2026,8 +2627,12 @@ func (n *NameName) Accept(v NodeVisitor) { v.NameName(n) } +func (n *NameName) GetPosition() *position.Position { + return n.Position +} + type NameFullyQualified struct { - Node + Position *position.Position NsSeparatorTkn *token.Token Parts []Vertex SeparatorTkns []*token.Token @@ -2037,8 +2642,12 @@ func (n *NameFullyQualified) Accept(v NodeVisitor) { v.NameFullyQualified(n) } +func (n *NameFullyQualified) GetPosition() *position.Position { + return n.Position +} + type NameRelative struct { - Node + Position *position.Position NsTkn *token.Token NsSeparatorTkn *token.Token Parts []Vertex @@ -2049,8 +2658,12 @@ func (n *NameRelative) Accept(v NodeVisitor) { v.NameRelative(n) } +func (n *NameRelative) GetPosition() *position.Position { + return n.Position +} + type NameNamePart struct { - Node + Position *position.Position StringTkn *token.Token Value []byte } @@ -2059,10 +2672,14 @@ func (n *NameNamePart) Accept(v NodeVisitor) { v.NameNamePart(n) } +func (n *NameNamePart) GetPosition() *position.Position { + return n.Position +} + // TODO: move to private section type ParserBrackets struct { - Node + Position *position.Position OpenBracketTkn *token.Token Child Vertex CloseBracketTkn *token.Token @@ -2072,8 +2689,12 @@ func (n *ParserBrackets) Accept(v NodeVisitor) { v.ParserBrackets(n) } +func (n *ParserBrackets) GetPosition() *position.Position { + return n.Position +} + type ParserSeparatedList struct { - Node + Position *position.Position Items []Vertex SeparatorTkns []*token.Token } @@ -2082,9 +2703,13 @@ func (n *ParserSeparatedList) Accept(v NodeVisitor) { v.ParserSeparatedList(n) } +func (n *ParserSeparatedList) GetPosition() *position.Position { + return n.Position +} + // ArgumentList node type ArgumentList struct { - Node + Position *position.Position OpenParenthesisTkn *token.Token Arguments []Vertex SeparatorTkns []*token.Token @@ -2095,8 +2720,12 @@ func (n *ArgumentList) Accept(v NodeVisitor) { // do nothing } +func (n *ArgumentList) GetPosition() *position.Position { + return n.Position +} + type ReturnType struct { - Node + Position *position.Position ColonTkn *token.Token Type Vertex } @@ -2104,3 +2733,7 @@ type ReturnType struct { func (n *ReturnType) Accept(v NodeVisitor) { // do nothing } + +func (n *ReturnType) GetPosition() *position.Position { + return n.Position +} diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index abcf932..771ac0c 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -5,7 +5,6 @@ import ( "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/token" "io" - "sort" "strconv" "strings" ) @@ -99,76 +98,6 @@ func (v *Dump) LeaveNode(_ ast.Vertex) { 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) - 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 @@ -194,25 +123,21 @@ func (v *Dump) printToken(key string, t *token.Token) { func (v *Dump) Root(n *ast.Root) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Root{\n") - v.printNode(n.GetNode()) } func (v *Dump) Nullable(n *ast.Nullable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Nullable{\n") - v.printNode(n.GetNode()) } func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent - 1) v.print("&ast.Parameter{\n") - v.printNode(n.GetNode()) } func (v *Dump) Identifier(n *ast.Identifier) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Identifier{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -221,79 +146,66 @@ func (v *Dump) Identifier(n *ast.Identifier) { func (v *Dump) Argument(n *ast.Argument) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Argument{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtBreak{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtCase(n *ast.StmtCase) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCase{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtCatch(n *ast.StmtCatch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtCatch{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClass(n *ast.StmtClass) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClass{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassConstList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassExtends{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassImplements{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtClassMethod{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtConstList(n *ast.StmtConstList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtConstant(n *ast.StmtConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtConstant{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtContinue(n *ast.StmtContinue) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtContinue{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDeclare{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -304,25 +216,21 @@ func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { func (v *Dump) StmtDefault(n *ast.StmtDefault) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDefault{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtDo(n *ast.StmtDo) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtDo{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtEcho(n *ast.StmtEcho) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtEcho{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtElse(n *ast.StmtElse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElse{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -333,7 +241,6 @@ func (v *Dump) StmtElse(n *ast.StmtElse) { func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtElseIf{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -344,19 +251,16 @@ func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { func (v *Dump) StmtExpression(n *ast.StmtExpression) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtExpression{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFinally(n *ast.StmtFinally) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFinally{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFor(n *ast.StmtFor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFor{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -367,37 +271,31 @@ func (v *Dump) StmtFor(n *ast.StmtFor) { func (v *Dump) StmtForeach(n *ast.StmtForeach) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtForeach{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtFunction(n *ast.StmtFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtFunction{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGlobal{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtGoto(n *ast.StmtGoto) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtGoto{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtHaltCompiler{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtIf(n *ast.StmtIf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtIf{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -408,7 +306,6 @@ func (v *Dump) StmtIf(n *ast.StmtIf) { func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInlineHtml{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -417,73 +314,61 @@ func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { func (v *Dump) StmtInterface(n *ast.StmtInterface) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterface{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtInterfaceExtends{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtLabel(n *ast.StmtLabel) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtLabel{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNamespace{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtNop(n *ast.StmtNop) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtNop{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtProperty(n *ast.StmtProperty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtProperty{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtPropertyList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtReturn(n *ast.StmtReturn) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtReturn{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStatic(n *ast.StmtStatic) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStatic{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStaticVar{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtStmtList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtSwitch{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -494,61 +379,51 @@ func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { func (v *Dump) StmtThrow(n *ast.StmtThrow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtThrow{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTrait(n *ast.StmtTrait) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTrait{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitAdaptationList{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitMethodRef{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUseAlias{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTraitUsePrecedence{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtTry(n *ast.StmtTry) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtTry{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtUnset(n *ast.StmtUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUnset{\n") - v.printNode(n.GetNode()) } func (v *Dump) StmtUse(n *ast.StmtUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUse{\n") - v.printNode(n.GetNode()) v.printToken("UseTkn", n.UseTkn) v.printToken("SemiColonTkn", n.SemiColonTkn) @@ -557,7 +432,6 @@ func (v *Dump) StmtUse(n *ast.StmtUse) { func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { 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) @@ -569,7 +443,6 @@ func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { 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) } @@ -577,7 +450,6 @@ func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtWhile{\n") - v.printNode(n.GetNode()) if n.Alt { v.printIndent(v.indent) @@ -588,547 +460,456 @@ func (v *Dump) StmtWhile(n *ast.StmtWhile) { func (v *Dump) ExprArray(n *ast.ExprArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArray{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayDimFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrayItem{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprArrowFunction{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBitwiseNot{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBooleanNot{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClassConstFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClone(n *ast.ExprClone) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClone{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosure{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprClosureUse{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprConstFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEmpty{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprErrorSuppress{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprEval(n *ast.ExprEval) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprEval{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprExit(n *ast.ExprExit) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprExit{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprFunctionCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprInclude(n *ast.ExprInclude) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInclude{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIncludeOnce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprInstanceOf{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprIsset(n *ast.ExprIsset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprIsset{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprList(n *ast.ExprList) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprList{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprMethodCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprNew(n *ast.ExprNew) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprNew{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostDec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPostInc{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreDec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPreInc{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPrint(n *ast.ExprPrint) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPrint{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprPropertyFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprReference(n *ast.ExprReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprReference{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprRequire(n *ast.ExprRequire) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequire{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprRequireOnce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprShellExec{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticCall{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprStaticPropertyFetch{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprTernary(n *ast.ExprTernary) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprTernary{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprUnaryPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprVariable(n *ast.ExprVariable) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprVariable{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprYield(n *ast.ExprYield) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYield{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprYieldFrom{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssign(n *ast.ExprAssign) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssign{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignReference{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignBitwiseXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignCoalesce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignConcat{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignDiv{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMod{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignMul{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignPow{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftLeft{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprAssignShiftRight{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBitwiseXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryBooleanOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryCoalesce{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryConcat{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryDiv{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreater{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryGreaterOrEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryIdentical{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalAnd{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalOr{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryLogicalXor{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMinus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMod{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryMul{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryNotIdentical{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPlus{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryPow{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftLeft{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinaryShiftRight{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmaller{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySmallerOrEqual{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprBinarySpaceship{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastArray{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastBool{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastDouble{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastInt{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastObject{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastString(n *ast.ExprCastString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastString{\n") - v.printNode(n.GetNode()) } func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ExprCastUnset{\n") - v.printNode(n.GetNode()) } func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarDnumber{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1137,13 +918,11 @@ func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsed{\n") - v.printNode(n.GetNode()) } func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarEncapsedStringPart{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1152,13 +931,11 @@ func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarHeredoc{\n") - v.printNode(n.GetNode()) } func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarLnumber{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1167,7 +944,6 @@ func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarMagicConstant{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1176,7 +952,6 @@ func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { func (v *Dump) ScalarString(n *ast.ScalarString) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ScalarString{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1185,25 +960,21 @@ func (v *Dump) ScalarString(n *ast.ScalarString) { func (v *Dump) NameName(n *ast.NameName) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameName{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameFullyQualified{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameRelative(n *ast.NameRelative) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameRelative{\n") - v.printNode(n.GetNode()) } func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.NameNamePart{\n") - v.printNode(n.GetNode()) v.printIndent(v.indent) v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) @@ -1212,7 +983,6 @@ func (v *Dump) NameNamePart(n *ast.NameNamePart) { func (v *Dump) ParserBrackets(n *ast.ParserBrackets) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.ParserBrackets{\n") - v.printNode(n.GetNode()) } func (v *Dump) ParserSeparatedList(n *ast.ParserSeparatedList) { diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 0ccdc27..3bcdad0 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -20,12 +20,6 @@ func ExampleDump() { }, }, }, - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 0, - EndPos: 1, - }, }, Stmts: []ast.Vertex{ &ast.Identifier{}, diff --git a/pkg/token/position.go b/pkg/token/position.go deleted file mode 100644 index cd76285..0000000 --- a/pkg/token/position.go +++ /dev/null @@ -1,74 +0,0 @@ -package token - -type Position int - -//go:generate stringer -type=Position -output ./position_string.go -const ( - Start Position = iota - End - SemiColon - AltEnd - Ampersand - Name - Key - Var - ReturnType - CaseSeparator - LexicalVars - Params - Ref - Cast - Expr - InitExpr - CondExpr - IncExpr - True - Cond - - Namespace - Static - Use - For - Foreach - Declare - Label - Finally - List - Default - Function - Alias - Equal - Array - Isset - Echo - Try - Catch - Unset - - Stmts - VarList - ConstList - NameList - ParamList - ModifierList - ArrayPairList - CaseListStart - CaseListEnd - PropertyList - ParameterList - AdaptationList - LexicalVarList - - CloseParenthesisToken -) - -type Collection map[Position][]*Token - -func (c Collection) IsEmpty() bool { - for _, v := range c { - if len(v) > 0 { - return false - } - } - return true -} diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go deleted file mode 100644 index ac7c7b5..0000000 --- a/pkg/token/position_string.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by "stringer -type=Position -output ./position_string.go"; DO NOT EDIT. - -package token - -import "strconv" - -func _() { - // An "invalid array index" compiler error signifies that the constant values have changed. - // Re-run the stringer command to generate them again. - var x [1]struct{} - _ = x[Start-0] - _ = x[End-1] - _ = x[SemiColon-2] - _ = x[AltEnd-3] - _ = x[Ampersand-4] - _ = x[Name-5] - _ = x[Key-6] - _ = x[Var-7] - _ = x[ReturnType-8] - _ = x[CaseSeparator-9] - _ = x[LexicalVars-10] - _ = x[Params-11] - _ = x[Ref-12] - _ = x[Cast-13] - _ = x[Expr-14] - _ = x[InitExpr-15] - _ = x[CondExpr-16] - _ = x[IncExpr-17] - _ = x[True-18] - _ = x[Cond-19] - _ = x[Namespace-20] - _ = x[Static-21] - _ = x[Use-22] - _ = x[For-23] - _ = x[Foreach-24] - _ = x[Declare-25] - _ = x[Label-26] - _ = x[Finally-27] - _ = x[List-28] - _ = x[Default-29] - _ = x[Function-30] - _ = x[Alias-31] - _ = x[Equal-32] - _ = x[Array-33] - _ = x[Isset-34] - _ = x[Echo-35] - _ = x[Try-36] - _ = x[Catch-37] - _ = x[Unset-38] - _ = x[Stmts-39] - _ = x[VarList-40] - _ = x[ConstList-41] - _ = x[NameList-42] - _ = x[ParamList-43] - _ = x[ModifierList-44] - _ = x[ArrayPairList-45] - _ = x[CaseListStart-46] - _ = x[CaseListEnd-47] - _ = x[PropertyList-48] - _ = x[ParameterList-49] - _ = x[AdaptationList-50] - _ = x[LexicalVarList-51] - _ = x[CloseParenthesisToken-52] -} - -const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondNamespaceStaticUseForForeachDeclareLabelFinallyListDefaultFunctionAliasEqualArrayIssetEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndPropertyListParameterListAdaptationListLexicalVarListCloseParenthesisToken" - -var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 133, 139, 142, 145, 152, 159, 164, 171, 175, 182, 190, 195, 200, 205, 210, 214, 217, 222, 227, 232, 239, 248, 256, 265, 277, 290, 303, 314, 326, 339, 353, 367, 388} - -func (i Position) String() string { - if i < 0 || i >= Position(len(_Position_index)-1) { - return "Position(" + strconv.FormatInt(int64(i), 10) + ")" - } - return _Position_name[_Position_index[i]:_Position_index[i+1]] -} From 8064d940f0ac0f998a19ce6afadb333599235ca6 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 8 Dec 2020 01:23:48 +0200 Subject: [PATCH 105/140] [refactoring] update Token structure --- internal/scanner/lexer.go | 17 ++----- internal/scanner/scanner.go | Bin 412497 -> 412478 bytes internal/scanner/scanner.rl | 33 +++++-------- internal/scanner/scanner_test.go | 78 +++++++++++++++---------------- pkg/ast/visitor/dump.go | 3 -- pkg/token/token.go | 9 ++-- 6 files changed, 59 insertions(+), 81 deletions(-) diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 7986acb..8c0381f 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -15,7 +15,6 @@ type Lexer struct { phpVersion string errHandlerFunc func(*errors.Error) - sts, ste int p, pe, cs int ts, te, act int stack []int @@ -57,26 +56,18 @@ func (lex *Lexer) setTokenPosition(token *token.Token) { token.Position = pos } -func (lex *Lexer) addSkippedToken(t *token.Token, id token.ID, ps, pe int) { - if lex.sts == -1 { - lex.sts = lex.ts - } - - lex.ste = lex.te - - // TODO remove after parser refactoring - +func (lex *Lexer) addFreeFloatingToken(t *token.Token, id token.ID, ps, pe int) { skippedTkn := lex.tokenPool.Get() skippedTkn.ID = id skippedTkn.Value = lex.data[ps:pe] lex.setTokenPosition(skippedTkn) - if t.SkippedTokens == nil { - t.SkippedTokens = make([]*token.Token, 0, 2) + if t.FreeFloating == nil { + t.FreeFloating = make([]*token.Token, 0, 2) } - t.SkippedTokens = append(t.SkippedTokens, skippedTkn) + t.FreeFloating = append(t.FreeFloating, skippedTkn) } func (lex *Lexer) isNotStringVar() bool { diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 9f779e69b85f30e18eea65d069f5eb189c65f1f8..bd7768b5025b17be7f396b99cf02f27296015bfd 100644 GIT binary patch delta 7002 zcma)BcUYCj(tqZhT`5uxCbmS3h9)Te0Ahkl^wVRk*!?W`#;CE7C>8{SLs3BybPZ#} z?$y|$L4D2jTCXLFC@9f@s9=d=Z;v-7M(*tU9u9&e&;5t9@9fO(%x`CQXNIDjrU!GH z?!3&zf7no6upzHM|JzKRf2b%g{YXrj?Jpc=hl$L@#=#;VW=z+K(W7I=PaZ4U-w6}16OV%*w(@}H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$#kk8_eQsVyo2ah>8(}k&-(Mv zWyPPt`_cvPu=N!B?fPZPKK+-@fblAd%ASoNsFi4$BeV^H(dOxJW z(&520qwQcmK-k{#){L+Egp5ZGB&eK*@KpH%rQY4u^Nt>?=)4P1U>J{=H%Iw;SBQQi zD3C#zKZ45}fkM1spglyVl$SE_OYYAo-ww3mZpzkCe1z=t)oW1D7(P=c&#ZRn@G-Mj z%E$3JI@t)xQM@;bVzKHVyp5}uK?Fum;MR)mB)*F-PO=}s#QEG0+fC-(Xw~wRZWQ?K z#g@2tGS47MdXJSm@!#sQz0GI58-`4wcm*2O-bits%J<64D8%tdrE@GlMYZj3dXDZm zDW1P8mOoK9cK}+wCrj1#5Bope}BSD7ETf*OU zcdC#9Z5L4>K4FXeaY(RwGd30m>X z2(1wHNdtYCbJ>m|e9d=buHc=>jBIrkVg%9Sj8Q|R84@C~E4Y8X)e%`_MBN46NTa>g z?eF>;RQr*K)0Uw3PG^x<)J&$U9}ZnfiA~q|Qfk$bt-u){t>lwruk&~6R#?5NA-zKW zS*&n1r;ikkpH|hr$qggd5MHK^{e!jKS@}GhyGy+0Pr)Fv!y|tZx zUN0Gx*F^Gz9V8j7x}lI8f2?#5wYD~lALF8Z8KduH@> newline => { - lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) + lex.addFreeFloatingToken(tkn, token.T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -143,12 +140,12 @@ func (lex *Lexer) Lex() *token.Token { fbreak; }; ' { - lex.addSkippedToken(tkn, token.T_OPEN_TAG, lex.ts, lex.te) + lex.addFreeFloatingToken(tkn, token.T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addSkippedToken(tkn, token.T_OPEN_TAG, lex.ts, lex.ts+5) + lex.addFreeFloatingToken(tkn, token.T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { @@ -160,7 +157,7 @@ func (lex *Lexer) Lex() *token.Token { *|; php := |* - whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addFreeFloatingToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; '?>' newline? => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext html; fbreak;}; ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext html; fbreak;}; @@ -320,7 +317,7 @@ func (lex *Lexer) Lex() *token.Token { ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) + lex.addFreeFloatingToken(tkn, token.T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; @@ -329,9 +326,9 @@ func (lex *Lexer) Lex() *token.Token { } if isDocComment { - lex.addSkippedToken(tkn, token.T_DOC_COMMENT, lex.ts, lex.te) + lex.addFreeFloatingToken(tkn, token.T_DOC_COMMENT, lex.ts, lex.te) } else { - lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) + lex.addFreeFloatingToken(tkn, token.T_COMMENT, lex.ts, lex.te) } }; @@ -378,7 +375,7 @@ func (lex *Lexer) Lex() *token.Token { *|; property := |* - whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addFreeFloatingToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; "->" => {lex.setTokenPosition(tkn); tok = token.T_OBJECT_OPERATOR; fbreak;}; varname => {lex.setTokenPosition(tkn); tok = token.T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; @@ -474,38 +471,32 @@ func (lex *Lexer) Lex() *token.Token { *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addFreeFloatingToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; "(" => {lex.setTokenPosition(tkn); tok = token.ID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addFreeFloatingToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; ")" => {lex.setTokenPosition(tkn); tok = token.ID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + whitespace_line* => {lex.addFreeFloatingToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; ";" => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addSkippedToken(tkn, token.T_HALT_COMPILER, lex.ts, lex.te); }; + any_line* => { lex.addFreeFloatingToken(tkn, token.T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - if lex.sts == -1 { - lex.sts = 0 - } - tkn.Value = lex.data[lex.ts:lex.te] tkn.ID = token.ID(tok) - tkn.Skipped = lex.data[lex.sts:lex.ste] - lex.addSkippedToken(tkn, tok, lex.ts, lex.te); return tkn } \ No newline at end of file diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 465c40a..c49b785 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -386,8 +386,8 @@ func TestShebang(t *testing.T) { tkn := lexer.Lex() assert.Equal(t, tkn.ID, token.T_DNUMBER) - l := len(tkn.SkippedTokens) - for _, tt := range tkn.SkippedTokens[:l-1] { + l := len(tkn.FreeFloating) + for _, tt := range tkn.FreeFloating[:l-1] { actual = append(actual, string(tt.Value)) } @@ -404,7 +404,7 @@ func TestShebangHtml(t *testing.T) { tkn := lexer.Lex() assert.Equal(t, tkn.ID, token.T_INLINE_HTML) - assert.Equal(t, string(tkn.SkippedTokens[0].Value), "#!/usr/bin/env php\n") + assert.Equal(t, string(tkn.FreeFloating[0].Value), "#!/usr/bin/env php\n") tkn = lexer.Lex() assert.Equal(t, tkn.ID, token.T_DNUMBER) @@ -1137,8 +1137,8 @@ func TestCommentEnd(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1169,8 +1169,8 @@ func TestCommentNewLine(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1201,8 +1201,8 @@ func TestCommentNewLine1(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1233,8 +1233,8 @@ func TestCommentNewLine2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1266,8 +1266,8 @@ func TestCommentWithPhpEndTag(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1299,8 +1299,8 @@ func TestInlineComment(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1332,8 +1332,8 @@ func TestInlineComment2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1369,8 +1369,8 @@ func TestEmptyInlineComment(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1402,8 +1402,8 @@ func TestEmptyInlineComment2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1428,8 +1428,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1442,8 +1442,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1456,8 +1456,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1470,8 +1470,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1484,8 +1484,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1498,8 +1498,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1512,8 +1512,8 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1537,8 +1537,8 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn := lexer.Lex() - l := len(tkn.SkippedTokens) - actual := tkn.SkippedTokens[:l-1] + l := len(tkn.FreeFloating) + actual := tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } @@ -1551,8 +1551,8 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.SkippedTokens) - actual = tkn.SkippedTokens[:l-1] + l = len(tkn.FreeFloating) + actual = tkn.FreeFloating[:l-1] for _, v := range actual { v.Position = nil } diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 771ac0c..af4a87a 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -113,9 +113,6 @@ func (v *Dump) printToken(key string, t *token.Token) { 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") } diff --git a/pkg/token/token.go b/pkg/token/token.go index b36c85f..406a577 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -147,11 +147,10 @@ const ( ) type Token struct { - ID ID - Value []byte - Position *position.Position - SkippedTokens []*Token - Skipped []byte + ID ID + Value []byte + Position *position.Position + FreeFloating []*Token } func (t *Token) GetPosition() *position.Position { From f3a605aba11d44015fca4b7d01ee612961833645 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 8 Dec 2020 02:08:59 +0200 Subject: [PATCH 106/140] [refactoring] update position builder --- Makefile | 7 +- internal/php5/parser.go | 3 + internal/php5/php5.go | Bin 257350 -> 264995 bytes internal/php5/php5.y | 1027 ++++++++++++++++----------------- internal/php7/parser.go | 3 + internal/php7/php7.go | Bin 213588 -> 219043 bytes internal/php7/php7.y | 735 ++++++++++++----------- internal/position/position.go | 215 ++++--- internal/scanner/lexer.go | 2 +- 9 files changed, 1013 insertions(+), 979 deletions(-) diff --git a/Makefile b/Makefile index 6bcfbcd..5309a04 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PHPFILE=example.php -all: compile fmt build run +all: compile fmt build fmt: find . -type f -iregex '.*\.go' -exec gofmt -l -s -w '{}' + @@ -9,9 +9,6 @@ build: go generate ./... go build ./cmd/... -run: - ./php-parser -d go $(PHPFILE) - test: go test ./... @@ -22,7 +19,7 @@ bench: go test -benchmem -bench=. ./internal/php5 go test -benchmem -bench=. ./internal/php7 -compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scanner.go fmt +compile: ./internal/php5/php5.go ./internal/php7/php7.go ./internal/scanner/scanner.go sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php7/php7.go sed -i '' -e 's/yyErrorVerbose = false/yyErrorVerbose = true/g' ./internal/php5/php5.go sed -i '' -e 's/\/\/line/\/\/ line/g' ./internal/php5/php5.go diff --git a/internal/php5/parser.go b/internal/php5/parser.go index ee75429..84015d2 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -1,6 +1,7 @@ package php5 import ( + builder "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -13,6 +14,7 @@ type Parser struct { currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) + builder *builder.Builder } // NewParser creates and returns new Parser @@ -20,6 +22,7 @@ func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser return &Parser{ Lexer: lexer, errHandlerFunc: errHandlerFunc, + builder: builder.NewBuilder(), } } diff --git a/internal/php5/php5.go b/internal/php5/php5.go index cf203cfb7976024ee7a247f7f0c322ab2a0ddf55..24fa23b155e37a3733f09cae54685b40a61807f9 100644 GIT binary patch delta 25993 zcmd6Qd3?@S_W$eND+q}QN+co)32MtKmK0$Wp|w=CC=#``wxFYGuYIW{iX24G1JJiaya{r*v}=gD)v61R>LCo72L$?Ypz?JJ56N+i>-mBeEeMvWTO_m#ReYIf)~{H4Cb zAFccRh!+R-={uZK!^M74pEmat!)Q!p@wiB&y_LluX=OdpnqJ*0O45u75n)6R-XUt! znFz5#B+!gVkzfQ|SxVNl{t}7F=xn-(qsvu9OWNC8l&8FXB8<9M6)mxhOE>V-7x+xa zKau=XC2AXuuM@Y+Fv^M(MJO*?R5#AjYo%yng~tdf3Snf{5EYFW;&au64%ZNEj1ZBJ zimUWhbup5Dcw2cE;XdS85lee&h_0p~EeyFs=-o$<9*Oe468IDr?i)_M(OlV7V9MGD?k90p#BR3|fzx300m-zaad{b)v2v#T?&;&!JLX zL}`lsQIw+ET|{jomKGq&Y9uz&{Ads#(?=U&JN_nTQ(P05ErJ8Tw>Q?XF-Z5ruaH5A zS20RY5mCl*nMV#iBifrFtc)fiNtk}6`9F$Ulu<&4(1oUAfsAWt^{Ogc3)`z@=*=q119_Z4v|Cf6Ip#y!A<~|`> ziDb{AR&IxN^eV2R=(n39jgIiwKiC@d-*u>gbhtwyg8r`@YCn3v6Lt;*>WfJEE~U@Sp$C z%$Fh?HI6iSn0!oG8M1ixI=FAOe*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00@uPapeuAd?+EjV#pE_B7*)%QY?cPb?SLh@R z(KnjCDd&p%%hrzJw!qiShT$1!(9LU5CI9m79?;#ts6-yTQWX6wPwh73ykTYyyy@se zb)}I%slGZR#LE9xm5^dpd{cgQyPlc(&S_%Q|@Bf~qt8d?~zKw}bT$UK1o9 zb#iX~{`E8c$X&w0VMZFMFO%~fVNWdaq?h%15Iq=uZgJ4}dI5PSy5S}0!2rw4K9C 0 { - pos = position.NewTokenNodeListPosition($1, $4) + pos = yylex.(*Parser).builder.NewTokenNodeListPosition($1, $4) } $$ = &ast.StmtIf{ @@ -796,7 +795,7 @@ unticked_statement: | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { $$ = &ast.StmtIf{ - Position: position.NewTokensPosition($1, $8), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), Alt: true, IfTkn: $1, OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, @@ -804,7 +803,7 @@ unticked_statement: CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, ColonTkn: $3, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($4), + Position: yylex.(*Parser).builder.NewNodeListPosition($4), Stmts: $4, }, ElseIf: $5, @@ -819,14 +818,14 @@ unticked_statement: $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn $3.(*ast.StmtWhile).Cond = $2.(*ast.ParserBrackets).Child $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn - $3.(*ast.StmtWhile).Position = position.NewTokenNodePosition($1, $3) + $3.(*ast.StmtWhile).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $3) $$ = $3 } | T_DO statement T_WHILE parenthesis_expr ';' { $$ = &ast.StmtDo{ - Position: position.NewTokensPosition($1, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), DoTkn: $1, Stmt: $2, WhileTkn: $3, @@ -849,7 +848,7 @@ unticked_statement: $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 - $9.(*ast.StmtFor).Position = position.NewTokenNodePosition($1, $9) + $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) $$ = $9 } @@ -859,14 +858,14 @@ unticked_statement: $3.(*ast.StmtSwitch).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn $3.(*ast.StmtSwitch).Cond = $2.(*ast.ParserBrackets).Child $3.(*ast.StmtSwitch).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn - $3.(*ast.StmtSwitch).Position = position.NewTokenNodePosition($1, $3) + $3.(*ast.StmtSwitch).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $3) $$ = $3 } | T_BREAK ';' { $$ = &ast.StmtBreak{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), BreakTkn: $1, SemiColonTkn: $2, } @@ -874,7 +873,7 @@ unticked_statement: | T_BREAK expr ';' { $$ = &ast.StmtBreak{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), BreakTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -883,7 +882,7 @@ unticked_statement: | T_CONTINUE ';' { $$ = &ast.StmtContinue{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), ContinueTkn: $1, SemiColonTkn: $2, } @@ -891,7 +890,7 @@ unticked_statement: | T_CONTINUE expr ';' { $$ = &ast.StmtContinue{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ContinueTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -900,7 +899,7 @@ unticked_statement: | T_RETURN ';' { $$ = &ast.StmtReturn{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), ReturnTkn: $1, SemiColonTkn: $2, } @@ -908,7 +907,7 @@ unticked_statement: | T_RETURN expr_without_variable ';' { $$ = &ast.StmtReturn{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ReturnTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -917,7 +916,7 @@ unticked_statement: | T_RETURN variable ';' { $$ = &ast.StmtReturn{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ReturnTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -926,7 +925,7 @@ unticked_statement: | yield_expr ';' { $$ = &ast.StmtExpression{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Expr: $1, SemiColonTkn: $2, } @@ -936,7 +935,7 @@ unticked_statement: $2.(*ast.StmtGlobal).GlobalTkn = $1 $2.(*ast.StmtGlobal).SemiColonTkn = $3 $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) - $2.(*ast.StmtGlobal).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtGlobal).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } @@ -945,7 +944,7 @@ unticked_statement: $2.(*ast.StmtStatic).StaticTkn = $1 $2.(*ast.StmtStatic).SemiColonTkn = $3 $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) - $2.(*ast.StmtStatic).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtStatic).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } @@ -953,14 +952,14 @@ unticked_statement: { $2.(*ast.StmtEcho).EchoTkn = $1 $2.(*ast.StmtEcho).SemiColonTkn = $3 - $2.(*ast.StmtEcho).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtEcho).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } | T_INLINE_HTML { $$ = &ast.StmtInlineHtml{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), InlineHtmlTkn: $1, Value: $1.Value, } @@ -968,7 +967,7 @@ unticked_statement: | expr ';' { $$ = &ast.StmtExpression{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Expr: $1, SemiColonTkn: $2, } @@ -979,7 +978,7 @@ unticked_statement: $3.(*ast.StmtUnset).OpenParenthesisTkn = $2 $3.(*ast.StmtUnset).CloseParenthesisTkn = $4 $3.(*ast.StmtUnset).SemiColonTkn = $5 - $3.(*ast.StmtUnset).Position = position.NewTokensPosition($1, $5) + $3.(*ast.StmtUnset).Position = yylex.(*Parser).builder.NewTokensPosition($1, $5) $$ = $3 } @@ -997,7 +996,7 @@ unticked_statement: $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $8) + $8.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) $$ = $8 } @@ -1015,7 +1014,7 @@ unticked_statement: $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var } $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $8) + $8.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) $$ = $8 } @@ -1026,22 +1025,22 @@ unticked_statement: $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 - $5.(*ast.StmtDeclare).Position = position.NewTokenNodePosition($1, $5) + $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) $$ = $5 } | ';' { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { - pos := position.NewTokenNodeListPosition($1, $5) + pos := yylex.(*Parser).builder.NewTokenNodeListPosition($1, $5) if $6 != nil { - pos = position.NewTokenNodePosition($1, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($1, $6) } $$ = &ast.StmtTry{ @@ -1057,7 +1056,7 @@ unticked_statement: | T_THROW expr ';' { $$ = &ast.StmtThrow{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ThrowTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1066,10 +1065,10 @@ unticked_statement: | T_GOTO T_STRING ';' { $$ = &ast.StmtGoto{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), GotoTkn: $1, Label: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1086,14 +1085,14 @@ catch_statement: | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { catch := &ast.StmtCatch{ - Position: position.NewTokensPosition($1, $8), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), CatchTkn: $1, OpenParenthesisTkn: $2, Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1115,7 +1114,7 @@ finally_statement: | T_FINALLY '{' inner_statement_list '}' { $$ = &ast.StmtFinally{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), FinallyTkn: $1, OpenCurlyBracketTkn: $2, Stmts: $3, @@ -1150,14 +1149,14 @@ additional_catch: T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' { $$ = &ast.StmtCatch{ - Position: position.NewTokensPosition($1, $8), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), CatchTkn: $1, OpenParenthesisTkn: $2, Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1233,11 +1232,11 @@ unticked_function_declaration_statement: function is_reference T_STRING '(' parameter_list ')' '{' inner_statement_list '}' { $$ = &ast.StmtFunction{ - Position: position.NewTokensPosition($1, $9), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $9), FunctionTkn: $1, AmpersandTkn: $2, FunctionName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1257,9 +1256,9 @@ unticked_class_declaration_statement: { switch n := $1.(type) { case *ast.StmtClass : - n.Position = position.NewNodeTokenPosition($1, $7) + n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) n.ClassName = &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } @@ -1269,9 +1268,9 @@ unticked_class_declaration_statement: n.Stmts = $6 n.CloseCurlyBracket = $7 case *ast.StmtTrait : - n.Position = position.NewNodeTokenPosition($1, $7) + n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) n.TraitName = &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } @@ -1287,10 +1286,10 @@ unticked_class_declaration_statement: | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { $$ = &ast.StmtInterface{ - Position: position.NewTokensPosition($1, $6), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), InterfaceTkn: $1, InterfaceName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1307,17 +1306,17 @@ class_entry_type: T_CLASS { $$ = &ast.StmtClass{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), ClassTkn: $1, } } | T_ABSTRACT T_CLASS { $$ = &ast.StmtClass{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), Modifiers: []ast.Vertex{ &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1328,17 +1327,17 @@ class_entry_type: | T_TRAIT { $$ = &ast.StmtTrait{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), TraitTkn: $1, } } | T_FINAL T_CLASS { $$ = &ast.StmtClass{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), Modifiers: []ast.Vertex{ &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1356,7 +1355,7 @@ extends_from: | T_EXTENDS fully_qualified_class_name { $$ = &ast.StmtClassExtends{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ExtendTkn: $1, ClassName: $2, } @@ -1378,7 +1377,7 @@ interface_extends_list: | T_EXTENDS interface_list { $$ = &ast.StmtInterfaceExtends{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ExtendsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1394,7 +1393,7 @@ implements_list: | T_IMPLEMENTS interface_list { $$ = &ast.StmtClassImplements{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ImplementsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1440,7 +1439,7 @@ foreach_variable: | '&' variable { $$ = &ast.ExprReference{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, } @@ -1455,7 +1454,7 @@ foreach_variable: } $$ = &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -1469,18 +1468,18 @@ for_statement: statement { $$ = &ast.StmtFor{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOR ';' { $$ = &ast.StmtFor{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndForTkn: $3, @@ -1493,18 +1492,18 @@ foreach_statement: statement { $$ = &ast.StmtForeach{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOREACH ';' { $$ = &ast.StmtForeach{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndForeachTkn: $3, @@ -1518,18 +1517,18 @@ declare_statement: statement { $$ = &ast.StmtDeclare{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDDECLARE ';' { $$ = &ast.StmtDeclare{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndDeclareTkn: $3, @@ -1545,9 +1544,9 @@ declare_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtConstant{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Name: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1563,9 +1562,9 @@ declare_list: $1.(*ast.ParserSeparatedList).Items = append( $1.(*ast.ParserSeparatedList).Items, &ast.StmtConstant{ - Position: position.NewTokenNodePosition($3, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1583,7 +1582,7 @@ switch_case_list: '{' case_list '}' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, CaseList: $2, CloseCurlyBracketTkn: $3, @@ -1592,7 +1591,7 @@ switch_case_list: | '{' ';' case_list '}' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), OpenCurlyBracketTkn: $1, CaseSeparatorTkn: $2, CaseList: $3, @@ -1602,7 +1601,7 @@ switch_case_list: | ':' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, CaseList: $2, @@ -1613,7 +1612,7 @@ switch_case_list: | ':' ';' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), Alt: true, ColonTkn: $1, CaseSeparatorTkn: $2, @@ -1633,7 +1632,7 @@ case_list: | case_list T_CASE expr case_separator inner_statement_list { $$ = append($1, &ast.StmtCase{ - Position: position.NewTokenNodeListPosition($2, $5), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $5), CaseTkn: $2, Cond: $3, CaseSeparatorTkn: $4, @@ -1643,7 +1642,7 @@ case_list: | case_list T_DEFAULT case_separator inner_statement_list { $$ = append($1, &ast.StmtDefault{ - Position: position.NewTokenNodeListPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $4), DefaultTkn: $2, CaseSeparatorTkn: $3, Stmts: $4, @@ -1668,18 +1667,18 @@ while_statement: statement { $$ = &ast.StmtWhile{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDWHILE ';' { $$ = &ast.StmtWhile{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndWhileTkn: $3, @@ -1698,7 +1697,7 @@ elseif_list: | elseif_list T_ELSEIF parenthesis_expr statement { $$ = append($1, &ast.StmtElseIf{ - Position: position.NewTokenNodePosition($2, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($2, $4), ElseIfTkn: $2, OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, Cond: $3.(*ast.ParserBrackets).Child, @@ -1717,7 +1716,7 @@ new_elseif_list: | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { $$ = append($1, &ast.StmtElseIf{ - Position: position.NewTokenNodeListPosition($2, $5), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $5), Alt: true, ElseIfTkn: $2, OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, @@ -1725,7 +1724,7 @@ new_elseif_list: CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, ColonTkn: $4, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($5), + Position: yylex.(*Parser).builder.NewNodeListPosition($5), Stmts: $5, }, }) @@ -1741,7 +1740,7 @@ else_single: | T_ELSE statement { $$ = &ast.StmtElse{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ElseTkn: $1, Stmt: $2, } @@ -1757,12 +1756,12 @@ new_else_single: | T_ELSE ':' inner_statement_list { $$ = &ast.StmtElse{ - Position: position.NewTokenNodeListPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3), Alt: true, ElseTkn: $1, ColonTkn: $2, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($3), + Position: yylex.(*Parser).builder.NewNodeListPosition($3), Stmts: $3, }, } @@ -1800,13 +1799,13 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - pos := position.NewTokenPosition($4) + pos := yylex.(*Parser).builder.NewTokenPosition($4) if $1 != nil { - pos = position.NewNodeTokenPosition($1, $4) + pos = yylex.(*Parser).builder.NewNodeTokenPosition($1, $4) } else if $2 != nil { - pos = position.NewTokensPosition($2, $4) + pos = yylex.(*Parser).builder.NewTokensPosition($2, $4) } else if $3 != nil { - pos = position.NewTokensPosition($3, $4) + pos = yylex.(*Parser).builder.NewTokensPosition($3, $4) } $$ = &ast.Parameter{ @@ -1815,9 +1814,9 @@ parameter: AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1826,13 +1825,13 @@ parameter: } | optional_class_type is_reference is_variadic T_VARIABLE '=' expr { - pos := position.NewTokenNodePosition($4, $6) + pos := yylex.(*Parser).builder.NewTokenNodePosition($4, $6) if $1 != nil { - pos = position.NewNodesPosition($1, $6) + pos = yylex.(*Parser).builder.NewNodesPosition($1, $6) } else if $2 != nil { - pos = position.NewTokenNodePosition($2, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($2, $6) } else if $3 != nil { - pos = position.NewTokenNodePosition($3, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($3, $6) } $$ = &ast.Parameter{ @@ -1841,9 +1840,9 @@ parameter: AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1863,7 +1862,7 @@ optional_class_type: | T_ARRAY { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1871,7 +1870,7 @@ optional_class_type: | T_CALLABLE { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1887,7 +1886,7 @@ function_call_parameter_list: '(' ')' { $$ = &ast.ArgumentList{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, } @@ -1895,7 +1894,7 @@ function_call_parameter_list: | '(' non_empty_function_call_parameter_list ')' { argumentList := $2.(*ast.ArgumentList) - argumentList.Position = position.NewTokensPosition($1, $3) + argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) argumentList.OpenParenthesisTkn = $1 argumentList.CloseParenthesisTkn = $3 @@ -1904,11 +1903,11 @@ function_call_parameter_list: | '(' yield_expr ')' { $$ = &ast.ArgumentList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Arguments: []ast.Vertex{ &ast.Argument{ - Position: position.NewNodePosition($2), + Position: yylex.(*Parser).builder.NewNodePosition($2), Expr: $2, }, }, @@ -1938,21 +1937,21 @@ function_call_parameter: expr_without_variable { $$ = &ast.Argument{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Expr: $1, } } | variable { $$ = &ast.Argument{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Expr: $1, } } | '&' w_variable { $$ = &ast.Argument{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Expr: $2, } @@ -1960,7 +1959,7 @@ function_call_parameter: | T_ELLIPSIS expr { $$ = &ast.Argument{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), VariadicTkn: $1, Expr: $2, } @@ -1988,9 +1987,9 @@ global_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1999,7 +1998,7 @@ global_var: | '$' r_variable { $$ = &ast.ExprVariable{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DollarTkn: $1, VarName: $2, } @@ -2007,10 +2006,10 @@ global_var: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -2024,11 +2023,11 @@ static_var_list: static_var_list ',' T_VARIABLE { $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2041,11 +2040,11 @@ static_var_list: | static_var_list ',' T_VARIABLE '=' static_scalar { $1.(*ast.StmtStatic).Vars = append($1.(*ast.StmtStatic).Vars, &ast.StmtStaticVar{ - Position: position.NewTokenNodePosition($3, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2062,11 +2061,11 @@ static_var_list: $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2080,11 +2079,11 @@ static_var_list: $$ = &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2114,7 +2113,7 @@ class_statement: variable_modifiers class_variable_declaration ';' { $$ = &ast.StmtPropertyList{ - Position: position.NewNodeListTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $3), Modifiers: $1, Properties: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -2124,7 +2123,7 @@ class_statement: | class_constant_declaration ';' { $1.(*ast.StmtClassConstList).SemiColonTkn = $2 - $1.(*ast.StmtClassConstList).Position = position.NewNodeTokenPosition($1, $2) + $1.(*ast.StmtClassConstList).Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $2) $$ = $1 } | trait_use_statement @@ -2133,9 +2132,9 @@ class_statement: } | method_modifiers function is_reference T_STRING '(' parameter_list ')' method_body { - pos := position.NewTokenNodePosition($2, $8) + pos := yylex.(*Parser).builder.NewTokenNodePosition($2, $8) if $1 != nil { - pos = position.NewNodeListNodePosition($1, $8) + pos = yylex.(*Parser).builder.NewNodeListNodePosition($1, $8) } $$ = &ast.StmtClassMethod{ @@ -2144,7 +2143,7 @@ class_statement: FunctionTkn: $2, AmpersandTkn: $3, MethodName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2161,7 +2160,7 @@ trait_use_statement: T_USE trait_list trait_adaptations { $$ = &ast.StmtTraitUse{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, Traits: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -2190,14 +2189,14 @@ trait_adaptations: ';' { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' trait_adaptation_list '}' { $$ = &ast.StmtTraitAdaptationList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Adaptations: $2, CloseParenthesisTkn: $3, @@ -2246,7 +2245,7 @@ trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Ref: $1, InsteadofTkn: $2, Insteadof: $3.(*ast.ParserSeparatedList).Items, @@ -2275,9 +2274,9 @@ trait_method_reference: T_STRING { $$ = &ast.StmtTraitMethodRef{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2293,11 +2292,11 @@ trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.StmtTraitMethodRef{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, Method: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2309,12 +2308,12 @@ trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Ref: $1, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2323,7 +2322,7 @@ trait_alias: | trait_method_reference T_AS member_modifier { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Ref: $1, AsTkn: $2, Modifier: $3, @@ -2346,14 +2345,14 @@ method_body: ';' /* abstract method */ { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' inner_statement_list '}' { $$ = &ast.StmtStmtList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracket: $1, Stmts: $2, CloseCurlyBracket: $3, @@ -2370,7 +2369,7 @@ variable_modifiers: { $$ = []ast.Vertex{ &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2404,7 +2403,7 @@ member_modifier: T_PUBLIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2412,7 +2411,7 @@ member_modifier: | T_PROTECTED { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2420,7 +2419,7 @@ member_modifier: | T_PRIVATE { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2428,7 +2427,7 @@ member_modifier: | T_STATIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2436,7 +2435,7 @@ member_modifier: | T_ABSTRACT { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2444,7 +2443,7 @@ member_modifier: | T_FINAL { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2455,11 +2454,11 @@ class_variable_declaration: class_variable_declaration ',' T_VARIABLE { item := &ast.StmtProperty{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2474,11 +2473,11 @@ class_variable_declaration: | class_variable_declaration ',' T_VARIABLE '=' static_scalar { item := &ast.StmtProperty{ - Position: position.NewTokenNodePosition($3, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2497,11 +2496,11 @@ class_variable_declaration: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2516,11 +2515,11 @@ class_variable_declaration: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2537,12 +2536,12 @@ class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { constList := $1.(*ast.StmtClassConstList) - constList.Position = position.NewNodesPosition($1, $5) + constList.Position = yylex.(*Parser).builder.NewNodesPosition($1, $5) constList.SeparatorTkns = append(constList.SeparatorTkns, $2) constList.Consts = append(constList.Consts, &ast.StmtConstant{ - Position: position.NewTokenNodePosition($3, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2555,13 +2554,13 @@ class_constant_declaration: | T_CONST T_STRING '=' static_scalar { $$ = &ast.StmtClassConstList{ - Position: position.NewTokenNodePosition($1, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), ConstTkn: $1, Consts: []ast.Vertex{ &ast.StmtConstant{ - Position: position.NewTokenNodePosition($2, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($2, $4), Name: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -2632,7 +2631,7 @@ chaining_dereference: chaining_dereference '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -2644,7 +2643,7 @@ chaining_dereference: | '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Var: nil, OpenBracketTkn: $1, Dim: $2, @@ -2686,7 +2685,7 @@ new_expr: { if $3 != nil { $$ = &ast.ExprNew{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, @@ -2696,7 +2695,7 @@ new_expr: } } else { $$ = &ast.ExprNew{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), Class: $2, } } @@ -2707,9 +2706,9 @@ expr_without_variable: T_LIST '(' assignment_list ')' '=' expr { $$ = &ast.ExprAssign{ - Position: position.NewTokenNodePosition($1, $6), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $6), Var: &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -2723,7 +2722,7 @@ expr_without_variable: | variable '=' expr { $$ = &ast.ExprAssign{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2732,7 +2731,7 @@ expr_without_variable: | variable '=' '&' variable { $$ = &ast.ExprAssignReference{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Var: $1, EqualTkn: $2, AmpersandTkn: $3, @@ -2744,7 +2743,7 @@ expr_without_variable: var _new *ast.ExprNew if $3 != nil { _new = &ast.ExprNew{ - Position: position.NewTokenNodePosition($4, $6), + Position: yylex.(*Parser).builder.NewTokenNodePosition($4, $6), NewTkn: $4, Class: $5, OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, @@ -2754,14 +2753,14 @@ expr_without_variable: } } else { _new = &ast.ExprNew{ - Position: position.NewTokenNodePosition($4, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($4, $5), NewTkn: $4, Class: $5, } } $$ = &ast.ExprAssignReference{ - Position: position.NewNodesPosition($1, _new), + Position: yylex.(*Parser).builder.NewNodesPosition($1, _new), Var: $1, EqualTkn: $2, AmpersandTkn: $3, @@ -2771,7 +2770,7 @@ expr_without_variable: | T_CLONE expr { $$ = &ast.ExprClone{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CloneTkn: $1, Expr: $2, } @@ -2779,7 +2778,7 @@ expr_without_variable: | variable T_PLUS_EQUAL expr { $$ = &ast.ExprAssignPlus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2788,7 +2787,7 @@ expr_without_variable: | variable T_MINUS_EQUAL expr { $$ = &ast.ExprAssignMinus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2797,7 +2796,7 @@ expr_without_variable: | variable T_MUL_EQUAL expr { $$ = &ast.ExprAssignMul{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2806,7 +2805,7 @@ expr_without_variable: | variable T_POW_EQUAL expr { $$ = &ast.ExprAssignPow{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2815,7 +2814,7 @@ expr_without_variable: | variable T_DIV_EQUAL expr { $$ = &ast.ExprAssignDiv{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2824,7 +2823,7 @@ expr_without_variable: | variable T_CONCAT_EQUAL expr { $$ = &ast.ExprAssignConcat{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2833,7 +2832,7 @@ expr_without_variable: | variable T_MOD_EQUAL expr { $$ = &ast.ExprAssignMod{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2842,7 +2841,7 @@ expr_without_variable: | variable T_AND_EQUAL expr { $$ = &ast.ExprAssignBitwiseAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2851,7 +2850,7 @@ expr_without_variable: | variable T_OR_EQUAL expr { $$ = &ast.ExprAssignBitwiseOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2860,7 +2859,7 @@ expr_without_variable: | variable T_XOR_EQUAL expr { $$ = &ast.ExprAssignBitwiseXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2869,7 +2868,7 @@ expr_without_variable: | variable T_SL_EQUAL expr { $$ = &ast.ExprAssignShiftLeft{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2878,7 +2877,7 @@ expr_without_variable: | variable T_SR_EQUAL expr { $$ = &ast.ExprAssignShiftRight{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2887,7 +2886,7 @@ expr_without_variable: | rw_variable T_INC { $$ = &ast.ExprPostInc{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Var: $1, IncTkn: $2, } @@ -2895,7 +2894,7 @@ expr_without_variable: | T_INC rw_variable { $$ = &ast.ExprPreInc{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncTkn: $1, Var: $2, } @@ -2903,7 +2902,7 @@ expr_without_variable: | rw_variable T_DEC { $$ = &ast.ExprPostDec{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Var: $1, DecTkn: $2, } @@ -2911,7 +2910,7 @@ expr_without_variable: | T_DEC rw_variable { $$ = &ast.ExprPreDec{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DecTkn: $1, Var: $2, } @@ -2919,7 +2918,7 @@ expr_without_variable: | expr T_BOOLEAN_OR expr { $$ = &ast.ExprBinaryBooleanOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2928,7 +2927,7 @@ expr_without_variable: | expr T_BOOLEAN_AND expr { $$ = &ast.ExprBinaryBooleanAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2937,7 +2936,7 @@ expr_without_variable: | expr T_LOGICAL_OR expr { $$ = &ast.ExprBinaryLogicalOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2946,7 +2945,7 @@ expr_without_variable: | expr T_LOGICAL_AND expr { $$ = &ast.ExprBinaryLogicalAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2955,7 +2954,7 @@ expr_without_variable: | expr T_LOGICAL_XOR expr { $$ = &ast.ExprBinaryLogicalXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2964,7 +2963,7 @@ expr_without_variable: | expr '|' expr { $$ = &ast.ExprBinaryBitwiseOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2973,7 +2972,7 @@ expr_without_variable: | expr '&' expr { $$ = &ast.ExprBinaryBitwiseAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2982,7 +2981,7 @@ expr_without_variable: | expr '^' expr { $$ = &ast.ExprBinaryBitwiseXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2991,7 +2990,7 @@ expr_without_variable: | expr '.' expr { $$ = &ast.ExprBinaryConcat{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3000,7 +2999,7 @@ expr_without_variable: | expr '+' expr { $$ = &ast.ExprBinaryPlus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3009,7 +3008,7 @@ expr_without_variable: | expr '-' expr { $$ = &ast.ExprBinaryMinus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3018,7 +3017,7 @@ expr_without_variable: | expr '*' expr { $$ = &ast.ExprBinaryMul{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3027,7 +3026,7 @@ expr_without_variable: | expr T_POW expr { $$ = &ast.ExprBinaryPow{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3036,7 +3035,7 @@ expr_without_variable: | expr '/' expr { $$ = &ast.ExprBinaryDiv{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3045,7 +3044,7 @@ expr_without_variable: | expr '%' expr { $$ = &ast.ExprBinaryMod{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3054,7 +3053,7 @@ expr_without_variable: | expr T_SL expr { $$ = &ast.ExprBinaryShiftLeft{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3063,7 +3062,7 @@ expr_without_variable: | expr T_SR expr { $$ = &ast.ExprBinaryShiftRight{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3072,7 +3071,7 @@ expr_without_variable: | '+' expr %prec T_INC { $$ = &ast.ExprUnaryPlus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), PlusTkn: $1, Expr: $2, } @@ -3080,7 +3079,7 @@ expr_without_variable: | '-' expr %prec T_INC { $$ = &ast.ExprUnaryMinus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), MinusTkn: $1, Expr: $2, } @@ -3088,7 +3087,7 @@ expr_without_variable: | '!' expr { $$ = &ast.ExprBooleanNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ExclamationTkn: $1, Expr: $2, } @@ -3096,7 +3095,7 @@ expr_without_variable: | '~' expr { $$ = &ast.ExprBitwiseNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), TildaTkn: $1, Expr: $2, } @@ -3104,7 +3103,7 @@ expr_without_variable: | expr T_IS_IDENTICAL expr { $$ = &ast.ExprBinaryIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3113,7 +3112,7 @@ expr_without_variable: | expr T_IS_NOT_IDENTICAL expr { $$ = &ast.ExprBinaryNotIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3122,7 +3121,7 @@ expr_without_variable: | expr T_IS_EQUAL expr { $$ = &ast.ExprBinaryEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3131,7 +3130,7 @@ expr_without_variable: | expr T_IS_NOT_EQUAL expr { $$ = &ast.ExprBinaryNotEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3140,7 +3139,7 @@ expr_without_variable: | expr '<' expr { $$ = &ast.ExprBinarySmaller{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3149,7 +3148,7 @@ expr_without_variable: | expr T_IS_SMALLER_OR_EQUAL expr { $$ = &ast.ExprBinarySmallerOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3158,7 +3157,7 @@ expr_without_variable: | expr '>' expr { $$ = &ast.ExprBinaryGreater{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3167,7 +3166,7 @@ expr_without_variable: | expr T_IS_GREATER_OR_EQUAL expr { $$ = &ast.ExprBinaryGreaterOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3176,7 +3175,7 @@ expr_without_variable: | expr T_INSTANCEOF class_name_reference { $$ = &ast.ExprInstanceOf{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Expr: $1, InstanceOfTkn: $2, Class: $3, @@ -3193,7 +3192,7 @@ expr_without_variable: | '(' new_expr ')' instance_call { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3203,22 +3202,22 @@ expr_without_variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn } } @@ -3226,7 +3225,7 @@ expr_without_variable: | expr '?' expr ':' expr { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $5), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -3237,7 +3236,7 @@ expr_without_variable: | expr '?' ':' expr { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -3251,7 +3250,7 @@ expr_without_variable: | T_INT_CAST expr { $$ = &ast.ExprCastInt{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3259,7 +3258,7 @@ expr_without_variable: | T_DOUBLE_CAST expr { $$ = &ast.ExprCastDouble{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3267,7 +3266,7 @@ expr_without_variable: | T_STRING_CAST expr { $$ = &ast.ExprCastString{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3275,7 +3274,7 @@ expr_without_variable: | T_ARRAY_CAST expr { $$ = &ast.ExprCastArray{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3283,7 +3282,7 @@ expr_without_variable: | T_OBJECT_CAST expr { $$ = &ast.ExprCastObject{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3291,7 +3290,7 @@ expr_without_variable: | T_BOOL_CAST expr { $$ = &ast.ExprCastBool{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3299,7 +3298,7 @@ expr_without_variable: | T_UNSET_CAST expr { $$ = &ast.ExprCastUnset{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3311,9 +3310,9 @@ expr_without_variable: } if $2 == nil { - exit.Position = position.NewTokenPosition($1) + exit.Position = yylex.(*Parser).builder.NewTokenPosition($1) } else { - exit.Position = position.NewTokenNodePosition($1, $2) + exit.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) exit.OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn exit.Expr = $2.(*ast.ParserBrackets).Child exit.CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn @@ -3324,7 +3323,7 @@ expr_without_variable: | '@' expr { $$ = &ast.ExprErrorSuppress{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AtTkn: $1, Expr: $2, } @@ -3344,7 +3343,7 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = &ast.ExprShellExec{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBacktickTkn: $1, Parts: $2, CloseBacktickTkn: $3, @@ -3353,7 +3352,7 @@ expr_without_variable: | T_PRINT expr { $$ = &ast.ExprPrint{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), PrintTkn: $1, Expr: $2, } @@ -3361,14 +3360,14 @@ expr_without_variable: | T_YIELD { $$ = &ast.ExprYield{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), YieldTkn: $1, } } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Position: position.NewTokensPosition($1, $9), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $9), FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, @@ -3384,7 +3383,7 @@ expr_without_variable: | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Position: position.NewTokensPosition($1, $10), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $10), StaticTkn: $1, FunctionTkn: $2, AmpersandTkn: $3, @@ -3404,7 +3403,7 @@ yield_expr: T_YIELD expr_without_variable { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3412,7 +3411,7 @@ yield_expr: | T_YIELD variable { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3420,7 +3419,7 @@ yield_expr: | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3430,7 +3429,7 @@ yield_expr: | T_YIELD expr T_DOUBLE_ARROW variable { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3443,7 +3442,7 @@ combined_scalar_offset: combined_scalar '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3453,7 +3452,7 @@ combined_scalar_offset: | combined_scalar_offset '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3463,9 +3462,9 @@ combined_scalar_offset: | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Var: &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, }, @@ -3477,7 +3476,7 @@ combined_scalar_offset: | general_constant '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3490,7 +3489,7 @@ combined_scalar: T_ARRAY '(' array_pair_list ')' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -3501,7 +3500,7 @@ combined_scalar: | '[' array_pair_list ']' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3525,7 +3524,7 @@ lexical_vars: | T_USE '(' lexical_var_list ')' { $$ = &ast.ExprClosureUse{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, OpenParenthesisTkn: $2, Uses: $3.(*ast.ParserSeparatedList).Items, @@ -3539,9 +3538,9 @@ lexical_var_list: lexical_var_list ',' T_VARIABLE { variable := &ast.ExprVariable{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -3555,12 +3554,12 @@ lexical_var_list: | lexical_var_list ',' '&' T_VARIABLE { reference := &ast.ExprReference{ - Position: position.NewTokensPosition($3, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($3, $4), AmpersandTkn: $3, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -3577,9 +3576,9 @@ lexical_var_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -3592,12 +3591,12 @@ lexical_var_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprReference{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), AmpersandTkn: $1, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -3612,9 +3611,9 @@ function_call: namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), + Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), Function: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -3627,9 +3626,9 @@ function_call: | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewTokenNodePosition($1, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), Function: &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -3644,9 +3643,9 @@ function_call: | T_NS_SEPARATOR namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Function: &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3660,7 +3659,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3673,7 +3672,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3686,7 +3685,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3699,7 +3698,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3712,7 +3711,7 @@ function_call: | variable_without_objects function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewNodesPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -3726,7 +3725,7 @@ class_name: T_STATIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -3734,7 +3733,7 @@ class_name: | namespace_name { $$ = &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } @@ -3742,7 +3741,7 @@ class_name: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -3752,7 +3751,7 @@ class_name: | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3764,7 +3763,7 @@ fully_qualified_class_name: namespace_name { $$ = &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } @@ -3772,7 +3771,7 @@ fully_qualified_class_name: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -3782,7 +3781,7 @@ fully_qualified_class_name: | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3812,12 +3811,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - *$$.GetPosition() = *position.NewNodesPosition($$, nn) + *$$.GetPosition() = *yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - *$$.GetPosition() = *position.NewNodesPosition($$, nn) + *$$.GetPosition() = *yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn } } @@ -3826,12 +3825,12 @@ dynamic_class_name_reference: switch nn := n.(type) { case *ast.ExprArrayDimFetch: nn.Var = $$ - *$$.GetPosition() = *position.NewNodesPosition($$, nn) + *$$.GetPosition() = *yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - *$$.GetPosition() = *position.NewNodesPosition($$, nn) + *$$.GetPosition() = *yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn } } @@ -3872,7 +3871,7 @@ exit_expr: | '(' ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenBracketTkn: $1, CloseBracketTkn: $2, } @@ -3892,7 +3891,7 @@ backticks_expr: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -3919,7 +3918,7 @@ common_scalar: T_LNUMBER { $$ = &ast.ScalarLnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3927,7 +3926,7 @@ common_scalar: | T_DNUMBER { $$ = &ast.ScalarDnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3935,7 +3934,7 @@ common_scalar: | T_CONSTANT_ENCAPSED_STRING { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -3943,7 +3942,7 @@ common_scalar: | T_LINE { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3951,7 +3950,7 @@ common_scalar: | T_FILE { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3959,7 +3958,7 @@ common_scalar: | T_DIR { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3967,7 +3966,7 @@ common_scalar: | T_TRAIT_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3975,7 +3974,7 @@ common_scalar: | T_METHOD_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3983,7 +3982,7 @@ common_scalar: | T_FUNC_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3991,7 +3990,7 @@ common_scalar: | T_NS_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3999,11 +3998,11 @@ common_scalar: | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -4014,7 +4013,7 @@ common_scalar: | T_START_HEREDOC T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenHeredocTkn: $1, CloseHeredocTkn: $2, } @@ -4025,11 +4024,11 @@ static_class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4056,9 +4055,9 @@ static_scalar_value: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Const: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -4067,9 +4066,9 @@ static_scalar_value: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4080,9 +4079,9 @@ static_scalar_value: | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4092,7 +4091,7 @@ static_scalar_value: | T_ARRAY '(' static_array_pair_list ')' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -4103,7 +4102,7 @@ static_scalar_value: | '[' static_array_pair_list ']' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4117,7 +4116,7 @@ static_scalar_value: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4132,7 +4131,7 @@ static_operation: static_scalar_value '[' static_scalar_value ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4142,7 +4141,7 @@ static_operation: | static_scalar_value '+' static_scalar_value { $$ = &ast.ExprBinaryPlus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4151,7 +4150,7 @@ static_operation: | static_scalar_value '-' static_scalar_value { $$ = &ast.ExprBinaryMinus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4160,7 +4159,7 @@ static_operation: | static_scalar_value '*' static_scalar_value { $$ = &ast.ExprBinaryMul{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4169,7 +4168,7 @@ static_operation: | static_scalar_value T_POW static_scalar_value { $$ = &ast.ExprBinaryPow{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4178,7 +4177,7 @@ static_operation: | static_scalar_value '/' static_scalar_value { $$ = &ast.ExprBinaryDiv{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4187,7 +4186,7 @@ static_operation: | static_scalar_value '%' static_scalar_value { $$ = &ast.ExprBinaryMod{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4196,7 +4195,7 @@ static_operation: | '!' static_scalar_value { $$ = &ast.ExprBooleanNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ExclamationTkn: $1, Expr: $2, } @@ -4204,7 +4203,7 @@ static_operation: | '~' static_scalar_value { $$ = &ast.ExprBitwiseNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), TildaTkn: $1, Expr: $2, } @@ -4212,7 +4211,7 @@ static_operation: | static_scalar_value '|' static_scalar_value { $$ = &ast.ExprBinaryBitwiseOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4221,7 +4220,7 @@ static_operation: | static_scalar_value '&' static_scalar_value { $$ = &ast.ExprBinaryBitwiseAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4230,7 +4229,7 @@ static_operation: | static_scalar_value '^' static_scalar_value { $$ = &ast.ExprBinaryBitwiseXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4239,7 +4238,7 @@ static_operation: | static_scalar_value T_SL static_scalar_value { $$ = &ast.ExprBinaryShiftLeft{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4248,7 +4247,7 @@ static_operation: | static_scalar_value T_SR static_scalar_value { $$ = &ast.ExprBinaryShiftRight{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4257,7 +4256,7 @@ static_operation: | static_scalar_value '.' static_scalar_value { $$ = &ast.ExprBinaryConcat{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4266,7 +4265,7 @@ static_operation: | static_scalar_value T_LOGICAL_XOR static_scalar_value { $$ = &ast.ExprBinaryLogicalXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4275,7 +4274,7 @@ static_operation: | static_scalar_value T_LOGICAL_AND static_scalar_value { $$ = &ast.ExprBinaryLogicalAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4284,7 +4283,7 @@ static_operation: | static_scalar_value T_LOGICAL_OR static_scalar_value { $$ = &ast.ExprBinaryLogicalOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4293,7 +4292,7 @@ static_operation: | static_scalar_value T_BOOLEAN_AND static_scalar_value { $$ = &ast.ExprBinaryBooleanAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4302,7 +4301,7 @@ static_operation: | static_scalar_value T_BOOLEAN_OR static_scalar_value { $$ = &ast.ExprBinaryBooleanOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4311,7 +4310,7 @@ static_operation: | static_scalar_value T_IS_IDENTICAL static_scalar_value { $$ = &ast.ExprBinaryIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4320,7 +4319,7 @@ static_operation: | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { $$ = &ast.ExprBinaryNotIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4329,7 +4328,7 @@ static_operation: | static_scalar_value T_IS_EQUAL static_scalar_value { $$ = &ast.ExprBinaryEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4338,7 +4337,7 @@ static_operation: | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { $$ = &ast.ExprBinaryNotEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4347,7 +4346,7 @@ static_operation: | static_scalar_value '<' static_scalar_value { $$ = &ast.ExprBinarySmaller{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4356,7 +4355,7 @@ static_operation: | static_scalar_value '>' static_scalar_value { $$ = &ast.ExprBinaryGreater{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4365,7 +4364,7 @@ static_operation: | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { $$ = &ast.ExprBinarySmallerOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4374,7 +4373,7 @@ static_operation: | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { $$ = &ast.ExprBinaryGreaterOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -4383,7 +4382,7 @@ static_operation: | static_scalar_value '?' ':' static_scalar_value { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -4393,7 +4392,7 @@ static_operation: | static_scalar_value '?' static_scalar_value ':' static_scalar_value { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $5), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -4404,7 +4403,7 @@ static_operation: | '+' static_scalar_value { $$ = &ast.ExprUnaryPlus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), PlusTkn: $1, Expr: $2, } @@ -4412,7 +4411,7 @@ static_operation: | '-' static_scalar_value { $$ = &ast.ExprUnaryMinus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), MinusTkn: $1, Expr: $2, } @@ -4420,7 +4419,7 @@ static_operation: | '(' static_scalar_value ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4436,9 +4435,9 @@ general_constant: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Const: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -4447,9 +4446,9 @@ general_constant: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -4460,9 +4459,9 @@ general_constant: | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -4475,9 +4474,9 @@ scalar: T_STRING_VARNAME { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4498,7 +4497,7 @@ scalar: | '"' encaps_list '"' { $$ = &ast.ScalarEncapsed{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, CloseQoteTkn: $1, @@ -4507,7 +4506,7 @@ scalar: | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: $2, CloseHeredocTkn: $3, @@ -4516,7 +4515,7 @@ scalar: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -4554,7 +4553,7 @@ non_empty_static_array_pair_list: non_empty_static_array_pair_list ',' static_scalar_value T_DOUBLE_ARROW static_scalar_value { arrayItem := &ast.ExprArrayItem{ - Position: position.NewNodesPosition($3, $5), + Position: yylex.(*Parser).builder.NewNodesPosition($3, $5), Key: $3, DoubleArrowTkn: $4, Val: $5, @@ -4568,7 +4567,7 @@ non_empty_static_array_pair_list: | non_empty_static_array_pair_list ',' static_scalar_value { arrayItem := &ast.ExprArrayItem{ - Position: position.NewNodePosition($3), + Position: yylex.(*Parser).builder.NewNodePosition($3), Val: $3, } @@ -4582,7 +4581,7 @@ non_empty_static_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -4595,7 +4594,7 @@ non_empty_static_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Val: $1, }, }, @@ -4618,7 +4617,7 @@ parenthesis_expr: '(' expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4627,7 +4626,7 @@ parenthesis_expr: | '(' yield_expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4671,7 +4670,7 @@ variable: case *ast.ExprArrayDimFetch: mc := $4[0].(*ast.ExprMethodCall) $3 = append($3, &ast.ExprFunctionCall{ - Position: position.NewNodePosition(mc), + Position: yylex.(*Parser).builder.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, SeparatorTkns: mc.SeparatorTkns, @@ -4690,22 +4689,22 @@ variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn } } @@ -4714,22 +4713,22 @@ variable: switch nn := n.(type) { case *ast.ExprFunctionCall: nn.Function = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprArrayDimFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprPropertyFetch: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn case *ast.ExprMethodCall: nn.Var = $$ - nn.Position = position.NewNodesPosition($$, nn) + nn.Position = yylex.(*Parser).builder.NewNodesPosition($$, nn) $$ = nn } } @@ -4763,7 +4762,7 @@ variable_property: case *ast.ExprArrayDimFetch: mc := $3[0].(*ast.ExprMethodCall) $2 = append($2, &ast.ExprFunctionCall{ - Position: position.NewNodePosition(mc), + Position: yylex.(*Parser).builder.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, SeparatorTkns: mc.SeparatorTkns, @@ -4786,7 +4785,7 @@ array_method_dereference: array_method_dereference '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -4798,7 +4797,7 @@ array_method_dereference: | method '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -4813,7 +4812,7 @@ method: function_call_parameter_list { $$ = &ast.ExprMethodCall{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $1.(*ast.ArgumentList).Arguments, SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns, @@ -4846,7 +4845,7 @@ variable_without_objects: { for i := len($1)-1; i>=0; i-- { $1[i].(*ast.ExprVariable).VarName = $2 - $1[i].(*ast.ExprVariable).Position = position.NewNodesPosition($1[i], $2) + $1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -4858,7 +4857,7 @@ static_member: class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4867,7 +4866,7 @@ static_member: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -4886,7 +4885,7 @@ array_function_dereference: array_function_dereference '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4896,7 +4895,7 @@ array_function_dereference: | function_call '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4930,7 +4929,7 @@ base_variable: { for i := len($1)-1; i>=0; i-- { $1[i].(*ast.ExprVariable).VarName = $2 - $1[i].(*ast.ExprVariable).Position = position.NewNodesPosition($1[i], $2) + $1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -4946,7 +4945,7 @@ reference_variable: reference_variable '[' dim_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4956,7 +4955,7 @@ reference_variable: | reference_variable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -4974,9 +4973,9 @@ compound_variable: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4985,10 +4984,10 @@ compound_variable: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -5018,7 +5017,7 @@ object_property: { $$ = []ast.Vertex{ &ast.ExprPropertyFetch{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Property: $1, }, } @@ -5029,7 +5028,7 @@ object_dim_list: object_dim_list '[' dim_offset ']' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5041,7 +5040,7 @@ object_dim_list: | object_dim_list '{' expr '}' { fetch := &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), Var: nil, OpenBracketTkn: $2, Dim: $3, @@ -5054,7 +5053,7 @@ object_dim_list: { $$ = []ast.Vertex{ &ast.ExprPropertyFetch{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Property: $1, }, } @@ -5065,7 +5064,7 @@ variable_name: T_STRING { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -5073,7 +5072,7 @@ variable_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5086,7 +5085,7 @@ simple_indirect_reference: { $$ = []ast.Vertex{ &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), DollarTkn: $1, }, } @@ -5094,7 +5093,7 @@ simple_indirect_reference: | simple_indirect_reference '$' { $$ = append($1, &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), DollarTkn: $2, }) } @@ -5121,7 +5120,7 @@ assignment_list_element: variable { $$ = &ast.ExprArrayItem{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Val: $1, } } @@ -5135,9 +5134,9 @@ assignment_list_element: } $$ = &ast.ExprArrayItem{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Val: &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -5173,7 +5172,7 @@ non_empty_array_pair_list: non_empty_array_pair_list ',' expr T_DOUBLE_ARROW expr { arrayItem := &ast.ExprArrayItem{ - Position: position.NewNodesPosition($3, $5), + Position: yylex.(*Parser).builder.NewNodesPosition($3, $5), Key: $3, DoubleArrowTkn: $4, Val: $5, @@ -5187,7 +5186,7 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' expr { arrayItem := &ast.ExprArrayItem{ - Position: position.NewNodePosition($3), + Position: yylex.(*Parser).builder.NewNodePosition($3), Val: $3, } @@ -5201,7 +5200,7 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -5214,7 +5213,7 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Val: $1, }, }, @@ -5223,11 +5222,11 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Position: position.NewNodesPosition($3, $6), + Position: yylex.(*Parser).builder.NewNodesPosition($3, $6), Key: $3, DoubleArrowTkn: $4, Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($5, $6), + Position: yylex.(*Parser).builder.NewTokenNodePosition($5, $6), AmpersandTkn: $5, Var: $6, }, @@ -5241,9 +5240,9 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Position: position.NewTokenNodePosition($3, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($3, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -5259,11 +5258,11 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($3, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -5276,9 +5275,9 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, }, @@ -5298,7 +5297,7 @@ encaps_list: $$ = append( $1, &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -5312,7 +5311,7 @@ encaps_list: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -5325,9 +5324,9 @@ encaps_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -5336,11 +5335,11 @@ encaps_var: | T_VARIABLE '[' encaps_var_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -5353,18 +5352,18 @@ encaps_var: | T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = &ast.ExprPropertyFetch{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, Property: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -5373,10 +5372,10 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Position: position.NewNodePosition($2), + Position: yylex.(*Parser).builder.NewNodePosition($2), VarName: $2, }, CloseBracketTkn: $3, @@ -5385,12 +5384,12 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -5401,14 +5400,14 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $6), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), OpenBracketTkn: $1, Child: &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $5), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -5423,7 +5422,7 @@ encaps_var: | T_CURLY_OPEN variable '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -5435,7 +5434,7 @@ encaps_var_offset: T_STRING { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -5445,13 +5444,13 @@ encaps_var_offset: // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { $$ = &ast.ScalarLnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } } else { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -5460,9 +5459,9 @@ encaps_var_offset: | T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -5474,7 +5473,7 @@ internal_functions_in_yacc: T_ISSET '(' isset_variables ')' { $$ = &ast.ExprIsset{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), IssetTkn: $1, OpenParenthesisTkn: $2, Vars: $3.(*ast.ParserSeparatedList).Items, @@ -5485,7 +5484,7 @@ internal_functions_in_yacc: | T_EMPTY '(' variable ')' { $$ = &ast.ExprEmpty{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -5495,7 +5494,7 @@ internal_functions_in_yacc: | T_EMPTY '(' expr ')' { $$ = &ast.ExprEmpty{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -5505,7 +5504,7 @@ internal_functions_in_yacc: | T_INCLUDE expr { $$ = &ast.ExprInclude{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -5513,7 +5512,7 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -5521,7 +5520,7 @@ internal_functions_in_yacc: | T_EVAL '(' expr ')' { $$ = &ast.ExprEval{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), EvalTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -5531,7 +5530,7 @@ internal_functions_in_yacc: | T_REQUIRE expr { $$ = &ast.ExprRequire{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), RequireTkn: $1, Expr: $2, } @@ -5539,7 +5538,7 @@ internal_functions_in_yacc: | T_REQUIRE_ONCE expr { $$ = &ast.ExprRequireOnce{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), RequireOnceTkn: $1, Expr: $2, } @@ -5577,11 +5576,11 @@ class_constant: class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -5590,11 +5589,11 @@ class_constant: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -5606,11 +5605,11 @@ static_class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -5622,11 +5621,11 @@ class_name_scalar: class_name T_PAAMAYIM_NEKUDOTAYIM T_CLASS { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, diff --git a/internal/php7/parser.go b/internal/php7/parser.go index f49ecd8..f053888 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -1,6 +1,7 @@ package php7 import ( + builder "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/errors" @@ -13,6 +14,7 @@ type Parser struct { currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) + builder *builder.Builder } // NewParser creates and returns new Parser @@ -20,6 +22,7 @@ func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser return &Parser{ Lexer: lexer, errHandlerFunc: errHandlerFunc, + builder: builder.NewBuilder(), } } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index d8af320f3eb8cfe29869d82366f872690453138f..11c021e4de7377a35ee9c6f6057e3afba89c48a7 100644 GIT binary patch delta 20688 zcmcg!30PIt_W$-i0wM}12&f3Cq=*3*96%JrOif=V=+o3JagH>>sni_EGUpspR?b6Z zT8?R+tSpC~R+>^;nO16pY2}lA4X?@mzrD^q_hSG5KKJ(J_kZ8_Y@c)YT6^s^ueJB# z62~``zQ7QPp7k-E`0B zH_zySYWA-cp3!|F_PZ}UqkF33U3W#nDbJ`!4g1|u&!|(V{cfLUlpSWj+vORhhTHEp zdPWUv;@y>S(Slah#4dRhUCSOV@{B?v>~}Lfqdz>OiIMm(`c)+X$;Y8~{RJQlo+hj4~4K(Pq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PB0EwR_Y;hkC=ni?V82}j|r%hS(f}WYfM~*leLX0E(@=B z=unE=29uv#*Qic=zJOa@uWdYe$JN;Y1M3=%TyETj>72?qe_O(okB@f^pNaO}Wi0nV zfFOSob46)*7of54>lu^WHP}f!FXtvcA$x+IKAy4@bi|mOg6E#y4YhcrK3DfwH6>I{ z-=k?QQJx&!*ihe!I3Lu^0Ni!jfz+>w(cP5;knw~EBk{||&_4^5`caJ}W8`0jxkr;> zG0JY?o7#IT_Bqs*im{kCw&gD8!8nt?O*P(kQWQMZeN|N-@uvO7_vcKS-NJatUA|O0 zoYPXdn)Kb6Yp$0849e^lNt`kiN(=D!H5xSr!s?w~mu3H0#FT zaqVJUzlV;Au&p$6We>wZk;nehGJy8puU{-UY&Gp^EOmqJp8FxfcRdZQcF$Bf4;Y0i f{JRfR88o67ww`1^Lfz`ET-pAggld%A$4LGk2|}Xp diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 5ad2f47..4f52bad 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4,7 +4,6 @@ package php7 import ( "strconv" - "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/token" ) @@ -283,7 +282,7 @@ start: top_statement_list { yylex.(*Parser).rootNode = &ast.Root{ - Position: position.NewNodeListPosition($1), + Position: yylex.(*Parser).builder.NewNodeListPosition($1), Stmts: $1, EndTkn: yylex.(*Parser).currentToken, } @@ -338,7 +337,7 @@ namespace_name: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, }, @@ -348,7 +347,7 @@ namespace_name: | namespace_name T_NS_SEPARATOR T_STRING { part := &ast.NameNamePart{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), StringTkn: $3, Value: $3.Value, } @@ -364,7 +363,7 @@ name: namespace_name { $$ = &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, } @@ -372,7 +371,7 @@ name: | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: position.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, Parts: $3.(*ast.ParserSeparatedList).Items, @@ -382,7 +381,7 @@ name: | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), NsSeparatorTkn: $1, Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -419,7 +418,7 @@ top_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = &ast.StmtHaltCompiler{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), HaltCompilerTkn: $1, OpenParenthesisTkn: $2, CloseParenthesisTkn: $3, @@ -429,10 +428,10 @@ top_statement: | T_NAMESPACE namespace_name ';' { $$ = &ast.StmtNamespace{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -442,10 +441,10 @@ top_statement: | T_NAMESPACE namespace_name '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ - Position: position.NewTokensPosition($1, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -457,7 +456,7 @@ top_statement: | T_NAMESPACE '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsTkn: $1, OpenCurlyBracket: $2, Stmts: $3, @@ -468,7 +467,7 @@ top_statement: { use := $2.(*ast.StmtGroupUse) - use.Position = position.NewTokensPosition($1, $3) + use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) use.UseTkn = $1 use.SemiColonTkn = $3 @@ -478,7 +477,7 @@ top_statement: { use := $3.(*ast.StmtGroupUse) - use.Position = position.NewTokensPosition($1, $4) + use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) use.UseTkn = $1 use.Type = $2 use.SemiColonTkn = $4 @@ -488,7 +487,7 @@ top_statement: | T_USE use_declarations ';' { $$ = &ast.StmtUse{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, UseDeclarations: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -498,7 +497,7 @@ top_statement: | T_USE use_type use_declarations ';' { $$ = &ast.StmtUse{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, Type: $2, UseDeclarations: $3.(*ast.ParserSeparatedList).Items, @@ -509,7 +508,7 @@ top_statement: | T_CONST const_list ';' { $$ = &ast.StmtConstList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ConstTkn: $1, Consts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -522,7 +521,7 @@ use_type: T_FUNCTION { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -530,7 +529,7 @@ use_type: | T_CONST { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -543,9 +542,9 @@ group_use_declaration: $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -561,10 +560,10 @@ group_use_declaration: $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ - Position: position.NewTokensPosition($1, $7), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -583,9 +582,9 @@ mixed_group_use_declaration: $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) $$ = &ast.StmtGroupUse{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -601,10 +600,10 @@ mixed_group_use_declaration: $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) $$ = &ast.StmtGroupUse{ - Position: position.NewTokensPosition($1, $7), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: position.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -685,7 +684,7 @@ inline_use_declaration: { decl := $2.(*ast.StmtUseDeclaration) decl.Type = $1 - decl.Position = position.NewNodesPosition($1, $2) + decl.Position = yylex.(*Parser).builder.NewNodesPosition($1, $2) $$ = $2 } @@ -695,9 +694,9 @@ unprefixed_use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Use: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, @@ -706,15 +705,15 @@ unprefixed_use_declaration: | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: position.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: position.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), Parts: $1.(*ast.ParserSeparatedList).Items, SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -731,7 +730,7 @@ use_declaration: { decl := $2.(*ast.StmtUseDeclaration) decl.NsSeparatorTkn = $1 - decl.Position = position.NewTokenNodePosition($1, $2) + decl.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) $$ = $2 } @@ -795,7 +794,7 @@ inner_statement: | T_HALT_COMPILER '(' ')' ';' { $$ = &ast.StmtHaltCompiler{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), HaltCompilerTkn: $1, OpenParenthesisTkn: $2, CloseParenthesisTkn: $3, @@ -807,7 +806,7 @@ statement: '{' inner_statement_list '}' { $$ = &ast.StmtStmtList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracket: $1, Stmts: $2, CloseCurlyBracket: $3, @@ -827,14 +826,14 @@ statement: $5.(*ast.StmtWhile).OpenParenthesisTkn = $2 $5.(*ast.StmtWhile).Cond = $3 $5.(*ast.StmtWhile).CloseParenthesisTkn = $4 - $5.(*ast.StmtWhile).Position = position.NewTokenNodePosition($1, $5) + $5.(*ast.StmtWhile).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) $$ = $5 } | T_DO statement T_WHILE '(' expr ')' ';' { $$ = &ast.StmtDo{ - Position: position.NewTokensPosition($1, $7), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), DoTkn: $1, Stmt: $2, WhileTkn: $3, @@ -857,7 +856,7 @@ statement: $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 - $9.(*ast.StmtFor).Position = position.NewTokenNodePosition($1, $9) + $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) $$ = $9 } @@ -867,14 +866,14 @@ statement: $5.(*ast.StmtSwitch).OpenParenthesisTkn = $2 $5.(*ast.StmtSwitch).Cond = $3 $5.(*ast.StmtSwitch).CloseParenthesisTkn = $4 - $5.(*ast.StmtSwitch).Position = position.NewTokenNodePosition($1, $5) + $5.(*ast.StmtSwitch).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) $$ = $5 } | T_BREAK optional_expr ';' { $$ = &ast.StmtBreak{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), BreakTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -883,7 +882,7 @@ statement: | T_CONTINUE optional_expr ';' { $$ = &ast.StmtContinue{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ContinueTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -892,7 +891,7 @@ statement: | T_RETURN optional_expr ';' { $$ = &ast.StmtReturn{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ReturnTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -902,7 +901,7 @@ statement: { $2.(*ast.StmtGlobal).GlobalTkn = $1 $2.(*ast.StmtGlobal).SemiColonTkn = $3 - $2.(*ast.StmtGlobal).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtGlobal).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } @@ -910,7 +909,7 @@ statement: { $2.(*ast.StmtStatic).StaticTkn = $1 $2.(*ast.StmtStatic).SemiColonTkn = $3 - $2.(*ast.StmtStatic).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtStatic).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } @@ -918,14 +917,14 @@ statement: { $2.(*ast.StmtEcho).EchoTkn = $1 $2.(*ast.StmtEcho).SemiColonTkn = $3 - $2.(*ast.StmtEcho).Position = position.NewTokensPosition($1, $3) + $2.(*ast.StmtEcho).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 } | T_INLINE_HTML { $$ = &ast.StmtInlineHtml{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), InlineHtmlTkn: $1, Value: $1.Value, } @@ -933,7 +932,7 @@ statement: | expr ';' { $$ = &ast.StmtExpression{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Expr: $1, SemiColonTkn: $2, } @@ -945,7 +944,7 @@ statement: $3.(*ast.StmtUnset).SeparatorTkns = append($3.(*ast.StmtUnset).SeparatorTkns, $4) $3.(*ast.StmtUnset).CloseParenthesisTkn = $5 $3.(*ast.StmtUnset).SemiColonTkn = $6 - $3.(*ast.StmtUnset).Position = position.NewTokensPosition($1, $6) + $3.(*ast.StmtUnset).Position = yylex.(*Parser).builder.NewTokensPosition($1, $6) $$ = $3 } @@ -957,7 +956,7 @@ statement: $7.(*ast.StmtForeach).AsTkn = $4 $7.(*ast.StmtForeach).Var = $5 $7.(*ast.StmtForeach).CloseParenthesisTkn = $6 - $7.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $7) + $7.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $7) $$ = $7 } @@ -971,7 +970,7 @@ statement: $9.(*ast.StmtForeach).DoubleArrowTkn = $6 $9.(*ast.StmtForeach).Var = $7 $9.(*ast.StmtForeach).CloseParenthesisTkn = $8 - $9.(*ast.StmtForeach).Position = position.NewTokenNodePosition($1, $9) + $9.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) $$ = $9 } @@ -982,22 +981,22 @@ statement: $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 - $5.(*ast.StmtDeclare).Position = position.NewTokenNodePosition($1, $5) + $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) $$ = $5 } | ';' { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | T_TRY '{' inner_statement_list '}' catch_list finally_statement { - pos := position.NewTokenNodeListPosition($1, $5) + pos := yylex.(*Parser).builder.NewTokenNodeListPosition($1, $5) if $6 != nil { - pos = position.NewTokenNodePosition($1, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($1, $6) } $$ = &ast.StmtTry{ @@ -1013,7 +1012,7 @@ statement: | T_THROW expr ';' { $$ = &ast.StmtThrow{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ThrowTkn: $1, Expr: $2, SemiColonTkn: $3, @@ -1022,10 +1021,10 @@ statement: | T_GOTO T_STRING ';' { $$ = &ast.StmtGoto{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), GotoTkn: $1, Label: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1035,9 +1034,9 @@ statement: | T_STRING ':' { $$ = &ast.StmtLabel{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), LabelName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1056,9 +1055,9 @@ catch_list: catch.CatchTkn = $2 catch.OpenParenthesisTkn = $3 catch.Var = &ast.ExprVariable{ - Position: position.NewTokenPosition($5), + Position: yylex.(*Parser).builder.NewTokenPosition($5), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($5), + Position: yylex.(*Parser).builder.NewTokenPosition($5), IdentifierTkn: $5, Value: $5.Value, }, @@ -1067,7 +1066,7 @@ catch_list: catch.OpenCurlyBracketTkn = $7 catch.Stmts = $8 catch.CloseCurlyBracketTkn = $9 - catch.Position = position.NewTokensPosition($2, $9) + catch.Position = yylex.(*Parser).builder.NewTokensPosition($2, $9) $$ = append($1, catch) } @@ -1096,7 +1095,7 @@ finally_statement: | T_FINALLY '{' inner_statement_list '}' { $$ = &ast.StmtFinally{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), FinallyTkn: $1, OpenCurlyBracketTkn: $2, Stmts: $3, @@ -1132,11 +1131,11 @@ function_declaration_statement: T_FUNCTION returns_ref T_STRING backup_doc_comment '(' parameter_list ')' return_type '{' inner_statement_list '}' { $$ = &ast.StmtFunction{ - Position: position.NewTokensPosition($1, $11), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $11), FunctionTkn: $1, AmpersandTkn: $2, FunctionName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1179,11 +1178,11 @@ class_declaration_statement: class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { $$ = &ast.StmtClass{ - Position: position.NewOptionalListTokensPosition($1, $2, $9), + Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $9), Modifiers: $1, ClassTkn: $2, ClassName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -1197,10 +1196,10 @@ class_declaration_statement: | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { $$ = &ast.StmtClass{ - Position: position.NewTokensPosition($1, $8), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, ClassName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1228,7 +1227,7 @@ class_modifier: T_ABSTRACT { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1236,7 +1235,7 @@ class_modifier: | T_FINAL { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1247,10 +1246,10 @@ trait_declaration_statement: T_TRAIT T_STRING backup_doc_comment '{' class_statement_list '}' { $$ = &ast.StmtTrait{ - Position: position.NewTokensPosition($1, $6), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), TraitTkn: $1, TraitName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1265,10 +1264,10 @@ interface_declaration_statement: T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' { $$ = &ast.StmtInterface{ - Position: position.NewTokensPosition($1, $7), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), InterfaceTkn: $1, InterfaceName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -1288,7 +1287,7 @@ extends_from: | T_EXTENDS name { $$ = &ast.StmtClassExtends{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ExtendTkn: $1, ClassName: $2, } @@ -1303,7 +1302,7 @@ interface_extends_list: | T_EXTENDS name_list { $$ = &ast.StmtInterfaceExtends{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ExtendsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1319,7 +1318,7 @@ implements_list: | T_IMPLEMENTS name_list { $$ = &ast.StmtClassImplements{ - Position: position.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), ImplementsTkn: $1, InterfaceNames: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1335,7 +1334,7 @@ foreach_variable: | '&' variable { $$ = &ast.ExprReference{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, } @@ -1343,7 +1342,7 @@ foreach_variable: | T_LIST '(' array_pair_list ')' { $$ = &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -1354,7 +1353,7 @@ foreach_variable: | '[' array_pair_list ']' { $$ = &ast.ExprList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1367,18 +1366,18 @@ for_statement: statement { $$ = &ast.StmtFor{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOR ';' { $$ = &ast.StmtFor{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndForTkn: $3, @@ -1391,18 +1390,18 @@ foreach_statement: statement { $$ = &ast.StmtForeach{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDFOREACH ';' { $$ = &ast.StmtForeach{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndForeachTkn: $3, @@ -1415,18 +1414,18 @@ declare_statement: statement { $$ = &ast.StmtDeclare{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDDECLARE ';' { $$ = &ast.StmtDeclare{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndDeclareTkn: $3, @@ -1439,7 +1438,7 @@ switch_case_list: '{' case_list '}' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, CaseList: $2, CloseCurlyBracketTkn: $3, @@ -1448,7 +1447,7 @@ switch_case_list: | '{' ';' case_list '}' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), OpenCurlyBracketTkn: $1, CaseSeparatorTkn: $2, CaseList: $3, @@ -1458,7 +1457,7 @@ switch_case_list: | ':' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, CaseList: $2, @@ -1469,7 +1468,7 @@ switch_case_list: | ':' ';' case_list T_ENDSWITCH ';' { $$ = &ast.StmtSwitch{ - Position: position.NewTokensPosition($1, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), Alt: true, ColonTkn: $1, CaseSeparatorTkn: $2, @@ -1488,7 +1487,7 @@ case_list: | case_list T_CASE expr case_separator inner_statement_list { $$ = append($1, &ast.StmtCase{ - Position: position.NewTokenNodeListPosition($2, $5), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $5), CaseTkn: $2, Cond: $3, CaseSeparatorTkn: $4, @@ -1498,7 +1497,7 @@ case_list: | case_list T_DEFAULT case_separator inner_statement_list { $$ = append($1, &ast.StmtDefault{ - Position: position.NewTokenNodeListPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $4), DefaultTkn: $2, CaseSeparatorTkn: $3, Stmts: $4, @@ -1521,18 +1520,18 @@ while_statement: statement { $$ = &ast.StmtWhile{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Stmt: $1, } } | ':' inner_statement_list T_ENDWHILE ';' { $$ = &ast.StmtWhile{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($2), + Position: yylex.(*Parser).builder.NewNodeListPosition($2), Stmts: $2, }, EndWhileTkn: $3, @@ -1545,7 +1544,7 @@ if_stmt_without_else: T_IF '(' expr ')' statement { $$ = &ast.StmtIf{ - Position: position.NewTokenNodePosition($1, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $5), IfTkn: $1, OpenParenthesisTkn: $2, Cond: $3, @@ -1556,7 +1555,7 @@ if_stmt_without_else: | if_stmt_without_else T_ELSEIF '(' expr ')' statement { $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ - Position: position.NewTokenNodePosition($2, $6), + Position: yylex.(*Parser).builder.NewTokenNodePosition($2, $6), ElseIfTkn: $2, OpenParenthesisTkn: $3, Cond: $4, @@ -1564,7 +1563,7 @@ if_stmt_without_else: Stmt: $6, }) - $1.(*ast.StmtIf).Position = position.NewNodesPosition($1, $6) + $1.(*ast.StmtIf).Position = yylex.(*Parser).builder.NewNodesPosition($1, $6) $$ = $1 } @@ -1578,12 +1577,12 @@ if_stmt: | if_stmt_without_else T_ELSE statement { $1.(*ast.StmtIf).Else = &ast.StmtElse{ - Position: position.NewTokenNodePosition($2, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($2, $3), ElseTkn: $2, Stmt: $3, } - $1.(*ast.StmtIf).Position = position.NewNodesPosition($1, $3) + $1.(*ast.StmtIf).Position = yylex.(*Parser).builder.NewNodesPosition($1, $3) $$ = $1 } @@ -1593,7 +1592,7 @@ alt_if_stmt_without_else: T_IF '(' expr ')' ':' inner_statement_list { $$ = &ast.StmtIf{ - Position: position.NewTokenNodeListPosition($1, $6), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $6), Alt: true, IfTkn: $1, OpenParenthesisTkn: $2, @@ -1601,7 +1600,7 @@ alt_if_stmt_without_else: CloseParenthesisTkn: $4, ColonTkn: $5, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($6), + Position: yylex.(*Parser).builder.NewNodeListPosition($6), Stmts: $6, }, } @@ -1609,7 +1608,7 @@ alt_if_stmt_without_else: | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list { $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ - Position: position.NewTokenNodeListPosition($2, $7), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $7), Alt: true, ElseIfTkn: $2, OpenParenthesisTkn: $3, @@ -1617,7 +1616,7 @@ alt_if_stmt_without_else: CloseParenthesisTkn: $5, ColonTkn: $6, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($7), + Position: yylex.(*Parser).builder.NewNodeListPosition($7), Stmts: $7, }, }) @@ -1631,25 +1630,25 @@ alt_if_stmt: { $1.(*ast.StmtIf).EndIfTkn = $2 $1.(*ast.StmtIf).SemiColonTkn = $3 - $1.(*ast.StmtIf).Position = position.NewNodeTokenPosition($1, $3) + $1.(*ast.StmtIf).Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $3) $$ = $1 } | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { $1.(*ast.StmtIf).Else = &ast.StmtElse{ - Position: position.NewTokenNodeListPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $4), Alt: true, ElseTkn: $2, ColonTkn: $3, Stmt: &ast.StmtStmtList{ - Position: position.NewNodeListPosition($4), + Position: yylex.(*Parser).builder.NewNodeListPosition($4), Stmts: $4, }, } $1.(*ast.StmtIf).EndIfTkn = $5 $1.(*ast.StmtIf).SemiColonTkn = $6 - $1.(*ast.StmtIf).Position = position.NewNodeTokenPosition($1, $6) + $1.(*ast.StmtIf).Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $6) $$ = $1 } @@ -1685,13 +1684,13 @@ non_empty_parameter_list: parameter: optional_type is_reference is_variadic T_VARIABLE { - pos := position.NewTokenPosition($4) + pos := yylex.(*Parser).builder.NewTokenPosition($4) if $1 != nil { - pos = position.NewNodeTokenPosition($1, $4) + pos = yylex.(*Parser).builder.NewNodeTokenPosition($1, $4) } else if $2 != nil { - pos = position.NewTokensPosition($2, $4) + pos = yylex.(*Parser).builder.NewTokensPosition($2, $4) } else if $3 != nil { - pos = position.NewTokensPosition($3, $4) + pos = yylex.(*Parser).builder.NewTokensPosition($3, $4) } $$ = &ast.Parameter{ @@ -1700,9 +1699,9 @@ parameter: AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1711,13 +1710,13 @@ parameter: } | optional_type is_reference is_variadic T_VARIABLE '=' expr { - pos := position.NewTokenNodePosition($4, $6) + pos := yylex.(*Parser).builder.NewTokenNodePosition($4, $6) if $1 != nil { - pos = position.NewNodesPosition($1, $6) + pos = yylex.(*Parser).builder.NewNodesPosition($1, $6) } else if $2 != nil { - pos = position.NewTokenNodePosition($2, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($2, $6) } else if $3 != nil { - pos = position.NewTokenNodePosition($3, $6) + pos = yylex.(*Parser).builder.NewTokenNodePosition($3, $6) } $$ = &ast.Parameter{ @@ -1726,9 +1725,9 @@ parameter: AmpersandTkn: $2, VariadicTkn: $3, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -1758,7 +1757,7 @@ type_expr: | '?' type { $$ = &ast.Nullable{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), QuestionTkn: $1, Expr: $2, } @@ -1769,7 +1768,7 @@ type: T_ARRAY { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1777,7 +1776,7 @@ type: | T_CALLABLE { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -1806,7 +1805,7 @@ argument_list: '(' ')' { $$ = &ast.ArgumentList{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, } @@ -1814,7 +1813,7 @@ argument_list: | '(' non_empty_argument_list possible_comma ')' { argumentList := $2.(*ast.ArgumentList) - argumentList.Position = position.NewTokensPosition($1, $4) + argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) argumentList.OpenParenthesisTkn = $1 argumentList.SeparatorTkns = append(argumentList.SeparatorTkns, $3) argumentList.CloseParenthesisTkn = $4 @@ -1843,14 +1842,14 @@ argument: expr { $$ = &ast.Argument{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Expr: $1, } } | T_ELLIPSIS expr { $$ = &ast.Argument{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), VariadicTkn: $1, Expr: $2, } @@ -1901,11 +1900,11 @@ static_var: { $$ = &ast.StmtStaticVar{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1915,11 +1914,11 @@ static_var: | T_VARIABLE '=' expr { $$ = &ast.StmtStaticVar{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -1945,7 +1944,7 @@ class_statement: variable_modifiers optional_type property_list ';' { $$ = &ast.StmtPropertyList{ - Position: position.NewNodeListTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $4), Modifiers: $1, Type: $2, Properties: $3.(*ast.ParserSeparatedList).Items, @@ -1956,7 +1955,7 @@ class_statement: | method_modifiers T_CONST class_const_list ';' { $$ = &ast.StmtClassConstList{ - Position: position.NewOptionalListTokensPosition($1, $2, $4), + Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $4), Modifiers: $1, ConstTkn: $2, Consts: $3.(*ast.ParserSeparatedList).Items, @@ -1967,7 +1966,7 @@ class_statement: | T_USE name_list trait_adaptations { $$ = &ast.StmtTraitUse{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, Traits: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -1976,9 +1975,9 @@ class_statement: } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { - pos := position.NewTokenNodePosition($2, $10) + pos := yylex.(*Parser).builder.NewTokenNodePosition($2, $10) if $1 != nil { - pos = position.NewNodeListNodePosition($1, $10) + pos = yylex.(*Parser).builder.NewNodeListNodePosition($1, $10) } $$ = &ast.StmtClassMethod{ @@ -1987,7 +1986,7 @@ class_statement: FunctionTkn: $2, AmpersandTkn: $3, MethodName: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2022,14 +2021,14 @@ trait_adaptations: ';' { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' '}' { $$ = &ast.StmtTraitAdaptationList{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, } @@ -2037,7 +2036,7 @@ trait_adaptations: | '{' trait_adaptation_list '}' { $$ = &ast.StmtTraitAdaptationList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Adaptations: $2, CloseParenthesisTkn: $3, @@ -2075,7 +2074,7 @@ trait_precedence: absolute_trait_method_reference T_INSTEADOF name_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: position.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), Ref: $1, InsteadofTkn: $2, Insteadof: $3.(*ast.ParserSeparatedList).Items, @@ -2088,11 +2087,11 @@ trait_alias: trait_method_reference T_AS T_STRING { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Ref: $1, AsTkn: $2, Alias: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2101,11 +2100,11 @@ trait_alias: | trait_method_reference T_AS reserved_non_modifiers { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Ref: $1, AsTkn: $2, Alias: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2114,12 +2113,12 @@ trait_alias: | trait_method_reference T_AS member_modifier identifier { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Ref: $1, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ - Position: position.NewTokenPosition($4), + Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, }, @@ -2128,7 +2127,7 @@ trait_alias: | trait_method_reference T_AS member_modifier { $$ = &ast.StmtTraitUseAlias{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Ref: $1, AsTkn: $2, Modifier: $3, @@ -2140,9 +2139,9 @@ trait_method_reference: identifier { $$ = &ast.StmtTraitMethodRef{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2158,11 +2157,11 @@ absolute_trait_method_reference: name T_PAAMAYIM_NEKUDOTAYIM identifier { $$ = &ast.StmtTraitMethodRef{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, Method: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -2174,14 +2173,14 @@ method_body: ';' /* abstract method */ { $$ = &ast.StmtNop{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), SemiColonTkn: $1, } } | '{' inner_statement_list '}' { $$ = &ast.StmtStmtList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracket: $1, Stmts: $2, CloseCurlyBracket: $3, @@ -2198,7 +2197,7 @@ variable_modifiers: { $$ = []ast.Vertex{ &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2232,7 +2231,7 @@ member_modifier: T_PUBLIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2240,7 +2239,7 @@ member_modifier: | T_PROTECTED { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2248,7 +2247,7 @@ member_modifier: | T_PRIVATE { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2256,7 +2255,7 @@ member_modifier: | T_STATIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2264,7 +2263,7 @@ member_modifier: | T_ABSTRACT { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2272,7 +2271,7 @@ member_modifier: | T_FINAL { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -2299,11 +2298,11 @@ property: T_VARIABLE backup_doc_comment { $$ = &ast.StmtProperty{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2314,11 +2313,11 @@ property: | T_VARIABLE '=' expr backup_doc_comment { $$ = &ast.StmtProperty{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2349,9 +2348,9 @@ class_const_decl: identifier '=' expr backup_doc_comment { $$ = &ast.StmtConstant{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Name: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2365,9 +2364,9 @@ const_decl: T_STRING '=' expr backup_doc_comment { $$ = &ast.StmtConstant{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Name: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -2431,7 +2430,7 @@ anonymous_class: T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' { $$ = &ast.StmtClass{ - Position: position.NewTokensPosition($1, $8), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -2451,7 +2450,7 @@ new_expr: { if $3 != nil { $$ = &ast.ExprNew{ - Position: position.NewTokenNodePosition($1, $3), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, @@ -2461,7 +2460,7 @@ new_expr: } } else { $$ = &ast.ExprNew{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), NewTkn: $1, Class: $2, } @@ -2470,7 +2469,7 @@ new_expr: | T_NEW anonymous_class { $$ = &ast.ExprNew{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), NewTkn: $1, Class: $2, } @@ -2481,9 +2480,9 @@ expr_without_variable: T_LIST '(' array_pair_list ')' '=' expr { $$ = &ast.ExprAssign{ - Position: position.NewTokenNodePosition($1, $6), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $6), Var: &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -2497,9 +2496,9 @@ expr_without_variable: | '[' array_pair_list ']' '=' expr { $$ = &ast.ExprAssign{ - Position: position.NewTokenNodePosition($1, $5), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $5), Var: &ast.ExprList{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -2512,7 +2511,7 @@ expr_without_variable: | variable '=' expr { $$ = &ast.ExprAssign{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2521,7 +2520,7 @@ expr_without_variable: | variable '=' '&' expr { $$ = &ast.ExprAssignReference{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Var: $1, EqualTkn: $2, AmpersandTkn: $3, @@ -2531,7 +2530,7 @@ expr_without_variable: | T_CLONE expr { $$ = &ast.ExprClone{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CloneTkn: $1, Expr: $2, } @@ -2539,7 +2538,7 @@ expr_without_variable: | variable T_PLUS_EQUAL expr { $$ = &ast.ExprAssignPlus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2548,7 +2547,7 @@ expr_without_variable: | variable T_MINUS_EQUAL expr { $$ = &ast.ExprAssignMinus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2557,7 +2556,7 @@ expr_without_variable: | variable T_MUL_EQUAL expr { $$ = &ast.ExprAssignMul{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2566,7 +2565,7 @@ expr_without_variable: | variable T_POW_EQUAL expr { $$ = &ast.ExprAssignPow{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2575,7 +2574,7 @@ expr_without_variable: | variable T_DIV_EQUAL expr { $$ = &ast.ExprAssignDiv{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2584,7 +2583,7 @@ expr_without_variable: | variable T_CONCAT_EQUAL expr { $$ = &ast.ExprAssignConcat{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2593,7 +2592,7 @@ expr_without_variable: | variable T_MOD_EQUAL expr { $$ = &ast.ExprAssignMod{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2602,7 +2601,7 @@ expr_without_variable: | variable T_AND_EQUAL expr { $$ = &ast.ExprAssignBitwiseAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2611,7 +2610,7 @@ expr_without_variable: | variable T_OR_EQUAL expr { $$ = &ast.ExprAssignBitwiseOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2620,7 +2619,7 @@ expr_without_variable: | variable T_XOR_EQUAL expr { $$ = &ast.ExprAssignBitwiseXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2629,7 +2628,7 @@ expr_without_variable: | variable T_SL_EQUAL expr { $$ = &ast.ExprAssignShiftLeft{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2638,7 +2637,7 @@ expr_without_variable: | variable T_SR_EQUAL expr { $$ = &ast.ExprAssignShiftRight{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2647,7 +2646,7 @@ expr_without_variable: | variable T_COALESCE_EQUAL expr { $$ = &ast.ExprAssignCoalesce{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, EqualTkn: $2, Expr: $3, @@ -2656,7 +2655,7 @@ expr_without_variable: | variable T_INC { $$ = &ast.ExprPostInc{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Var: $1, IncTkn: $2, } @@ -2664,7 +2663,7 @@ expr_without_variable: | T_INC variable { $$ = &ast.ExprPreInc{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncTkn: $1, Var: $2, } @@ -2672,7 +2671,7 @@ expr_without_variable: | variable T_DEC { $$ = &ast.ExprPostDec{ - Position: position.NewNodeTokenPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $2), Var: $1, DecTkn: $2, } @@ -2680,7 +2679,7 @@ expr_without_variable: | T_DEC variable { $$ = &ast.ExprPreDec{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DecTkn: $1, Var: $2, } @@ -2688,7 +2687,7 @@ expr_without_variable: | expr T_BOOLEAN_OR expr { $$ = &ast.ExprBinaryBooleanOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2697,7 +2696,7 @@ expr_without_variable: | expr T_BOOLEAN_AND expr { $$ = &ast.ExprBinaryBooleanAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2706,7 +2705,7 @@ expr_without_variable: | expr T_LOGICAL_OR expr { $$ = &ast.ExprBinaryLogicalOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2715,7 +2714,7 @@ expr_without_variable: | expr T_LOGICAL_AND expr { $$ = &ast.ExprBinaryLogicalAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2724,7 +2723,7 @@ expr_without_variable: | expr T_LOGICAL_XOR expr { $$ = &ast.ExprBinaryLogicalXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2733,7 +2732,7 @@ expr_without_variable: | expr '|' expr { $$ = &ast.ExprBinaryBitwiseOr{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2742,7 +2741,7 @@ expr_without_variable: | expr '&' expr { $$ = &ast.ExprBinaryBitwiseAnd{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2751,7 +2750,7 @@ expr_without_variable: | expr '^' expr { $$ = &ast.ExprBinaryBitwiseXor{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2760,7 +2759,7 @@ expr_without_variable: | expr '.' expr { $$ = &ast.ExprBinaryConcat{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2769,7 +2768,7 @@ expr_without_variable: | expr '+' expr { $$ = &ast.ExprBinaryPlus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2778,7 +2777,7 @@ expr_without_variable: | expr '-' expr { $$ = &ast.ExprBinaryMinus{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2787,7 +2786,7 @@ expr_without_variable: | expr '*' expr { $$ = &ast.ExprBinaryMul{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2796,7 +2795,7 @@ expr_without_variable: | expr T_POW expr { $$ = &ast.ExprBinaryPow{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2805,7 +2804,7 @@ expr_without_variable: | expr '/' expr { $$ = &ast.ExprBinaryDiv{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2814,7 +2813,7 @@ expr_without_variable: | expr '%' expr { $$ = &ast.ExprBinaryMod{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2823,7 +2822,7 @@ expr_without_variable: | expr T_SL expr { $$ = &ast.ExprBinaryShiftLeft{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2832,7 +2831,7 @@ expr_without_variable: | expr T_SR expr { $$ = &ast.ExprBinaryShiftRight{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2841,7 +2840,7 @@ expr_without_variable: | '+' expr %prec T_INC { $$ = &ast.ExprUnaryPlus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), PlusTkn: $1, Expr: $2, } @@ -2849,7 +2848,7 @@ expr_without_variable: | '-' expr %prec T_INC { $$ = &ast.ExprUnaryMinus{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), MinusTkn: $1, Expr: $2, } @@ -2857,7 +2856,7 @@ expr_without_variable: | '!' expr { $$ = &ast.ExprBooleanNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), ExclamationTkn: $1, Expr: $2, } @@ -2865,7 +2864,7 @@ expr_without_variable: | '~' expr { $$ = &ast.ExprBitwiseNot{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), TildaTkn: $1, Expr: $2, } @@ -2873,7 +2872,7 @@ expr_without_variable: | expr T_IS_IDENTICAL expr { $$ = &ast.ExprBinaryIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2882,7 +2881,7 @@ expr_without_variable: | expr T_IS_NOT_IDENTICAL expr { $$ = &ast.ExprBinaryNotIdentical{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2891,7 +2890,7 @@ expr_without_variable: | expr T_IS_EQUAL expr { $$ = &ast.ExprBinaryEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2900,7 +2899,7 @@ expr_without_variable: | expr T_IS_NOT_EQUAL expr { $$ = &ast.ExprBinaryNotEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2909,7 +2908,7 @@ expr_without_variable: | expr '<' expr { $$ = &ast.ExprBinarySmaller{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2918,7 +2917,7 @@ expr_without_variable: | expr T_IS_SMALLER_OR_EQUAL expr { $$ = &ast.ExprBinarySmallerOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2927,7 +2926,7 @@ expr_without_variable: | expr '>' expr { $$ = &ast.ExprBinaryGreater{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2936,7 +2935,7 @@ expr_without_variable: | expr T_IS_GREATER_OR_EQUAL expr { $$ = &ast.ExprBinaryGreaterOrEqual{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2945,7 +2944,7 @@ expr_without_variable: | expr T_SPACESHIP expr { $$ = &ast.ExprBinarySpaceship{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -2954,7 +2953,7 @@ expr_without_variable: | expr T_INSTANCEOF class_name_reference { $$ = &ast.ExprInstanceOf{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Expr: $1, InstanceOfTkn: $2, Class: $3, @@ -2963,7 +2962,7 @@ expr_without_variable: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -2976,7 +2975,7 @@ expr_without_variable: | expr '?' expr ':' expr { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $5), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), Condition: $1, QuestionTkn: $2, IfTrue: $3, @@ -2987,7 +2986,7 @@ expr_without_variable: | expr '?' ':' expr { $$ = &ast.ExprTernary{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Condition: $1, QuestionTkn: $2, ColonTkn: $3, @@ -2997,7 +2996,7 @@ expr_without_variable: | expr T_COALESCE expr { $$ = &ast.ExprBinaryCoalesce{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Left: $1, OpTkn: $2, Right: $3, @@ -3010,7 +3009,7 @@ expr_without_variable: | T_INT_CAST expr { $$ = &ast.ExprCastInt{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3018,7 +3017,7 @@ expr_without_variable: | T_DOUBLE_CAST expr { $$ = &ast.ExprCastDouble{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3026,7 +3025,7 @@ expr_without_variable: | T_STRING_CAST expr { $$ = &ast.ExprCastString{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3034,7 +3033,7 @@ expr_without_variable: | T_ARRAY_CAST expr { $$ = &ast.ExprCastArray{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3042,7 +3041,7 @@ expr_without_variable: | T_OBJECT_CAST expr { $$ = &ast.ExprCastObject{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3050,7 +3049,7 @@ expr_without_variable: | T_BOOL_CAST expr { $$ = &ast.ExprCastBool{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3058,7 +3057,7 @@ expr_without_variable: | T_UNSET_CAST expr { $$ = &ast.ExprCastUnset{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), CastTkn: $1, Expr: $2, } @@ -3070,9 +3069,9 @@ expr_without_variable: } if $2 == nil { - exit.Position = position.NewTokenPosition($1) + exit.Position = yylex.(*Parser).builder.NewTokenPosition($1) } else { - exit.Position = position.NewTokenNodePosition($1, $2) + exit.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) exit.OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn exit.Expr = $2.(*ast.ParserBrackets).Child exit.CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn @@ -3083,7 +3082,7 @@ expr_without_variable: | '@' expr { $$ = &ast.ExprErrorSuppress{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AtTkn: $1, Expr: $2, } @@ -3095,7 +3094,7 @@ expr_without_variable: | '`' backticks_expr '`' { $$ = &ast.ExprShellExec{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBacktickTkn: $1, Parts: $2, CloseBacktickTkn: $3, @@ -3104,7 +3103,7 @@ expr_without_variable: | T_PRINT expr { $$ = &ast.ExprPrint{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), PrintTkn: $1, Expr: $2, } @@ -3112,14 +3111,14 @@ expr_without_variable: | T_YIELD { $$ = &ast.ExprYield{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), YieldTkn: $1, } } | T_YIELD expr { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, Value: $2, } @@ -3127,7 +3126,7 @@ expr_without_variable: | T_YIELD expr T_DOUBLE_ARROW expr { $$ = &ast.ExprYield{ - Position: position.NewTokenNodePosition($1, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, @@ -3137,7 +3136,7 @@ expr_without_variable: | T_YIELD_FROM expr { $$ = &ast.ExprYieldFrom{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldFromTkn: $1, Expr: $2, } @@ -3150,10 +3149,10 @@ expr_without_variable: { switch n := $2.(type) { case *ast.ExprClosure : - n.Position = position.NewTokenNodePosition($1, $2) + n.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) n.StaticTkn = $1; case *ast.ExprArrowFunction : - n.Position = position.NewTokenNodePosition($1, $2) + n.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) n.StaticTkn = $1; }; @@ -3165,7 +3164,7 @@ inline_function: T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { $$ = &ast.ExprClosure{ - Position: position.NewTokensPosition($1, $11), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $11), FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $4, @@ -3183,7 +3182,7 @@ inline_function: | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr { $$ = &ast.ExprArrowFunction{ - Position: position.NewTokenNodePosition($1, $9), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $9), FnTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, @@ -3221,7 +3220,7 @@ lexical_vars: | T_USE '(' lexical_var_list ')' { $$ = &ast.ExprClosureUse{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, OpenParenthesisTkn: $2, Uses: $3.(*ast.ParserSeparatedList).Items, @@ -3251,9 +3250,9 @@ lexical_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -3262,12 +3261,12 @@ lexical_var: | '&' T_VARIABLE { $$ = &ast.ExprReference{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), AmpersandTkn: $1, Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -3280,7 +3279,7 @@ function_call: name argument_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewNodesPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -3291,7 +3290,7 @@ function_call: | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3304,7 +3303,7 @@ function_call: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { $$ = &ast.ExprStaticCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, Call: $3, @@ -3317,7 +3316,7 @@ function_call: | callable_expr argument_list { $$ = &ast.ExprFunctionCall{ - Position: position.NewNodesPosition($1, $2), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, @@ -3331,7 +3330,7 @@ class_name: T_STATIC { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -3361,7 +3360,7 @@ exit_expr: | '(' optional_expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3378,7 +3377,7 @@ backticks_expr: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -3405,7 +3404,7 @@ dereferencable_scalar: T_ARRAY '(' array_pair_list ')' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -3416,7 +3415,7 @@ dereferencable_scalar: | '[' array_pair_list ']' { $$ = &ast.ExprArray{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Items: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, @@ -3426,7 +3425,7 @@ dereferencable_scalar: | T_CONSTANT_ENCAPSED_STRING { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -3437,7 +3436,7 @@ scalar: T_LNUMBER { $$ = &ast.ScalarLnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3445,7 +3444,7 @@ scalar: | T_DNUMBER { $$ = &ast.ScalarDnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } @@ -3453,7 +3452,7 @@ scalar: | T_LINE { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3461,7 +3460,7 @@ scalar: | T_FILE { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3469,7 +3468,7 @@ scalar: | T_DIR { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3477,7 +3476,7 @@ scalar: | T_TRAIT_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3485,7 +3484,7 @@ scalar: | T_METHOD_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3493,7 +3492,7 @@ scalar: | T_FUNC_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3501,7 +3500,7 @@ scalar: | T_NS_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3509,7 +3508,7 @@ scalar: | T_CLASS_C { $$ = &ast.ScalarMagicConstant{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), MagicConstTkn: $1, Value: $1.Value, } @@ -3517,11 +3516,11 @@ scalar: | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -3532,7 +3531,7 @@ scalar: | T_START_HEREDOC T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenHeredocTkn: $1, CloseHeredocTkn: $2, } @@ -3540,7 +3539,7 @@ scalar: | '"' encaps_list '"' { $$ = &ast.ScalarEncapsed{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, CloseQoteTkn: $1, @@ -3549,7 +3548,7 @@ scalar: | T_START_HEREDOC encaps_list T_END_HEREDOC { $$ = &ast.ScalarHeredoc{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenHeredocTkn: $1, Parts: $2, CloseHeredocTkn: $3, @@ -3569,18 +3568,18 @@ constant: name { $$ = &ast.ExprConstFetch{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Const: $1, } } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -3589,11 +3588,11 @@ constant: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier { $$ = &ast.ExprClassConstFetch{ - Position: position.NewNodeTokenPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, ConstantName: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -3638,7 +3637,7 @@ dereferencable: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3658,7 +3657,7 @@ callable_expr: | '(' expr ')' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3678,7 +3677,7 @@ callable_variable: | dereferencable '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3688,7 +3687,7 @@ callable_variable: | constant '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3698,7 +3697,7 @@ callable_variable: | dereferencable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3708,7 +3707,7 @@ callable_variable: | dereferencable T_OBJECT_OPERATOR property_name argument_list { $$ = &ast.ExprMethodCall{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Var: $1, ObjectOperatorTkn: $2, Method: $3, @@ -3736,7 +3735,7 @@ variable: | dereferencable T_OBJECT_OPERATOR property_name { $$ = &ast.ExprPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, @@ -3748,9 +3747,9 @@ simple_variable: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -3759,10 +3758,10 @@ simple_variable: | '$' '{' expr '}' { $$ = &ast.ExprVariable{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, VarName: &ast.ParserBrackets{ - Position: position.NewTokensPosition($2, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $4), OpenBracketTkn: $2, Child: $3, CloseBracketTkn: $4, @@ -3772,7 +3771,7 @@ simple_variable: | '$' simple_variable { $$ = &ast.ExprVariable{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DollarTkn: $1, VarName: $2, } @@ -3783,7 +3782,7 @@ static_member: class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -3792,7 +3791,7 @@ static_member: | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -3808,7 +3807,7 @@ new_variable: | new_variable '[' optional_expr ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3818,7 +3817,7 @@ new_variable: | new_variable '{' expr '}' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewNodeTokenPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), Var: $1, OpenBracketTkn: $2, Dim: $3, @@ -3828,7 +3827,7 @@ new_variable: | new_variable T_OBJECT_OPERATOR property_name { $$ = &ast.ExprPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, @@ -3837,7 +3836,7 @@ new_variable: | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -3846,7 +3845,7 @@ new_variable: | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { $$ = &ast.ExprStaticPropertyFetch{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, Property: $3, @@ -3858,7 +3857,7 @@ member_name: identifier { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -3866,7 +3865,7 @@ member_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3882,7 +3881,7 @@ property_name: T_STRING { $$ = &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, } @@ -3890,7 +3889,7 @@ property_name: | '{' expr '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -3947,7 +3946,7 @@ array_pair: expr T_DOUBLE_ARROW expr { $$ = &ast.ExprArrayItem{ - Position: position.NewNodesPosition($1, $3), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Key: $1, DoubleArrowTkn: $2, Val: $3, @@ -3956,18 +3955,18 @@ array_pair: | expr { $$ = &ast.ExprArrayItem{ - Position: position.NewNodePosition($1), + Position: yylex.(*Parser).builder.NewNodePosition($1), Val: $1, } } | expr T_DOUBLE_ARROW '&' variable { $$ = &ast.ExprArrayItem{ - Position: position.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($3, $4), + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), AmpersandTkn: $3, Var: $4, }, @@ -3976,9 +3975,9 @@ array_pair: | '&' variable { $$ = &ast.ExprArrayItem{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), Val: &ast.ExprReference{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), AmpersandTkn: $1, Var: $2, }, @@ -3987,7 +3986,7 @@ array_pair: | T_ELLIPSIS expr { $$ = &ast.ExprArrayItem{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), EllipsisTkn: $1, Val: $2, } @@ -3995,11 +3994,11 @@ array_pair: | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { $$ = &ast.ExprArrayItem{ - Position: position.NewNodeTokenPosition($1, $6), + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $6), Key: $1, DoubleArrowTkn: $2, Val: &ast.ExprList{ - Position: position.NewTokensPosition($3, $6), + Position: yylex.(*Parser).builder.NewTokensPosition($3, $6), ListTkn: $3, OpenBracketTkn: $4, Items: $5.(*ast.ParserSeparatedList).Items, @@ -4011,9 +4010,9 @@ array_pair: | T_LIST '(' array_pair_list ')' { $$ = &ast.ExprArrayItem{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Val: &ast.ExprList{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, Items: $3.(*ast.ParserSeparatedList).Items, @@ -4034,7 +4033,7 @@ encaps_list: $$ = append( $1, &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), EncapsedStrTkn: $2, Value: $2.Value, }, @@ -4048,7 +4047,7 @@ encaps_list: { $$ = []ast.Vertex{ &ast.ScalarEncapsedStringPart{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), EncapsedStrTkn: $1, Value: $1.Value, }, @@ -4061,9 +4060,9 @@ encaps_var: T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4072,11 +4071,11 @@ encaps_var: | T_VARIABLE '[' encaps_var_offset ']' { $$ = &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4089,18 +4088,18 @@ encaps_var: | T_VARIABLE T_OBJECT_OPERATOR T_STRING { $$ = &ast.ExprPropertyFetch{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, Property: &ast.Identifier{ - Position: position.NewTokenPosition($3), + Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, }, @@ -4109,10 +4108,10 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Position: position.NewNodePosition($2), + Position: yylex.(*Parser).builder.NewNodePosition($2), VarName: $2, }, CloseBracketTkn: $3, @@ -4121,12 +4120,12 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -4137,14 +4136,14 @@ encaps_var: | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $6), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), OpenBracketTkn: $1, Child: &ast.ExprArrayDimFetch{ - Position: position.NewTokensPosition($2, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($2, $5), Var: &ast.ExprVariable{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, }, @@ -4159,7 +4158,7 @@ encaps_var: | T_CURLY_OPEN variable '}' { $$ = &ast.ParserBrackets{ - Position: position.NewTokensPosition($1, $3), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, CloseBracketTkn: $3, @@ -4171,7 +4170,7 @@ encaps_var_offset: T_STRING { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -4181,13 +4180,13 @@ encaps_var_offset: // TODO: add option to handle 64 bit integer if _, err := strconv.Atoi(string($1.Value)); err == nil { $$ = &ast.ScalarLnumber{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), NumberTkn: $1, Value: $1.Value, } } else { $$ = &ast.ScalarString{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, } @@ -4200,17 +4199,17 @@ encaps_var_offset: if isInt { $$ = &ast.ExprUnaryMinus{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), MinusTkn: $1, Expr: &ast.ScalarLnumber{ - Position: position.NewTokenPosition($2), + Position: yylex.(*Parser).builder.NewTokenPosition($2), NumberTkn: $2, Value: $2.Value, }, } } else { $$ = &ast.ScalarString{ - Position: position.NewTokensPosition($1, $2), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), MinusTkn: $1, StringTkn: $2, Value: append([]byte("-"), $2.Value...), @@ -4220,9 +4219,9 @@ encaps_var_offset: | T_VARIABLE { $$ = &ast.ExprVariable{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), VarName: &ast.Identifier{ - Position: position.NewTokenPosition($1), + Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, @@ -4238,7 +4237,7 @@ internal_functions_in_yacc: } $$ = &ast.ExprIsset{ - Position: position.NewTokensPosition($1, $5), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), IssetTkn: $1, OpenParenthesisTkn: $2, Vars: $3.(*ast.ParserSeparatedList).Items, @@ -4249,7 +4248,7 @@ internal_functions_in_yacc: | T_EMPTY '(' expr ')' { $$ = &ast.ExprEmpty{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), EmptyTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -4259,7 +4258,7 @@ internal_functions_in_yacc: | T_INCLUDE expr { $$ = &ast.ExprInclude{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -4267,7 +4266,7 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), IncludeTkn: $1, Expr: $2, } @@ -4275,7 +4274,7 @@ internal_functions_in_yacc: | T_EVAL '(' expr ')' { $$ = &ast.ExprEval{ - Position: position.NewTokensPosition($1, $4), + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), EvalTkn: $1, OpenParenthesisTkn: $2, Expr: $3, @@ -4285,7 +4284,7 @@ internal_functions_in_yacc: | T_REQUIRE expr { $$ = &ast.ExprRequire{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), RequireTkn: $1, Expr: $2, } @@ -4293,7 +4292,7 @@ internal_functions_in_yacc: | T_REQUIRE_ONCE expr { $$ = &ast.ExprRequireOnce{ - Position: position.NewTokenNodePosition($1, $2), + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), RequireOnceTkn: $1, Expr: $2, } diff --git a/internal/position/position.go b/internal/position/position.go index 888f24b..e6be89a 100644 --- a/internal/position/position.go +++ b/internal/position/position.go @@ -16,6 +16,16 @@ type endPos struct { endPos int } +type Builder struct { + pool *position.Pool +} + +func NewBuilder() *Builder { + return &Builder{ + pool: position.NewPool(position.DefaultBlockSize), + } +} + func getListStartPos(l []ast.Vertex) startPos { if l == nil { return startPos{-1, -1} @@ -75,130 +85,153 @@ func getNodeEndPos(n ast.Vertex) endPos { } // NewNodeListPosition returns new Position -func NewNodeListPosition(list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: getListStartPos(list).startLine, - EndLine: getListEndPos(list).endLine, - StartPos: getListStartPos(list).startPos, - EndPos: getListEndPos(list).endPos, - } +func (b *Builder) NewNodeListPosition(list []ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getListStartPos(list).startLine + pos.EndLine = getListEndPos(list).endLine + pos.StartPos = getListStartPos(list).startPos + pos.EndPos = getListEndPos(list).endPos + + return pos } // NewNodePosition returns new Position -func NewNodePosition(n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: getNodeStartPos(n).startLine, - EndLine: getNodeEndPos(n).endLine, - StartPos: getNodeStartPos(n).startPos, - EndPos: getNodeEndPos(n).endPos, - } +func (b *Builder) NewNodePosition(n ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getNodeStartPos(n).startLine + pos.EndLine = getNodeEndPos(n).endLine + pos.StartPos = getNodeStartPos(n).startPos + pos.EndPos = getNodeEndPos(n).endPos + + return pos } // NewTokenPosition returns new Position -func NewTokenPosition(t *token.Token) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: t.Position.EndLine, - StartPos: t.Position.StartPos, - EndPos: t.Position.EndPos, - } +func (b *Builder) NewTokenPosition(t *token.Token) *position.Position { + pos := b.pool.Get() + + pos.StartLine = t.Position.StartLine + pos.EndLine = t.Position.EndLine + pos.StartPos = t.Position.StartPos + pos.EndPos = t.Position.EndPos + + return pos } // NewTokensPosition returns new Position -func NewTokensPosition(startToken *token.Token, endToken *token.Token) *position.Position { - return &position.Position{ - StartLine: startToken.Position.StartLine, - EndLine: endToken.Position.EndLine, - StartPos: startToken.Position.StartPos, - EndPos: endToken.Position.EndPos, - } +func (b *Builder) NewTokensPosition(startToken *token.Token, endToken *token.Token) *position.Position { + pos := b.pool.Get() + + pos.StartLine = startToken.Position.StartLine + pos.EndLine = endToken.Position.EndLine + pos.StartPos = startToken.Position.StartPos + pos.EndPos = endToken.Position.EndPos + + return pos } // NewTokenNodePosition returns new Position -func NewTokenNodePosition(t *token.Token, n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: getNodeEndPos(n).endLine, - StartPos: t.Position.StartPos, - EndPos: getNodeEndPos(n).endPos, - } +func (b *Builder) NewTokenNodePosition(t *token.Token, n ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = t.Position.StartLine + pos.EndLine = getNodeEndPos(n).endLine + pos.StartPos = t.Position.StartPos + pos.EndPos = getNodeEndPos(n).endPos + + return pos } // NewNodeTokenPosition returns new Position -func NewNodeTokenPosition(n ast.Vertex, t *token.Token) *position.Position { - return &position.Position{ - StartLine: getNodeStartPos(n).startLine, - EndLine: t.Position.EndLine, - StartPos: getNodeStartPos(n).startPos, - EndPos: t.Position.EndPos, - } +func (b *Builder) NewNodeTokenPosition(n ast.Vertex, t *token.Token) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getNodeStartPos(n).startLine + pos.EndLine = t.Position.EndLine + pos.StartPos = getNodeStartPos(n).startPos + pos.EndPos = t.Position.EndPos + + return pos } // NewNodesPosition returns new Position -func NewNodesPosition(startNode ast.Vertex, endNode ast.Vertex) *position.Position { - return &position.Position{ - StartLine: getNodeStartPos(startNode).startLine, - EndLine: getNodeEndPos(endNode).endLine, - StartPos: getNodeStartPos(startNode).startPos, - EndPos: getNodeEndPos(endNode).endPos, - } +func (b *Builder) NewNodesPosition(startNode ast.Vertex, endNode ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getNodeStartPos(startNode).startLine + pos.EndLine = getNodeEndPos(endNode).endLine + pos.StartPos = getNodeStartPos(startNode).startPos + pos.EndPos = getNodeEndPos(endNode).endPos + + return pos } // NewNodeListTokenPosition returns new Position -func NewNodeListTokenPosition(list []ast.Vertex, t *token.Token) *position.Position { - return &position.Position{ - StartLine: getListStartPos(list).startLine, - EndLine: t.Position.EndLine, - StartPos: getListStartPos(list).startPos, - EndPos: t.Position.EndPos, - } +func (b *Builder) NewNodeListTokenPosition(list []ast.Vertex, t *token.Token) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getListStartPos(list).startLine + pos.EndLine = t.Position.EndLine + pos.StartPos = getListStartPos(list).startPos + pos.EndPos = t.Position.EndPos + + return pos } // NewTokenNodeListPosition returns new Position -func NewTokenNodeListPosition(t *token.Token, list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: getListEndPos(list).endLine, - StartPos: t.Position.StartPos, - EndPos: getListEndPos(list).endPos, - } +func (b *Builder) NewTokenNodeListPosition(t *token.Token, list []ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = t.Position.StartLine + pos.EndLine = getListEndPos(list).endLine + pos.StartPos = t.Position.StartPos + pos.EndPos = getListEndPos(list).endPos + + return pos } // NewNodeNodeListPosition returns new Position -func NewNodeNodeListPosition(n ast.Vertex, list []ast.Vertex) *position.Position { - return &position.Position{ - StartLine: getNodeStartPos(n).startLine, - EndLine: getListEndPos(list).endLine, - StartPos: getNodeStartPos(n).startPos, - EndPos: getListEndPos(list).endPos, - } +func (b *Builder) NewNodeNodeListPosition(n ast.Vertex, list []ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getNodeStartPos(n).startLine + pos.EndLine = getListEndPos(list).endLine + pos.StartPos = getNodeStartPos(n).startPos + pos.EndPos = getListEndPos(list).endPos + + return pos } // NewNodeListNodePosition returns new Position -func NewNodeListNodePosition(list []ast.Vertex, n ast.Vertex) *position.Position { - return &position.Position{ - StartLine: getListStartPos(list).startLine, - EndLine: getNodeEndPos(n).endLine, - StartPos: getListStartPos(list).startPos, - EndPos: getNodeEndPos(n).endPos, - } +func (b *Builder) NewNodeListNodePosition(list []ast.Vertex, n ast.Vertex) *position.Position { + pos := b.pool.Get() + + pos.StartLine = getListStartPos(list).startLine + pos.EndLine = getNodeEndPos(n).endLine + pos.StartPos = getListStartPos(list).startPos + pos.EndPos = getNodeEndPos(n).endPos + + return pos } // NewOptionalListTokensPosition returns new Position -func NewOptionalListTokensPosition(list []ast.Vertex, t *token.Token, endToken *token.Token) *position.Position { - if list == nil { - return &position.Position{ - StartLine: t.Position.StartLine, - EndLine: endToken.Position.EndLine, - StartPos: t.Position.StartPos, - EndPos: endToken.Position.EndPos, - } - } +func (b *Builder) NewOptionalListTokensPosition(list []ast.Vertex, t *token.Token, endToken *token.Token) *position.Position { + pos := b.pool.Get() - return &position.Position{ - StartLine: getListStartPos(list).startLine, - EndLine: endToken.Position.EndLine, - StartPos: getListStartPos(list).startPos, - EndPos: endToken.Position.EndPos, + if list == nil { + pos.StartLine = t.Position.StartLine + pos.EndLine = endToken.Position.EndLine + pos.StartPos = t.Position.StartPos + pos.EndPos = endToken.Position.EndPos + + return pos } + pos.StartLine = getListStartPos(list).startLine + pos.EndLine = endToken.Position.EndLine + pos.StartPos = getListStartPos(list).startPos + pos.EndPos = endToken.Position.EndPos + + return pos } diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 8c0381f..6a26ffc 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -36,7 +36,7 @@ func NewLexer(data []byte, phpVersion string, errHandlerFunc func(*errors.Error) stack: make([]int, 0), tokenPool: token.NewPool(position.DefaultBlockSize), - positionPool: position.NewPool(position.DefaultBlockSize), + positionPool: position.NewPool(token.DefaultBlockSize), newLines: NewLines{make([]int, 0, 128)}, } From 497e7f82eeb128f0ca5c2f64575a3dddc2fec06f Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 09:54:26 +0200 Subject: [PATCH 107/140] [refactoring] update printer --- internal/php5/php5.go | Bin 264995 -> 264823 bytes internal/php5/php5.y | 38 +- internal/php7/php7.go | Bin 219043 -> 219258 bytes internal/php7/php7.y | 42 +- pkg/ast/node.go | 8 +- pkg/ast/visitor/printer.go | 1239 +++++++ .../visitor/printer_php5_test.go} | 8 +- .../visitor/printer_php7_test.go} | 15 +- pkg/{printer => ast/visitor}/printer_test.go | 1746 +++++----- pkg/printer/printer.go | 2838 ----------------- 10 files changed, 2285 insertions(+), 3649 deletions(-) create mode 100644 pkg/ast/visitor/printer.go rename pkg/{printer/printer_parsed_php5_test.go => ast/visitor/printer_php5_test.go} (99%) rename pkg/{printer/printer_parsed_php7_test.go => ast/visitor/printer_php7_test.go} (99%) rename pkg/{printer => ast/visitor}/printer_test.go (75%) delete mode 100644 pkg/printer/printer.go diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 24fa23b155e37a3733f09cae54685b40a61807f9..219f8fc92b6bc597f1d42f5e4c02f3d392fba6ba 100644 GIT binary patch delta 1426 zcmZuxTTGl)5YBfFEDI^OHXvAFx9pZQg)VHNEJUgF!cuK3D_X@?aak@ADJ)PfZArOw zV=Yiyh%J-Qiz)RIP#Z|JC&3ph2~m}_SnoU9ikWYsz&_rb^ zD8eS{IW05k8ryW&gVl8Fj>uEh7DNF#s>O=OgxHux6RBvW=I=#3&Hcfk7i@6T)Jt;d zIIA5SN2QaB>?o#@L9v>$+z3%0*wG0Z>{~k1=5!>|!rR!RuB72AkV|X6hDCR)@pbSE z`n*{##WJ=LZJR4QzvrKFwtj=0{;wRu}%(*iEF%BuaK+yE>AONkP71 zgH0;Myf4-dMaeEzvJ2}#-J9eJdS)}r5Nkn_*1Qf$qwaLL)cRd`LQvBdxP{ZHRo?-^ zHdYEQLvfuzEnPZfq%R`xQ&>q0buv>8Z$}5CUGQogS_J*DgRAH=Fw2yO5_xhb=MJjA zjL0#8JT>t&PU%`cXg`(4JREh=Y|LsIg&fdyDPITcZc+8mYJ%{}6g-4NByBBYmceAp zC={}g`{3rO{JB>+>3lZARsKHlmY}wBuHmcFR45mr>Sj64X~W}ny+VyQrJX)YK_pf9 zI5=P1$xOQLrklJi4w7U+;V)`n=I%mBPb&I^HH&Y7e9hcKR$;`>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dAg5uCfzdQN5cB<(P#ud73P9DaR7)sDxW+p0;8v!A&;0e?`fCz#{( tC^iy){yonad*gVqO=r{nhW47nd-b;s{{lzo3*`U+ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index f26e824..f244655 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -264,6 +264,8 @@ import ( start: top_statement_list { + yylex.(*Parser).currentToken.Value = nil + yylex.(*Parser).rootNode = &ast.Root{ Position: yylex.(*Parser).builder.NewNodeListPosition($1), Stmts: $1, @@ -934,7 +936,6 @@ unticked_statement: { $2.(*ast.StmtGlobal).GlobalTkn = $1 $2.(*ast.StmtGlobal).SemiColonTkn = $3 - $2.(*ast.StmtGlobal).SeparatorTkns = append($2.(*ast.StmtGlobal).SeparatorTkns, nil) $2.(*ast.StmtGlobal).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 @@ -943,7 +944,6 @@ unticked_statement: { $2.(*ast.StmtStatic).StaticTkn = $1 $2.(*ast.StmtStatic).SemiColonTkn = $3 - $2.(*ast.StmtStatic).SeparatorTkns = append($2.(*ast.StmtStatic).SeparatorTkns, nil) $2.(*ast.StmtStatic).Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) $$ = $2 @@ -1069,8 +1069,8 @@ unticked_statement: GotoTkn: $1, Label: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - IdentifierTkn: $1, - Value: $1.Value, + IdentifierTkn: $2, + Value: $2.Value, }, SemiColonTkn: $3, } @@ -2197,9 +2197,9 @@ trait_adaptations: { $$ = &ast.StmtTraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenParenthesisTkn: $1, - Adaptations: $2, - CloseParenthesisTkn: $3, + OpenCurlyBracketTkn: $1, + Adaptations: $2, + CloseCurlyBracketTkn: $3, } } ; @@ -2691,7 +2691,7 @@ new_expr: OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -2749,7 +2749,7 @@ expr_without_variable: OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $6.(*ast.ArgumentList).Arguments, SeparatorTkns: $6.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $6.(*ast.ArgumentList).CloseParenthesisTkn, } } else { _new = &ast.ExprNew{ @@ -3620,7 +3620,7 @@ function_call: OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3637,7 +3637,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3653,7 +3653,7 @@ function_call: OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3666,7 +3666,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list @@ -3679,7 +3679,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3692,7 +3692,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list @@ -3705,7 +3705,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | variable_without_objects function_call_parameter_list @@ -3716,7 +3716,7 @@ function_call: OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, } } ; @@ -4500,7 +4500,7 @@ scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, - CloseQoteTkn: $1, + CloseQoteTkn: $3, } } | T_START_HEREDOC encaps_list T_END_HEREDOC @@ -4674,7 +4674,7 @@ variable: OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, SeparatorTkns: mc.SeparatorTkns, - CloseParenthesisTkn: mc.OpenParenthesisTkn, + CloseParenthesisTkn: mc.CloseParenthesisTkn, }, ) $3 = append($3, $4[1:len($4)]...) diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 11c021e4de7377a35ee9c6f6057e3afba89c48a7..7e9dd54a0e260e7a8a18ba547b7b3c3859391285 100644 GIT binary patch delta 8285 zcmZ`;d304p@;=o!3rWa^ELmPQ2&)J$FE1OI7=#cAiYyvI6cQOhS)2ee8WsgX!JUYt z21h_#Ky+9{ppU2!5Lv}U5D|4)92F2ma7JL*{C(B;-uL31`Tdcc?&__o`m3+1?|Xf9 z^rbb?YmyTw`#n$Mu@k&lQPb!y<(19`d5{cSF zQXBX7*}W__W4EN4F{iiv553~_#$y{B_2ejL$*PRTlRC6++r$7KfFPY2r7?(m~+gTogawI{ZN+;4AjTH5(`dsKV0b9iNY+Mu$t_}oF&f{VXY zi9EjpF7y~#$-L&G3gfy$)n2#mNQtC!yt=Rx6)HYbB`Mo%ST5{cel+2YroRG2G?H-bD%}}>HFk411xZPdSU3x)faSy*l z>Oo4^yT?-=@!=d;kS+VBakuW2$i;gwVZZ?utJmhzR!5hrmnfpqaAA>UhWioU(v9jl zzC@*Itga#|s4b!dE*wS8xKk00l$|0NvQ9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k+X^;To;Qi7x3WM;xHq ze626q=NlI#+9gYz!^|dtl%ZVpGos6+ES@~BLG`26#tewaCv3e9?@t`Ky#BK#c{@C2qk~(I>rF}EdPBAWPZ0+TK z308qzktMi8OWsX1+Tjl1giC6Y2(2e1S$BDzpT9jW_rE4vgCx#Gy=uRe#M68*K`_&~ z4b*CG6}eGmek$t4JHdi4pch_XZm2LG-_jb+!7xRT?lSw8P@iaR;eFn8QlZlt^WA^a5Pm7udeI8z z+0~E@20|1(l}}V{^|rQFv9$1}gy5`F6N72i5)}-1*S1IZ};udSOijCwa= zvj#S2OARu+A>abU?*w5Pb1kb%h8;`DYGNL6?H`cbn^qq2yn5D?T$qh;H8>y@m=PRF zGW#FepJUB4mDB!#XN>pGS%;rHjxt_V4!f@Eitg?0S8zR=b*uH0xa+X$wyYtdX4QxI zLFT_qY|Y(+@IM~rqPV;We=>fdku^R`v#h3ERft_OTH`sax)%y>-!9fNJ7^QOcD3%e zOp1l#YWi&^6hkEmh)yZwu-gyC*dnOYdRzZd zHr_hjS;M~8YN-VsK=MTn#nHnz}xIlh61YTP(7}f8cFoh}<4R|fO(+d1Q8M{EO diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 4f52bad..1db8b0a 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -281,6 +281,8 @@ import ( start: top_statement_list { + yylex.(*Parser).currentToken.Value = nil + yylex.(*Parser).rootNode = &ast.Root{ Position: yylex.(*Parser).builder.NewNodeListPosition($1), Stmts: $1, @@ -579,7 +581,9 @@ group_use_declaration: mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + if $5 != nil { + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), @@ -597,7 +601,9 @@ mixed_group_use_declaration: } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + if $6 != nil { + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), @@ -941,7 +947,9 @@ statement: { $3.(*ast.StmtUnset).UnsetTkn = $1 $3.(*ast.StmtUnset).OpenParenthesisTkn = $2 - $3.(*ast.StmtUnset).SeparatorTkns = append($3.(*ast.StmtUnset).SeparatorTkns, $4) + if $4 != nil { + $3.(*ast.StmtUnset).SeparatorTkns = append($3.(*ast.StmtUnset).SeparatorTkns, $4) + } $3.(*ast.StmtUnset).CloseParenthesisTkn = $5 $3.(*ast.StmtUnset).SemiColonTkn = $6 $3.(*ast.StmtUnset).Position = yylex.(*Parser).builder.NewTokensPosition($1, $6) @@ -1815,7 +1823,9 @@ argument_list: argumentList := $2.(*ast.ArgumentList) argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) argumentList.OpenParenthesisTkn = $1 - argumentList.SeparatorTkns = append(argumentList.SeparatorTkns, $3) + if $3 != nil { + argumentList.SeparatorTkns = append(argumentList.SeparatorTkns, $3) + } argumentList.CloseParenthesisTkn = $4 $$ = argumentList @@ -2029,17 +2039,17 @@ trait_adaptations: { $$ = &ast.StmtTraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), - OpenParenthesisTkn: $1, - CloseParenthesisTkn: $2, + OpenCurlyBracketTkn: $1, + CloseCurlyBracketTkn: $2, } } | '{' trait_adaptation_list '}' { $$ = &ast.StmtTraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenParenthesisTkn: $1, - Adaptations: $2, - CloseParenthesisTkn: $3, + OpenCurlyBracketTkn: $1, + Adaptations: $2, + CloseCurlyBracketTkn: $3, } } ; @@ -2435,7 +2445,7 @@ anonymous_class: OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, Extends: $3, Implements: $4, OpenCurlyBracket: $6, @@ -2456,7 +2466,7 @@ new_expr: OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -3284,7 +3294,7 @@ function_call: OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list @@ -3297,7 +3307,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list @@ -3310,7 +3320,7 @@ function_call: OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } | callable_expr argument_list @@ -3321,7 +3331,7 @@ function_call: OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, } } ; @@ -3542,7 +3552,7 @@ scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenQoteTkn: $1, Parts: $2, - CloseQoteTkn: $1, + CloseQoteTkn: $3, } } | T_START_HEREDOC encaps_list T_END_HEREDOC diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 70655b5..4089027 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -954,10 +954,10 @@ func (n *StmtTrait) GetPosition() *position.Position { // StmtTraitAdaptationList node type StmtTraitAdaptationList struct { - Position *position.Position - OpenParenthesisTkn *token.Token - Adaptations []Vertex - CloseParenthesisTkn *token.Token + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go new file mode 100644 index 0000000..5d49077 --- /dev/null +++ b/pkg/ast/visitor/printer.go @@ -0,0 +1,1239 @@ +package visitor + +import ( + "bytes" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" + "io" +) + +type printerState int + +const ( + PrinterStateHTML printerState = iota + PrinterStatePHP +) + +type printer struct { + output io.Writer + state printerState + last []byte +} + +func NewPrinter(output io.Writer) *printer { + return &printer{ + output: output, + } +} + +func (p *printer) WithState(state printerState) *printer { + p.state = state + return p +} + +func isValidVarName(r byte) bool { + return (r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r >= 0x80 +} + +func (p *printer) write(b []byte) { + if len(b) == 0 { + return + } + + if p.state == PrinterStateHTML { + if !bytes.HasPrefix(b, []byte(""))) + p.printNode(n.Var) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, nil) + if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { + p.printToken(stmt.OpenCurlyBracket, nil) + p.printList(stmt.Stmts) + p.printToken(stmt.CloseCurlyBracket, nil) + } else { + p.printNode(n.Stmt) + } + p.printToken(n.EndForeachTkn, p.ifToken(n.ColonTkn, []byte("endforeach"), nil)) + p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil)) +} + +func (p *printer) StmtFunction(n *ast.StmtFunction) { + p.printToken(n.FunctionTkn, []byte("function")) + p.printToken(n.AmpersandTkn, nil) + p.printNode(n.FunctionName) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":"))) + p.printNode(n.ReturnType) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) +} + +func (p *printer) StmtGlobal(n *ast.StmtGlobal) { + p.printToken(n.GlobalTkn, []byte("global")) + p.printSeparatedList(n.Vars, n.SeparatorTkns, []byte(",")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtGoto(n *ast.StmtGoto) { + p.printToken(n.GotoTkn, []byte("goto")) + p.printNode(n.Label) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtHaltCompiler(n *ast.StmtHaltCompiler) { + p.printToken(n.HaltCompilerTkn, []byte("__halt_compiler")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtIf(n *ast.StmtIf) { + p.printToken(n.IfTkn, []byte("if")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printNode(n.Cond) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, nil) + if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { + p.printToken(stmt.OpenCurlyBracket, nil) + p.printList(stmt.Stmts) + p.printToken(stmt.CloseCurlyBracket, nil) + } else { + p.printNode(n.Stmt) + } + p.printList(n.ElseIf) + p.printNode(n.Else) + p.printToken(n.EndIfTkn, p.ifToken(n.ColonTkn, []byte("endif"), nil)) + p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil)) +} + +func (p *printer) StmtInlineHtml(n *ast.StmtInlineHtml) { + p.state = PrinterStatePHP + if p.last != nil && !bytes.HasSuffix(p.last, []byte("?>")) && !bytes.HasSuffix(p.last, []byte("?>\n")) { + p.write([]byte("?>")) + } + + p.printToken(n.InlineHtmlTkn, n.Value) + p.state = PrinterStateHTML +} + +func (p *printer) StmtInterface(n *ast.StmtInterface) { + p.printToken(n.InterfaceTkn, []byte("interface")) + p.printNode(n.InterfaceName) + p.printNode(n.Extends) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) +} + +func (p *printer) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { + p.printToken(n.ExtendsTkn, []byte("extends")) + p.printSeparatedList(n.InterfaceNames, n.SeparatorTkns, []byte(",")) +} + +func (p *printer) StmtLabel(n *ast.StmtLabel) { + p.printNode(n.LabelName) + p.printToken(n.ColonTkn, []byte(":")) +} + +func (p *printer) StmtNamespace(n *ast.StmtNamespace) { + p.printToken(n.NsTkn, []byte("namespace")) + p.printNode(n.Name) + p.printToken(n.OpenCurlyBracket, p.ifNodeList(n.Stmts, []byte("{"))) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracket, p.ifNodeList(n.Stmts, []byte("}"))) + p.printToken(n.SemiColonTkn, p.ifNotNodeList(n.Stmts, []byte(";"))) +} + +func (p *printer) StmtNop(n *ast.StmtNop) { + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtProperty(n *ast.StmtProperty) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, p.ifNode(n.Expr, []byte("="))) + p.printNode(n.Expr) +} + +func (p *printer) StmtPropertyList(n *ast.StmtPropertyList) { + p.printList(n.Modifiers) + p.printNode(n.Type) + p.printSeparatedList(n.Properties, n.SeparatorTkns, []byte(",")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtReturn(n *ast.StmtReturn) { + p.printToken(n.ReturnTkn, []byte("return")) + p.printNode(n.Expr) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtStatic(n *ast.StmtStatic) { + p.printToken(n.StaticTkn, []byte("static")) + p.printSeparatedList(n.Vars, n.SeparatorTkns, []byte(",")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtStaticVar(n *ast.StmtStaticVar) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, p.ifNode(n.Expr, []byte("="))) + p.printNode(n.Expr) +} + +func (p *printer) StmtStmtList(n *ast.StmtStmtList) { + p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracket, []byte("}")) +} + +func (p *printer) StmtSwitch(n *ast.StmtSwitch) { + p.printToken(n.SwitchTkn, []byte("switch")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printNode(n.Cond) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, nil) + p.printToken(n.OpenCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("{"))) + p.printToken(n.CaseSeparatorTkn, nil) + p.printList(n.CaseList) + p.printToken(n.CloseCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("}"))) + p.printToken(n.EndSwitchTkn, p.ifToken(n.ColonTkn, []byte("endswitch"), nil)) + p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil)) +} + +func (p *printer) StmtThrow(n *ast.StmtThrow) { + p.printToken(n.ThrowTkn, []byte("throw")) + p.printNode(n.Expr) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtTrait(n *ast.StmtTrait) { + p.printToken(n.TraitTkn, []byte("trait")) + p.printNode(n.TraitName) + p.printNode(n.Extends) + p.printNode(n.Implements) + p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracket, []byte("}")) +} + +func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) + p.printList(n.Adaptations) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) +} + +func (p *printer) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { + p.printNode(n.Trait) + p.printToken(n.DoubleColonTkn, p.ifNode(n.Trait, []byte("::"))) + p.printNode(n.Method) +} + +func (p *printer) StmtTraitUse(n *ast.StmtTraitUse) { + p.printToken(n.UseTkn, []byte("use")) + p.printSeparatedList(n.Traits, n.SeparatorTkns, []byte(",")) + p.printNode(n.Adaptations) +} + +func (p *printer) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { + p.printNode(n.Ref) + p.printToken(n.AsTkn, []byte("as")) + p.printNode(n.Modifier) + p.printNode(n.Alias) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { + p.printNode(n.Ref) + p.printToken(n.InsteadofTkn, []byte("insteadof")) + p.printSeparatedList(n.Insteadof, n.SeparatorTkns, []byte(",")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtTry(n *ast.StmtTry) { + p.printToken(n.TryTkn, []byte("try")) + p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracket, []byte("}")) + p.printList(n.Catches) + p.printNode(n.Finally) +} + +func (p *printer) StmtUnset(n *ast.StmtUnset) { + p.printToken(n.UnsetTkn, []byte("unset")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Vars, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtUse(n *ast.StmtUse) { + p.printToken(n.UseTkn, []byte("use")) + p.printNode(n.Type) + p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(",")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtGroupUse(n *ast.StmtGroupUse) { + p.printToken(n.UseTkn, []byte("use")) + p.printNode(n.Type) + p.printToken(n.LeadingNsSeparatorTkn, nil) + p.printNode(n.Prefix) + p.printToken(n.NsSeparatorTkn, []byte("\\")) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) + p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) + p.printToken(n.SemiColonTkn, []byte(";")) +} + +func (p *printer) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + p.printNode(n.Type) + p.printToken(n.NsSeparatorTkn, nil) + p.printNode(n.Use) + p.printToken(n.AsTkn, p.ifNode(n.Alias, []byte("as"))) + p.printNode(n.Alias) +} + +func (p *printer) StmtWhile(n *ast.StmtWhile) { + p.printToken(n.WhileTkn, []byte("while")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printNode(n.Cond) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, nil) + if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { + p.printToken(stmt.OpenCurlyBracket, nil) + p.printList(stmt.Stmts) + p.printToken(stmt.CloseCurlyBracket, nil) + } else { + p.printNode(n.Stmt) + } + p.printToken(n.EndWhileTkn, p.ifToken(n.ColonTkn, []byte("endwhile"), nil)) + p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil)) +} + +func (p *printer) ExprArray(n *ast.ExprArray) { + p.printToken(n.ArrayTkn, nil) + p.printToken(n.OpenBracketTkn, p.ifToken(n.ArrayTkn, []byte("("), []byte("["))) + p.printSeparatedList(n.Items, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseBracketTkn, p.ifToken(n.ArrayTkn, []byte(")"), []byte("]"))) +} + +func (p *printer) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { + p.printNode(n.Var) + p.printToken(n.OpenBracketTkn, []byte("[")) + p.printNode(n.Dim) + p.printToken(n.CloseBracketTkn, []byte("]")) +} + +func (p *printer) ExprArrayItem(n *ast.ExprArrayItem) { + p.printToken(n.EllipsisTkn, nil) + p.printNode(n.Key) + p.printToken(n.DoubleArrowTkn, p.ifNode(n.Key, []byte("=>"))) + p.printNode(n.Val) +} + +func (p *printer) ExprArrowFunction(n *ast.ExprArrowFunction) { + p.printToken(n.StaticTkn, nil) + p.printToken(n.FnTkn, []byte("fn")) + p.printToken(n.AmpersandTkn, nil) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":"))) + p.printNode(n.ReturnType) + p.printToken(n.DoubleArrowTkn, []byte("=>")) + p.printNode(n.Expr) +} + +func (p *printer) ExprBitwiseNot(n *ast.ExprBitwiseNot) { + p.printToken(n.TildaTkn, []byte("~")) + p.printNode(n.Expr) +} + +func (p *printer) ExprBooleanNot(n *ast.ExprBooleanNot) { + p.printToken(n.ExclamationTkn, []byte("!")) + p.printNode(n.Expr) +} + +func (p *printer) ExprClassConstFetch(n *ast.ExprClassConstFetch) { + p.printNode(n.Class) + p.printToken(n.DoubleColonTkn, []byte("::")) + p.printNode(n.ConstantName) +} + +func (p *printer) ExprClone(n *ast.ExprClone) { + p.printToken(n.CloneTkn, []byte("clone")) + p.printNode(n.Expr) +} + +func (p *printer) ExprClosure(n *ast.ExprClosure) { + p.printToken(n.StaticTkn, nil) + p.printToken(n.FunctionTkn, []byte("function")) + p.printToken(n.AmpersandTkn, nil) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printNode(n.ClosureUse) + p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":"))) + p.printNode(n.ReturnType) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) + p.printList(n.Stmts) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) +} + +func (p *printer) ExprClosureUse(n *ast.ExprClosureUse) { + p.printToken(n.UseTkn, []byte("use")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprConstFetch(n *ast.ExprConstFetch) { + p.printNode(n.Const) +} + +func (p *printer) ExprEmpty(n *ast.ExprEmpty) { + p.printToken(n.EmptyTkn, []byte("empty")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printNode(n.Expr) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprErrorSuppress(n *ast.ExprErrorSuppress) { + p.printToken(n.AtTkn, []byte("@")) + p.printNode(n.Expr) +} + +func (p *printer) ExprEval(n *ast.ExprEval) { + p.printToken(n.EvalTkn, []byte("eval")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printNode(n.Expr) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprExit(n *ast.ExprExit) { + p.printToken(n.DieTkn, []byte("exit")) + p.printToken(n.OpenParenthesisTkn, nil) + p.printNode(n.Expr) + p.printToken(n.CloseParenthesisTkn, p.ifToken(n.OpenParenthesisTkn, []byte(")"), nil)) +} + +func (p *printer) ExprFunctionCall(n *ast.ExprFunctionCall) { + p.printNode(n.Function) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprInclude(n *ast.ExprInclude) { + p.printToken(n.IncludeTkn, []byte("include")) + p.printNode(n.Expr) +} + +func (p *printer) ExprIncludeOnce(n *ast.ExprIncludeOnce) { + p.printToken(n.IncludeTkn, []byte("include_once")) + p.printNode(n.Expr) +} + +func (p *printer) ExprInstanceOf(n *ast.ExprInstanceOf) { + p.printNode(n.Expr) + p.printToken(n.InstanceOfTkn, []byte("instanceof")) + p.printNode(n.Class) +} + +func (p *printer) ExprIsset(n *ast.ExprIsset) { + p.printToken(n.IssetTkn, []byte("isset")) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Vars, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprList(n *ast.ExprList) { + p.printToken(n.ListTkn, p.ifToken(n.OpenBracketTkn, nil, []byte("list"))) + p.printToken(n.OpenBracketTkn, []byte("(")) + p.printSeparatedList(n.Items, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseBracketTkn, []byte(")")) +} + +func (p *printer) ExprMethodCall(n *ast.ExprMethodCall) { + p.printNode(n.Var) + p.printToken(n.ObjectOperatorTkn, []byte("->")) + p.printNode(n.Method) + p.printToken(n.OpenParenthesisTkn, []byte("(")) + p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, []byte(")")) +} + +func (p *printer) ExprNew(n *ast.ExprNew) { + p.printToken(n.NewTkn, []byte("new")) + p.printNode(n.Class) + p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) + p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) +} + +func (p *printer) ExprPostDec(n *ast.ExprPostDec) { + p.printNode(n.Var) + p.printToken(n.DecTkn, []byte("--")) +} + +func (p *printer) ExprPostInc(n *ast.ExprPostInc) { + p.printNode(n.Var) + p.printToken(n.IncTkn, []byte("++")) +} + +func (p *printer) ExprPreDec(n *ast.ExprPreDec) { + p.printToken(n.DecTkn, []byte("--")) + p.printNode(n.Var) +} + +func (p *printer) ExprPreInc(n *ast.ExprPreInc) { + p.printToken(n.IncTkn, []byte("++")) + p.printNode(n.Var) +} + +func (p *printer) ExprPrint(n *ast.ExprPrint) { + p.printToken(n.PrintTkn, []byte("print")) + p.printNode(n.Expr) +} + +func (p *printer) ExprPropertyFetch(n *ast.ExprPropertyFetch) { + p.printNode(n.Var) + p.printToken(n.ObjectOperatorTkn, []byte("->")) + p.printNode(n.Property) +} + +func (p *printer) ExprReference(n *ast.ExprReference) { + p.printToken(n.AmpersandTkn, []byte("&")) + p.printNode(n.Var) +} + +func (p *printer) ExprRequire(n *ast.ExprRequire) { + p.printToken(n.RequireTkn, []byte("require")) + p.printNode(n.Expr) +} + +func (p *printer) ExprRequireOnce(n *ast.ExprRequireOnce) { + p.printToken(n.RequireOnceTkn, []byte("require_once")) + p.printNode(n.Expr) +} + +func (p *printer) ExprShellExec(n *ast.ExprShellExec) { + p.printToken(n.OpenBacktickTkn, []byte("`")) + p.printList(n.Parts) + p.printToken(n.CloseBacktickTkn, []byte("`")) +} + +func (p *printer) ExprStaticCall(n *ast.ExprStaticCall) { + p.printNode(n.Class) + p.printToken(n.DoubleColonTkn, []byte("::")) + p.printNode(n.Call) + p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) + p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) +} + +func (p *printer) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { + p.printNode(n.Class) + p.printToken(n.DoubleColonTkn, []byte("::")) + p.printNode(n.Property) +} + +func (p *printer) ExprTernary(n *ast.ExprTernary) { + p.printNode(n.Condition) + p.printToken(n.QuestionTkn, []byte("?")) + p.printNode(n.IfTrue) + p.printToken(n.ColonTkn, []byte(":")) + p.printNode(n.IfFalse) +} + +func (p *printer) ExprUnaryMinus(n *ast.ExprUnaryMinus) { + p.printToken(n.MinusTkn, []byte("-")) + p.printNode(n.Expr) +} + +func (p *printer) ExprUnaryPlus(n *ast.ExprUnaryPlus) { + p.printToken(n.PlusTkn, []byte("+")) + p.printNode(n.Expr) +} + +func (p *printer) ExprVariable(n *ast.ExprVariable) { + p.printToken(n.DollarTkn, nil) + p.printNode(n.VarName) +} + +func (p *printer) ExprYield(n *ast.ExprYield) { + p.printToken(n.YieldTkn, []byte("yield")) + p.printNode(n.Key) + p.printToken(n.DoubleArrowTkn, p.ifNode(n.Key, []byte("=>"))) + p.printNode(n.Value) +} + +func (p *printer) ExprYieldFrom(n *ast.ExprYieldFrom) { + p.printToken(n.YieldFromTkn, []byte("yield from")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssign(n *ast.ExprAssign) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignReference(n *ast.ExprAssignReference) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("=")) + p.printToken(n.AmpersandTkn, []byte("&")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("&=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("|=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("^=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("??=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignConcat(n *ast.ExprAssignConcat) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte(".=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignDiv(n *ast.ExprAssignDiv) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("/=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignMinus(n *ast.ExprAssignMinus) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("-=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignMod(n *ast.ExprAssignMod) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("%=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignMul(n *ast.ExprAssignMul) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("*=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignPlus(n *ast.ExprAssignPlus) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("+=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignPow(n *ast.ExprAssignPow) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("**=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte("<<=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { + p.printNode(n.Var) + p.printToken(n.EqualTkn, []byte(">>=")) + p.printNode(n.Expr) +} + +func (p *printer) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("&")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("|")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("^")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("&&")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("||")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("??")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryConcat(n *ast.ExprBinaryConcat) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte(".")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryDiv(n *ast.ExprBinaryDiv) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("/")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryEqual(n *ast.ExprBinaryEqual) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("==")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryGreater(n *ast.ExprBinaryGreater) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte(">")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte(">=")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("===")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("and")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("or")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("xor")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryMinus(n *ast.ExprBinaryMinus) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("-")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryMod(n *ast.ExprBinaryMod) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("%")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryMul(n *ast.ExprBinaryMul) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("*")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("!=")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("!==")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryPlus(n *ast.ExprBinaryPlus) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("+")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryPow(n *ast.ExprBinaryPow) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("**")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("<<")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte(">>")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinarySmaller(n *ast.ExprBinarySmaller) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("<")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("<=")) + p.printNode(n.Right) +} + +func (p *printer) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { + p.printNode(n.Left) + p.printToken(n.OpTkn, []byte("<=>")) + p.printNode(n.Right) +} + +func (p *printer) ExprCastArray(n *ast.ExprCastArray) { + p.printToken(n.CastTkn, []byte("(array)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastBool(n *ast.ExprCastBool) { + p.printToken(n.CastTkn, []byte("(bool)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastDouble(n *ast.ExprCastDouble) { + p.printToken(n.CastTkn, []byte("(float)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastInt(n *ast.ExprCastInt) { + p.printToken(n.CastTkn, []byte("(integer)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastObject(n *ast.ExprCastObject) { + p.printToken(n.CastTkn, []byte("(object)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastString(n *ast.ExprCastString) { + p.printToken(n.CastTkn, []byte("(string)")) + p.printNode(n.Expr) +} + +func (p *printer) ExprCastUnset(n *ast.ExprCastUnset) { + p.printToken(n.CastTkn, []byte("(unset)")) + p.printNode(n.Expr) +} + +func (p *printer) ScalarDnumber(n *ast.ScalarDnumber) { + p.printToken(n.NumberTkn, n.Value) +} + +func (p *printer) ScalarEncapsed(n *ast.ScalarEncapsed) { + p.printToken(n.OpenQoteTkn, []byte("\"")) + p.printList(n.Parts) + p.printToken(n.CloseQoteTkn, []byte("\"")) +} + +func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { + p.printToken(n.EncapsedStrTkn, n.Value) +} + +func (p *printer) ScalarHeredoc(n *ast.ScalarHeredoc) { + p.printToken(n.OpenHeredocTkn, []byte("<<HTML")}, &ast.StmtEcho{ @@ -85,9 +87,10 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `

HTML
HTML
>=$b` actual := o.String() @@ -771,15 +786,16 @@ func TestPrinterPrintAssignShiftRight(t *testing.T) { func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryBitwiseAnd{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryBitwiseAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a&$b` actual := o.String() @@ -792,15 +808,16 @@ func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryBitwiseOr{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryBitwiseOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a|$b` actual := o.String() @@ -813,15 +830,16 @@ func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryBitwiseXor{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryBitwiseXor{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a^$b` actual := o.String() @@ -834,15 +852,16 @@ func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryBooleanAnd{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryBooleanAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a&&$b` actual := o.String() @@ -855,15 +874,16 @@ func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { func TestPrinterPrintBinaryBooleanOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryBooleanOr{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryBooleanOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a||$b` actual := o.String() @@ -876,15 +896,16 @@ func TestPrinterPrintBinaryBooleanOr(t *testing.T) { func TestPrinterPrintBinaryCoalesce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryCoalesce{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryCoalesce{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a??$b` actual := o.String() @@ -897,15 +918,16 @@ func TestPrinterPrintBinaryCoalesce(t *testing.T) { func TestPrinterPrintBinaryConcat(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryConcat{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryConcat{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a.$b` actual := o.String() @@ -918,15 +940,16 @@ func TestPrinterPrintBinaryConcat(t *testing.T) { func TestPrinterPrintBinaryDiv(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryDiv{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryDiv{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a/$b` actual := o.String() @@ -939,15 +962,16 @@ func TestPrinterPrintBinaryDiv(t *testing.T) { func TestPrinterPrintBinaryEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryEqual{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a==$b` actual := o.String() @@ -960,15 +984,16 @@ func TestPrinterPrintBinaryEqual(t *testing.T) { func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryGreaterOrEqual{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryGreaterOrEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a>=$b` actual := o.String() @@ -981,15 +1006,16 @@ func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { func TestPrinterPrintBinaryGreater(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryGreater{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryGreater{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a>$b` actual := o.String() @@ -1002,15 +1028,16 @@ func TestPrinterPrintBinaryGreater(t *testing.T) { func TestPrinterPrintBinaryIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryIdentical{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryIdentical{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a===$b` actual := o.String() @@ -1023,17 +1050,18 @@ func TestPrinterPrintBinaryIdentical(t *testing.T) { func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryLogicalAnd{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryLogicalAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) - expected := `$a and $b` + expected := `$a and$b` actual := o.String() if expected != actual { @@ -1044,17 +1072,18 @@ func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { func TestPrinterPrintBinaryLogicalOr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryLogicalOr{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryLogicalOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) - expected := `$a or $b` + expected := `$a or$b` actual := o.String() if expected != actual { @@ -1065,17 +1094,18 @@ func TestPrinterPrintBinaryLogicalOr(t *testing.T) { func TestPrinterPrintBinaryLogicalXor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryLogicalXor{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryLogicalXor{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) - expected := `$a xor $b` + expected := `$a xor$b` actual := o.String() if expected != actual { @@ -1086,15 +1116,16 @@ func TestPrinterPrintBinaryLogicalXor(t *testing.T) { func TestPrinterPrintBinaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryMinus{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryMinus{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a-$b` actual := o.String() @@ -1107,15 +1138,16 @@ func TestPrinterPrintBinaryMinus(t *testing.T) { func TestPrinterPrintBinaryMod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryMod{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryMod{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a%$b` actual := o.String() @@ -1128,15 +1160,16 @@ func TestPrinterPrintBinaryMod(t *testing.T) { func TestPrinterPrintBinaryMul(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryMul{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryMul{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a*$b` actual := o.String() @@ -1149,15 +1182,16 @@ func TestPrinterPrintBinaryMul(t *testing.T) { func TestPrinterPrintBinaryNotEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryNotEqual{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryNotEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a!=$b` actual := o.String() @@ -1170,15 +1204,16 @@ func TestPrinterPrintBinaryNotEqual(t *testing.T) { func TestPrinterPrintBinaryNotIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryNotIdentical{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryNotIdentical{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a!==$b` actual := o.String() @@ -1191,15 +1226,16 @@ func TestPrinterPrintBinaryNotIdentical(t *testing.T) { func TestPrinterPrintBinaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryPlus{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryPlus{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a+$b` actual := o.String() @@ -1212,15 +1248,16 @@ func TestPrinterPrintBinaryPlus(t *testing.T) { func TestPrinterPrintBinaryPow(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryPow{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryPow{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a**$b` actual := o.String() @@ -1233,15 +1270,16 @@ func TestPrinterPrintBinaryPow(t *testing.T) { func TestPrinterPrintBinaryShiftLeft(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryShiftLeft{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryShiftLeft{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a<<$b` actual := o.String() @@ -1254,15 +1292,16 @@ func TestPrinterPrintBinaryShiftLeft(t *testing.T) { func TestPrinterPrintBinaryShiftRight(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinaryShiftRight{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinaryShiftRight{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a>>$b` actual := o.String() @@ -1275,15 +1314,16 @@ func TestPrinterPrintBinaryShiftRight(t *testing.T) { func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinarySmallerOrEqual{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinarySmallerOrEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a<=$b` actual := o.String() @@ -1296,15 +1336,16 @@ func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { func TestPrinterPrintBinarySmaller(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinarySmaller{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinarySmaller{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a<$b` actual := o.String() @@ -1317,15 +1358,16 @@ func TestPrinterPrintBinarySmaller(t *testing.T) { func TestPrinterPrintBinarySpaceship(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBinarySpaceship{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBinarySpaceship{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a<=>$b` actual := o.String() @@ -1340,12 +1382,13 @@ func TestPrinterPrintBinarySpaceship(t *testing.T) { func TestPrinterPrintArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastArray{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastArray{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(array)$var` actual := o.String() @@ -1358,14 +1401,15 @@ func TestPrinterPrintArray(t *testing.T) { func TestPrinterPrintBool(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastBool{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastBool{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `(boolean)$var` + expected := `(bool)$var` actual := o.String() if expected != actual { @@ -1376,12 +1420,13 @@ func TestPrinterPrintBool(t *testing.T) { func TestPrinterPrintDouble(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastDouble{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastDouble{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(float)$var` actual := o.String() @@ -1394,12 +1439,13 @@ func TestPrinterPrintDouble(t *testing.T) { func TestPrinterPrintInt(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastInt{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastInt{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(integer)$var` actual := o.String() @@ -1412,12 +1458,13 @@ func TestPrinterPrintInt(t *testing.T) { func TestPrinterPrintObject(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastObject{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastObject{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(object)$var` actual := o.String() @@ -1430,12 +1477,13 @@ func TestPrinterPrintObject(t *testing.T) { func TestPrinterPrintString(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastString{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastString{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(string)$var` actual := o.String() @@ -1448,12 +1496,13 @@ func TestPrinterPrintString(t *testing.T) { func TestPrinterPrintUnset(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprCastUnset{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprCastUnset{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `(unset)$var` actual := o.String() @@ -1468,13 +1517,14 @@ func TestPrinterPrintUnset(t *testing.T) { func TestPrinterPrintExprArrayDimFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprArrayDimFetch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArrayDimFetch{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, Dim: &ast.ScalarLnumber{Value: []byte("1")}, - }) + } + n.Accept(p) expected := `$var[1]` actual := o.String() @@ -1487,13 +1537,14 @@ func TestPrinterPrintExprArrayDimFetch(t *testing.T) { func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprArrayItem{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, Val: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$world")}, }, - }) + } + n.Accept(p) expected := `'Hello'=>$world` actual := o.String() @@ -1506,12 +1557,13 @@ func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { func TestPrinterPrintExprArrayItem(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprArrayItem{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArrayItem{ Val: &ast.ExprReference{Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$world")}, }}, - }) + } + n.Accept(p) expected := `&$world` actual := o.String() @@ -1524,13 +1576,16 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { func TestPrinterPrintExprArrayItemUnpack(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprArrayItem{ - Unpack: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArrayItem{ + EllipsisTkn: &token.Token{ + Value: []byte("..."), + }, Val: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$world")}, }, - }) + } + n.Accept(p) expected := `...$world` actual := o.String() @@ -1543,8 +1598,11 @@ func TestPrinterPrintExprArrayItemUnpack(t *testing.T) { func TestPrinterPrintExprArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprArray{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArray{ + ArrayTkn: &token.Token{ + Value: []byte("array"), + }, Items: []ast.Vertex{ &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, @@ -1564,7 +1622,8 @@ func TestPrinterPrintExprArray(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `array('Hello'=>$world,2=>&$var,$var)` actual := o.String() @@ -1577,12 +1636,13 @@ func TestPrinterPrintExprArray(t *testing.T) { func TestPrinterPrintExprBitwiseNot(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBitwiseNot{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBitwiseNot{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `~$var` actual := o.String() @@ -1595,12 +1655,13 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { func TestPrinterPrintExprBooleanNot(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprBooleanNot{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `!$var` actual := o.String() @@ -1613,15 +1674,16 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { func TestPrinterPrintExprClassConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprClassConstFetch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprClassConstFetch{ Class: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, ConstantName: &ast.Identifier{ Value: []byte("CONST"), }, - }) + } + n.Accept(p) expected := `$var::CONST` actual := o.String() @@ -1634,14 +1696,15 @@ func TestPrinterPrintExprClassConstFetch(t *testing.T) { func TestPrinterPrintExprClone(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprClone{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprClone{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `clone $var` + expected := `clone$var` actual := o.String() if expected != actual { @@ -1652,8 +1715,8 @@ func TestPrinterPrintExprClone(t *testing.T) { func TestPrinterPrintExprClosureUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprClosureUse{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprClosureUse{ Uses: []ast.Vertex{ &ast.ExprReference{Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, @@ -1662,7 +1725,8 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$bar")}, }, }, - }) + } + n.Accept(p) expected := `use(&$foo,$bar)` actual := o.String() @@ -1675,16 +1739,18 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { func TestPrinterPrintExprClosure(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprClosure{ - Static: true, - ReturnsRef: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprClosure{ + StaticTkn: &token.Token{ + Value: []byte("static"), + }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, Params: []ast.Vertex{ &ast.Parameter{ - Var: &ast.Reference{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, - }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$var")}, }, }, }, @@ -1706,9 +1772,10 @@ func TestPrinterPrintExprClosure(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$a")}, }}, }, - }) + } + n.Accept(p) - expected := `static function&(&$var)use(&$a,$b):\Foo{$a;}` + expected := `static function&($var)use(&$a,$b):\Foo{$a;}` actual := o.String() if expected != actual { @@ -1719,17 +1786,22 @@ func TestPrinterPrintExprClosure(t *testing.T) { func TestPrinterPrintExprArrowFunction(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtExpression{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtExpression{ Expr: &ast.ExprArrowFunction{ - Static: true, - ReturnsRef: true, + StaticTkn: &token.Token{ + Value: []byte("static"), + }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, Params: []ast.Vertex{ &ast.Parameter{ - Var: &ast.Reference{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, - }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$var")}, }, }, }, @@ -1740,7 +1812,8 @@ func TestPrinterPrintExprArrowFunction(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$a")}, }, }, - }) + } + n.Accept(p) expected := `static fn&(&$var):\Foo=>$a;` actual := o.String() @@ -1753,10 +1826,11 @@ func TestPrinterPrintExprArrowFunction(t *testing.T) { func TestPrinterPrintExprConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprConstFetch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprConstFetch{ Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}, - }) + } + n.Accept(p) expected := "null" actual := o.String() @@ -1769,12 +1843,13 @@ func TestPrinterPrintExprConstFetch(t *testing.T) { func TestPrinterPrintEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprEmpty{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprEmpty{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `empty($var)` actual := o.String() @@ -1787,12 +1862,13 @@ func TestPrinterPrintEmpty(t *testing.T) { func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprErrorSuppress{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprErrorSuppress{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `@$var` actual := o.String() @@ -1805,12 +1881,13 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { func TestPrinterPrintEval(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprEval{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprEval{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `eval($var)` actual := o.String() @@ -1823,15 +1900,15 @@ func TestPrinterPrintEval(t *testing.T) { func TestPrinterPrintExit(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprExit{ - Die: false, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprExit{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `exit $var` + expected := `exit$var` actual := o.String() if expected != actual { @@ -1842,15 +1919,18 @@ func TestPrinterPrintExit(t *testing.T) { func TestPrinterPrintDie(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprExit{ - Die: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprExit{ + DieTkn: &token.Token{ + Value: []byte("die"), + }, Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `die $var` + expected := `die$var` actual := o.String() if expected != actual { @@ -1861,33 +1941,36 @@ func TestPrinterPrintDie(t *testing.T) { func TestPrinterPrintFunctionCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprFunctionCall{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprFunctionCall{ Function: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - IsReference: true, - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + Arguments: []ast.Vertex{ + &ast.Argument{ + AmpersandTkn: &token.Token{ + Value: []byte("&"), }, - &ast.Argument{ - Variadic: true, - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, - }, + }, + &ast.Argument{ + VariadicTkn: &token.Token{ + Value: []byte("..."), + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, + }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$c")}, }, }, }, - }) + } + n.Accept(p) expected := `$var(&$a,...$b,$c)` actual := o.String() @@ -1900,12 +1983,13 @@ func TestPrinterPrintFunctionCall(t *testing.T) { func TestPrinterPrintInclude(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprInclude{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprInclude{ Expr: &ast.ScalarString{Value: []byte("'path'")}, - }) + } + n.Accept(p) - expected := `include 'path'` + expected := `include'path'` actual := o.String() if expected != actual { @@ -1916,12 +2000,13 @@ func TestPrinterPrintInclude(t *testing.T) { func TestPrinterPrintIncludeOnce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprIncludeOnce{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprIncludeOnce{ Expr: &ast.ScalarString{Value: []byte("'path'")}, - }) + } + n.Accept(p) - expected := `include_once 'path'` + expected := `include_once'path'` actual := o.String() if expected != actual { @@ -1932,13 +2017,14 @@ func TestPrinterPrintIncludeOnce(t *testing.T) { func TestPrinterPrintInstanceOf(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprInstanceOf{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprInstanceOf{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - }) + } + n.Accept(p) expected := `$var instanceof Foo` actual := o.String() @@ -1951,8 +2037,8 @@ func TestPrinterPrintInstanceOf(t *testing.T) { func TestPrinterPrintIsset(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprIsset{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprIsset{ Vars: []ast.Vertex{ &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1961,7 +2047,8 @@ func TestPrinterPrintIsset(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$b")}, }, }, - }) + } + n.Accept(p) expected := `isset($a,$b)` actual := o.String() @@ -1974,8 +2061,8 @@ func TestPrinterPrintIsset(t *testing.T) { func TestPrinterPrintList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ @@ -1999,7 +2086,8 @@ func TestPrinterPrintList(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `list($a,list($b,$c))` actual := o.String() @@ -2012,27 +2100,26 @@ func TestPrinterPrintList(t *testing.T) { func TestPrinterPrintMethodCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprMethodCall{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, }, Method: &ast.Identifier{Value: []byte("bar")}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, - }) + } + n.Accept(p) expected := `$foo->bar($a,$b)` actual := o.String() @@ -2045,8 +2132,8 @@ func TestPrinterPrintMethodCall(t *testing.T) { func TestPrinterPrintNew(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprNew{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprNew{ Class: &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{ @@ -2054,21 +2141,20 @@ func TestPrinterPrintNew(t *testing.T) { }, }, }, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, - }) + } + n.Accept(p) expected := `new Foo($a,$b)` actual := o.String() @@ -2081,12 +2167,13 @@ func TestPrinterPrintNew(t *testing.T) { func TestPrinterPrintPostDec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPostDec{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPostDec{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `$var--` actual := o.String() @@ -2099,12 +2186,13 @@ func TestPrinterPrintPostDec(t *testing.T) { func TestPrinterPrintPostInc(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPostInc{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPostInc{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `$var++` actual := o.String() @@ -2117,12 +2205,13 @@ func TestPrinterPrintPostInc(t *testing.T) { func TestPrinterPrintPreDec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPreDec{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPreDec{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `--$var` actual := o.String() @@ -2135,12 +2224,13 @@ func TestPrinterPrintPreDec(t *testing.T) { func TestPrinterPrintPreInc(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPreInc{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPreInc{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `++$var` actual := o.String() @@ -2153,14 +2243,15 @@ func TestPrinterPrintPreInc(t *testing.T) { func TestPrinterPrintPrint(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPrint{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPrint{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `print $var` + expected := `print$var` actual := o.String() if expected != actual { @@ -2171,13 +2262,14 @@ func TestPrinterPrintPrint(t *testing.T) { func TestPrinterPrintPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprPropertyFetch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprPropertyFetch{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, }, Property: &ast.Identifier{Value: []byte("bar")}, - }) + } + n.Accept(p) expected := `$foo->bar` actual := o.String() @@ -2190,12 +2282,13 @@ func TestPrinterPrintPropertyFetch(t *testing.T) { func TestPrinterPrintExprReference(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprReference{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprReference{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, }, - }) + } + n.Accept(p) expected := `&$foo` actual := o.String() @@ -2208,12 +2301,13 @@ func TestPrinterPrintExprReference(t *testing.T) { func TestPrinterPrintRequire(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprRequire{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprRequire{ Expr: &ast.ScalarString{Value: []byte("'path'")}, - }) + } + n.Accept(p) - expected := `require 'path'` + expected := `require'path'` actual := o.String() if expected != actual { @@ -2224,12 +2318,13 @@ func TestPrinterPrintRequire(t *testing.T) { func TestPrinterPrintRequireOnce(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprRequireOnce{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprRequireOnce{ Expr: &ast.ScalarString{Value: []byte("'path'")}, - }) + } + n.Accept(p) - expected := `require_once 'path'` + expected := `require_once'path'` actual := o.String() if expected != actual { @@ -2240,8 +2335,8 @@ func TestPrinterPrintRequireOnce(t *testing.T) { func TestPrinterPrintShellExec(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprShellExec{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprShellExec{ Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, &ast.ExprVariable{ @@ -2249,7 +2344,8 @@ func TestPrinterPrintShellExec(t *testing.T) { }, &ast.ScalarEncapsedStringPart{Value: []byte("!")}, }, - }) + } + n.Accept(p) expected := "`hello $world!`" actual := o.String() @@ -2262,8 +2358,8 @@ func TestPrinterPrintShellExec(t *testing.T) { func TestPrinterPrintExprShortArray(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprShortArray{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArray{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, @@ -2283,7 +2379,8 @@ func TestPrinterPrintExprShortArray(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `['Hello'=>$world,2=>&$var,$var]` actual := o.String() @@ -2296,8 +2393,11 @@ func TestPrinterPrintExprShortArray(t *testing.T) { func TestPrinterPrintShortList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprShortList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprList{ + OpenBracketTkn: &token.Token{ + Value: []byte("["), + }, Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ @@ -2321,7 +2421,11 @@ func TestPrinterPrintShortList(t *testing.T) { }, }, }, - }) + CloseBracketTkn: &token.Token{ + Value: []byte("]"), + }, + } + n.Accept(p) expected := `[$a,list($b,$c)]` actual := o.String() @@ -2334,25 +2438,24 @@ func TestPrinterPrintShortList(t *testing.T) { func TestPrinterPrintStaticCall(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprStaticCall{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprStaticCall{ Class: &ast.Identifier{Value: []byte("Foo")}, Call: &ast.Identifier{Value: []byte("bar")}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, - }) + } + n.Accept(p) expected := `Foo::bar($a,$b)` actual := o.String() @@ -2365,13 +2468,14 @@ func TestPrinterPrintStaticCall(t *testing.T) { func TestPrinterPrintStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprStaticPropertyFetch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprStaticPropertyFetch{ Class: &ast.Identifier{Value: []byte("Foo")}, Property: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$bar")}, }, - }) + } + n.Accept(p) expected := `Foo::$bar` actual := o.String() @@ -2384,15 +2488,16 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { func TestPrinterPrintTernary(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprTernary{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprTernary{ Condition: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, IfFalse: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, - }) + } + n.Accept(p) expected := `$a?:$b` actual := o.String() @@ -2405,8 +2510,8 @@ func TestPrinterPrintTernary(t *testing.T) { func TestPrinterPrintTernaryFull(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprTernary{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprTernary{ Condition: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, @@ -2416,7 +2521,8 @@ func TestPrinterPrintTernaryFull(t *testing.T) { IfFalse: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$c")}, }, - }) + } + n.Accept(p) expected := `$a?$b:$c` actual := o.String() @@ -2429,12 +2535,13 @@ func TestPrinterPrintTernaryFull(t *testing.T) { func TestPrinterPrintUnaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprUnaryMinus{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprUnaryMinus{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `-$var` actual := o.String() @@ -2447,12 +2554,13 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { func TestPrinterPrintUnaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprUnaryPlus{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprUnaryPlus{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `+$var` actual := o.String() @@ -2465,12 +2573,16 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { func TestPrinterPrintVariable(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprVariable{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprVariable{ + DollarTkn: &token.Token{ + Value: []byte("$"), + }, VarName: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) expected := `$$var` actual := o.String() @@ -2483,14 +2595,15 @@ func TestPrinterPrintVariable(t *testing.T) { func TestPrinterPrintYieldFrom(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprYieldFrom{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprYieldFrom{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `yield from $var` + expected := `yield from$var` actual := o.String() if expected != actual { @@ -2501,14 +2614,15 @@ func TestPrinterPrintYieldFrom(t *testing.T) { func TestPrinterPrintYield(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprYield{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprYield{ Value: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `yield $var` + expected := `yield$var` actual := o.String() if expected != actual { @@ -2519,17 +2633,18 @@ func TestPrinterPrintYield(t *testing.T) { func TestPrinterPrintYieldFull(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.ExprYield{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprYield{ Key: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$k")}, }, Value: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `yield $k=>$var` + expected := `yield$k=>$var` actual := o.String() if expected != actual { @@ -2542,12 +2657,14 @@ func TestPrinterPrintYieldFull(t *testing.T) { func TestPrinterPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtElseIf{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2555,7 +2672,8 @@ func TestPrinterPrintAltElseIf(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) expected := `elseif($a):$b;` actual := o.String() @@ -2568,14 +2686,17 @@ func TestPrinterPrintAltElseIf(t *testing.T) { func TestPrinterPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtElseIf{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{}, - }) + } + n.Accept(p) expected := `elseif($a):` actual := o.String() @@ -2588,9 +2709,11 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { func TestPrinterPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtElse{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtElse{ + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2598,7 +2721,8 @@ func TestPrinterPrintAltElse(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) expected := `else:$b;` actual := o.String() @@ -2611,11 +2735,14 @@ func TestPrinterPrintAltElse(t *testing.T) { func TestPrinterPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtElse{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtElse{ + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{}, - }) + } + n.Accept(p) expected := `else:` actual := o.String() @@ -2628,9 +2755,8 @@ func TestPrinterPrintAltElseEmpty(t *testing.T) { func TestPrinterPrintAltFor(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtFor{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2646,6 +2772,9 @@ func TestPrinterPrintAltFor(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$c")}, }, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2653,7 +2782,8 @@ func TestPrinterPrintAltFor(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) expected := `for($a;$b;$c):$d;endfor;` actual := o.String() @@ -2666,18 +2796,22 @@ func TestPrinterPrintAltFor(t *testing.T) { func TestPrinterPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtForeach{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, Key: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$key")}, }, - Var: &ast.ExprReference{Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$val")}, - }}, + Var: &ast.ExprReference{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$val")}, + }, + }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2685,9 +2819,10 @@ func TestPrinterPrintAltForeach(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) - expected := `foreach($var as $key=>&$val):$d;endforeach;` + expected := `foreach($var as$key=>&$val):$d;endforeach;` actual := o.String() if expected != actual { @@ -2698,12 +2833,14 @@ func TestPrinterPrintAltForeach(t *testing.T) { func TestPrinterPrintAltIf(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtIf{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2713,10 +2850,12 @@ func TestPrinterPrintAltIf(t *testing.T) { }, ElseIf: []ast.Vertex{ &ast.StmtElseIf{ - Alt: true, Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2726,15 +2865,19 @@ func TestPrinterPrintAltIf(t *testing.T) { }, }, &ast.StmtElseIf{ - Alt: true, Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$c")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{}, }, }, Else: &ast.StmtElse{ - Alt: true, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2743,7 +2886,8 @@ func TestPrinterPrintAltIf(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `if($a):$d;elseif($b):$b;elseif($c):else:$b;endif;` actual := o.String() @@ -2756,12 +2900,14 @@ func TestPrinterPrintAltIf(t *testing.T) { func TestPrinterPrintStmtAltSwitch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtSwitch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - Alt: true, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, CaseList: []ast.Vertex{ &ast.StmtCase{ Cond: &ast.ScalarString{Value: []byte("'a'")}, @@ -2780,9 +2926,10 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `switch($var):case 'a':$a;case 'b':$b;endswitch;` + expected := `switch($var):case'a':$a;case'b':$b;endswitch;` actual := o.String() if expected != actual { @@ -2793,12 +2940,14 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { func TestPrinterPrintAltWhile(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtWhile{ - Alt: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, + ColonTkn: &token.Token{ + Value: []byte(":"), + }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -2806,7 +2955,8 @@ func TestPrinterPrintAltWhile(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) expected := `while($a):$b;endwhile;` actual := o.String() @@ -2819,12 +2969,13 @@ func TestPrinterPrintAltWhile(t *testing.T) { func TestPrinterPrintStmtBreak(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtBreak{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtBreak{ Expr: &ast.ScalarLnumber{ Value: []byte("1"), }, - }) + } + n.Accept(p) expected := "break 1;" actual := o.String() @@ -2837,8 +2988,8 @@ func TestPrinterPrintStmtBreak(t *testing.T) { func TestPrinterPrintStmtCase(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtCase{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtCase{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, @@ -2847,9 +2998,10 @@ func TestPrinterPrintStmtCase(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$a")}, }}, }, - }) + } + n.Accept(p) - expected := `case $a:$a;` + expected := `case$a:$a;` actual := o.String() if expected != actual { @@ -2860,15 +3012,16 @@ func TestPrinterPrintStmtCase(t *testing.T) { func TestPrinterPrintStmtCaseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtCase{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtCase{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Stmts: []ast.Vertex{}, - }) + } + n.Accept(p) - expected := "case $a:" + expected := "case$a:" actual := o.String() if expected != actual { @@ -2879,8 +3032,8 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { func TestPrinterPrintStmtCatch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtCatch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtCatch{ Types: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, @@ -2893,7 +3046,8 @@ func TestPrinterPrintStmtCatch(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$a")}, }}, }, - }) + } + n.Accept(p) expected := `catch(Exception|\RuntimeException$e){$a;}` actual := o.String() @@ -2906,26 +3060,30 @@ func TestPrinterPrintStmtCatch(t *testing.T) { func TestPrinterPrintStmtClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - ReturnsRef: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtClassMethod{ + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, MethodName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.Reference{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ - Var: &ast.Variadic{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + VariadicTkn: &token.Token{ + Value: []byte("..."), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -2939,9 +3097,10 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) - expected := `public function &foo(?int&$a=null,...$b):void{$a;}` + expected := `public function&foo(?int&$a=null,...$b):void{$a;}` actual := o.String() if expected != actual { @@ -2952,29 +3111,33 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtClassMethod{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtClassMethod{ Modifiers: []ast.Vertex{ &ast.Identifier{Value: []byte("public")}, &ast.Identifier{Value: []byte("static")}, }, - ReturnsRef: true, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, MethodName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.Reference{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ - Var: &ast.Variadic{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + VariadicTkn: &token.Token{ + Value: []byte("..."), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -2982,9 +3145,10 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}, }, Stmt: &ast.StmtNop{}, - }) + } + n.Accept(p) - expected := `public static function &foo(?int&$a=null,...$b):void;` + expected := `public static function&foo(?int&$a=null,...$b):void;` actual := o.String() if expected != actual { @@ -2995,8 +3159,8 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { func TestPrinterPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtClass{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, ClassName: &ast.Identifier{Value: []byte("Foo")}, Extends: &ast.StmtClassExtends{ @@ -3022,7 +3186,8 @@ func TestPrinterPrintStmtClass(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `abstract class Foo extends Bar implements Baz,Quuz{public static const FOO='bar';}` actual := o.String() @@ -3035,20 +3200,18 @@ func TestPrinterPrintStmtClass(t *testing.T) { func TestPrinterPrintStmtAnonymousClass(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtClass{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, - }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, }, - &ast.Argument{ - Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, - }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -3072,9 +3235,10 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `abstract class($a,$b) extends Bar implements Baz,Quuz{public const FOO='bar';}` + expected := `abstract class($a,$b)extends Bar implements Baz,Quuz{public const FOO='bar';}` actual := o.String() if expected != actual { @@ -3085,8 +3249,8 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { func TestPrinterPrintStmtClassConstList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtClassConstList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtClassConstList{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, Consts: []ast.Vertex{ &ast.StmtConstant{ @@ -3098,7 +3262,8 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, - }) + } + n.Accept(p) expected := `public const FOO='a',BAR='b';` actual := o.String() @@ -3111,8 +3276,8 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { func TestPrinterPrintStmtConstList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtConstList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtConstList{ Consts: []ast.Vertex{ &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, @@ -3123,7 +3288,8 @@ func TestPrinterPrintStmtConstList(t *testing.T) { Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, - }) + } + n.Accept(p) expected := `const FOO='a',BAR='b';` actual := o.String() @@ -3136,11 +3302,12 @@ func TestPrinterPrintStmtConstList(t *testing.T) { func TestPrinterPrintStmtConstant(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtConstant{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, Expr: &ast.ScalarString{Value: []byte("'BAR'")}, - }) + } + n.Accept(p) expected := "FOO='BAR'" actual := o.String() @@ -3153,12 +3320,13 @@ func TestPrinterPrintStmtConstant(t *testing.T) { func TestPrinterPrintStmtContinue(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtContinue{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtContinue{ Expr: &ast.ScalarLnumber{ Value: []byte("1"), }, - }) + } + n.Accept(p) expected := `continue 1;` actual := o.String() @@ -3171,8 +3339,8 @@ func TestPrinterPrintStmtContinue(t *testing.T) { func TestPrinterPrintStmtDeclareStmts(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDeclare{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, @@ -3184,7 +3352,8 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { &ast.StmtNop{}, }, }, - }) + } + n.Accept(p) expected := `declare(FOO='bar'){;}` actual := o.String() @@ -3197,8 +3366,8 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { func TestPrinterPrintStmtDeclareExpr(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDeclare{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, @@ -3206,7 +3375,8 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { }, }, Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }) + } + n.Accept(p) expected := `declare(FOO='bar')'bar';` actual := o.String() @@ -3219,8 +3389,8 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { func TestPrinterPrintStmtDeclareNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDeclare{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, @@ -3228,7 +3398,8 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { }, }, Stmt: &ast.StmtNop{}, - }) + } + n.Accept(p) expected := `declare(FOO='bar');` actual := o.String() @@ -3241,14 +3412,15 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { func TestPrinterPrintStmtDefalut(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDefault{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDefault{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }}, }, - }) + } + n.Accept(p) expected := `default:$a;` actual := o.String() @@ -3261,10 +3433,11 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDefault{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDefault{ Stmts: []ast.Vertex{}, - }) + } + n.Accept(p) expected := `default:` actual := o.String() @@ -3277,17 +3450,18 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { func TestPrinterPrintStmtDo_Expression(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDo{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDo{ Cond: &ast.ScalarLnumber{Value: []byte("1")}, Stmt: &ast.StmtExpression{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, }, - }) + } + n.Accept(p) - expected := `do $a;while(1);` + expected := `do$a;while(1);` actual := o.String() if expected != actual { @@ -3298,8 +3472,8 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { func TestPrinterPrintStmtDo_StmtList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtDo{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtDo{ Cond: &ast.ScalarLnumber{Value: []byte("1")}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -3308,9 +3482,10 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) - expected := `do {$a;}while(1);` + expected := `do{$a;}while(1);` actual := o.String() if expected != actual { @@ -3321,8 +3496,8 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.Root{ + p := visitor.NewPrinter(o) + n := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtEcho{ Exprs: []ast.Vertex{ @@ -3335,9 +3510,10 @@ func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `$v){;}` + expected := `foreach($a as$k=>$v){;}` actual := o.String() if expected != actual { @@ -3593,16 +3780,19 @@ func TestPrinterPrintStmtForeach(t *testing.T) { func TestPrinterPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtFunction{ - ReturnsRef: true, + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtFunction{ + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, FunctionName: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - Var: &ast.Reference{ - Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, - }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$var")}, }, }, }, @@ -3612,9 +3802,10 @@ func TestPrinterPrintStmtFunction(t *testing.T) { Stmts: []ast.Vertex{ &ast.StmtNop{}, }, - }) + } + n.Accept(p) - expected := `function &foo(&$var):\Foo{;}` + expected := `function&foo(&$var):\Foo{;}` actual := o.String() if expected != actual { @@ -3625,8 +3816,8 @@ func TestPrinterPrintStmtFunction(t *testing.T) { func TestPrinterPrintStmtGlobal(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtGlobal{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtGlobal{ Vars: []ast.Vertex{ &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3635,9 +3826,10 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$b")}, }, }, - }) + } + n.Accept(p) - expected := `global $a,$b;` + expected := `global$a,$b;` actual := o.String() if expected != actual { @@ -3648,10 +3840,11 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { func TestPrinterPrintStmtGoto(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtGoto{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtGoto{ Label: &ast.Identifier{Value: []byte("FOO")}, - }) + } + n.Accept(p) expected := `goto FOO;` actual := o.String() @@ -3664,8 +3857,9 @@ func TestPrinterPrintStmtGoto(t *testing.T) { func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtHaltCompiler{}) + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtHaltCompiler{} + n.Accept(p) expected := `__halt_compiler();` actual := o.String() @@ -3678,8 +3872,8 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { func TestPrinterPrintIfExpression(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtIf{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, @@ -3717,9 +3911,10 @@ func TestPrinterPrintIfExpression(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `if($a)$b;elseif($c){$d;}elseif($e);else $f;` + expected := `if($a)$b;elseif($c){$d;}elseif($e);else$f;` actual := o.String() if expected != actual { @@ -3730,8 +3925,8 @@ func TestPrinterPrintIfExpression(t *testing.T) { func TestPrinterPrintIfStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtIf{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, @@ -3744,7 +3939,8 @@ func TestPrinterPrintIfStmtList(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `if($a){$b;}` actual := o.String() @@ -3757,13 +3953,14 @@ func TestPrinterPrintIfStmtList(t *testing.T) { func TestPrinterPrintIfNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtIf{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtNop{}, - }) + } + n.Accept(p) expected := `if($a);` actual := o.String() @@ -3776,14 +3973,15 @@ func TestPrinterPrintIfNop(t *testing.T) { func TestPrinterPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.Root{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtInlineHtml{ Value: []byte("test"), }, }, - }) + } + n.Accept(p) expected := `test` actual := o.String() @@ -3796,8 +3994,8 @@ func TestPrinterPrintInlineHtml(t *testing.T) { func TestPrinterPrintInterface(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtInterface{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtInterface{ InterfaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Extends: &ast.StmtInterfaceExtends{ InterfaceNames: []ast.Vertex{ @@ -3819,7 +4017,8 @@ func TestPrinterPrintInterface(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `interface Foo extends Bar,Baz{public function foo(){$a;}}` actual := o.String() @@ -3832,10 +4031,11 @@ func TestPrinterPrintInterface(t *testing.T) { func TestPrinterPrintLabel(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtLabel{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtLabel{ LabelName: &ast.Identifier{Value: []byte("FOO")}, - }) + } + n.Accept(p) expected := `FOO:` actual := o.String() @@ -3848,10 +4048,11 @@ func TestPrinterPrintLabel(t *testing.T) { func TestPrinterPrintNamespace(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtNamespace{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtNamespace{ Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - }) + } + n.Accept(p) expected := `namespace Foo;` actual := o.String() @@ -3864,15 +4065,16 @@ func TestPrinterPrintNamespace(t *testing.T) { func TestPrinterPrintNamespaceWithStmts(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtNamespace{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtNamespace{ Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }}, }, - }) + } + n.Accept(p) expected := `namespace Foo{$a;}` actual := o.String() @@ -3885,8 +4087,9 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { func TestPrinterPrintNop(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtNop{}) + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtNop{} + n.Accept(p) expected := `;` actual := o.String() @@ -3899,8 +4102,8 @@ func TestPrinterPrintNop(t *testing.T) { func TestPrinterPrintPropertyList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtPropertyList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtPropertyList{ Modifiers: []ast.Vertex{ &ast.Identifier{Value: []byte("public")}, &ast.Identifier{Value: []byte("static")}, @@ -3925,9 +4128,10 @@ func TestPrinterPrintPropertyList(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `public static Foo $a='a',$b;` + expected := `public static Foo$a='a',$b;` actual := o.String() if expected != actual { @@ -3938,13 +4142,14 @@ func TestPrinterPrintPropertyList(t *testing.T) { func TestPrinterPrintProperty(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtProperty{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtProperty{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ScalarLnumber{Value: []byte("1")}, - }) + } + n.Accept(p) expected := `$a=1` actual := o.String() @@ -3957,10 +4162,11 @@ func TestPrinterPrintProperty(t *testing.T) { func TestPrinterPrintReturn(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtReturn{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtReturn{ Expr: &ast.ScalarLnumber{Value: []byte("1")}, - }) + } + n.Accept(p) expected := `return 1;` actual := o.String() @@ -3973,13 +4179,14 @@ func TestPrinterPrintReturn(t *testing.T) { func TestPrinterPrintStaticVar(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtStaticVar{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtStaticVar{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ScalarLnumber{Value: []byte("1")}, - }) + } + n.Accept(p) expected := `$a=1` actual := o.String() @@ -3992,8 +4199,8 @@ func TestPrinterPrintStaticVar(t *testing.T) { func TestPrinterPrintStatic(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtStatic{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ Var: &ast.ExprVariable{ @@ -4006,9 +4213,10 @@ func TestPrinterPrintStatic(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `static $a,$b;` + expected := `static$a,$b;` actual := o.String() if expected != actual { @@ -4019,8 +4227,8 @@ func TestPrinterPrintStatic(t *testing.T) { func TestPrinterPrintStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtStmtList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4029,7 +4237,8 @@ func TestPrinterPrintStmtList(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$b")}, }}, }, - }) + } + n.Accept(p) expected := `{$a;$b;}` actual := o.String() @@ -4042,8 +4251,8 @@ func TestPrinterPrintStmtList(t *testing.T) { func TestPrinterPrintStmtListNested(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtStmtList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4063,7 +4272,8 @@ func TestPrinterPrintStmtListNested(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `{$a;{$b;{$c;}}}` actual := o.String() @@ -4076,8 +4286,8 @@ func TestPrinterPrintStmtListNested(t *testing.T) { func TestPrinterPrintStmtSwitch(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtSwitch{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, @@ -4099,9 +4309,10 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { }, }, }, - }) + } + n.Accept(p) - expected := `switch($var){case 'a':$a;case 'b':$b;}` + expected := `switch($var){case'a':$a;case'b':$b;}` actual := o.String() if expected != actual { @@ -4112,14 +4323,15 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { func TestPrinterPrintStmtThrow(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtThrow{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtThrow{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, }, - }) + } + n.Accept(p) - expected := `throw $var;` + expected := `throw$var;` actual := o.String() if expected != actual { @@ -4130,8 +4342,8 @@ func TestPrinterPrintStmtThrow(t *testing.T) { func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitAdaptationList{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitAdaptationList{ Adaptations: []ast.Vertex{ &ast.StmtTraitUseAlias{ Ref: &ast.StmtTraitMethodRef{ @@ -4141,7 +4353,8 @@ func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { Alias: &ast.Identifier{Value: []byte("b")}, }, }, - }) + } + n.Accept(p) expected := `{Foo::a as b;}` actual := o.String() @@ -4154,10 +4367,11 @@ func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { func TestPrinterPrintStmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitMethodRef{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitMethodRef{ Method: &ast.Identifier{Value: []byte("a")}, - }) + } + n.Accept(p) expected := `a` actual := o.String() @@ -4170,11 +4384,12 @@ func TestPrinterPrintStmtTraitMethodRef(t *testing.T) { func TestPrinterPrintStmtTraitMethodRefFull(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitMethodRef{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitMethodRef{ Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, - }) + } + n.Accept(p) expected := `Foo::a` actual := o.String() @@ -4187,15 +4402,16 @@ func TestPrinterPrintStmtTraitMethodRefFull(t *testing.T) { func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitUseAlias{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitUseAlias{ Ref: &ast.StmtTraitMethodRef{ Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, }, Modifier: &ast.Identifier{Value: []byte("public")}, Alias: &ast.Identifier{Value: []byte("b")}, - }) + } + n.Accept(p) expected := `Foo::a as public b;` actual := o.String() @@ -4208,8 +4424,8 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitUsePrecedence{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitUsePrecedence{ Ref: &ast.StmtTraitMethodRef{ Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, @@ -4218,7 +4434,8 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, - }) + } + n.Accept(p) expected := `Foo::a insteadof Bar,Baz;` actual := o.String() @@ -4231,14 +4448,15 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { func TestPrinterPrintStmtTraitUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitUse{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - TraitAdaptationList: &ast.StmtNop{}, - }) + Adaptations: &ast.StmtNop{}, + } + n.Accept(p) expected := `use Foo,Bar;` actual := o.String() @@ -4251,13 +4469,13 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTraitUse{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Adaptations: &ast.StmtTraitAdaptationList{ Adaptations: []ast.Vertex{ &ast.StmtTraitUseAlias{ Ref: &ast.StmtTraitMethodRef{ @@ -4268,7 +4486,8 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `use Foo,Bar{Foo::a as b;}` actual := o.String() @@ -4281,8 +4500,8 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { func TestPrinterPrintTrait(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTrait{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTrait{ TraitName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ &ast.StmtClassMethod{ @@ -4298,7 +4517,8 @@ func TestPrinterPrintTrait(t *testing.T) { }, }, }, - }) + } + n.Accept(p) expected := `trait Foo{public function foo(){$a;}}` actual := o.String() @@ -4311,8 +4531,8 @@ func TestPrinterPrintTrait(t *testing.T) { func TestPrinterPrintStmtTry(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtTry{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtTry{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4339,7 +4559,8 @@ func TestPrinterPrintStmtTry(t *testing.T) { &ast.StmtNop{}, }, }, - }) + } + n.Accept(p) expected := `try{$a;}catch(Exception|\RuntimeException$e){$b;}finally{;}` actual := o.String() @@ -4352,8 +4573,8 @@ func TestPrinterPrintStmtTry(t *testing.T) { func TestPrinterPrintStmtUnset(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtUnset{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtUnset{ Vars: []ast.Vertex{ &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4362,7 +4583,8 @@ func TestPrinterPrintStmtUnset(t *testing.T) { VarName: &ast.Identifier{Value: []byte("$b")}, }, }, - }) + } + n.Accept(p) expected := `unset($a,$b);` actual := o.String() @@ -4375,8 +4597,8 @@ func TestPrinterPrintStmtUnset(t *testing.T) { func TestPrinterPrintUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtUse{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtUse{ Type: &ast.Identifier{Value: []byte("function")}, UseDeclarations: []ast.Vertex{ &ast.StmtUseDeclaration{ @@ -4387,7 +4609,8 @@ func TestPrinterPrintUse(t *testing.T) { Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, }, - }) + } + n.Accept(p) expected := `use function Foo as Bar,Baz;` actual := o.String() @@ -4400,8 +4623,8 @@ func TestPrinterPrintUse(t *testing.T) { func TestPrinterPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtGroupUse{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtGroupUse{ Type: &ast.Identifier{Value: []byte("function")}, Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, UseDeclarations: []ast.Vertex{ @@ -4413,7 +4636,8 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, }, - }) + } + n.Accept(p) expected := `use function Foo\{Foo as Bar,Baz};` actual := o.String() @@ -4426,12 +4650,13 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { func TestPrinterPrintUseDeclaration(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtUseDeclaration{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtUseDeclaration{ Type: &ast.Identifier{Value: []byte("function")}, Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Alias: &ast.Identifier{Value: []byte("Bar")}, - }) + } + n.Accept(p) expected := `function Foo as Bar` actual := o.String() @@ -4444,8 +4669,8 @@ func TestPrinterPrintUseDeclaration(t *testing.T) { func TestPrinterPrintWhileStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := printer.NewPrinter(o) - p.Print(&ast.StmtWhile{ + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, }, @@ -4456,7 +4681,8 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { }}, }, }, - }) + } + n.Accept(p) expected := `while($a){$a;}` actual := o.String() diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go deleted file mode 100644 index 026708e..0000000 --- a/pkg/printer/printer.go +++ /dev/null @@ -1,2838 +0,0 @@ -package printer - -import ( - "bytes" - "io" - "strings" - - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/token" -) - -type printerState int - -const ( - PhpState printerState = iota - HtmlState -) - -type Printer struct { - w io.Writer - s printerState - bufStart string - lastWrite []byte -} - -// NewPrinter - Constructor for Printer -func NewPrinter(w io.Writer) *Printer { - return &Printer{ - w: w, - } -} - -func (p *Printer) SetState(s printerState) { - p.s = s -} - -func (p *Printer) write(b []byte) { - p.lastWrite = b - p.w.Write(b) -} - -func (p *Printer) Print(n ast.Vertex) { - _, isRoot := n.(*ast.Root) - _, isInlineHtml := n.(*ast.StmtInlineHtml) - if p.s == HtmlState && !isInlineHtml && !isRoot { - if n.GetNode().Tokens.IsEmpty() { - p.bufStart = " 0 { - p.write([]byte(glue)) - } - - p.Print(n) - } -} - -func (p *Printer) joinPrintRefactored(glue string, nn []ast.Vertex) { - for k, n := range nn { - if k > 0 { - p.bufStart = glue - } - - p.Print(n) - } -} - -func (p *Printer) printSeparatedList(nodeList []ast.Vertex, separatorList []*token.Token, def string) { - var separators []*token.Token - - if cap(separatorList) >= len(nodeList) { - separators = separatorList[:len(nodeList)] - } else { - separators = make([]*token.Token, len(nodeList)) - copy(separators, separatorList) - } - - for k, n := range nodeList { - p.Print(n) - if k < len(nodeList)-1 { - p.printToken(separators[k], def) - } else { - p.printToken(separators[k], "") - } - } -} - -func (p *Printer) printNodes(nn []ast.Vertex) { - for _, n := range nn { - p.Print(n) - } -} - -func (p *Printer) printFreeFloatingOrDefault(n ast.Vertex, pos token.Position, def string) { - if n == nil { - return - } - - if len(n.GetNode().Tokens[pos]) == 0 { - p.write([]byte(def)) - return - } - - for _, m := range n.GetNode().Tokens[pos] { - p.write(m.Value) - } -} - -func (p *Printer) printToken(t *token.Token, def string) { - if t != nil { - p.write(t.Skipped) - p.write(t.Value) - p.bufStart = "" - return - } - - if def != "" { - p.write([]byte(p.bufStart)) - p.bufStart = "" - - p.write([]byte(def)) - return - } -} - -func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { - if n == nil { - return - } - - for _, m := range n.GetNode().Tokens[pos] { - p.write(m.Value) - } -} - -func (p *Printer) printNode(n ast.Vertex) { - switch n := n.(type) { - - // node - - case *ast.Root: - p.printNodeRoot(n) - case *ast.Identifier: - p.printNodeIdentifier(n) - case *ast.Parameter: - p.printNodeParameter(n) - case *ast.Nullable: - p.printNodeNullable(n) - case *ast.Argument: - p.printNodeArgument(n) - - // name - - case *ast.NameNamePart: - p.printNameNamePart(n) - case *ast.NameName: - p.printNameName(n) - case *ast.NameFullyQualified: - p.printNameFullyQualified(n) - case *ast.NameRelative: - p.printNameRelative(n) - - // scalar - - case *ast.ScalarLnumber: - p.printScalarLNumber(n) - case *ast.ScalarDnumber: - p.printScalarDNumber(n) - case *ast.ScalarString: - p.printScalarString(n) - case *ast.ScalarEncapsedStringPart: - p.printScalarEncapsedStringPart(n) - case *ast.ScalarEncapsed: - p.printScalarEncapsed(n) - case *ast.ScalarHeredoc: - p.printScalarHeredoc(n) - case *ast.ScalarMagicConstant: - p.printScalarMagicConstant(n) - - // assign - - case *ast.ExprAssign: - p.printAssign(n) - case *ast.ExprAssignReference: - p.printAssignReference(n) - case *ast.ExprAssignBitwiseAnd: - p.printAssignBitwiseAnd(n) - case *ast.ExprAssignBitwiseOr: - p.printAssignBitwiseOr(n) - case *ast.ExprAssignBitwiseXor: - p.printAssignBitwiseXor(n) - case *ast.ExprAssignCoalesce: - p.printAssignCoalesce(n) - case *ast.ExprAssignConcat: - p.printAssignConcat(n) - case *ast.ExprAssignDiv: - p.printAssignDiv(n) - case *ast.ExprAssignMinus: - p.printAssignMinus(n) - case *ast.ExprAssignMod: - p.printAssignMod(n) - case *ast.ExprAssignMul: - p.printAssignMul(n) - case *ast.ExprAssignPlus: - p.printAssignPlus(n) - case *ast.ExprAssignPow: - p.printAssignPow(n) - case *ast.ExprAssignShiftLeft: - p.printAssignShiftLeft(n) - case *ast.ExprAssignShiftRight: - p.printAssignShiftRight(n) - - // binary - - case *ast.ExprBinaryBitwiseAnd: - p.printBinaryBitwiseAnd(n) - case *ast.ExprBinaryBitwiseOr: - p.printBinaryBitwiseOr(n) - case *ast.ExprBinaryBitwiseXor: - p.printBinaryBitwiseXor(n) - case *ast.ExprBinaryBooleanAnd: - p.printBinaryBooleanAnd(n) - case *ast.ExprBinaryBooleanOr: - p.printBinaryBooleanOr(n) - case *ast.ExprBinaryCoalesce: - p.printBinaryCoalesce(n) - case *ast.ExprBinaryConcat: - p.printBinaryConcat(n) - case *ast.ExprBinaryDiv: - p.printBinaryDiv(n) - case *ast.ExprBinaryEqual: - p.printBinaryEqual(n) - case *ast.ExprBinaryGreaterOrEqual: - p.printBinaryGreaterOrEqual(n) - case *ast.ExprBinaryGreater: - p.printBinaryGreater(n) - case *ast.ExprBinaryIdentical: - p.printBinaryIdentical(n) - case *ast.ExprBinaryLogicalAnd: - p.printBinaryLogicalAnd(n) - case *ast.ExprBinaryLogicalOr: - p.printBinaryLogicalOr(n) - case *ast.ExprBinaryLogicalXor: - p.printBinaryLogicalXor(n) - case *ast.ExprBinaryMinus: - p.printBinaryMinus(n) - case *ast.ExprBinaryMod: - p.printBinaryMod(n) - case *ast.ExprBinaryMul: - p.printBinaryMul(n) - case *ast.ExprBinaryNotEqual: - p.printBinaryNotEqual(n) - case *ast.ExprBinaryNotIdentical: - p.printBinaryNotIdentical(n) - case *ast.ExprBinaryPlus: - p.printBinaryPlus(n) - case *ast.ExprBinaryPow: - p.printBinaryPow(n) - case *ast.ExprBinaryShiftLeft: - p.printBinaryShiftLeft(n) - case *ast.ExprBinaryShiftRight: - p.printBinaryShiftRight(n) - case *ast.ExprBinarySmallerOrEqual: - p.printBinarySmallerOrEqual(n) - case *ast.ExprBinarySmaller: - p.printBinarySmaller(n) - case *ast.ExprBinarySpaceship: - p.printBinarySpaceship(n) - - // cast - - case *ast.ExprCastArray: - p.printArray(n) - case *ast.ExprCastBool: - p.printBool(n) - case *ast.ExprCastDouble: - p.printDouble(n) - case *ast.ExprCastInt: - p.printInt(n) - case *ast.ExprCastObject: - p.printObject(n) - case *ast.ExprCastString: - p.printString(n) - case *ast.ExprCastUnset: - p.printUnset(n) - - // expr - - case *ast.ExprArrayDimFetch: - p.printExprArrayDimFetch(n) - case *ast.ExprArrayItem: - p.printExprArrayItem(n) - case *ast.ExprArray: - p.printExprArray(n) - case *ast.ExprArrowFunction: - p.printExprArrowFunction(n) - case *ast.ExprBitwiseNot: - p.printExprBitwiseNot(n) - case *ast.ExprBooleanNot: - p.printExprBooleanNot(n) - case *ast.ExprClassConstFetch: - p.printExprClassConstFetch(n) - case *ast.ExprClone: - p.printExprClone(n) - case *ast.ExprClosureUse: - p.printExprClosureUse(n) - case *ast.ExprClosure: - p.printExprClosure(n) - case *ast.ExprConstFetch: - p.printExprConstFetch(n) - case *ast.ExprEmpty: - p.printExprEmpty(n) - case *ast.ExprErrorSuppress: - p.printExprErrorSuppress(n) - case *ast.ExprEval: - p.printExprEval(n) - case *ast.ExprExit: - p.printExprExit(n) - case *ast.ExprFunctionCall: - p.printExprFunctionCall(n) - case *ast.ExprInclude: - p.printExprInclude(n) - case *ast.ExprIncludeOnce: - p.printExprIncludeOnce(n) - case *ast.ExprInstanceOf: - p.printExprInstanceOf(n) - case *ast.ExprIsset: - p.printExprIsset(n) - case *ast.ExprList: - p.printExprList(n) - case *ast.ExprMethodCall: - p.printExprMethodCall(n) - case *ast.ExprNew: - p.printExprNew(n) - case *ast.ExprPostDec: - p.printExprPostDec(n) - case *ast.ExprPostInc: - p.printExprPostInc(n) - case *ast.ExprPreDec: - p.printExprPreDec(n) - case *ast.ExprPreInc: - p.printExprPreInc(n) - case *ast.ExprPrint: - p.printExprPrint(n) - case *ast.ExprPropertyFetch: - p.printExprPropertyFetch(n) - case *ast.ExprReference: - p.printExprReference(n) - case *ast.ExprRequire: - p.printExprRequire(n) - case *ast.ExprRequireOnce: - p.printExprRequireOnce(n) - case *ast.ExprShellExec: - p.printExprShellExec(n) - case *ast.ExprStaticCall: - p.printExprStaticCall(n) - case *ast.ExprStaticPropertyFetch: - p.printExprStaticPropertyFetch(n) - case *ast.ExprTernary: - p.printExprTernary(n) - case *ast.ExprUnaryMinus: - p.printExprUnaryMinus(n) - case *ast.ExprUnaryPlus: - p.printExprUnaryPlus(n) - case *ast.ExprVariable: - p.printExprVariable(n) - case *ast.ExprYieldFrom: - p.printExprYieldFrom(n) - case *ast.ExprYield: - p.printExprYield(n) - - // stmt - - case *ast.StmtBreak: - p.printStmtBreak(n) - case *ast.StmtCase: - p.printStmtCase(n) - case *ast.StmtCatch: - p.printStmtCatch(n) - case *ast.StmtClassMethod: - p.printStmtClassMethod(n) - case *ast.StmtClass: - p.printStmtClass(n) - case *ast.StmtClassConstList: - p.printStmtClassConstList(n) - case *ast.StmtConstList: - p.printStmtConstList(n) - case *ast.StmtConstant: - p.printStmtConstant(n) - case *ast.StmtContinue: - p.printStmtContinue(n) - case *ast.StmtDeclare: - p.printStmtDeclare(n) - case *ast.StmtDefault: - p.printStmtDefault(n) - case *ast.StmtDo: - p.printStmtDo(n) - case *ast.StmtEcho: - p.printStmtEcho(n) - case *ast.StmtElseIf: - p.printStmtElseif(n) - case *ast.StmtElse: - p.printStmtElse(n) - case *ast.StmtExpression: - p.printStmtExpression(n) - case *ast.StmtFinally: - p.printStmtFinally(n) - case *ast.StmtFor: - p.printStmtFor(n) - case *ast.StmtForeach: - p.printStmtForeach(n) - case *ast.StmtFunction: - p.printStmtFunction(n) - case *ast.StmtGlobal: - p.printStmtGlobal(n) - case *ast.StmtGoto: - p.printStmtGoto(n) - case *ast.StmtHaltCompiler: - p.printStmtHaltCompiler(n) - case *ast.StmtIf: - p.printStmtIf(n) - case *ast.StmtInlineHtml: - p.printStmtInlineHTML(n) - case *ast.StmtInterface: - p.printStmtInterface(n) - case *ast.StmtLabel: - p.printStmtLabel(n) - case *ast.StmtNamespace: - p.printStmtNamespace(n) - case *ast.StmtNop: - p.printStmtNop(n) - case *ast.StmtPropertyList: - p.printStmtPropertyList(n) - case *ast.StmtProperty: - p.printStmtProperty(n) - case *ast.StmtReturn: - p.printStmtReturn(n) - case *ast.StmtStaticVar: - p.printStmtStaticVar(n) - case *ast.StmtStatic: - p.printStmtStatic(n) - case *ast.StmtStmtList: - p.printStmtStmtList(n) - case *ast.StmtSwitch: - p.printStmtSwitch(n) - case *ast.StmtThrow: - p.printStmtThrow(n) - case *ast.StmtTraitAdaptationList: - p.printStmtTraitAdaptationList(n) - case *ast.StmtTraitMethodRef: - p.printStmtTraitMethodRef(n) - case *ast.StmtTraitUseAlias: - p.printStmtTraitUseAlias(n) - case *ast.StmtTraitUsePrecedence: - p.printStmtTraitUsePrecedence(n) - case *ast.StmtTraitUse: - p.printStmtTraitUse(n) - case *ast.StmtTrait: - p.printStmtTrait(n) - case *ast.StmtTry: - p.printStmtTry(n) - case *ast.StmtUnset: - p.printStmtUnset(n) - case *ast.StmtUse: - p.printStmtUse(n) - case *ast.StmtGroupUse: - p.printStmtGroupUse(n) - case *ast.StmtUseDeclaration: - p.printStmtUseDeclaration(n) - case *ast.StmtWhile: - p.printStmtWhile(n) - case *ast.ParserBrackets: - p.printParserBrackets(n) - } -} - -// node - -func (p *Printer) printNodeRoot(n ast.Vertex) { - nn := n.(*ast.Root) - p.SetState(HtmlState) - p.printFreeFloating(nn, token.Start) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printNodeIdentifier(n ast.Vertex) { - nn := n.(*ast.Identifier) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printNodeParameter(n ast.Vertex) { - nn := n.(*ast.Parameter) - p.printFreeFloating(nn, token.Start) - - if nn.Type != nil { - p.Print(nn.Type) - } - - p.Print(nn.Var) - - if nn.DefaultValue != nil { - p.write([]byte("=")) - p.Print(nn.DefaultValue) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printNodeNullable(n ast.Vertex) { - nn := n.(*ast.Nullable) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("?")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printNodeArgument(n ast.Vertex) { - nn := n.(*ast.Argument) - p.printFreeFloating(nn, token.Start) - - if nn.AmpersandTkn != nil { - p.write([]byte("&")) - } - p.printFreeFloating(nn, token.Ampersand) - - if nn.VariadicTkn != nil { - p.write([]byte("...")) - } - - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -// name - -func (p *Printer) printNameNamePart(n *ast.NameNamePart) { - p.printToken(n.StringTkn, string(n.Value)) -} - -func (p *Printer) printNameName(n *ast.NameName) { - p.printFreeFloating(n, token.Start) - - p.joinPrintRefactored("\\", n.Parts) -} - -func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { - p.printFreeFloating(n, token.Start) - p.printToken(n.NsSeparatorTkn, "\\") - - p.joinPrintRefactored("\\", n.Parts) -} - -func (p *Printer) printNameRelative(n *ast.NameRelative) { - p.printFreeFloating(n, token.Start) - p.printToken(n.NsTkn, "namespace") - p.printToken(n.NsSeparatorTkn, "\\") - - p.joinPrintRefactored("\\", n.Parts) -} - -// scalar - -func (p *Printer) printScalarLNumber(n ast.Vertex) { - nn := n.(*ast.ScalarLnumber) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarDNumber(n ast.Vertex) { - nn := n.(*ast.ScalarDnumber) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarString(n ast.Vertex) { - nn := n.(*ast.ScalarString) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarEncapsedStringPart(n ast.Vertex) { - nn := n.(*ast.ScalarEncapsedStringPart) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarEncapsed(n ast.Vertex) { - nn := n.(*ast.ScalarEncapsed) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write([]byte("\"")) - for _, part := range nn.Parts { - switch part.(type) { - case *ast.ExprArrayDimFetch: - s := part.GetNode().Tokens[token.Start] - if len(s) > 0 && string(s[0].Value) == "${" { - p.printExprArrayDimFetchWithoutLeadingDollar(part) - } else { - p.Print(part) - } - case *ast.ExprVariable: - s := part.GetNode().Tokens[token.Start] - if len(s) > 0 && string(s[0].Value) == "${" { - p.printExprVariableWithoutLeadingDollar(part) - } else { - p.Print(part) - } - default: - p.Print(part) - } - } - p.write([]byte("\"")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarHeredoc(n ast.Vertex) { - nn := n.(*ast.ScalarHeredoc) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.OpenHeredocTkn.Value) - - for _, part := range nn.Parts { - switch part.(type) { - case *ast.ExprArrayDimFetch: - s := part.GetNode().Tokens[token.Start] - if len(s) > 0 && string(s[0].Value) == "${" { - p.printExprArrayDimFetchWithoutLeadingDollar(part) - } else { - p.Print(part) - } - case *ast.ExprVariable: - s := part.GetNode().Tokens[token.Start] - if len(s) > 0 && string(s[0].Value) == "${" { - p.printExprVariableWithoutLeadingDollar(part) - } else { - p.Print(part) - } - default: - p.Print(part) - } - } - - p.write([]byte(strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n"))) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printScalarMagicConstant(n ast.Vertex) { - nn := n.(*ast.ScalarMagicConstant) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - p.write(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -// Assign - -func (p *Printer) printAssign(n ast.Vertex) { - nn := n.(*ast.ExprAssign) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignReference(n ast.Vertex) { - nn := n.(*ast.ExprAssignReference) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("=")) - p.printFreeFloating(nn, token.Equal) - p.write([]byte("&")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignBitwiseAnd(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseAnd) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("&")) - p.write([]byte("=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignBitwiseOr(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseOr) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("|=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignBitwiseXor(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseXor) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("^=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignCoalesce(n ast.Vertex) { - nn := n.(*ast.ExprAssignCoalesce) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("??=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignConcat(n ast.Vertex) { - nn := n.(*ast.ExprAssignConcat) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte(".=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignDiv(n ast.Vertex) { - nn := n.(*ast.ExprAssignDiv) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("/=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignMinus(n ast.Vertex) { - nn := n.(*ast.ExprAssignMinus) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("-=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignMod(n ast.Vertex) { - nn := n.(*ast.ExprAssignMod) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("%=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignMul(n ast.Vertex) { - nn := n.(*ast.ExprAssignMul) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("*=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignPlus(n ast.Vertex) { - nn := n.(*ast.ExprAssignPlus) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("+=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignPow(n ast.Vertex) { - nn := n.(*ast.ExprAssignPow) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("**=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignShiftLeft(n ast.Vertex) { - nn := n.(*ast.ExprAssignShiftLeft) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("<<=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printAssignShiftRight(n ast.Vertex) { - nn := n.(*ast.ExprAssignShiftRight) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte(">>=")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -// binary - -func (p *Printer) printBinaryBitwiseAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseAnd) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("&")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryBitwiseOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseOr) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("|")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryBitwiseXor(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseXor) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("^")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryBooleanAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBooleanAnd) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("&&")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryBooleanOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBooleanOr) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("||")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryCoalesce(n ast.Vertex) { - nn := n.(*ast.ExprBinaryCoalesce) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("??")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryConcat(n ast.Vertex) { - nn := n.(*ast.ExprBinaryConcat) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte(".")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryDiv(n ast.Vertex) { - nn := n.(*ast.ExprBinaryDiv) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("/")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryEqual) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("==")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryGreaterOrEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryGreaterOrEqual) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte(">=")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryGreater(n ast.Vertex) { - nn := n.(*ast.ExprBinaryGreater) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte(">")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryIdentical(n ast.Vertex) { - nn := n.(*ast.ExprBinaryIdentical) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("===")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryLogicalAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalAnd) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("and")) - if nn.Right.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryLogicalOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalOr) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("or")) - if nn.Right.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryLogicalXor(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalXor) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("xor")) - if nn.Right.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryMinus(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMinus) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("-")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryMod(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMod) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("%")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryMul(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMul) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("*")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryNotEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryNotEqual) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.printFreeFloating(nn, token.Equal) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("!=")) - } - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryNotIdentical(n ast.Vertex) { - nn := n.(*ast.ExprBinaryNotIdentical) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("!==")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryPlus(n ast.Vertex) { - nn := n.(*ast.ExprBinaryPlus) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("+")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryPow(n ast.Vertex) { - nn := n.(*ast.ExprBinaryPow) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("**")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryShiftLeft(n ast.Vertex) { - nn := n.(*ast.ExprBinaryShiftLeft) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("<<")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinaryShiftRight(n ast.Vertex) { - nn := n.(*ast.ExprBinaryShiftRight) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte(">>")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinarySmallerOrEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinarySmallerOrEqual) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("<=")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinarySmaller(n ast.Vertex) { - nn := n.(*ast.ExprBinarySmaller) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("<")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBinarySpaceship(n ast.Vertex) { - nn := n.(*ast.ExprBinarySpaceship) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Left) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("<=>")) - p.Print(nn.Right) - - p.printFreeFloating(nn, token.End) -} - -// cast - -func (p *Printer) printArray(n ast.Vertex) { - nn := n.(*ast.ExprCastArray) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(array)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printBool(n ast.Vertex) { - nn := n.(*ast.ExprCastBool) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(boolean)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printDouble(n ast.Vertex) { - nn := n.(*ast.ExprCastDouble) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(float)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printInt(n ast.Vertex) { - nn := n.(*ast.ExprCastInt) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(integer)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printObject(n ast.Vertex) { - nn := n.(*ast.ExprCastObject) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(object)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printString(n ast.Vertex) { - nn := n.(*ast.ExprCastString) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(string)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printUnset(n ast.Vertex) { - nn := n.(*ast.ExprCastUnset) - p.printFreeFloating(nn, token.Start) - - p.printFreeFloating(nn, token.Cast) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("(unset)")) - } - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -// expr - -func (p *Printer) printExprArrayDimFetch(n ast.Vertex) { - nn := n.(*ast.ExprArrayDimFetch) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("[")) - } - p.Print(nn.Dim) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("]")) - } - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprArrayDimFetchWithoutLeadingDollar(n ast.Vertex) { - nn := n.(*ast.ExprArrayDimFetch) - p.printFreeFloating(nn, token.Start) - p.printExprVariableWithoutLeadingDollar(nn.Var) - p.printFreeFloating(nn, token.Var) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("[")) - } - p.Print(nn.Dim) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte("]")) - } - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprArrayItem(n ast.Vertex) { - nn := n.(*ast.ExprArrayItem) - p.printFreeFloating(nn, token.Start) - - if nn.EllipsisTkn != nil { - p.write([]byte("...")) - } - - if nn.Key != nil { - p.Print(nn.Key) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("=>")) - } - - p.Print(nn.Val) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprArray(n ast.Vertex) { - nn := n.(*ast.ExprArray) - p.printFreeFloating(nn, token.Start) - p.write([]byte("array")) - p.printFreeFloating(nn, token.Array) - p.write([]byte("(")) - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, token.ArrayPairList) - p.write([]byte(")")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprArrowFunction(n ast.Vertex) { - nn := n.(*ast.ExprArrowFunction) - p.printFreeFloating(nn, token.Start) - - if nn.StaticTkn != nil { - p.write([]byte("static")) - } - p.printFreeFloating(nn, token.Static) - if nn.StaticTkn != nil && n.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.write([]byte("fn")) - p.printFreeFloating(nn, token.Function) - - if nn.AmpersandTkn != nil { - p.write([]byte("&")) - } - p.printFreeFloating(nn, token.Ampersand) - - p.write([]byte("(")) - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, token.ParameterList) - p.write([]byte(")")) - p.printFreeFloating(nn, token.Params) - - if nn.ReturnType != nil { - p.bufStart = ":" - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, token.ReturnType) - - p.write([]byte("=>")) - - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprBitwiseNot(n ast.Vertex) { - nn := n.(*ast.ExprBitwiseNot) - p.printFreeFloating(nn, token.Start) - p.write([]byte("~")) - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprBooleanNot(n ast.Vertex) { - nn := n.(*ast.ExprBooleanNot) - p.printFreeFloating(nn, token.Start) - p.write([]byte("!")) - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprClassConstFetch(n ast.Vertex) { - nn := n.(*ast.ExprClassConstFetch) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, token.Name) - p.write([]byte("::")) - p.Print(nn.ConstantName) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprClone(n ast.Vertex) { - nn := n.(*ast.ExprClone) - p.printFreeFloating(nn, token.Start) - p.write([]byte("clone")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprClosureUse(n ast.Vertex) { - nn := n.(*ast.ExprClosureUse) - p.printFreeFloating(nn, token.Start) - p.write([]byte("use")) - p.printFreeFloating(nn, token.Use) - p.write([]byte("(")) - p.joinPrint(",", nn.Uses) - p.printFreeFloating(nn, token.LexicalVarList) - p.write([]byte(")")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprClosure(n ast.Vertex) { - nn := n.(*ast.ExprClosure) - p.printFreeFloating(nn, token.Start) - - if nn.StaticTkn != nil { - p.write([]byte("static")) - } - p.printFreeFloating(nn, token.Static) - if nn.StaticTkn != nil && n.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.write([]byte("function")) - p.printFreeFloating(nn, token.Function) - - if nn.AmpersandTkn != nil { - p.write([]byte("&")) - } - p.printFreeFloating(nn, token.Ampersand) - - p.write([]byte("(")) - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, token.ParameterList) - p.write([]byte(")")) - p.printFreeFloating(nn, token.Params) - - if nn.ClosureUse != nil { - p.Print(nn.ClosureUse) - } - p.printFreeFloating(nn, token.LexicalVars) - - if nn.ReturnType != nil { - p.bufStart = ":" - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, token.ReturnType) - - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprConstFetch(n ast.Vertex) { - nn := n.(*ast.ExprConstFetch) - p.printFreeFloating(nn, token.Start) - p.Print(nn.Const) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprEmpty(n ast.Vertex) { - nn := n.(*ast.ExprEmpty) - p.printFreeFloating(nn, token.Start) - p.write([]byte("empty")) - - if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - p.write([]byte("(")) - } - - p.Print(nn.Expr) - - if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - p.write([]byte(")")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprErrorSuppress(n ast.Vertex) { - nn := n.(*ast.ExprErrorSuppress) - p.printFreeFloating(nn, token.Start) - p.write([]byte("@")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprEval(n ast.Vertex) { - nn := n.(*ast.ExprEval) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("eval")) - - if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - p.write([]byte("(")) - } - - p.Print(nn.Expr) - - if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { - p.write([]byte(")")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprExit(n ast.Vertex) { - nn := n.(*ast.ExprExit) - p.printFreeFloating(nn, token.Start) - - if nn.DieTkn != nil { - p.write(nn.DieTkn.Value) - } else { - p.write([]byte("exit")) - } - - if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() && nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprFunctionCall(n ast.Vertex) { - nn := n.(*ast.ExprFunctionCall) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Function) - - p.printToken(nn.OpenParenthesisTkn, "(") - p.joinPrint(",", nn.Arguments) - p.printToken(nn.CloseParenthesisTkn, ")") - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprInclude(n ast.Vertex) { - nn := n.(*ast.ExprInclude) - p.printFreeFloating(nn, token.Start) - p.write([]byte("include")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprIncludeOnce(n ast.Vertex) { - nn := n.(*ast.ExprIncludeOnce) - p.printFreeFloating(nn, token.Start) - p.write([]byte("include_once")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprInstanceOf(n ast.Vertex) { - nn := n.(*ast.ExprInstanceOf) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.write([]byte("instanceof")) - - p.bufStart = " " - p.Print(nn.Class) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprIsset(n ast.Vertex) { - nn := n.(*ast.ExprIsset) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("isset")) - p.printFreeFloating(nn, token.Isset) - p.write([]byte("(")) - p.joinPrint(",", nn.Vars) - p.printFreeFloating(nn, token.VarList) - p.write([]byte(")")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprList(n ast.Vertex) { - nn := n.(*ast.ExprList) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("list")) - p.printFreeFloating(nn, token.List) - p.write([]byte("(")) - p.joinPrint(",", nn.Items) - p.printFreeFloating(nn, token.ArrayPairList) - p.write([]byte(")")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprMethodCall(n ast.Vertex) { - nn := n.(*ast.ExprMethodCall) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("->")) - p.Print(nn.Method) - - p.printToken(nn.OpenParenthesisTkn, "(") - p.joinPrint(",", nn.Arguments) - p.printToken(nn.CloseParenthesisTkn, ")") - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprNew(n ast.Vertex) { - nn := n.(*ast.ExprNew) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("new")) - p.bufStart = " " - p.Print(nn.Class) - - if nn.Arguments != nil { - p.printToken(nn.OpenParenthesisTkn, "(") - p.joinPrint(",", nn.Arguments) - p.printToken(nn.CloseParenthesisTkn, ")") - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPostDec(n ast.Vertex) { - nn := n.(*ast.ExprPostDec) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("--")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPostInc(n ast.Vertex) { - nn := n.(*ast.ExprPostInc) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("++")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPreDec(n ast.Vertex) { - nn := n.(*ast.ExprPreDec) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("--")) - p.Print(nn.Var) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPreInc(n ast.Vertex) { - nn := n.(*ast.ExprPreInc) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("++")) - p.Print(nn.Var) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPrint(n ast.Vertex) { - nn := n.(*ast.ExprPrint) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("print")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprPropertyFetch(n ast.Vertex) { - nn := n.(*ast.ExprPropertyFetch) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Var) - p.printFreeFloating(nn, token.Var) - p.write([]byte("->")) - p.Print(nn.Property) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprReference(n ast.Vertex) { - nn := n.(*ast.ExprReference) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("&")) - p.Print(nn.Var) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprRequire(n ast.Vertex) { - nn := n.(*ast.ExprRequire) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("require")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprRequireOnce(n ast.Vertex) { - nn := n.(*ast.ExprRequireOnce) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("require_once")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprShellExec(n ast.Vertex) { - nn := n.(*ast.ExprShellExec) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("`")) - p.joinPrint("", nn.Parts) - p.write([]byte("`")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprStaticCall(n ast.Vertex) { - nn := n.(*ast.ExprStaticCall) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, token.Name) - p.write([]byte("::")) - p.Print(nn.Call) - - p.printToken(nn.OpenParenthesisTkn, "(") - p.joinPrint(",", nn.Arguments) - p.printToken(nn.CloseParenthesisTkn, ")") - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprStaticPropertyFetch(n ast.Vertex) { - nn := n.(*ast.ExprStaticPropertyFetch) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Class) - p.printFreeFloating(nn, token.Name) - p.write([]byte("::")) - p.Print(nn.Property) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprTernary(n ast.Vertex) { - nn := n.(*ast.ExprTernary) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Condition) - p.printFreeFloating(nn, token.Cond) - p.write([]byte("?")) - - if nn.IfTrue != nil { - p.Print(nn.IfTrue) - } - p.printFreeFloating(nn, token.True) - - p.write([]byte(":")) - p.Print(nn.IfFalse) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprUnaryMinus(n ast.Vertex) { - nn := n.(*ast.ExprUnaryMinus) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("-")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprUnaryPlus(n ast.Vertex) { - nn := n.(*ast.ExprUnaryPlus) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("+")) - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprVariable(n ast.Vertex) { - nn := n.(*ast.ExprVariable) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - if _, ok := nn.VarName.(*ast.Identifier); !ok { - p.write([]byte("$")) - } - - p.Print(nn.VarName) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprVariableWithoutLeadingDollar(n ast.Vertex) { - nn := n.(*ast.ExprVariable) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.VarName) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprYieldFrom(n ast.Vertex) { - nn := n.(*ast.ExprYieldFrom) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("yield from")) - if nn.Expr.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printExprYield(n ast.Vertex) { - nn := n.(*ast.ExprYield) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("yield")) - - if nn.Key != nil { - if nn.Key.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Key) - p.printFreeFloating(nn, token.Expr) - p.write([]byte("=>")) - } else { - if nn.Value.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - - p.Print(nn.Value) - - p.printFreeFloating(nn, token.End) -} - -// smtm - -func (p *Printer) printStmtBreak(n *ast.StmtBreak) { - p.printToken(n.BreakTkn, "break") - - if n.Expr != nil { - p.bufStart = " " - } - - p.Print(n.Expr) - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtCase(n *ast.StmtCase) { - p.printToken(n.CaseTkn, "case") - p.bufStart = " " - p.Print(n.Cond) - p.printToken(n.CaseSeparatorTkn, ":") - p.printNodes(n.Stmts) -} - -func (p *Printer) printStmtCatch(n *ast.StmtCatch) { - p.printToken(n.CatchTkn, "catch") - p.printToken(n.OpenParenthesisTkn, "(") - p.printSeparatedList(n.Types, n.SeparatorTkns, "|") - p.Print(n.Var) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.OpenCurlyBracketTkn, "{") - p.printNodes(n.Stmts) - p.printToken(n.CloseCurlyBracketTkn, "}") -} - -func (p *Printer) printStmtClassMethod(n ast.Vertex) { - nn := n.(*ast.StmtClassMethod) - p.printFreeFloating(nn, token.Start) - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(m) - } - - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - p.printFreeFloating(nn, token.ModifierList) - p.write([]byte("function")) - p.printFreeFloating(nn, token.Function) - - if nn.AmpersandTkn != nil { - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("&")) - p.printFreeFloating(nn, token.Ampersand) - } else { - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - - p.Print(nn.MethodName) - p.printFreeFloating(nn, token.Name) - p.write([]byte("(")) - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, token.ParameterList) - p.write([]byte(")")) - p.printFreeFloating(nn, token.Params) - - if nn.ReturnType != nil { - p.bufStart = ":" - p.Print(nn.ReturnType) - } - - p.Print(nn.Stmt) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtClass(n ast.Vertex) { - nn := n.(*ast.StmtClass) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(m) - } - - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - p.printFreeFloating(nn, token.ModifierList) - p.write([]byte("class")) - - if nn.ClassName != nil { - p.bufStart = " " - p.Print(nn.ClassName) - } - - if nn.Arguments != nil { - p.printToken(nn.OpenParenthesisTkn, "(") - p.joinPrint(",", nn.Arguments) - p.printToken(nn.CloseParenthesisTkn, ")") - } - - if nn.Extends != nil { - p.printFreeFloating(nn.Extends, token.Start) - if nn.Extends.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("extends")) - p.bufStart = " " - p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName) - } - - if nn.Implements != nil { - p.printFreeFloating(nn.Implements, token.Start) - if nn.Implements.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("implements")) - p.bufStart = " " - p.joinPrintRefactored(",", nn.Implements.(*ast.StmtClassImplements).InterfaceNames) - - } - - p.printFreeFloating(nn, token.Name) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtClassConstList(n *ast.StmtClassConstList) { - p.joinPrintRefactored(" ", n.Modifiers) - p.bufStart = " " - p.printToken(n.ConstTkn, "const") - p.bufStart = " " - p.joinPrintRefactored(",", n.Consts) - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtConstList(n *ast.StmtConstList) { - p.printToken(n.ConstTkn, "const") - p.bufStart = " " - p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtConstant(n *ast.StmtConstant) { - p.Print(n.Name) - p.printToken(n.EqualTkn, "=") - p.Print(n.Expr) -} - -func (p *Printer) printStmtContinue(n *ast.StmtContinue) { - p.printToken(n.ContinueTkn, "continue") - - if n.Expr != nil { - p.bufStart = " " - } - - p.Print(n.Expr) - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtDeclare(n *ast.StmtDeclare) { - if n.Alt { - p.printStmtAltDeclare(n) - return - } - p.printToken(n.DeclareTkn, "declare") - p.printToken(n.OpenParenthesisTkn, "(") - p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") - p.printToken(n.CloseParenthesisTkn, ")") - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltDeclare(n *ast.StmtDeclare) { - p.printToken(n.DeclareTkn, "declare") - p.printToken(n.OpenParenthesisTkn, "(") - p.printSeparatedList(n.Consts, n.SeparatorTkns, ",") - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } - - p.printToken(n.EndDeclareTkn, "enddeclare") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtDefault(n *ast.StmtDefault) { - p.printToken(n.DefaultTkn, "default") - p.printToken(n.CaseSeparatorTkn, ":") - p.printNodes(n.Stmts) -} - -func (p *Printer) printStmtDo(n *ast.StmtDo) { - p.printToken(n.DoTkn, "do") - p.bufStart = " " - - p.Print(n.Stmt) - - p.printToken(n.WhileTkn, "while") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtEcho(n *ast.StmtEcho) { - p.printToken(n.EchoTkn, "echo") - p.bufStart = " " - p.printSeparatedList(n.Exprs, n.SeparatorTkns, ",") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtElseif(n *ast.StmtElseIf) { - if n.Alt { - p.printStmtAltElseIf(n) - return - } - - p.printToken(n.ElseIfTkn, "elseif") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltElseIf(n *ast.StmtElseIf) { - p.printToken(n.ElseIfTkn, "elseif") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } -} - -func (p *Printer) printStmtElse(n *ast.StmtElse) { - if n.Alt { - p.printStmtAltElse(n) - return - } - - p.printToken(n.ElseTkn, "else") - p.bufStart = " " - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltElse(n *ast.StmtElse) { - p.printToken(n.ElseTkn, "else") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } -} - -func (p *Printer) printStmtExpression(n ast.Vertex) { - nn := n.(*ast.StmtExpression) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtFinally(n *ast.StmtFinally) { - p.printToken(n.FinallyTkn, "finally") - p.printToken(n.OpenCurlyBracketTkn, "{") - p.printNodes(n.Stmts) - p.printToken(n.CloseCurlyBracketTkn, "}") -} - -func (p *Printer) printStmtFor(n *ast.StmtFor) { - if n.Alt { - p.printStmtAltFor(n) - return - } - - p.printToken(n.ForTkn, "for") - p.printToken(n.OpenParenthesisTkn, "(") - p.joinPrint(",", n.Init) - p.printToken(n.InitSemiColonTkn, ";") - p.joinPrint(",", n.Cond) - p.printToken(n.CondSemiColonTkn, ";") - p.joinPrint(",", n.Loop) - p.printToken(n.CloseParenthesisTkn, ")") - - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltFor(n *ast.StmtFor) { - p.printToken(n.ForTkn, "for") - p.printToken(n.OpenParenthesisTkn, "(") - p.joinPrint(",", n.Init) - p.printToken(n.InitSemiColonTkn, ";") - p.joinPrint(",", n.Cond) - p.printToken(n.CondSemiColonTkn, ";") - p.joinPrint(",", n.Loop) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } - - p.printToken(n.EndForTkn, "endfor") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtForeach(n *ast.StmtForeach) { - if n.Alt { - p.printStmtAltForeach(n) - return - } - - p.printToken(n.ForeachTkn, "foreach") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Expr) - p.bufStart = " " - p.printToken(n.AsTkn, "as") - p.bufStart = " " - if n.Key != nil { - p.Print(n.Key) - p.printToken(n.DoubleArrowTkn, "=>") - } - p.Print(n.Var) - p.printToken(n.CloseParenthesisTkn, ")") - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltForeach(n *ast.StmtForeach) { - p.printToken(n.ForeachTkn, "foreach") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Expr) - p.bufStart = " " - p.printToken(n.AsTkn, "as") - p.bufStart = " " - if n.Key != nil { - p.Print(n.Key) - p.printToken(n.DoubleArrowTkn, "=>") - } - p.Print(n.Var) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } - - p.printToken(n.EndForeachTkn, "endforeach") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtFunction(n ast.Vertex) { - nn := n.(*ast.StmtFunction) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("function")) - p.printFreeFloating(nn, token.Function) - - if nn.AmpersandTkn != nil { - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("&")) - } else { - if nn.FunctionName.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - } - - p.Print(nn.FunctionName) - p.printFreeFloating(nn, token.Name) - - p.write([]byte("(")) - p.joinPrint(",", nn.Params) - p.printFreeFloating(nn, token.ParamList) - p.write([]byte(")")) - p.printFreeFloating(nn, token.Params) - - if nn.ReturnType != nil { - p.bufStart = ":" - p.Print(nn.ReturnType) - } - p.printFreeFloating(nn, token.ReturnType) - - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtGlobal(n *ast.StmtGlobal) { - p.printToken(n.GlobalTkn, "global") - p.bufStart = " " - p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtGoto(n *ast.StmtGoto) { - p.printToken(n.GotoTkn, "goto") - p.bufStart = " " - p.Print(n.Label) - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtHaltCompiler(n *ast.StmtHaltCompiler) { - p.printToken(n.HaltCompilerTkn, "__halt_compiler") - p.printToken(n.OpenParenthesisTkn, "(") - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtIf(n *ast.StmtIf) { - if n.Alt { - p.printStmtAltIf(n) - return - } - - p.printToken(n.IfTkn, "if") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - - p.Print(n.Stmt) - p.printNodes(n.ElseIf) - p.Print(n.Else) -} - -func (p *Printer) printStmtAltIf(n *ast.StmtIf) { - p.printToken(n.IfTkn, "if") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } - - p.printNodes(n.ElseIf) - p.Print(n.Else) - - p.printToken(n.EndIfTkn, "endif") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtInlineHTML(n *ast.StmtInlineHtml) { - if p.s == PhpState && !bytes.Contains(p.lastWrite, []byte("?>")) { - p.write([]byte("?>")) - } - p.SetState(HtmlState) - - p.printToken(n.InlineHtmlTkn, string(n.Value)) -} - -func (p *Printer) printStmtInterface(n ast.Vertex) { - nn := n.(*ast.StmtInterface) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("interface")) - - if nn.InterfaceName.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.Print(nn.InterfaceName) - - if nn.Extends != nil { - p.printFreeFloating(nn.Extends, token.Start) - if nn.Extends.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("extends")) - p.bufStart = " " - p.joinPrintRefactored(",", nn.Extends.(*ast.StmtInterfaceExtends).InterfaceNames) - } - - p.printFreeFloating(nn, token.Name) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtLabel(n *ast.StmtLabel) { - p.Print(n.LabelName) - p.printToken(n.ColonTkn, ":") -} - -func (p *Printer) printStmtNamespace(n *ast.StmtNamespace) { - p.printToken(n.NsTkn, "namespace") - - if n.Name != nil { - p.bufStart = " " - p.Print(n.Name) - } - - if n.Stmts != nil { - p.printToken(n.OpenCurlyBracket, "{") - p.printNodes(n.Stmts) - p.printToken(n.CloseCurlyBracket, "}") - return - } - - if n.OpenCurlyBracket != nil { - p.printToken(n.OpenCurlyBracket, "{") - p.printToken(n.CloseCurlyBracket, "}") - return - } - - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtNop(n *ast.StmtNop) { - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtPropertyList(n ast.Vertex) { - nn := n.(*ast.StmtPropertyList) - p.printFreeFloating(nn, token.Start) - - for k, m := range nn.Modifiers { - if k > 0 && m.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(m) - } - - if nn.Type != nil { - p.bufStart = " " - p.Print(nn.Type) - } - - if nn.Properties[0].GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.joinPrint(",", nn.Properties) - p.printFreeFloating(n, token.PropertyList) - - p.printFreeFloating(n, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtProperty(n ast.Vertex) { - nn := n.(*ast.StmtProperty) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Var) - - if nn.Expr != nil { - p.printFreeFloating(nn, token.Var) - p.write([]byte("=")) - p.Print(nn.Expr) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtReturn(n *ast.StmtReturn) { - p.printToken(n.ReturnTkn, "return") - - if n.Expr != nil { - p.bufStart = " " - } - p.Print(n.Expr) - - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtStaticVar(n *ast.StmtStaticVar) { - p.Print(n.Var) - - if n.Expr != nil { - p.printToken(n.EqualTkn, "=") - p.Print(n.Expr) - } -} - -func (p *Printer) printStmtStatic(n *ast.StmtStatic) { - p.printToken(n.StaticTkn, "static") - p.bufStart = " " - p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtStmtList(n *ast.StmtStmtList) { - p.printToken(n.OpenCurlyBracket, "{") - p.printNodes(n.Stmts) - p.printToken(n.CloseCurlyBracket, "}") -} - -func (p *Printer) printStmtSwitch(n *ast.StmtSwitch) { - if n.Alt { - p.printStmtAltSwitch(n) - return - } - - p.printToken(n.SwitchTkn, "switch") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.OpenCurlyBracketTkn, "{") - p.printToken(n.CaseSeparatorTkn, "") - p.printNodes(n.CaseList) - p.printToken(n.CloseCurlyBracketTkn, "}") -} - -func (p *Printer) printStmtAltSwitch(n *ast.StmtSwitch) { - p.printToken(n.SwitchTkn, "switch") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - p.printToken(n.CaseSeparatorTkn, "") - p.printNodes(n.CaseList) - p.printToken(n.EndSwitchTkn, "endswitch") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtThrow(n *ast.StmtThrow) { - p.printToken(n.ThrowTkn, "throw") - p.bufStart = " " - p.Print(n.Expr) - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtTraitAdaptationList(n ast.Vertex) { - nn := n.(*ast.StmtTraitAdaptationList) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("{")) - p.printNodes(nn.Adaptations) - p.printFreeFloating(nn, token.AdaptationList) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTraitMethodRef(n ast.Vertex) { - nn := n.(*ast.StmtTraitMethodRef) - p.printFreeFloating(nn, token.Start) - - if nn.Trait != nil { - p.Print(nn.Trait) - p.printFreeFloating(nn, token.Name) - p.write([]byte("::")) - } - - p.Print(nn.Method) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTraitUseAlias(n ast.Vertex) { - nn := n.(*ast.StmtTraitUseAlias) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Ref) - p.printFreeFloating(nn, token.Ref) - - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.write([]byte("as")) - - if nn.Modifier != nil { - if nn.Modifier.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Modifier) - } - - if nn.Alias != nil { - if nn.Alias.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.Alias) - } - p.printFreeFloating(nn, token.Alias) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTraitUsePrecedence(n ast.Vertex) { - nn := n.(*ast.StmtTraitUsePrecedence) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Ref) - p.printFreeFloating(nn, token.Ref) - if nn.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - - p.write([]byte("insteadof")) - p.bufStart = " " - p.joinPrint(",", nn.Insteadof) - p.printFreeFloating(nn, token.NameList) - - p.printFreeFloating(nn, token.SemiColon) - if n.GetNode().Tokens.IsEmpty() { - p.write([]byte(";")) - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTraitUse(n ast.Vertex) { - nn := n.(*ast.StmtTraitUse) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("use")) - p.bufStart = " " - p.joinPrintRefactored(",", nn.Traits) - - p.Print(nn.Adaptations) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTrait(n ast.Vertex) { - nn := n.(*ast.StmtTrait) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("trait")) - if nn.TraitName.GetNode().Tokens.IsEmpty() { - p.write([]byte(" ")) - } - p.Print(nn.TraitName) - - p.printFreeFloating(nn, token.Name) - p.write([]byte("{")) - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - p.write([]byte("}")) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtTry(n *ast.StmtTry) { - p.printToken(n.TryTkn, "try") - p.printToken(n.OpenCurlyBracket, "{") - p.printNodes(n.Stmts) - p.printToken(n.CloseCurlyBracket, "}") - - if n.Catches != nil { - p.printNodes(n.Catches) - } - - if n.Finally != nil { - p.Print(n.Finally) - } -} - -func (p *Printer) printStmtUnset(n *ast.StmtUnset) { - p.printToken(n.UnsetTkn, "unset") - p.printToken(n.OpenParenthesisTkn, "(") - p.printSeparatedList(n.Vars, n.SeparatorTkns, ",") - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtUse(n *ast.StmtUse) { - p.printToken(n.UseTkn, "use") - - if n.Type != nil { - p.bufStart = " " - p.Print(n.Type) - } - - p.bufStart = " " - p.joinPrintRefactored(",", n.UseDeclarations) - - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtGroupUse(n *ast.StmtGroupUse) { - p.printToken(n.UseTkn, "use") - - p.bufStart = " " - p.Print(n.Type) - - p.bufStart = " " - p.printToken(n.LeadingNsSeparatorTkn, "") - - p.Print(n.Prefix) - p.printToken(n.NsSeparatorTkn, "\\") - p.printToken(n.OpenCurlyBracketTkn, "{") - - p.joinPrintRefactored(",", n.UseDeclarations) - - p.printToken(n.CloseCurlyBracketTkn, "}") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { - p.Print(n.Type) - - if n.Type != nil { - p.bufStart = " " - } - - p.printToken(n.NsSeparatorTkn, "") - - p.Print(n.Use) - - if n.Alias == nil { - return - } - - p.bufStart = " " - p.printToken(n.AsTkn, "as") - - p.bufStart = " " - p.Print(n.Alias) -} - -func (p *Printer) printStmtWhile(n *ast.StmtWhile) { - if n.Alt { - p.printStmtAltWhile(n) - return - } - - p.printToken(n.WhileTkn, "while") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - - p.Print(n.Stmt) -} - -func (p *Printer) printStmtAltWhile(n *ast.StmtWhile) { - p.printToken(n.WhileTkn, "while") - p.printToken(n.OpenParenthesisTkn, "(") - p.Print(n.Cond) - p.printToken(n.CloseParenthesisTkn, ")") - p.printToken(n.ColonTkn, ":") - - if stmtList, ok := n.Stmt.(*ast.StmtStmtList); ok { - p.printNodes(stmtList.Stmts) - } else { - p.Print(n.Stmt) - } - - p.printToken(n.EndWhileTkn, "endwhile") - p.printToken(n.SemiColonTkn, ";") -} - -func (p *Printer) printParserBrackets(n ast.Vertex) { - nn := n.(*ast.ParserBrackets) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Child) - - p.printFreeFloating(nn, token.End) -} From 60433615a9d19d63ebdb8faad742af9dd4e96c6b Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 10:05:02 +0200 Subject: [PATCH 108/140] [refactoring] fix namespaceResolver tests --- pkg/ast/visitor/dump_test.go | 18 ++++++------------ pkg/ast/visitor/namespace_resolver_test.go | 22 +++------------------- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 3bcdad0..42283dc 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -1,26 +1,16 @@ package visitor_test import ( + "os" + "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/ast/traverser" "github.com/z7zmey/php-parser/pkg/ast/visitor" - "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" - "os" ) func ExampleDump() { stxTree := &ast.Root{ - Node: ast.Node{ - Tokens: token.Collection{ - token.Start: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - }, - }, - }, - }, Stmts: []ast.Vertex{ &ast.Identifier{}, &ast.Parameter{ @@ -30,6 +20,10 @@ func ExampleDump() { Value: []byte("foo"), }, }, + EndTkn: &token.Token{ + ID: token.T_WHITESPACE, + Value: []byte(" "), + }, } traverser.NewDFS(visitor.NewDump(os.Stdout)).Traverse(stxTree) diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 8e84e88..e5ec818 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -24,9 +24,8 @@ func TestResolveStaticCall(t *testing.T) { }, }, &ast.ExprStaticCall{ - Class: nameBC, - Call: &ast.Identifier{Value: []byte("foo")}, - ArgumentList: &ast.ArgumentList{}, + Class: nameBC, + Call: &ast.Identifier{Value: []byte("foo")}, }, }, } @@ -119,7 +118,6 @@ func TestResolveNew(t *testing.T) { }, &ast.ExprNew{ Class: nameBC, - ArgumentList: &ast.ArgumentList{}, }, }, } @@ -230,7 +228,6 @@ func TestResolveFunctionCall(t *testing.T) { }, &ast.ExprFunctionCall{ Function: nameB, - ArgumentList: &ast.ArgumentList{}, }, }, } @@ -313,11 +310,9 @@ func TestResolveGroupUse(t *testing.T) { }, &ast.ExprFunctionCall{ Function: nameF, - ArgumentList: &ast.ArgumentList{}, }, &ast.ExprFunctionCall{ Function: nameE, - ArgumentList: &ast.ArgumentList{}, }, }, } @@ -359,7 +354,7 @@ func TestResolveTraitUse(t *testing.T) { nameB, relativeNameB, }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ + Adaptations: &ast.StmtTraitAdaptationList{ Adaptations: []ast.Vertex{ &ast.StmtTraitUsePrecedence{ Ref: &ast.StmtTraitMethodRef{ @@ -498,7 +493,6 @@ func TestResolveFunctionName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} functionNode := &ast.StmtFunction{ - ReturnsRef: false, FunctionName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ @@ -534,7 +528,6 @@ func TestResolveMethodName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} methodNode := &ast.StmtClassMethod{ - ReturnsRef: false, MethodName: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ @@ -565,8 +558,6 @@ func TestResolveClosureName(t *testing.T) { nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} closureNode := &ast.ExprClosure{ - ReturnsRef: false, - Static: false, Params: []ast.Vertex{ &ast.Parameter{ Type: nameAB, @@ -660,7 +651,6 @@ func TestResolveNamespaces(t *testing.T) { &ast.ExprStaticCall{ Class: nameFG, Call: &ast.Identifier{Value: []byte("foo")}, - ArgumentList: &ast.ArgumentList{}, }, &ast.StmtNamespace{ Stmts: []ast.Vertex{}, @@ -678,12 +668,10 @@ func TestResolveNamespaces(t *testing.T) { &ast.ExprStaticCall{ Class: relativeNameCE, Call: &ast.Identifier{Value: []byte("foo")}, - ArgumentList: &ast.ArgumentList{}, }, &ast.ExprStaticCall{ Class: nameCF, Call: &ast.Identifier{Value: []byte("foo")}, - ArgumentList: &ast.ArgumentList{}, }, }, }, @@ -711,7 +699,6 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { &ast.ExprStaticCall{ Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, Call: &ast.Identifier{Value: []byte("foo")}, - ArgumentList: &ast.ArgumentList{}, }, }, } @@ -932,21 +919,18 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { Expr: &ast.ExprStaticCall{ Class: nameSelf, Call: &ast.Identifier{Value: []byte("func")}, - ArgumentList: &ast.ArgumentList{}, }, }, &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ Class: nameStatic, Call: &ast.Identifier{Value: []byte("func")}, - ArgumentList: &ast.ArgumentList{}, }, }, &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ Class: nameParent, Call: &ast.Identifier{Value: []byte("func")}, - ArgumentList: &ast.ArgumentList{}, }, }, }, From 632146f98e4d995872b7bb9268238d09da077c19 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 13:28:16 +0200 Subject: [PATCH 109/140] [refactoring] update dumper --- cmd/php-parser/main.go | 17 +- internal/scanner/scanner.go | Bin 412478 -> 410134 bytes internal/scanner/scanner.rl | 2 +- pkg/ast/visitor/dump.go | 2312 ++++++++++++++++---- pkg/ast/visitor/dump_test.go | 106 +- pkg/ast/visitor/namespace_resolver_test.go | 36 +- 6 files changed, 1937 insertions(+), 536 deletions(-) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 554dcf9..73af6c5 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "flag" "io" "io/ioutil" @@ -163,12 +164,12 @@ func printerWorker(r <-chan result) { } if *printBack { - //o := bytes.NewBuffer([]byte{}) - //p := printer.NewPrinter(o) - //p.Print(res.rootNode) - // - //err := ioutil.WriteFile(res.path, o.Bytes(), 0644) - //checkErr(err) + o := bytes.NewBuffer([]byte{}) + p := visitor.NewPrinter(o) + res.rootNode.Accept(p) + + err := ioutil.WriteFile(res.path, o.Bytes(), 0644) + checkErr(err) } if *showResolvedNs { @@ -181,9 +182,7 @@ func printerWorker(r <-chan result) { } if *dump == true { - v := visitor.NewDump(os.Stdout) - t := traverser.NewDFS(v) - t.Traverse(res.rootNode) + visitor.NewDump(os.Stdout).WithPositions().WithTokens().Dump(res.rootNode) } wg.Done() diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index bd7768b5025b17be7f396b99cf02f27296015bfd..49e8150e909af3178d6c5ad83cbd6dcc40a33cd0 100644 GIT binary patch delta 12684 zcmb7K33yc1z5mX==gefCNkRhIAPI&5A;8?(?hL^~6xo*$5Lqls3%Em&uo^H?Q41o0 zEBPy%q$sXcFzQ9EK5&1yL0zjBK~X7HfiCvZQhC2~?#yJdzJ8DI1MZx2?tkCUeW5w8 z`IfvrH#044T5DL5m7(QYzhz09XmE@y{uHdi)KXeXgXWoc?;$iU$vmF_`>3l-%Lrd7QI#4`mlb* zKuZ3F?y;^5q**H$r(4B=A=a`$zV%rk*UGI+w|3(9-vU8vS+Kw=500}o2FFu0s(Y=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ROHBot5cG_+(K&z^3oBt1P#UUU7 diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index e7d1179..30d12af 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -255,7 +255,7 @@ func (lex *Lexer) Lex() *token.Token { 'use'i => {lex.setTokenPosition(tkn); tok = token.T_USE; fbreak;}; 'var'i => {lex.setTokenPosition(tkn); tok = token.T_VAR; fbreak;}; 'while'i => {lex.setTokenPosition(tkn); tok = token.T_WHILE; fbreak;}; - 'yield'i whitespace_line* 'from'i => {lex.setTokenPosition(tkn); tok = token.T_YIELD_FROM; fbreak;}; + 'yield'i whitespace_line+ 'from'i => {lex.setTokenPosition(tkn); tok = token.T_YIELD_FROM; fbreak;}; 'yield'i => {lex.setTokenPosition(tkn); tok = token.T_YIELD; fbreak;}; 'include'i => {lex.setTokenPosition(tkn); tok = token.T_INCLUDE; fbreak;}; 'include_once'i => {lex.setTokenPosition(tkn); tok = token.T_INCLUDE_ONCE; fbreak;}; diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index af4a87a..7ea2622 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -1,985 +1,2373 @@ package visitor import ( - "fmt" - "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" "io" "strconv" "strings" + + "github.com/z7zmey/php-parser/pkg/ast" ) -type meta struct { - singleNode bool -} - type Dump struct { - writer io.Writer - indent int - depth int - stack []meta + writer io.Writer + indent int + withTokens bool + withPositions bool } func NewDump(writer io.Writer) *Dump { return &Dump{writer: writer} } -func (v *Dump) print(str string) { - _, err := io.WriteString(v.writer, str) +func (v *Dump) WithTokens() *Dump { + v.withTokens = true + return v +} + +func (v *Dump) WithPositions() *Dump { + v.withPositions = true + return v +} + +func (v *Dump) Dump(n ast.Vertex) { + n.Accept(v) +} + +func (v *Dump) print(indent int, str string) { + _, err := io.WriteString(v.writer, strings.Repeat("\t", indent)) + if err != nil { + panic(err) + } + + _, err = io.WriteString(v.writer, str) if err != nil { panic(err) } } -func (v *Dump) printIndent(indentDepth int) { - if indentDepth < 0 { - indentDepth = 0 - } - - v.print(strings.Repeat("\t", indentDepth)) -} - -func (v *Dump) printIndentIfNotSingle(indentDepth int) { - if indentDepth < 0 { - indentDepth = 0 - } - - 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) - - 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) printToken(key string, t *token.Token) { - if t == nil { +func (v *Dump) dumpVertex(key string, node ast.Vertex) { + if node == nil { return } - v.printIndent(v.indent) - v.print(key) - v.print(": &token.Token{\n") + v.print(v.indent, key+": ") + node.Accept(v) +} - v.printIndent(v.indent + 1) - v.print("ID: token." + t.ID.String() + ",\n") +func (v *Dump) dumpVertexList(key string, list []ast.Vertex) { + if list == nil { + return + } - v.printIndent(v.indent + 1) - v.print("Value: []byte(" + strconv.Quote(string(t.Value)) + "),\n") + if len(list) == 0 { + v.print(v.indent, key+": []ast.Vertex{},\n") + return + } + + v.print(v.indent, key+": []ast.Vertex{\n") + v.indent++ + + for _, nn := range list { + v.print(v.indent, "") + nn.Accept(v) + } + + v.indent-- + v.print(v.indent, "},\n") +} + +func (v *Dump) dumpToken(key string, tok *token.Token) { + if !v.withTokens { + return + } + + if tok == nil { + return + } + + if key == "" { + v.print(v.indent, "{\n") + } else { + v.print(v.indent, key+": &token.Token{\n") + } + + v.indent++ + + if tok.ID > 0 { + v.print(v.indent, "ID: token."+tok.ID.String()+",\n") + } + if tok.Value != nil { + v.print(v.indent, "Value: []byte("+strconv.Quote(string(tok.Value))+"),\n") + } + v.dumpPosition(tok.Position) + v.dumpTokenList("FreeFloating", tok.FreeFloating) + + v.indent-- + v.print(v.indent, "},\n") +} + +func (v *Dump) dumpTokenList(key string, list []*token.Token) { + if !v.withTokens { + return + } + + if list == nil { + return + } + + if len(list) == 0 { + v.print(v.indent, key+": []*token.Token{},\n") + return + } + + v.print(v.indent, key+": []*token.Token{\n") + v.indent++ + + for _, tok := range list { + v.dumpToken("", tok) + } + + v.indent-- + v.print(v.indent, "},\n") +} + +func (v *Dump) dumpPosition(pos *position.Position) { + if !v.withPositions { + return + } + + if pos == nil { + return + } + + v.print(v.indent, "Position: &position.Position{\n") + v.indent++ + + v.print(v.indent, "StartLine: "+strconv.Itoa(pos.StartLine)+",\n") + v.print(v.indent, "EndLine: "+strconv.Itoa(pos.EndLine)+",\n") + v.print(v.indent, "StartPos: "+strconv.Itoa(pos.StartPos)+",\n") + v.print(v.indent, "EndPos: "+strconv.Itoa(pos.EndPos)+",\n") + + v.indent-- + v.print(v.indent, "},\n") +} + +func (v *Dump) dumpValue(key string, val []byte) { + if val == nil { + return + } + + v.print(v.indent, key+": []byte("+strconv.Quote(string(val))+"),\n") - v.printIndent(v.indent) - v.print("},\n") } func (v *Dump) Root(n *ast.Root) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.Root{\n") + v.print(0, "&ast.Root{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("EndTkn", n.EndTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) Nullable(n *ast.Nullable) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.Nullable{\n") + v.print(0, "&ast.Nullable{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("QuestionTkn", n.QuestionTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) Parameter(n *ast.Parameter) { - v.printIndent(v.indent - 1) - v.print("&ast.Parameter{\n") + v.print(0, "&ast.Parameter{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Type", n.Type) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpToken("VariadicTkn", n.VariadicTkn) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("DefaultValue", n.DefaultValue) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) Identifier(n *ast.Identifier) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.Identifier{\n") + v.print(0, "&ast.Identifier{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("IdentifierTkn", n.IdentifierTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) Argument(n *ast.Argument) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.Argument{\n") + v.print(0, "&ast.Argument{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpToken("VariadicTkn", n.VariadicTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtBreak(n *ast.StmtBreak) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtBreak{\n") + v.print(0, "&ast.StmtBreak{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("BreakTkn", n.BreakTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtCase(n *ast.StmtCase) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtCase{\n") + v.print(0, "&ast.StmtCase{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CaseTkn", n.CaseTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CaseSeparatorTkn", n.CaseSeparatorTkn) + v.dumpVertexList("Stmts", n.Stmts) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtCatch(n *ast.StmtCatch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtCatch{\n") + v.print(0, "&ast.StmtCatch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CatchTkn", n.CatchTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Types", n.Types) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpVertex("Var", n.Var) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtClass(n *ast.StmtClass) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtClass{\n") + v.print(0, "&ast.StmtClass{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Modifiers", n.Modifiers) + v.dumpToken("ClassTkn", n.ClassTkn) + v.dumpVertex("ClassName", n.ClassName) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Arguments", n.Arguments) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpVertex("Extends", n.Extends) + v.dumpVertex("Implements", n.Implements) + v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtClassConstList{\n") + v.print(0, "&ast.StmtClassConstList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Modifiers", n.Modifiers) + v.dumpToken("ConstTkn", n.ConstTkn) + v.dumpVertexList("Consts", n.Consts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtClassExtends{\n") + v.print(0, "&ast.StmtClassExtends{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ExtendTkn", n.ExtendTkn) + v.dumpVertex("ClassName", n.ClassName) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtClassImplements{\n") + v.print(0, "&ast.StmtClassImplements{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ImplementsTkn", n.ImplementsTkn) + v.dumpVertexList("InterfaceNames", n.InterfaceNames) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtClassMethod{\n") + v.print(0, "&ast.StmtClassMethod{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Modifiers", n.Modifiers) + v.dumpToken("FunctionTkn", n.FunctionTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpVertex("MethodName", n.MethodName) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Params", n.Params) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("ReturnType", n.ReturnType) + v.dumpVertex("Stmt", n.Stmt) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtConstList(n *ast.StmtConstList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtConstList{\n") + v.print(0, "&ast.StmtConstList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ConstTkn", n.ConstTkn) + v.dumpVertexList("Consts", n.Consts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtConstant(n *ast.StmtConstant) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtConstant{\n") + v.print(0, "&ast.StmtConstant{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Name", n.Name) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtContinue(n *ast.StmtContinue) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtContinue{\n") + v.print(0, "&ast.StmtContinue{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ContinueTkn", n.ContinueTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtDeclare{\n") + v.print(0, "&ast.StmtDeclare{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("DeclareTkn", n.DeclareTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Consts", n.Consts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpToken("EndDeclareTkn", n.EndDeclareTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtDefault(n *ast.StmtDefault) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtDefault{\n") + v.print(0, "&ast.StmtDefault{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("DefaultTkn", n.DefaultTkn) + v.dumpToken("CaseSeparatorTkn", n.CaseSeparatorTkn) + v.dumpVertexList("Stmts", n.Stmts) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtDo(n *ast.StmtDo) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtDo{\n") + v.print(0, "&ast.StmtDo{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("DoTkn", n.DoTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpToken("WhileTkn", n.WhileTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") + } func (v *Dump) StmtEcho(n *ast.StmtEcho) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtEcho{\n") + v.print(0, "&ast.StmtEcho{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("EchoTkn", n.EchoTkn) + v.dumpVertexList("Exprs", n.Exprs) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtElse(n *ast.StmtElse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtElse{\n") + v.print(0, "&ast.StmtElse{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("ElseTkn", n.ElseTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtElseIf{\n") + v.print(0, "&ast.StmtElseIf{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("ElseIfTkn", n.ElseIfTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtExpression(n *ast.StmtExpression) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtExpression{\n") + v.print(0, "&ast.StmtExpression{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtFinally(n *ast.StmtFinally) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtFinally{\n") + v.print(0, "&ast.StmtFinally{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("FinallyTkn", n.FinallyTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtFor(n *ast.StmtFor) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtFor{\n") + v.print(0, "&ast.StmtFor{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("ForTkn", n.ForTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Init", n.Init) + v.dumpTokenList("InitSeparatorTkns", n.InitSeparatorTkns) + v.dumpToken("InitSemiColonTkn", n.InitSemiColonTkn) + v.dumpVertexList("Cond", n.Cond) + v.dumpTokenList("CondSeparatorTkns", n.CondSeparatorTkns) + v.dumpToken("CondSemiColonTkn", n.CondSemiColonTkn) + v.dumpVertexList("Loop", n.Loop) + v.dumpTokenList("LoopSeparatorTkns", n.LoopSeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpToken("EndForTkn", n.EndForTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtForeach(n *ast.StmtForeach) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtForeach{\n") + v.print(0, "&ast.StmtForeach{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ForeachTkn", n.ForeachTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("AsTkn", n.AsTkn) + v.dumpVertex("Key", n.Key) + v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) + v.dumpVertex("Var", n.Var) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpToken("EndForeachTkn", n.EndForeachTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtFunction(n *ast.StmtFunction) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtFunction{\n") + v.print(0, "&ast.StmtFunction{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("FunctionTkn", n.FunctionTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpVertex("FunctionName", n.FunctionName) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Params", n.Params) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("ReturnType", n.ReturnType) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtGlobal{\n") + v.print(0, "&ast.StmtGlobal{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("GlobalTkn", n.GlobalTkn) + v.dumpVertexList("Vars", n.Vars) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtGoto(n *ast.StmtGoto) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtGoto{\n") + v.print(0, "&ast.StmtGoto{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("GotoTkn", n.GotoTkn) + v.dumpVertex("Label", n.Label) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtHaltCompiler{\n") + v.print(0, "&ast.StmtHaltCompiler{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("HaltCompilerTkn", n.HaltCompilerTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtIf(n *ast.StmtIf) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtIf{\n") + v.print(0, "&ast.StmtIf{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("IfTkn", n.IfTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpVertexList("ElseIf", n.ElseIf) + v.dumpVertex("Else", n.Else) + v.dumpToken("EndIfTkn", n.EndIfTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtInlineHtml{\n") + v.print(0, "&ast.StmtInlineHtml{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("InlineHtmlTkn", n.InlineHtmlTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtInterface(n *ast.StmtInterface) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtInterface{\n") + v.print(0, "&ast.StmtInterface{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("InterfaceTkn", n.InterfaceTkn) + v.dumpVertex("InterfaceName", n.InterfaceName) + v.dumpVertex("Extends", n.Extends) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtInterfaceExtends{\n") + v.print(0, "&ast.StmtInterfaceExtends{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ExtendsTkn", n.ExtendsTkn) + v.dumpVertexList("InterfaceNames", n.InterfaceNames) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtLabel(n *ast.StmtLabel) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtLabel{\n") + v.print(0, "&ast.StmtLabel{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("LabelName", n.LabelName) + v.dumpToken("ColonTkn", n.ColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtNamespace{\n") + v.print(0, "&ast.StmtNamespace{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("NsTkn", n.NsTkn) + v.dumpVertex("Name", n.Name) + v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtNop(n *ast.StmtNop) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtNop{\n") + v.print(0, "&ast.StmtNop{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtProperty(n *ast.StmtProperty) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtProperty{\n") + v.print(0, "&ast.StmtProperty{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtPropertyList{\n") + v.print(0, "&ast.StmtPropertyList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Modifiers", n.Modifiers) + v.dumpVertex("Type", n.Type) + v.dumpVertexList("Properties", n.Properties) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtReturn(n *ast.StmtReturn) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtReturn{\n") + v.print(0, "&ast.StmtReturn{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ReturnTkn", n.ReturnTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtStatic(n *ast.StmtStatic) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtStatic{\n") + v.print(0, "&ast.StmtStatic{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("StaticTkn", n.StaticTkn) + v.dumpVertexList("Vars", n.Vars) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtStaticVar{\n") + v.print(0, "&ast.StmtStaticVar{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtStmtList{\n") + v.print(0, "&ast.StmtStmtList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtSwitch{\n") + v.print(0, "&ast.StmtSwitch{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("SwitchTkn", n.SwitchTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpToken("CaseSeparatorTkn", n.CaseSeparatorTkn) + v.dumpVertexList("CaseList", n.CaseList) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + v.dumpToken("EndSwitchTkn", n.EndSwitchTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtThrow(n *ast.StmtThrow) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtThrow{\n") + v.print(0, "&ast.StmtThrow{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ThrowTkn", n.ThrowTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTrait(n *ast.StmtTrait) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTrait{\n") + v.print(0, "&ast.StmtTrait{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("TraitTkn", n.TraitTkn) + v.dumpVertex("TraitName", n.TraitName) + v.dumpVertex("Extends", n.Extends) + v.dumpVertex("Implements", n.Implements) + v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTraitAdaptationList{\n") + v.print(0, "&ast.StmtTraitAdaptationList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Adaptations", n.Adaptations) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTraitMethodRef{\n") + v.print(0, "&ast.StmtTraitMethodRef{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Trait", n.Trait) + v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) + v.dumpVertex("Method", n.Method) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTraitUse{\n") + v.print(0, "&ast.StmtTraitUse{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("UseTkn", n.UseTkn) + v.dumpVertexList("Traits", n.Traits) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpVertex("Adaptations", n.Adaptations) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTraitUseAlias{\n") + v.print(0, "&ast.StmtTraitUseAlias{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Ref", n.Ref) + v.dumpToken("AsTkn", n.AsTkn) + v.dumpVertex("Modifier", n.Modifier) + v.dumpVertex("Alias", n.Alias) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTraitUsePrecedence{\n") + v.print(0, "&ast.StmtTraitUsePrecedence{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Ref", n.Ref) + v.dumpToken("InsteadofTkn", n.InsteadofTkn) + v.dumpVertexList("Insteadof", n.Insteadof) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtTry(n *ast.StmtTry) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtTry{\n") + v.print(0, "&ast.StmtTry{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("TryTkn", n.TryTkn) + v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpVertexList("Catches", n.Catches) + v.dumpVertex("Finally", n.Finally) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtUnset(n *ast.StmtUnset) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtUnset{\n") + v.print(0, "&ast.StmtUnset{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("UnsetTkn", n.UnsetTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Vars", n.Vars) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtUse(n *ast.StmtUse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtUse{\n") - v.printToken("UseTkn", n.UseTkn) - v.printToken("SemiColonTkn", n.SemiColonTkn) + v.print(0, "&ast.StmtUse{\n") + v.indent++ + v.dumpPosition(n.Position) + v.dumpToken("UseTkn", n.UseTkn) + v.dumpVertex("Type", n.Type) + v.dumpVertexList("UseDeclarations", n.UseDeclarations) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtGroupUse{\n") - 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) + v.print(0, "&ast.StmtGroupUse{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("UseTkn", n.UseTkn) + v.dumpVertex("Type", n.Type) + v.dumpToken("LeadingNsSeparatorTkn", n.LeadingNsSeparatorTkn) + v.dumpVertex("Prefix", n.Prefix) + v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("UseDeclarations", n.UseDeclarations) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtUseDeclaration{\n") - v.printToken("NsSeparatorTkn", n.NsSeparatorTkn) - v.printToken("AsTkn", n.AsTkn) + v.print(0, "&ast.StmtUseDeclaration{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Type", n.Type) + v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) + v.dumpVertex("Use", n.Use) + v.dumpToken("AsTkn", n.AsTkn) + v.dumpVertex("Alias", n.Alias) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) StmtWhile(n *ast.StmtWhile) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtWhile{\n") + v.print(0, "&ast.StmtWhile{\n") + v.indent++ - if n.Alt { - v.printIndent(v.indent) - v.print("Alt: true,\n") - } + v.dumpPosition(n.Position) + v.dumpToken("WhileTkn", n.WhileTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Cond", n.Cond) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("Stmt", n.Stmt) + v.dumpToken("EndWhileTkn", n.EndWhileTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprArray(n *ast.ExprArray) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprArray{\n") + v.print(0, "&ast.ExprArray{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ArrayTkn", n.ArrayTkn) + v.dumpToken("OpenBracketTkn", n.OpenBracketTkn) + v.dumpVertexList("Items", n.Items) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseBracketTkn", n.CloseBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprArrayDimFetch{\n") + v.print(0, "&ast.ExprArrayDimFetch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("OpenBracketTkn", n.OpenBracketTkn) + v.dumpVertex("Dim", n.Dim) + v.dumpToken("CloseBracketTkn", n.CloseBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprArrayItem{\n") + v.print(0, "&ast.ExprArrayItem{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("EllipsisTkn", n.EllipsisTkn) + v.dumpVertex("Key", n.Key) + v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) + v.dumpVertex("Val", n.Val) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprArrowFunction{\n") + v.print(0, "&ast.ExprArrowFunction{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("StaticTkn", n.StaticTkn) + v.dumpToken("FnTkn", n.FnTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Params", n.Params) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("ReturnType", n.ReturnType) + v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBitwiseNot{\n") + v.print(0, "&ast.ExprBitwiseNot{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("TildaTkn", n.TildaTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBooleanNot{\n") + v.print(0, "&ast.ExprBooleanNot{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ExclamationTkn", n.ExclamationTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprClassConstFetch{\n") + v.print(0, "&ast.ExprClassConstFetch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Class", n.Class) + v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) + v.dumpVertex("ConstantName", n.ConstantName) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprClone(n *ast.ExprClone) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprClone{\n") + v.print(0, "&ast.ExprClone{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CloneTkn", n.CloneTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprClosure(n *ast.ExprClosure) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprClosure{\n") + v.print(0, "&ast.ExprClosure{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("StaticTkn", n.StaticTkn) + v.dumpToken("FunctionTkn", n.FunctionTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Params", n.Params) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpVertex("ClosureUse", n.ClosureUse) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("ReturnType", n.ReturnType) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Stmts", n.Stmts) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprClosureUse{\n") + v.print(0, "&ast.ExprClosureUse{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("UseTkn", n.UseTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Uses", n.Uses) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprConstFetch{\n") + v.print(0, "&ast.ExprConstFetch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Const", n.Const) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprEmpty{\n") + v.print(0, "&ast.ExprEmpty{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("EmptyTkn", n.EmptyTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprErrorSuppress{\n") + v.print(0, "&ast.ExprErrorSuppress{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("AtTkn", n.AtTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprEval(n *ast.ExprEval) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprEval{\n") + v.print(0, "&ast.ExprEval{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("EvalTkn", n.EvalTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprExit(n *ast.ExprExit) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprExit{\n") + v.print(0, "&ast.ExprExit{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("DieTkn", n.DieTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprFunctionCall{\n") + v.print(0, "&ast.ExprFunctionCall{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Function", n.Function) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Arguments", n.Arguments) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprInclude(n *ast.ExprInclude) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprInclude{\n") + v.print(0, "&ast.ExprInclude{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprIncludeOnce{\n") + v.print(0, "&ast.ExprIncludeOnce{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprInstanceOf{\n") + v.print(0, "&ast.ExprInstanceOf{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Expr", n.Expr) + v.dumpToken("InstanceOfTkn", n.InstanceOfTkn) + v.dumpVertex("Class", n.Class) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprIsset(n *ast.ExprIsset) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprIsset{\n") + v.print(0, "&ast.ExprIsset{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("IssetTkn", n.IssetTkn) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Vars", n.Vars) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprList(n *ast.ExprList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprList{\n") + v.print(0, "&ast.ExprList{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("ListTkn", n.ListTkn) + v.dumpToken("OpenBracketTkn", n.OpenBracketTkn) + v.dumpVertexList("Items", n.Items) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseBracketTkn", n.CloseBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprMethodCall{\n") + v.print(0, "&ast.ExprMethodCall{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn) + v.dumpVertex("Method", n.Method) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Arguments", n.Arguments) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprNew(n *ast.ExprNew) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprNew{\n") + v.print(0, "&ast.ExprNew{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("NewTkn", n.NewTkn) + v.dumpVertex("Class", n.Class) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Arguments", n.Arguments) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPostDec{\n") + v.print(0, "&ast.ExprPostDec{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("DecTkn", n.DecTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPostInc{\n") + v.print(0, "&ast.ExprPostInc{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("IncTkn", n.IncTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPreDec{\n") + v.print(0, "&ast.ExprPreDec{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("DecTkn", n.DecTkn) + v.dumpVertex("Var", n.Var) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPreInc{\n") + v.print(0, "&ast.ExprPreInc{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("IncTkn", n.IncTkn) + v.dumpVertex("Var", n.Var) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPrint(n *ast.ExprPrint) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPrint{\n") + v.print(0, "&ast.ExprPrint{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("PrintTkn", n.PrintTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprPropertyFetch{\n") + v.print(0, "&ast.ExprPropertyFetch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn) + v.dumpVertex("Property", n.Property) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprReference(n *ast.ExprReference) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprReference{\n") + v.print(0, "&ast.ExprReference{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpVertex("Var", n.Var) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprRequire(n *ast.ExprRequire) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprRequire{\n") + v.print(0, "&ast.ExprRequire{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("RequireTkn", n.RequireTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprRequireOnce{\n") + v.print(0, "&ast.ExprRequireOnce{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("RequireOnceTkn", n.RequireOnceTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprShellExec{\n") + v.print(0, "&ast.ExprShellExec{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenBacktickTkn", n.OpenBacktickTkn) + v.dumpVertexList("Parts", n.Parts) + v.dumpToken("CloseBacktickTkn", n.CloseBacktickTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprStaticCall{\n") + v.print(0, "&ast.ExprStaticCall{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Class", n.Class) + v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) + v.dumpVertex("Call", n.Call) + v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) + v.dumpVertexList("Arguments", n.Arguments) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprStaticPropertyFetch{\n") + v.print(0, "&ast.ExprStaticPropertyFetch{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Class", n.Class) + v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) + v.dumpVertex("Property", n.Property) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprTernary(n *ast.ExprTernary) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprTernary{\n") + v.print(0, "&ast.ExprTernary{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Condition", n.Condition) + v.dumpToken("QuestionTkn", n.QuestionTkn) + v.dumpVertex("IfTrue", n.IfTrue) + v.dumpToken("ColonTkn", n.ColonTkn) + v.dumpVertex("IfFalse", n.IfFalse) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprUnaryMinus{\n") + v.print(0, "&ast.ExprUnaryMinus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("MinusTkn", n.MinusTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprUnaryPlus{\n") + v.print(0, "&ast.ExprUnaryPlus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("PlusTkn", n.PlusTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprVariable(n *ast.ExprVariable) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprVariable{\n") + v.print(0, "&ast.ExprVariable{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("DollarTkn", n.DollarTkn) + v.dumpVertex("VarName", n.VarName) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprYield(n *ast.ExprYield) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprYield{\n") + v.print(0, "&ast.ExprYield{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("YieldTkn", n.YieldTkn) + v.dumpVertex("Key", n.Key) + v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) + v.dumpVertex("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprYieldFrom{\n") + v.print(0, "&ast.ExprYieldFrom{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("YieldFromTkn", n.YieldFromTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssign(n *ast.ExprAssign) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssign{\n") + v.print(0, "&ast.ExprAssign{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignReference{\n") + v.print(0, "&ast.ExprAssignReference{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignBitwiseAnd{\n") + v.print(0, "&ast.ExprAssignBitwiseAnd{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignBitwiseOr{\n") + v.print(0, "&ast.ExprAssignBitwiseOr{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignBitwiseXor{\n") + v.print(0, "&ast.ExprAssignBitwiseXor{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignCoalesce{\n") + v.print(0, "&ast.ExprAssignCoalesce{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignConcat{\n") + v.print(0, "&ast.ExprAssignConcat{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignDiv{\n") + v.print(0, "&ast.ExprAssignDiv{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignMinus{\n") + v.print(0, "&ast.ExprAssignMinus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignMod{\n") + v.print(0, "&ast.ExprAssignMod{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignMul{\n") + v.print(0, "&ast.ExprAssignMul{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignPlus{\n") + v.print(0, "&ast.ExprAssignPlus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignPow{\n") + v.print(0, "&ast.ExprAssignPow{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignShiftLeft{\n") + v.print(0, "&ast.ExprAssignShiftLeft{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprAssignShiftRight{\n") + v.print(0, "&ast.ExprAssignShiftRight{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Var", n.Var) + v.dumpToken("EqualTkn", n.EqualTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryBitwiseAnd{\n") + v.print(0, "&ast.ExprBinaryBitwiseAnd{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryBitwiseOr{\n") + v.print(0, "&ast.ExprBinaryBitwiseOr{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryBitwiseXor{\n") + v.print(0, "&ast.ExprBinaryBitwiseXor{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryBooleanAnd{\n") + v.print(0, "&ast.ExprBinaryBooleanAnd{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryBooleanOr{\n") + v.print(0, "&ast.ExprBinaryBooleanOr{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryCoalesce{\n") + v.print(0, "&ast.ExprBinaryCoalesce{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryConcat{\n") + v.print(0, "&ast.ExprBinaryConcat{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryDiv{\n") + v.print(0, "&ast.ExprBinaryDiv{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryEqual{\n") + v.print(0, "&ast.ExprBinaryEqual{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryGreater{\n") + v.print(0, "&ast.ExprBinaryGreater{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryGreaterOrEqual{\n") + v.print(0, "&ast.ExprBinaryGreaterOrEqual{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryIdentical{\n") + v.print(0, "&ast.ExprBinaryIdentical{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryLogicalAnd{\n") + v.print(0, "&ast.ExprBinaryLogicalAnd{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryLogicalOr{\n") + v.print(0, "&ast.ExprBinaryLogicalOr{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryLogicalXor{\n") + v.print(0, "&ast.ExprBinaryLogicalXor{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryMinus{\n") + v.print(0, "&ast.ExprBinaryMinus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryMod{\n") + v.print(0, "&ast.ExprBinaryMod{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryMul{\n") + v.print(0, "&ast.ExprBinaryMul{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryNotEqual{\n") + v.print(0, "&ast.ExprBinaryNotEqual{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryNotIdentical{\n") + v.print(0, "&ast.ExprBinaryNotIdentical{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryPlus{\n") + v.print(0, "&ast.ExprBinaryPlus{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryPow{\n") + v.print(0, "&ast.ExprBinaryPow{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryShiftLeft{\n") + v.print(0, "&ast.ExprBinaryShiftLeft{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinaryShiftRight{\n") + v.print(0, "&ast.ExprBinaryShiftRight{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinarySmaller{\n") + v.print(0, "&ast.ExprBinarySmaller{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinarySmallerOrEqual{\n") + v.print(0, "&ast.ExprBinarySmallerOrEqual{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprBinarySpaceship{\n") + v.print(0, "&ast.ExprBinarySpaceship{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertex("Left", n.Left) + v.dumpToken("OpTkn", n.OpTkn) + v.dumpVertex("Right", n.Right) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastArray{\n") + v.print(0, "&ast.ExprCastArray{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastBool{\n") + v.print(0, "&ast.ExprCastBool{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastDouble{\n") + v.print(0, "&ast.ExprCastDouble{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastInt{\n") + v.print(0, "&ast.ExprCastInt{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastObject{\n") + v.print(0, "&ast.ExprCastObject{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastString(n *ast.ExprCastString) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastString{\n") + v.print(0, "&ast.ExprCastString{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ExprCastUnset{\n") + v.print(0, "&ast.ExprCastUnset{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("CastTkn", n.CastTkn) + v.dumpVertex("Expr", n.Expr) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarDnumber{\n") + v.print(0, "&ast.ScalarDnumber{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("NumberTkn", n.NumberTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarEncapsed{\n") + v.print(0, "&ast.ScalarEncapsed{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenQoteTkn", n.OpenQoteTkn) + v.dumpVertexList("Parts", n.Parts) + v.dumpToken("CloseQoteTkn", n.CloseQoteTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarEncapsedStringPart{\n") + v.print(0, "&ast.ScalarEncapsedStringPart{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("EncapsedStrTkn", n.EncapsedStrTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarHeredoc{\n") + v.print(0, "&ast.ScalarHeredoc{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenHeredocTkn", n.OpenHeredocTkn) + v.dumpVertexList("Parts", n.Parts) + v.dumpToken("CloseHeredocTkn", n.CloseHeredocTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarLnumber{\n") + v.print(0, "&ast.ScalarLnumber{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("NumberTkn", n.NumberTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarMagicConstant{\n") + v.print(0, "&ast.ScalarMagicConstant{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("MagicConstTkn", n.MagicConstTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ScalarString(n *ast.ScalarString) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ScalarString{\n") + v.print(0, "&ast.ScalarString{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("MinusTkn", n.MinusTkn) + v.dumpToken("StringTkn", n.StringTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) NameName(n *ast.NameName) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.NameName{\n") + v.print(0, "&ast.NameName{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpVertexList("Parts", n.Parts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.NameFullyQualified{\n") + v.print(0, "&ast.NameFullyQualified{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) + v.dumpVertexList("Parts", n.Parts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) NameRelative(n *ast.NameRelative) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.NameRelative{\n") + v.print(0, "&ast.NameRelative{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("NsTkn", n.NsTkn) + v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) + v.dumpVertexList("Parts", n.Parts) + v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) NameNamePart(n *ast.NameNamePart) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.NameNamePart{\n") + v.print(0, "&ast.NameNamePart{\n") + v.indent++ - v.printIndent(v.indent) - v.print(fmt.Sprintf("Value: []byte(%q),\n", n.Value)) + v.dumpPosition(n.Position) + v.dumpToken("StringTkn", n.StringTkn) + v.dumpValue("Value", n.Value) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ParserBrackets(n *ast.ParserBrackets) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.ParserBrackets{\n") + v.print(0, "&ast.ParserBrackets{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenBracketTkn", n.OpenBracketTkn) + v.dumpVertex("Child", n.Child) + v.dumpToken("CloseBracketTkn", n.CloseBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") } func (v *Dump) ParserSeparatedList(n *ast.ParserSeparatedList) { diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index 42283dc..cc9fb09 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -1,62 +1,76 @@ package visitor_test import ( - "os" + "bytes" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" + "testing" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" "github.com/z7zmey/php-parser/pkg/ast/visitor" - "github.com/z7zmey/php-parser/pkg/token" ) -func ExampleDump() { - stxTree := &ast.Root{ +func TestDumper_root(t *testing.T) { + o := bytes.NewBufferString("") + + p := visitor.NewDump(o) + n := &ast.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, + }, Stmts: []ast.Vertex{ - &ast.Identifier{}, - &ast.Parameter{ - Var: &ast.ExprVariable{}, - }, - &ast.StmtInlineHtml{ - Value: []byte("foo"), - }, + &ast.StmtNop{}, }, EndTkn: &token.Token{ - ID: token.T_WHITESPACE, - Value: []byte(" "), + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, + }, + }, + }, }, } + n.Accept(p) - traverser.NewDFS(visitor.NewDump(os.Stdout)).Traverse(stxTree) + expected := `&ast.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{ + }, + }, + EndTkn: &token.Token{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 2, + StartPos: 3, + EndPos: 4, + }, + }, + }, + }, +}, +` + actual := o.String() - //output: - //&ast.Root{ - // Node: ast.Node{ - // Tokens: token.Collection{ - // token.Start: []*token.Token{ - // { - // ID: token.T_WHITESPACE, - // Value: []byte(" "), - // }, - // }, - // }, - // Position: &position.Position{ - // StartLine: 1, - // EndLine: 1, - // StartPos: 0, - // EndPos: 1, - // }, - // }, - // Stmts: []ast.Vertex{ - // &ast.Identifier{ - // Value: []byte(""), - // }, - // &ast.Parameter{ - // Var: &ast.ExprVariable{ - // }, - // }, - // &ast.StmtInlineHtml{ - // Value: []byte("foo"), - // }, - // }, - //} + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index e5ec818..fa7043a 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -117,7 +117,7 @@ func TestResolveNew(t *testing.T) { }, }, &ast.ExprNew{ - Class: nameBC, + Class: nameBC, }, }, } @@ -227,7 +227,7 @@ func TestResolveFunctionCall(t *testing.T) { }, }, &ast.ExprFunctionCall{ - Function: nameB, + Function: nameB, }, }, } @@ -309,10 +309,10 @@ func TestResolveGroupUse(t *testing.T) { Const: nameC, }, &ast.ExprFunctionCall{ - Function: nameF, + Function: nameF, }, &ast.ExprFunctionCall{ - Function: nameE, + Function: nameE, }, }, } @@ -649,8 +649,8 @@ func TestResolveNamespaces(t *testing.T) { }, }, &ast.ExprStaticCall{ - Class: nameFG, - Call: &ast.Identifier{Value: []byte("foo")}, + Class: nameFG, + Call: &ast.Identifier{Value: []byte("foo")}, }, &ast.StmtNamespace{ Stmts: []ast.Vertex{}, @@ -666,12 +666,12 @@ func TestResolveNamespaces(t *testing.T) { }, }, &ast.ExprStaticCall{ - Class: relativeNameCE, - Call: &ast.Identifier{Value: []byte("foo")}, + Class: relativeNameCE, + Call: &ast.Identifier{Value: []byte("foo")}, }, &ast.ExprStaticCall{ - Class: nameCF, - Call: &ast.Identifier{Value: []byte("foo")}, + Class: nameCF, + Call: &ast.Identifier{Value: []byte("foo")}, }, }, }, @@ -697,8 +697,8 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.ExprStaticCall{ - Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, - Call: &ast.Identifier{Value: []byte("foo")}, + Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Call: &ast.Identifier{Value: []byte("foo")}, }, }, } @@ -917,20 +917,20 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { Stmts: []ast.Vertex{ &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ - Class: nameSelf, - Call: &ast.Identifier{Value: []byte("func")}, + Class: nameSelf, + Call: &ast.Identifier{Value: []byte("func")}, }, }, &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ - Class: nameStatic, - Call: &ast.Identifier{Value: []byte("func")}, + Class: nameStatic, + Call: &ast.Identifier{Value: []byte("func")}, }, }, &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ - Class: nameParent, - Call: &ast.Identifier{Value: []byte("func")}, + Class: nameParent, + Call: &ast.Identifier{Value: []byte("func")}, }, }, }, From 45ded326d0d2c10343cec99af68ddf929aca1d8d Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 17:17:13 +0200 Subject: [PATCH 110/140] [refactoring] remove ParserSeparatedList from visitor --- pkg/ast/ast.go | 1 - pkg/ast/node.go | 2 +- pkg/ast/visitor/dump.go | 4 ---- pkg/ast/visitor/null.go | 4 ---- pkg/ast/visitor/printer.go | 4 ---- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index c689909..fad100c 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -187,5 +187,4 @@ type NodeVisitor interface { NameNamePart(n *NameNamePart) ParserBrackets(n *ParserBrackets) - ParserSeparatedList(n *ParserSeparatedList) } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 4089027..4108daa 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -2700,7 +2700,7 @@ type ParserSeparatedList struct { } func (n *ParserSeparatedList) Accept(v NodeVisitor) { - v.ParserSeparatedList(n) + // do nothing } func (n *ParserSeparatedList) GetPosition() *position.Position { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 7ea2622..5ddc306 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -2369,7 +2369,3 @@ func (v *Dump) ParserBrackets(n *ast.ParserBrackets) { v.indent-- v.print(v.indent, "},\n") } - -func (v *Dump) ParserSeparatedList(n *ast.ParserSeparatedList) { - // do nothing -} diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 92b9b55..bba280c 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -657,7 +657,3 @@ func (v *Null) NameNamePart(_ *ast.NameNamePart) { func (v *Null) ParserBrackets(_ *ast.ParserBrackets) { // do nothing } - -func (v *Null) ParserSeparatedList(_ *ast.ParserSeparatedList) { - // do nothing -} diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 5d49077..3388399 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -1233,7 +1233,3 @@ func (p *printer) ParserBrackets(n *ast.ParserBrackets) { p.printNode(n.Child) p.printToken(n.CloseBracketTkn, nil) } - -func (p *printer) ParserSeparatedList(n *ast.ParserSeparatedList) { - // do nothing -} From 5291529a37ff01cdc9a6c1e80c26769dde56118f Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 17:29:22 +0200 Subject: [PATCH 111/140] [refactoring] fix typo --- internal/php5/php5.go | Bin 264823 -> 264908 bytes internal/php5/php5.y | 44 ++++++++--------- internal/php7/php7.go | Bin 219258 -> 219381 bytes internal/php7/php7.y | 90 +++++++++++++++++------------------ pkg/ast/node.go | 86 ++++++++++++++++----------------- pkg/ast/visitor/dump.go | 24 +++++----- pkg/ast/visitor/dump_test.go | 2 +- pkg/ast/visitor/printer.go | 52 ++++++++++---------- 8 files changed, 149 insertions(+), 149 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 219f8fc92b6bc597f1d42f5e4c02f3d392fba6ba..6dd0b6554b8c461c03ad75f9c75fb816d7f5ef68 100644 GIT binary patch delta 421 zcma)&PbhE!pd7i!>Dg7#~8wIQf7`YW12TD?<`UV%z zi^9pzNjP~EKn=AssN5|{%Zovwtre?0+{Z8r4ykjYa_jSoY9`*LoqEuUeDiWe@ypZs zn1Sa9we)I{pC8~f(?Rs~R#^S?ElW53Pw+Dmhnp8gp)heNT=c!5j^$&kB)VD)=;W6h; z?BTDuc#8J5|L$Hf!ooDd@~(r%I2u`=K(~k{nNP|Pb1l{{rsL3T(d5i*j9d58!@&>~ KvuREarM>{y{g&zRp9#+frc%Ny;@TpnWU!YW-!pmL)8A=B)lFLkRB>PqP%YyuW`us8>3fzjN>68e%&5A3tq!BL&Ggq9jH%NZ z524t>Z^$G!{bDMk#Pkab7PWSr+bYLEc`}RB|=l0&YjE5wr$LwVE-o9Wv<4#5}b2^YIF@16clkoHh z%8WAGKkj5?>?Fcv?YEtow%>MUK4Un&po!6K`h#Xh{^<^xj4aH7`6bggerA-LURTb{ XH=XkgFdX_b8TlClxBHhd*G>Td=1hKH diff --git a/internal/php5/php5.y b/internal/php5/php5.y index f244655..67e127a 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -366,19 +366,19 @@ top_statement: Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, - OpenCurlyBracket: $3, - Stmts: $4, - CloseCurlyBracket: $5, + OpenCurlyBracketTkn: $3, + Stmts: $4, + CloseCurlyBracketTkn: $5, } } | T_NAMESPACE '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - NsTkn: $1, - OpenCurlyBracket: $2, - Stmts: $3, - CloseCurlyBracket: $4, + NsTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, } } | T_USE use_declarations ';' @@ -769,9 +769,9 @@ unticked_statement: { $$ = &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenCurlyBracket: $1, - Stmts: $2, - CloseCurlyBracket: $3, + OpenCurlyBracketTkn: $1, + Stmts: $2, + CloseCurlyBracketTkn: $3, } } | T_IF parenthesis_expr statement elseif_list else_single @@ -1045,12 +1045,12 @@ unticked_statement: $$ = &ast.StmtTry{ Position: pos, - TryTkn: $1, - OpenCurlyBracket: $2, - Stmts: $3, - CloseCurlyBracket: $4, - Catches: $5, - Finally: $6, + TryTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, + Catches: $5, + Finally: $6, } } | T_THROW expr ';' @@ -2353,9 +2353,9 @@ method_body: { $$ = &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenCurlyBracket: $1, - Stmts: $2, - CloseCurlyBracket: $3, + OpenCurlyBracketTkn: $1, + Stmts: $2, + CloseCurlyBracketTkn: $3, } } ; @@ -4498,9 +4498,9 @@ scalar: { $$ = &ast.ScalarEncapsed{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenQoteTkn: $1, - Parts: $2, - CloseQoteTkn: $3, + OpenQuoteTkn: $1, + Parts: $2, + CloseQuoteTkn: $3, } } | T_START_HEREDOC encaps_list T_END_HEREDOC diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 7e9dd54a0e260e7a8a18ba547b7b3c3859391285..e2b0b1acbe29200fb2546adbc6ef6474c0ec3ca8 100644 GIT binary patch delta 642 zcmbu6Pe_w-7{~cOxg@uDzG^Fl<`M!sM1-**?T-Z#>|k4n6dmeP;Atb~r5*GV7(~4t z<~JxX-jh(0E&sQ`zaZN044I@MhV2Z=F>`7M3xW}rC7-upDc+~%z!RQgj^O|h^q{+VqZ}VFo`?*|I*y5T# z_OuDRnE8RAKQxWpK~o-V+SANR0bT4Kkr16xG;?r90^Ba3&1_Pf)$Mk_A1XHVBwiam zmOoX*Dh$hB)@0g4hha6)d-=qJZCDHA>e7a*n5x%cZFM$SJ##n~FpcNR>fdJ{K?`-B>HBZYnS+qeI&JYJVxf9Jd8#(n`YI`R?# delta 638 zcma)(F=!KU7{z(tMN2hzxu{K(rcI+nCyS(_)bp?n6rBt?!9t0UICKyS4b~#H(ArVK zP45jN3L;pG@dDzZLv6v$QlbztNp;adL>DbMRR1wn3L-du|L=Xg_kRDc75%%XUw(`$ z7Azu*7-#C(!9+&Wd8>|AE|=7ZRYbXN;X1FiXmNT+agv3w7NoZ%Ar^-abRVLF>ouia zs6pqEyNENrrmlV*g6_}R7(e*y)_s9vywfc~X5L5#%?SkP%^}3+HD$I~Lc)Jn!c>Zd z8|Y+iLOm7-VDQWk%zt>q7RvWhTY#y2$8Gb0=7;eA?!?KVuYlGOKWipcN2+nE2LeETa1 z2d(7fR+s&XN#gcds||gPE^!{4P)sAyK zC#g+{9_6Hso+Ep?vMh%=FsQH{aHQ9bDKHz8L9;4p+E#OEF!WNQ{NzZaQ9r_G9@=Q6 z8`v9|A~wP*`qF!JH@+$C+G_KstYIaSf7Pv@l2lN&QmYSZ+qPi diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 1db8b0a..b69d0a3 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -450,19 +450,19 @@ top_statement: Parts: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }, - OpenCurlyBracket: $3, - Stmts: $4, - CloseCurlyBracket: $5, + OpenCurlyBracketTkn: $3, + Stmts: $4, + CloseCurlyBracketTkn: $5, } } | T_NAMESPACE '{' top_statement_list '}' { $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - NsTkn: $1, - OpenCurlyBracket: $2, - Stmts: $3, - CloseCurlyBracket: $4, + NsTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracket: $4, } } | T_USE mixed_group_use_declaration ';' @@ -813,9 +813,9 @@ statement: { $$ = &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenCurlyBracket: $1, - Stmts: $2, - CloseCurlyBracket: $3, + OpenCurlyBracketTkn: $1, + Stmts: $2, + CloseCurlyBracketTkn: $3, } } | if_stmt @@ -1009,12 +1009,12 @@ statement: $$ = &ast.StmtTry{ Position: pos, - TryTkn: $1, - OpenCurlyBracket: $2, - Stmts: $3, - CloseCurlyBracket: $4, - Catches: $5, - Finally: $6, + TryTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, + Catches: $5, + Finally: $6, } } | T_THROW expr ';' @@ -1194,11 +1194,11 @@ class_declaration_statement: IdentifierTkn: $3, Value: $3.Value, }, - Extends: $4, - Implements: $5, - OpenCurlyBracket: $7, - Stmts: $8, - CloseCurlyBracket: $9, + Extends: $4, + Implements: $5, + OpenCurlyBracketTkn: $7, + Stmts: $8, + CloseCurlyBracketTkn: $9, } } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' @@ -1211,11 +1211,11 @@ class_declaration_statement: IdentifierTkn: $2, Value: $2.Value, }, - Extends: $3, - Implements: $4, - OpenCurlyBracket: $6, - Stmts: $7, - CloseCurlyBracket: $8, + Extends: $3, + Implements: $4, + OpenCurlyBracketTkn: $6, + Stmts: $7, + CloseCurlyBracketTkn: $8, } } ; @@ -1261,9 +1261,9 @@ trait_declaration_statement: IdentifierTkn: $2, Value: $2.Value, }, - OpenCurlyBracket: $4, - Stmts: $5, - CloseCurlyBracket: $6, + OpenCurlyBracketTkn: $4, + Stmts: $5, + CloseCurlyBracketTkn: $6, } } ; @@ -2191,9 +2191,9 @@ method_body: { $$ = &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenCurlyBracket: $1, - Stmts: $2, - CloseCurlyBracket: $3, + OpenCurlyBracketTkn: $1, + Stmts: $2, + CloseCurlyBracketTkn: $3, } } ; @@ -2441,16 +2441,16 @@ anonymous_class: { $$ = &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), - ClassTkn: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, - Extends: $3, - Implements: $4, - OpenCurlyBracket: $6, - Stmts: $7, - CloseCurlyBracket: $8, + ClassTkn: $1, + OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + Extends: $3, + Implements: $4, + OpenCurlyBracketTkn: $6, + Stmts: $7, + CloseCurlyBracketTkn: $8, } } ; @@ -3550,9 +3550,9 @@ scalar: { $$ = &ast.ScalarEncapsed{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenQoteTkn: $1, - Parts: $2, - CloseQoteTkn: $3, + OpenQuoteTkn: $1, + Parts: $2, + CloseQuoteTkn: $3, } } | T_START_HEREDOC encaps_list T_END_HEREDOC diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 4108daa..7ba8fc6 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -102,10 +102,10 @@ func (n *ScalarDnumber) GetPosition() *position.Position { // ScalarEncapsed node type ScalarEncapsed struct { - Position *position.Position - OpenQoteTkn *token.Token - Parts []Vertex - CloseQoteTkn *token.Token + Position *position.Position + OpenQuoteTkn *token.Token + Parts []Vertex + CloseQuoteTkn *token.Token } func (n *ScalarEncapsed) Accept(v NodeVisitor) { @@ -250,19 +250,19 @@ func (n *StmtCatch) GetPosition() *position.Position { // StmtClass node type StmtClass struct { - Position *position.Position - Modifiers []Vertex - ClassTkn *token.Token - ClassName Vertex - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token - Extends Vertex - Implements Vertex - OpenCurlyBracket *token.Token - Stmts []Vertex - CloseCurlyBracket *token.Token + Position *position.Position + Modifiers []Vertex + ClassTkn *token.Token + ClassName Vertex + OpenParenthesisTkn *token.Token + Arguments []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token + Extends Vertex + Implements Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtClass) Accept(v NodeVisitor) { @@ -761,13 +761,13 @@ func (n *StmtLabel) GetPosition() *position.Position { // StmtNamespace node type StmtNamespace struct { - Position *position.Position - NsTkn *token.Token - Name Vertex - OpenCurlyBracket *token.Token - Stmts []Vertex - CloseCurlyBracket *token.Token - SemiColonTkn *token.Token + Position *position.Position + NsTkn *token.Token + Name Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtNamespace) Accept(v NodeVisitor) { @@ -877,10 +877,10 @@ func (n *StmtStaticVar) GetPosition() *position.Position { // StmtStmtList node type StmtStmtList struct { - Position *position.Position - OpenCurlyBracket *token.Token - Stmts []Vertex - CloseCurlyBracket *token.Token + Position *position.Position + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtStmtList) Accept(v NodeVisitor) { @@ -934,14 +934,14 @@ func (n *StmtThrow) GetPosition() *position.Position { // StmtTrait node type StmtTrait struct { - Position *position.Position - TraitTkn *token.Token - TraitName Vertex - Extends Vertex - Implements Vertex - OpenCurlyBracket *token.Token - Stmts []Vertex - CloseCurlyBracket *token.Token + Position *position.Position + TraitTkn *token.Token + TraitName Vertex + Extends Vertex + Implements Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtTrait) Accept(v NodeVisitor) { @@ -1039,13 +1039,13 @@ func (n *StmtTraitUsePrecedence) GetPosition() *position.Position { // StmtTry node type StmtTry struct { - Position *position.Position - TryTkn *token.Token - OpenCurlyBracket *token.Token - Stmts []Vertex - CloseCurlyBracket *token.Token - Catches []Vertex - Finally Vertex + Position *position.Position + TryTkn *token.Token + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token + Catches []Vertex + Finally Vertex } func (n *StmtTry) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 5ddc306..8366e52 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -288,9 +288,9 @@ func (v *Dump) StmtClass(n *ast.StmtClass) { v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) v.dumpVertex("Extends", n.Extends) v.dumpVertex("Implements", n.Implements) - v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) - v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- v.print(v.indent, "},\n") @@ -706,9 +706,9 @@ func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { v.dumpPosition(n.Position) v.dumpToken("NsTkn", n.NsTkn) v.dumpVertex("Name", n.Name) - v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) - v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("SemiColonTkn", n.SemiColonTkn) v.indent-- @@ -799,9 +799,9 @@ func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) - v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- v.print(v.indent, "},\n") @@ -850,9 +850,9 @@ func (v *Dump) StmtTrait(n *ast.StmtTrait) { v.dumpVertex("TraitName", n.TraitName) v.dumpVertex("Extends", n.Extends) v.dumpVertex("Implements", n.Implements) - v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) - v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- v.print(v.indent, "},\n") @@ -934,9 +934,9 @@ func (v *Dump) StmtTry(n *ast.StmtTry) { v.dumpPosition(n.Position) v.dumpToken("TryTkn", n.TryTkn) - v.dumpToken("OpenCurlyBracket", n.OpenCurlyBracket) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) - v.dumpToken("CloseCurlyBracket", n.CloseCurlyBracket) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpVertexList("Catches", n.Catches) v.dumpVertex("Finally", n.Finally) @@ -2236,9 +2236,9 @@ func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("OpenQoteTkn", n.OpenQoteTkn) + v.dumpToken("OpenQuoteTkn", n.OpenQuoteTkn) v.dumpVertexList("Parts", n.Parts) - v.dumpToken("CloseQoteTkn", n.CloseQoteTkn) + v.dumpToken("CloseQuoteTkn", n.CloseQuoteTkn) v.indent-- v.print(v.indent, "},\n") diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index cc9fb09..f3a26df 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -13,7 +13,7 @@ import ( func TestDumper_root(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewDump(o) + p := visitor.NewDump(o).WithTokens().WithPositions() n := &ast.Root{ Position: &position.Position{ StartLine: 1, diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 3388399..ae85256 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -196,9 +196,9 @@ func (p *printer) StmtClass(n *ast.StmtClass) { p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) p.printNode(n.Extends) p.printNode(n.Implements) - p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) - p.printToken(n.CloseCurlyBracket, []byte("}")) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) } func (p *printer) StmtClassConstList(n *ast.StmtClassConstList) { @@ -256,9 +256,9 @@ func (p *printer) StmtDeclare(n *ast.StmtDeclare) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -293,9 +293,9 @@ func (p *printer) StmtElse(n *ast.StmtElse) { p.printToken(n.ElseTkn, []byte("else")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -308,9 +308,9 @@ func (p *printer) StmtElseIf(n *ast.StmtElseIf) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -339,9 +339,9 @@ func (p *printer) StmtFor(n *ast.StmtFor) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -360,9 +360,9 @@ func (p *printer) StmtForeach(n *ast.StmtForeach) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -410,9 +410,9 @@ func (p *printer) StmtIf(n *ast.StmtIf) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -454,9 +454,9 @@ func (p *printer) StmtLabel(n *ast.StmtLabel) { func (p *printer) StmtNamespace(n *ast.StmtNamespace) { p.printToken(n.NsTkn, []byte("namespace")) p.printNode(n.Name) - p.printToken(n.OpenCurlyBracket, p.ifNodeList(n.Stmts, []byte("{"))) + p.printToken(n.OpenCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("{"))) p.printList(n.Stmts) - p.printToken(n.CloseCurlyBracket, p.ifNodeList(n.Stmts, []byte("}"))) + p.printToken(n.CloseCurlyBracketTkn, p.ifNodeList(n.Stmts, []byte("}"))) p.printToken(n.SemiColonTkn, p.ifNotNodeList(n.Stmts, []byte(";"))) } @@ -496,9 +496,9 @@ func (p *printer) StmtStaticVar(n *ast.StmtStaticVar) { } func (p *printer) StmtStmtList(n *ast.StmtStmtList) { - p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) - p.printToken(n.CloseCurlyBracket, []byte("}")) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) } func (p *printer) StmtSwitch(n *ast.StmtSwitch) { @@ -526,9 +526,9 @@ func (p *printer) StmtTrait(n *ast.StmtTrait) { p.printNode(n.TraitName) p.printNode(n.Extends) p.printNode(n.Implements) - p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) - p.printToken(n.CloseCurlyBracket, []byte("}")) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) } func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { @@ -566,9 +566,9 @@ func (p *printer) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { func (p *printer) StmtTry(n *ast.StmtTry) { p.printToken(n.TryTkn, []byte("try")) - p.printToken(n.OpenCurlyBracket, []byte("{")) + p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) - p.printToken(n.CloseCurlyBracket, []byte("}")) + p.printToken(n.CloseCurlyBracketTkn, []byte("}")) p.printList(n.Catches) p.printNode(n.Finally) } @@ -615,9 +615,9 @@ func (p *printer) StmtWhile(n *ast.StmtWhile) { p.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) if stmt, ok := n.Stmt.(*ast.StmtStmtList); ok && n.ColonTkn != nil { - p.printToken(stmt.OpenCurlyBracket, nil) + p.printToken(stmt.OpenCurlyBracketTkn, nil) p.printList(stmt.Stmts) - p.printToken(stmt.CloseCurlyBracket, nil) + p.printToken(stmt.CloseCurlyBracketTkn, nil) } else { p.printNode(n.Stmt) } @@ -1181,9 +1181,9 @@ func (p *printer) ScalarDnumber(n *ast.ScalarDnumber) { } func (p *printer) ScalarEncapsed(n *ast.ScalarEncapsed) { - p.printToken(n.OpenQoteTkn, []byte("\"")) + p.printToken(n.OpenQuoteTkn, []byte("\"")) p.printList(n.Parts) - p.printToken(n.CloseQoteTkn, []byte("\"")) + p.printToken(n.CloseQuoteTkn, []byte("\"")) } func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { From c32f5bd29b7b7b4e5769d8109dd3f6c8c0cb4d3e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 11 Dec 2020 17:34:29 +0200 Subject: [PATCH 112/140] [refactoring] remove Alt flags --- internal/php5/php5.go | Bin 264908 -> 264694 bytes internal/php5/php5.y | 17 ++++------------- internal/php7/php7.go | Bin 219381 -> 219167 bytes internal/php7/php7.y | 17 ++++------------- pkg/ast/node.go | 8 -------- 5 files changed, 8 insertions(+), 34 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 6dd0b6554b8c461c03ad75f9c75fb816d7f5ef68..0d1325e150b05928ca6e0a2a4e5c9e9c74a6ba29 100644 GIT binary patch delta 8283 zcmZ`;d05uP_J7V9KyhJl!4QxaQL%7gU$PR+Sk&Cp)Kt)GDQZ%tl`Cp)m8EH%as|tu zODbaJJh_xhn!C`VU6+6?%gV$uEpO@XGxL1`^||*S_|D9kGiT16^E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AliNIT@IN??TDzv^U!f5z z(1ABlpA7N2LWkEO3=@9MkExJ;Cw|MMjKd7rbvhBAh6CYyS zN+V$!Qmzr_SjsCQS@||rmmYH{Z=wu1hJ&`!p(Mh^vNc-u&~Z@;*m(Om*3dW_S7yA! zeYrI;pE}7|%mYKMjS0>5-GP}v|;&Y_RUwS7>@ralewI z{n59loySZ;z^S^=p66Mne%Sch&M~}!A2lpf%*~f*^Ij|^-cqyvA8rSG&6#k zsjaWTzVe@c%=eu^R! z{FpC>U{c%65#k$#C&h&eeAPhZ@CBsi)r)*xf~}r{%~MgCmGDSG^-wu43H{ zq*ds>=kgyav{TiRXhgQaY!A%Z*Y7Ac?x%DNA5TfJCdg}T;XllL=(cln+ zCi`BQa>E4E8`}Q9`9zkwrzd=cPtb|`dD47V+zfGE>DS;qL+GZ@*nbm}^9*KOrMGzv(~eE5 z$h5=lb|kQJTNx)^^(s~y*<`ybG&fvXblqh9oe_@BHX^Qq{UQ{s@wohQAfXE=aa$xd zxeeky1TfuoG6azHwCR8<-;HZC@SR>*LLe4LYq~m^JqSl3wwu$b`mqz*1D$u3$^3RZRNL1S5BO0=8H#aQPmx3qw3^n%x`SVbZ=t z_|&Gq_4%WT%04ggB3%LIw1~95?H5U^Sax|;k9M0M_Cf$q?z-qSJ~=B-cS})^l7Wen z^Ab!~;j%MTl_7Q8Y)VbT?wl;sO@dl$eGqjp9W?;PRtNW-9tyS03Rq%T%g2HnA{#?^lrOAt__@gMLkMfwejNmQPPfzcs#u}D3$*=1& zR5{4qJ}(o@^8)_QG8q7M&^mc8%PN+z@A#k**8{5cA*cAM>peTv5NpIG9*=HVfF8LL|gR8NqbX^z+4;@+(b zf`xyT>K_CDc*e#_W8MxS!Mq({%!Kh diff --git a/internal/php7/php7.y b/internal/php7/php7.y index b69d0a3..4b5c149 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -459,10 +459,10 @@ top_statement: { $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - NsTkn: $1, - OpenCurlyBracketTkn: $2, - Stmts: $3, - CloseCurlyBracket: $4, + NsTkn: $1, + OpenCurlyBracketTkn: $2, + Stmts: $3, + CloseCurlyBracketTkn: $4, } } | T_USE mixed_group_use_declaration ';' @@ -1382,7 +1382,6 @@ for_statement: { $$ = &ast.StmtFor{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($2), @@ -1406,7 +1405,6 @@ foreach_statement: { $$ = &ast.StmtForeach{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($2), @@ -1430,7 +1428,6 @@ declare_statement: { $$ = &ast.StmtDeclare{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($2), @@ -1466,7 +1463,6 @@ switch_case_list: { $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - Alt: true, ColonTkn: $1, CaseList: $2, EndSwitchTkn: $3, @@ -1477,7 +1473,6 @@ switch_case_list: { $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), - Alt: true, ColonTkn: $1, CaseSeparatorTkn: $2, CaseList: $3, @@ -1536,7 +1531,6 @@ while_statement: { $$ = &ast.StmtWhile{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - Alt: true, ColonTkn: $1, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($2), @@ -1601,7 +1595,6 @@ alt_if_stmt_without_else: { $$ = &ast.StmtIf{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $6), - Alt: true, IfTkn: $1, OpenParenthesisTkn: $2, Cond: $3, @@ -1617,7 +1610,6 @@ alt_if_stmt_without_else: { $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, &ast.StmtElseIf{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $7), - Alt: true, ElseIfTkn: $2, OpenParenthesisTkn: $3, Cond: $4, @@ -1646,7 +1638,6 @@ alt_if_stmt: { $1.(*ast.StmtIf).Else = &ast.StmtElse{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $4), - Alt: true, ElseTkn: $2, ColonTkn: $3, Stmt: &ast.StmtStmtList{ diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 7ba8fc6..7497f9a 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -398,7 +398,6 @@ func (n *StmtContinue) GetPosition() *position.Position { // StmtDeclare node type StmtDeclare struct { Position *position.Position - Alt bool DeclareTkn *token.Token OpenParenthesisTkn *token.Token Consts []Vertex @@ -474,7 +473,6 @@ func (n *StmtEcho) GetPosition() *position.Position { // StmtElse node type StmtElse struct { Position *position.Position - Alt bool ElseTkn *token.Token ColonTkn *token.Token Stmt Vertex @@ -491,7 +489,6 @@ func (n *StmtElse) GetPosition() *position.Position { // StmtElseIf node type StmtElseIf struct { Position *position.Position - Alt bool ElseIfTkn *token.Token OpenParenthesisTkn *token.Token Cond Vertex @@ -543,7 +540,6 @@ func (n *StmtFinally) GetPosition() *position.Position { // StmtFor node type StmtFor struct { Position *position.Position - Alt bool ForTkn *token.Token OpenParenthesisTkn *token.Token Init []Vertex @@ -572,7 +568,6 @@ func (n *StmtFor) GetPosition() *position.Position { // StmtForeach node type StmtForeach struct { Position *position.Position - Alt bool ForeachTkn *token.Token OpenParenthesisTkn *token.Token Expr Vertex @@ -673,7 +668,6 @@ func (n *StmtHaltCompiler) GetPosition() *position.Position { // StmtIf node type StmtIf struct { Position *position.Position - Alt bool IfTkn *token.Token OpenParenthesisTkn *token.Token Cond Vertex @@ -894,7 +888,6 @@ func (n *StmtStmtList) GetPosition() *position.Position { // StmtSwitch node type StmtSwitch struct { Position *position.Position - Alt bool SwitchTkn *token.Token OpenParenthesisTkn *token.Token Cond Vertex @@ -1137,7 +1130,6 @@ func (n *StmtUseDeclaration) GetPosition() *position.Position { // StmtWhile node type StmtWhile struct { Position *position.Position - Alt bool WhileTkn *token.Token OpenParenthesisTkn *token.Token Cond Vertex From 6941f0f51bd9d7245f8905a86b549de5bd173175 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 12 Dec 2020 12:09:39 +0200 Subject: [PATCH 113/140] [refactoring] rename dumper --- cmd/php-parser/main.go | 2 +- pkg/ast/visitor/{dump.go => dumper.go} | 344 +++++++++--------- .../visitor/{dump_test.go => dumper_test.go} | 2 +- 3 files changed, 174 insertions(+), 174 deletions(-) rename pkg/ast/visitor/{dump.go => dumper.go} (82%) rename pkg/ast/visitor/{dump_test.go => dumper_test.go} (95%) diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 73af6c5..13d8734 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -182,7 +182,7 @@ func printerWorker(r <-chan result) { } if *dump == true { - visitor.NewDump(os.Stdout).WithPositions().WithTokens().Dump(res.rootNode) + visitor.NewDumper(os.Stdout).WithPositions().WithTokens().Dump(res.rootNode) } wg.Done() diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dumper.go similarity index 82% rename from pkg/ast/visitor/dump.go rename to pkg/ast/visitor/dumper.go index 8366e52..98ef5ef 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dumper.go @@ -10,32 +10,32 @@ import ( "github.com/z7zmey/php-parser/pkg/ast" ) -type Dump struct { +type Dumper struct { writer io.Writer indent int withTokens bool withPositions bool } -func NewDump(writer io.Writer) *Dump { - return &Dump{writer: writer} +func NewDumper(writer io.Writer) *Dumper { + return &Dumper{writer: writer} } -func (v *Dump) WithTokens() *Dump { +func (v *Dumper) WithTokens() *Dumper { v.withTokens = true return v } -func (v *Dump) WithPositions() *Dump { +func (v *Dumper) WithPositions() *Dumper { v.withPositions = true return v } -func (v *Dump) Dump(n ast.Vertex) { +func (v *Dumper) Dump(n ast.Vertex) { n.Accept(v) } -func (v *Dump) print(indent int, str string) { +func (v *Dumper) print(indent int, str string) { _, err := io.WriteString(v.writer, strings.Repeat("\t", indent)) if err != nil { panic(err) @@ -47,7 +47,7 @@ func (v *Dump) print(indent int, str string) { } } -func (v *Dump) dumpVertex(key string, node ast.Vertex) { +func (v *Dumper) dumpVertex(key string, node ast.Vertex) { if node == nil { return } @@ -56,7 +56,7 @@ func (v *Dump) dumpVertex(key string, node ast.Vertex) { node.Accept(v) } -func (v *Dump) dumpVertexList(key string, list []ast.Vertex) { +func (v *Dumper) dumpVertexList(key string, list []ast.Vertex) { if list == nil { return } @@ -78,7 +78,7 @@ func (v *Dump) dumpVertexList(key string, list []ast.Vertex) { v.print(v.indent, "},\n") } -func (v *Dump) dumpToken(key string, tok *token.Token) { +func (v *Dumper) dumpToken(key string, tok *token.Token) { if !v.withTokens { return } @@ -108,7 +108,7 @@ func (v *Dump) dumpToken(key string, tok *token.Token) { v.print(v.indent, "},\n") } -func (v *Dump) dumpTokenList(key string, list []*token.Token) { +func (v *Dumper) dumpTokenList(key string, list []*token.Token) { if !v.withTokens { return } @@ -133,7 +133,7 @@ func (v *Dump) dumpTokenList(key string, list []*token.Token) { v.print(v.indent, "},\n") } -func (v *Dump) dumpPosition(pos *position.Position) { +func (v *Dumper) dumpPosition(pos *position.Position) { if !v.withPositions { return } @@ -154,7 +154,7 @@ func (v *Dump) dumpPosition(pos *position.Position) { v.print(v.indent, "},\n") } -func (v *Dump) dumpValue(key string, val []byte) { +func (v *Dumper) dumpValue(key string, val []byte) { if val == nil { return } @@ -163,7 +163,7 @@ func (v *Dump) dumpValue(key string, val []byte) { } -func (v *Dump) Root(n *ast.Root) { +func (v *Dumper) Root(n *ast.Root) { v.print(0, "&ast.Root{\n") v.indent++ @@ -175,7 +175,7 @@ func (v *Dump) Root(n *ast.Root) { v.print(v.indent, "},\n") } -func (v *Dump) Nullable(n *ast.Nullable) { +func (v *Dumper) Nullable(n *ast.Nullable) { v.print(0, "&ast.Nullable{\n") v.indent++ @@ -187,7 +187,7 @@ func (v *Dump) Nullable(n *ast.Nullable) { v.print(v.indent, "},\n") } -func (v *Dump) Parameter(n *ast.Parameter) { +func (v *Dumper) Parameter(n *ast.Parameter) { v.print(0, "&ast.Parameter{\n") v.indent++ @@ -203,7 +203,7 @@ func (v *Dump) Parameter(n *ast.Parameter) { v.print(v.indent, "},\n") } -func (v *Dump) Identifier(n *ast.Identifier) { +func (v *Dumper) Identifier(n *ast.Identifier) { v.print(0, "&ast.Identifier{\n") v.indent++ @@ -215,7 +215,7 @@ func (v *Dump) Identifier(n *ast.Identifier) { v.print(v.indent, "},\n") } -func (v *Dump) Argument(n *ast.Argument) { +func (v *Dumper) Argument(n *ast.Argument) { v.print(0, "&ast.Argument{\n") v.indent++ @@ -228,7 +228,7 @@ func (v *Dump) Argument(n *ast.Argument) { v.print(v.indent, "},\n") } -func (v *Dump) StmtBreak(n *ast.StmtBreak) { +func (v *Dumper) StmtBreak(n *ast.StmtBreak) { v.print(0, "&ast.StmtBreak{\n") v.indent++ @@ -241,7 +241,7 @@ func (v *Dump) StmtBreak(n *ast.StmtBreak) { v.print(v.indent, "},\n") } -func (v *Dump) StmtCase(n *ast.StmtCase) { +func (v *Dumper) StmtCase(n *ast.StmtCase) { v.print(0, "&ast.StmtCase{\n") v.indent++ @@ -255,7 +255,7 @@ func (v *Dump) StmtCase(n *ast.StmtCase) { v.print(v.indent, "},\n") } -func (v *Dump) StmtCatch(n *ast.StmtCatch) { +func (v *Dumper) StmtCatch(n *ast.StmtCatch) { v.print(0, "&ast.StmtCatch{\n") v.indent++ @@ -274,7 +274,7 @@ func (v *Dump) StmtCatch(n *ast.StmtCatch) { v.print(v.indent, "},\n") } -func (v *Dump) StmtClass(n *ast.StmtClass) { +func (v *Dumper) StmtClass(n *ast.StmtClass) { v.print(0, "&ast.StmtClass{\n") v.indent++ @@ -296,7 +296,7 @@ func (v *Dump) StmtClass(n *ast.StmtClass) { v.print(v.indent, "},\n") } -func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { +func (v *Dumper) StmtClassConstList(n *ast.StmtClassConstList) { v.print(0, "&ast.StmtClassConstList{\n") v.indent++ @@ -311,7 +311,7 @@ func (v *Dump) StmtClassConstList(n *ast.StmtClassConstList) { v.print(v.indent, "},\n") } -func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { +func (v *Dumper) StmtClassExtends(n *ast.StmtClassExtends) { v.print(0, "&ast.StmtClassExtends{\n") v.indent++ @@ -323,7 +323,7 @@ func (v *Dump) StmtClassExtends(n *ast.StmtClassExtends) { v.print(v.indent, "},\n") } -func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { +func (v *Dumper) StmtClassImplements(n *ast.StmtClassImplements) { v.print(0, "&ast.StmtClassImplements{\n") v.indent++ @@ -336,7 +336,7 @@ func (v *Dump) StmtClassImplements(n *ast.StmtClassImplements) { v.print(v.indent, "},\n") } -func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { +func (v *Dumper) StmtClassMethod(n *ast.StmtClassMethod) { v.print(0, "&ast.StmtClassMethod{\n") v.indent++ @@ -357,7 +357,7 @@ func (v *Dump) StmtClassMethod(n *ast.StmtClassMethod) { v.print(v.indent, "},\n") } -func (v *Dump) StmtConstList(n *ast.StmtConstList) { +func (v *Dumper) StmtConstList(n *ast.StmtConstList) { v.print(0, "&ast.StmtConstList{\n") v.indent++ @@ -371,7 +371,7 @@ func (v *Dump) StmtConstList(n *ast.StmtConstList) { v.print(v.indent, "},\n") } -func (v *Dump) StmtConstant(n *ast.StmtConstant) { +func (v *Dumper) StmtConstant(n *ast.StmtConstant) { v.print(0, "&ast.StmtConstant{\n") v.indent++ @@ -384,7 +384,7 @@ func (v *Dump) StmtConstant(n *ast.StmtConstant) { v.print(v.indent, "},\n") } -func (v *Dump) StmtContinue(n *ast.StmtContinue) { +func (v *Dumper) StmtContinue(n *ast.StmtContinue) { v.print(0, "&ast.StmtContinue{\n") v.indent++ @@ -397,7 +397,7 @@ func (v *Dump) StmtContinue(n *ast.StmtContinue) { v.print(v.indent, "},\n") } -func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { +func (v *Dumper) StmtDeclare(n *ast.StmtDeclare) { v.print(0, "&ast.StmtDeclare{\n") v.indent++ @@ -416,7 +416,7 @@ func (v *Dump) StmtDeclare(n *ast.StmtDeclare) { v.print(v.indent, "},\n") } -func (v *Dump) StmtDefault(n *ast.StmtDefault) { +func (v *Dumper) StmtDefault(n *ast.StmtDefault) { v.print(0, "&ast.StmtDefault{\n") v.indent++ @@ -429,7 +429,7 @@ func (v *Dump) StmtDefault(n *ast.StmtDefault) { v.print(v.indent, "},\n") } -func (v *Dump) StmtDo(n *ast.StmtDo) { +func (v *Dumper) StmtDo(n *ast.StmtDo) { v.print(0, "&ast.StmtDo{\n") v.indent++ @@ -447,7 +447,7 @@ func (v *Dump) StmtDo(n *ast.StmtDo) { } -func (v *Dump) StmtEcho(n *ast.StmtEcho) { +func (v *Dumper) StmtEcho(n *ast.StmtEcho) { v.print(0, "&ast.StmtEcho{\n") v.indent++ @@ -461,7 +461,7 @@ func (v *Dump) StmtEcho(n *ast.StmtEcho) { v.print(v.indent, "},\n") } -func (v *Dump) StmtElse(n *ast.StmtElse) { +func (v *Dumper) StmtElse(n *ast.StmtElse) { v.print(0, "&ast.StmtElse{\n") v.indent++ @@ -474,7 +474,7 @@ func (v *Dump) StmtElse(n *ast.StmtElse) { v.print(v.indent, "},\n") } -func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { +func (v *Dumper) StmtElseIf(n *ast.StmtElseIf) { v.print(0, "&ast.StmtElseIf{\n") v.indent++ @@ -490,7 +490,7 @@ func (v *Dump) StmtElseIf(n *ast.StmtElseIf) { v.print(v.indent, "},\n") } -func (v *Dump) StmtExpression(n *ast.StmtExpression) { +func (v *Dumper) StmtExpression(n *ast.StmtExpression) { v.print(0, "&ast.StmtExpression{\n") v.indent++ @@ -502,7 +502,7 @@ func (v *Dump) StmtExpression(n *ast.StmtExpression) { v.print(v.indent, "},\n") } -func (v *Dump) StmtFinally(n *ast.StmtFinally) { +func (v *Dumper) StmtFinally(n *ast.StmtFinally) { v.print(0, "&ast.StmtFinally{\n") v.indent++ @@ -516,7 +516,7 @@ func (v *Dump) StmtFinally(n *ast.StmtFinally) { v.print(v.indent, "},\n") } -func (v *Dump) StmtFor(n *ast.StmtFor) { +func (v *Dumper) StmtFor(n *ast.StmtFor) { v.print(0, "&ast.StmtFor{\n") v.indent++ @@ -541,7 +541,7 @@ func (v *Dump) StmtFor(n *ast.StmtFor) { v.print(v.indent, "},\n") } -func (v *Dump) StmtForeach(n *ast.StmtForeach) { +func (v *Dumper) StmtForeach(n *ast.StmtForeach) { v.print(0, "&ast.StmtForeach{\n") v.indent++ @@ -563,7 +563,7 @@ func (v *Dump) StmtForeach(n *ast.StmtForeach) { v.print(v.indent, "},\n") } -func (v *Dump) StmtFunction(n *ast.StmtFunction) { +func (v *Dumper) StmtFunction(n *ast.StmtFunction) { v.print(0, "&ast.StmtFunction{\n") v.indent++ @@ -585,7 +585,7 @@ func (v *Dump) StmtFunction(n *ast.StmtFunction) { v.print(v.indent, "},\n") } -func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { +func (v *Dumper) StmtGlobal(n *ast.StmtGlobal) { v.print(0, "&ast.StmtGlobal{\n") v.indent++ @@ -599,7 +599,7 @@ func (v *Dump) StmtGlobal(n *ast.StmtGlobal) { v.print(v.indent, "},\n") } -func (v *Dump) StmtGoto(n *ast.StmtGoto) { +func (v *Dumper) StmtGoto(n *ast.StmtGoto) { v.print(0, "&ast.StmtGoto{\n") v.indent++ @@ -612,7 +612,7 @@ func (v *Dump) StmtGoto(n *ast.StmtGoto) { v.print(v.indent, "},\n") } -func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { +func (v *Dumper) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.print(0, "&ast.StmtHaltCompiler{\n") v.indent++ @@ -626,7 +626,7 @@ func (v *Dump) StmtHaltCompiler(n *ast.StmtHaltCompiler) { v.print(v.indent, "},\n") } -func (v *Dump) StmtIf(n *ast.StmtIf) { +func (v *Dumper) StmtIf(n *ast.StmtIf) { v.print(0, "&ast.StmtIf{\n") v.indent++ @@ -646,7 +646,7 @@ func (v *Dump) StmtIf(n *ast.StmtIf) { v.print(v.indent, "},\n") } -func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { +func (v *Dumper) StmtInlineHtml(n *ast.StmtInlineHtml) { v.print(0, "&ast.StmtInlineHtml{\n") v.indent++ @@ -658,7 +658,7 @@ func (v *Dump) StmtInlineHtml(n *ast.StmtInlineHtml) { v.print(v.indent, "},\n") } -func (v *Dump) StmtInterface(n *ast.StmtInterface) { +func (v *Dumper) StmtInterface(n *ast.StmtInterface) { v.print(0, "&ast.StmtInterface{\n") v.indent++ @@ -674,7 +674,7 @@ func (v *Dump) StmtInterface(n *ast.StmtInterface) { v.print(v.indent, "},\n") } -func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { +func (v *Dumper) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { v.print(0, "&ast.StmtInterfaceExtends{\n") v.indent++ @@ -687,7 +687,7 @@ func (v *Dump) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { v.print(v.indent, "},\n") } -func (v *Dump) StmtLabel(n *ast.StmtLabel) { +func (v *Dumper) StmtLabel(n *ast.StmtLabel) { v.print(0, "&ast.StmtLabel{\n") v.indent++ @@ -699,7 +699,7 @@ func (v *Dump) StmtLabel(n *ast.StmtLabel) { v.print(v.indent, "},\n") } -func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { +func (v *Dumper) StmtNamespace(n *ast.StmtNamespace) { v.print(0, "&ast.StmtNamespace{\n") v.indent++ @@ -715,7 +715,7 @@ func (v *Dump) StmtNamespace(n *ast.StmtNamespace) { v.print(v.indent, "},\n") } -func (v *Dump) StmtNop(n *ast.StmtNop) { +func (v *Dumper) StmtNop(n *ast.StmtNop) { v.print(0, "&ast.StmtNop{\n") v.indent++ @@ -726,7 +726,7 @@ func (v *Dump) StmtNop(n *ast.StmtNop) { v.print(v.indent, "},\n") } -func (v *Dump) StmtProperty(n *ast.StmtProperty) { +func (v *Dumper) StmtProperty(n *ast.StmtProperty) { v.print(0, "&ast.StmtProperty{\n") v.indent++ @@ -739,7 +739,7 @@ func (v *Dump) StmtProperty(n *ast.StmtProperty) { v.print(v.indent, "},\n") } -func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { +func (v *Dumper) StmtPropertyList(n *ast.StmtPropertyList) { v.print(0, "&ast.StmtPropertyList{\n") v.indent++ @@ -754,7 +754,7 @@ func (v *Dump) StmtPropertyList(n *ast.StmtPropertyList) { v.print(v.indent, "},\n") } -func (v *Dump) StmtReturn(n *ast.StmtReturn) { +func (v *Dumper) StmtReturn(n *ast.StmtReturn) { v.print(0, "&ast.StmtReturn{\n") v.indent++ @@ -767,7 +767,7 @@ func (v *Dump) StmtReturn(n *ast.StmtReturn) { v.print(v.indent, "},\n") } -func (v *Dump) StmtStatic(n *ast.StmtStatic) { +func (v *Dumper) StmtStatic(n *ast.StmtStatic) { v.print(0, "&ast.StmtStatic{\n") v.indent++ @@ -781,7 +781,7 @@ func (v *Dump) StmtStatic(n *ast.StmtStatic) { v.print(v.indent, "},\n") } -func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { +func (v *Dumper) StmtStaticVar(n *ast.StmtStaticVar) { v.print(0, "&ast.StmtStaticVar{\n") v.indent++ @@ -794,7 +794,7 @@ func (v *Dump) StmtStaticVar(n *ast.StmtStaticVar) { v.print(v.indent, "},\n") } -func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { +func (v *Dumper) StmtStmtList(n *ast.StmtStmtList) { v.print(0, "&ast.StmtStmtList{\n") v.indent++ @@ -807,7 +807,7 @@ func (v *Dump) StmtStmtList(n *ast.StmtStmtList) { v.print(v.indent, "},\n") } -func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { +func (v *Dumper) StmtSwitch(n *ast.StmtSwitch) { v.print(0, "&ast.StmtSwitch{\n") v.indent++ @@ -828,7 +828,7 @@ func (v *Dump) StmtSwitch(n *ast.StmtSwitch) { v.print(v.indent, "},\n") } -func (v *Dump) StmtThrow(n *ast.StmtThrow) { +func (v *Dumper) StmtThrow(n *ast.StmtThrow) { v.print(0, "&ast.StmtThrow{\n") v.indent++ @@ -841,7 +841,7 @@ func (v *Dump) StmtThrow(n *ast.StmtThrow) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTrait(n *ast.StmtTrait) { +func (v *Dumper) StmtTrait(n *ast.StmtTrait) { v.print(0, "&ast.StmtTrait{\n") v.indent++ @@ -858,7 +858,7 @@ func (v *Dump) StmtTrait(n *ast.StmtTrait) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { +func (v *Dumper) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { v.print(0, "&ast.StmtTraitAdaptationList{\n") v.indent++ @@ -871,7 +871,7 @@ func (v *Dump) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { +func (v *Dumper) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.print(0, "&ast.StmtTraitMethodRef{\n") v.indent++ @@ -884,7 +884,7 @@ func (v *Dump) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { +func (v *Dumper) StmtTraitUse(n *ast.StmtTraitUse) { v.print(0, "&ast.StmtTraitUse{\n") v.indent++ @@ -898,7 +898,7 @@ func (v *Dump) StmtTraitUse(n *ast.StmtTraitUse) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { +func (v *Dumper) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { v.print(0, "&ast.StmtTraitUseAlias{\n") v.indent++ @@ -913,7 +913,7 @@ func (v *Dump) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { +func (v *Dumper) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { v.print(0, "&ast.StmtTraitUsePrecedence{\n") v.indent++ @@ -928,7 +928,7 @@ func (v *Dump) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { v.print(v.indent, "},\n") } -func (v *Dump) StmtTry(n *ast.StmtTry) { +func (v *Dumper) StmtTry(n *ast.StmtTry) { v.print(0, "&ast.StmtTry{\n") v.indent++ @@ -944,7 +944,7 @@ func (v *Dump) StmtTry(n *ast.StmtTry) { v.print(v.indent, "},\n") } -func (v *Dump) StmtUnset(n *ast.StmtUnset) { +func (v *Dumper) StmtUnset(n *ast.StmtUnset) { v.print(0, "&ast.StmtUnset{\n") v.indent++ @@ -960,7 +960,7 @@ func (v *Dump) StmtUnset(n *ast.StmtUnset) { v.print(v.indent, "},\n") } -func (v *Dump) StmtUse(n *ast.StmtUse) { +func (v *Dumper) StmtUse(n *ast.StmtUse) { v.print(0, "&ast.StmtUse{\n") v.indent++ @@ -975,7 +975,7 @@ func (v *Dump) StmtUse(n *ast.StmtUse) { v.print(v.indent, "},\n") } -func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { +func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) { v.print(0, "&ast.StmtGroupUse{\n") v.indent++ @@ -995,7 +995,7 @@ func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { v.print(v.indent, "},\n") } -func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { +func (v *Dumper) StmtUseDeclaration(n *ast.StmtUseDeclaration) { v.print(0, "&ast.StmtUseDeclaration{\n") v.indent++ @@ -1010,7 +1010,7 @@ func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { v.print(v.indent, "},\n") } -func (v *Dump) StmtWhile(n *ast.StmtWhile) { +func (v *Dumper) StmtWhile(n *ast.StmtWhile) { v.print(0, "&ast.StmtWhile{\n") v.indent++ @@ -1028,7 +1028,7 @@ func (v *Dump) StmtWhile(n *ast.StmtWhile) { v.print(v.indent, "},\n") } -func (v *Dump) ExprArray(n *ast.ExprArray) { +func (v *Dumper) ExprArray(n *ast.ExprArray) { v.print(0, "&ast.ExprArray{\n") v.indent++ @@ -1043,7 +1043,7 @@ func (v *Dump) ExprArray(n *ast.ExprArray) { v.print(v.indent, "},\n") } -func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { +func (v *Dumper) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { v.print(0, "&ast.ExprArrayDimFetch{\n") v.indent++ @@ -1057,7 +1057,7 @@ func (v *Dump) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { v.print(v.indent, "},\n") } -func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { +func (v *Dumper) ExprArrayItem(n *ast.ExprArrayItem) { v.print(0, "&ast.ExprArrayItem{\n") v.indent++ @@ -1071,7 +1071,7 @@ func (v *Dump) ExprArrayItem(n *ast.ExprArrayItem) { v.print(v.indent, "},\n") } -func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { +func (v *Dumper) ExprArrowFunction(n *ast.ExprArrowFunction) { v.print(0, "&ast.ExprArrowFunction{\n") v.indent++ @@ -1092,7 +1092,7 @@ func (v *Dump) ExprArrowFunction(n *ast.ExprArrowFunction) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { +func (v *Dumper) ExprBitwiseNot(n *ast.ExprBitwiseNot) { v.print(0, "&ast.ExprBitwiseNot{\n") v.indent++ @@ -1104,7 +1104,7 @@ func (v *Dump) ExprBitwiseNot(n *ast.ExprBitwiseNot) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { +func (v *Dumper) ExprBooleanNot(n *ast.ExprBooleanNot) { v.print(0, "&ast.ExprBooleanNot{\n") v.indent++ @@ -1116,7 +1116,7 @@ func (v *Dump) ExprBooleanNot(n *ast.ExprBooleanNot) { v.print(v.indent, "},\n") } -func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { +func (v *Dumper) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.print(0, "&ast.ExprClassConstFetch{\n") v.indent++ @@ -1129,7 +1129,7 @@ func (v *Dump) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.print(v.indent, "},\n") } -func (v *Dump) ExprClone(n *ast.ExprClone) { +func (v *Dumper) ExprClone(n *ast.ExprClone) { v.print(0, "&ast.ExprClone{\n") v.indent++ @@ -1141,7 +1141,7 @@ func (v *Dump) ExprClone(n *ast.ExprClone) { v.print(v.indent, "},\n") } -func (v *Dump) ExprClosure(n *ast.ExprClosure) { +func (v *Dumper) ExprClosure(n *ast.ExprClosure) { v.print(0, "&ast.ExprClosure{\n") v.indent++ @@ -1164,7 +1164,7 @@ func (v *Dump) ExprClosure(n *ast.ExprClosure) { v.print(v.indent, "},\n") } -func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { +func (v *Dumper) ExprClosureUse(n *ast.ExprClosureUse) { v.print(0, "&ast.ExprClosureUse{\n") v.indent++ @@ -1179,7 +1179,7 @@ func (v *Dump) ExprClosureUse(n *ast.ExprClosureUse) { v.print(v.indent, "},\n") } -func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { +func (v *Dumper) ExprConstFetch(n *ast.ExprConstFetch) { v.print(0, "&ast.ExprConstFetch{\n") v.indent++ @@ -1190,7 +1190,7 @@ func (v *Dump) ExprConstFetch(n *ast.ExprConstFetch) { v.print(v.indent, "},\n") } -func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { +func (v *Dumper) ExprEmpty(n *ast.ExprEmpty) { v.print(0, "&ast.ExprEmpty{\n") v.indent++ @@ -1204,7 +1204,7 @@ func (v *Dump) ExprEmpty(n *ast.ExprEmpty) { v.print(v.indent, "},\n") } -func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { +func (v *Dumper) ExprErrorSuppress(n *ast.ExprErrorSuppress) { v.print(0, "&ast.ExprErrorSuppress{\n") v.indent++ @@ -1216,7 +1216,7 @@ func (v *Dump) ExprErrorSuppress(n *ast.ExprErrorSuppress) { v.print(v.indent, "},\n") } -func (v *Dump) ExprEval(n *ast.ExprEval) { +func (v *Dumper) ExprEval(n *ast.ExprEval) { v.print(0, "&ast.ExprEval{\n") v.indent++ @@ -1230,7 +1230,7 @@ func (v *Dump) ExprEval(n *ast.ExprEval) { v.print(v.indent, "},\n") } -func (v *Dump) ExprExit(n *ast.ExprExit) { +func (v *Dumper) ExprExit(n *ast.ExprExit) { v.print(0, "&ast.ExprExit{\n") v.indent++ @@ -1244,7 +1244,7 @@ func (v *Dump) ExprExit(n *ast.ExprExit) { v.print(v.indent, "},\n") } -func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { +func (v *Dumper) ExprFunctionCall(n *ast.ExprFunctionCall) { v.print(0, "&ast.ExprFunctionCall{\n") v.indent++ @@ -1259,7 +1259,7 @@ func (v *Dump) ExprFunctionCall(n *ast.ExprFunctionCall) { v.print(v.indent, "},\n") } -func (v *Dump) ExprInclude(n *ast.ExprInclude) { +func (v *Dumper) ExprInclude(n *ast.ExprInclude) { v.print(0, "&ast.ExprInclude{\n") v.indent++ @@ -1271,7 +1271,7 @@ func (v *Dump) ExprInclude(n *ast.ExprInclude) { v.print(v.indent, "},\n") } -func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { +func (v *Dumper) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.print(0, "&ast.ExprIncludeOnce{\n") v.indent++ @@ -1283,7 +1283,7 @@ func (v *Dump) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.print(v.indent, "},\n") } -func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { +func (v *Dumper) ExprInstanceOf(n *ast.ExprInstanceOf) { v.print(0, "&ast.ExprInstanceOf{\n") v.indent++ @@ -1296,7 +1296,7 @@ func (v *Dump) ExprInstanceOf(n *ast.ExprInstanceOf) { v.print(v.indent, "},\n") } -func (v *Dump) ExprIsset(n *ast.ExprIsset) { +func (v *Dumper) ExprIsset(n *ast.ExprIsset) { v.print(0, "&ast.ExprIsset{\n") v.indent++ @@ -1311,7 +1311,7 @@ func (v *Dump) ExprIsset(n *ast.ExprIsset) { v.print(v.indent, "},\n") } -func (v *Dump) ExprList(n *ast.ExprList) { +func (v *Dumper) ExprList(n *ast.ExprList) { v.print(0, "&ast.ExprList{\n") v.indent++ @@ -1326,7 +1326,7 @@ func (v *Dump) ExprList(n *ast.ExprList) { v.print(v.indent, "},\n") } -func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { +func (v *Dumper) ExprMethodCall(n *ast.ExprMethodCall) { v.print(0, "&ast.ExprMethodCall{\n") v.indent++ @@ -1343,7 +1343,7 @@ func (v *Dump) ExprMethodCall(n *ast.ExprMethodCall) { v.print(v.indent, "},\n") } -func (v *Dump) ExprNew(n *ast.ExprNew) { +func (v *Dumper) ExprNew(n *ast.ExprNew) { v.print(0, "&ast.ExprNew{\n") v.indent++ @@ -1359,7 +1359,7 @@ func (v *Dump) ExprNew(n *ast.ExprNew) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { +func (v *Dumper) ExprPostDec(n *ast.ExprPostDec) { v.print(0, "&ast.ExprPostDec{\n") v.indent++ @@ -1371,7 +1371,7 @@ func (v *Dump) ExprPostDec(n *ast.ExprPostDec) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { +func (v *Dumper) ExprPostInc(n *ast.ExprPostInc) { v.print(0, "&ast.ExprPostInc{\n") v.indent++ @@ -1383,7 +1383,7 @@ func (v *Dump) ExprPostInc(n *ast.ExprPostInc) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { +func (v *Dumper) ExprPreDec(n *ast.ExprPreDec) { v.print(0, "&ast.ExprPreDec{\n") v.indent++ @@ -1395,7 +1395,7 @@ func (v *Dump) ExprPreDec(n *ast.ExprPreDec) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { +func (v *Dumper) ExprPreInc(n *ast.ExprPreInc) { v.print(0, "&ast.ExprPreInc{\n") v.indent++ @@ -1407,7 +1407,7 @@ func (v *Dump) ExprPreInc(n *ast.ExprPreInc) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPrint(n *ast.ExprPrint) { +func (v *Dumper) ExprPrint(n *ast.ExprPrint) { v.print(0, "&ast.ExprPrint{\n") v.indent++ @@ -1419,7 +1419,7 @@ func (v *Dump) ExprPrint(n *ast.ExprPrint) { v.print(v.indent, "},\n") } -func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { +func (v *Dumper) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.print(0, "&ast.ExprPropertyFetch{\n") v.indent++ @@ -1432,7 +1432,7 @@ func (v *Dump) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.print(v.indent, "},\n") } -func (v *Dump) ExprReference(n *ast.ExprReference) { +func (v *Dumper) ExprReference(n *ast.ExprReference) { v.print(0, "&ast.ExprReference{\n") v.indent++ @@ -1444,7 +1444,7 @@ func (v *Dump) ExprReference(n *ast.ExprReference) { v.print(v.indent, "},\n") } -func (v *Dump) ExprRequire(n *ast.ExprRequire) { +func (v *Dumper) ExprRequire(n *ast.ExprRequire) { v.print(0, "&ast.ExprRequire{\n") v.indent++ @@ -1456,7 +1456,7 @@ func (v *Dump) ExprRequire(n *ast.ExprRequire) { v.print(v.indent, "},\n") } -func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { +func (v *Dumper) ExprRequireOnce(n *ast.ExprRequireOnce) { v.print(0, "&ast.ExprRequireOnce{\n") v.indent++ @@ -1468,7 +1468,7 @@ func (v *Dump) ExprRequireOnce(n *ast.ExprRequireOnce) { v.print(v.indent, "},\n") } -func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { +func (v *Dumper) ExprShellExec(n *ast.ExprShellExec) { v.print(0, "&ast.ExprShellExec{\n") v.indent++ @@ -1481,7 +1481,7 @@ func (v *Dump) ExprShellExec(n *ast.ExprShellExec) { v.print(v.indent, "},\n") } -func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { +func (v *Dumper) ExprStaticCall(n *ast.ExprStaticCall) { v.print(0, "&ast.ExprStaticCall{\n") v.indent++ @@ -1498,7 +1498,7 @@ func (v *Dump) ExprStaticCall(n *ast.ExprStaticCall) { v.print(v.indent, "},\n") } -func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { +func (v *Dumper) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.print(0, "&ast.ExprStaticPropertyFetch{\n") v.indent++ @@ -1511,7 +1511,7 @@ func (v *Dump) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.print(v.indent, "},\n") } -func (v *Dump) ExprTernary(n *ast.ExprTernary) { +func (v *Dumper) ExprTernary(n *ast.ExprTernary) { v.print(0, "&ast.ExprTernary{\n") v.indent++ @@ -1526,7 +1526,7 @@ func (v *Dump) ExprTernary(n *ast.ExprTernary) { v.print(v.indent, "},\n") } -func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { +func (v *Dumper) ExprUnaryMinus(n *ast.ExprUnaryMinus) { v.print(0, "&ast.ExprUnaryMinus{\n") v.indent++ @@ -1538,7 +1538,7 @@ func (v *Dump) ExprUnaryMinus(n *ast.ExprUnaryMinus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { +func (v *Dumper) ExprUnaryPlus(n *ast.ExprUnaryPlus) { v.print(0, "&ast.ExprUnaryPlus{\n") v.indent++ @@ -1550,7 +1550,7 @@ func (v *Dump) ExprUnaryPlus(n *ast.ExprUnaryPlus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprVariable(n *ast.ExprVariable) { +func (v *Dumper) ExprVariable(n *ast.ExprVariable) { v.print(0, "&ast.ExprVariable{\n") v.indent++ @@ -1562,7 +1562,7 @@ func (v *Dump) ExprVariable(n *ast.ExprVariable) { v.print(v.indent, "},\n") } -func (v *Dump) ExprYield(n *ast.ExprYield) { +func (v *Dumper) ExprYield(n *ast.ExprYield) { v.print(0, "&ast.ExprYield{\n") v.indent++ @@ -1576,7 +1576,7 @@ func (v *Dump) ExprYield(n *ast.ExprYield) { v.print(v.indent, "},\n") } -func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { +func (v *Dumper) ExprYieldFrom(n *ast.ExprYieldFrom) { v.print(0, "&ast.ExprYieldFrom{\n") v.indent++ @@ -1588,7 +1588,7 @@ func (v *Dump) ExprYieldFrom(n *ast.ExprYieldFrom) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssign(n *ast.ExprAssign) { +func (v *Dumper) ExprAssign(n *ast.ExprAssign) { v.print(0, "&ast.ExprAssign{\n") v.indent++ @@ -1601,7 +1601,7 @@ func (v *Dump) ExprAssign(n *ast.ExprAssign) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { +func (v *Dumper) ExprAssignReference(n *ast.ExprAssignReference) { v.print(0, "&ast.ExprAssignReference{\n") v.indent++ @@ -1615,7 +1615,7 @@ func (v *Dump) ExprAssignReference(n *ast.ExprAssignReference) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { +func (v *Dumper) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { v.print(0, "&ast.ExprAssignBitwiseAnd{\n") v.indent++ @@ -1628,7 +1628,7 @@ func (v *Dump) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { +func (v *Dumper) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { v.print(0, "&ast.ExprAssignBitwiseOr{\n") v.indent++ @@ -1641,7 +1641,7 @@ func (v *Dump) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { +func (v *Dumper) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { v.print(0, "&ast.ExprAssignBitwiseXor{\n") v.indent++ @@ -1654,7 +1654,7 @@ func (v *Dump) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { +func (v *Dumper) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { v.print(0, "&ast.ExprAssignCoalesce{\n") v.indent++ @@ -1667,7 +1667,7 @@ func (v *Dump) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { +func (v *Dumper) ExprAssignConcat(n *ast.ExprAssignConcat) { v.print(0, "&ast.ExprAssignConcat{\n") v.indent++ @@ -1680,7 +1680,7 @@ func (v *Dump) ExprAssignConcat(n *ast.ExprAssignConcat) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { +func (v *Dumper) ExprAssignDiv(n *ast.ExprAssignDiv) { v.print(0, "&ast.ExprAssignDiv{\n") v.indent++ @@ -1693,7 +1693,7 @@ func (v *Dump) ExprAssignDiv(n *ast.ExprAssignDiv) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { +func (v *Dumper) ExprAssignMinus(n *ast.ExprAssignMinus) { v.print(0, "&ast.ExprAssignMinus{\n") v.indent++ @@ -1706,7 +1706,7 @@ func (v *Dump) ExprAssignMinus(n *ast.ExprAssignMinus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { +func (v *Dumper) ExprAssignMod(n *ast.ExprAssignMod) { v.print(0, "&ast.ExprAssignMod{\n") v.indent++ @@ -1719,7 +1719,7 @@ func (v *Dump) ExprAssignMod(n *ast.ExprAssignMod) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { +func (v *Dumper) ExprAssignMul(n *ast.ExprAssignMul) { v.print(0, "&ast.ExprAssignMul{\n") v.indent++ @@ -1732,7 +1732,7 @@ func (v *Dump) ExprAssignMul(n *ast.ExprAssignMul) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { +func (v *Dumper) ExprAssignPlus(n *ast.ExprAssignPlus) { v.print(0, "&ast.ExprAssignPlus{\n") v.indent++ @@ -1745,7 +1745,7 @@ func (v *Dump) ExprAssignPlus(n *ast.ExprAssignPlus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { +func (v *Dumper) ExprAssignPow(n *ast.ExprAssignPow) { v.print(0, "&ast.ExprAssignPow{\n") v.indent++ @@ -1758,7 +1758,7 @@ func (v *Dump) ExprAssignPow(n *ast.ExprAssignPow) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { +func (v *Dumper) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { v.print(0, "&ast.ExprAssignShiftLeft{\n") v.indent++ @@ -1771,7 +1771,7 @@ func (v *Dump) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { v.print(v.indent, "},\n") } -func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { +func (v *Dumper) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { v.print(0, "&ast.ExprAssignShiftRight{\n") v.indent++ @@ -1784,7 +1784,7 @@ func (v *Dump) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { +func (v *Dumper) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { v.print(0, "&ast.ExprBinaryBitwiseAnd{\n") v.indent++ @@ -1797,7 +1797,7 @@ func (v *Dump) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { +func (v *Dumper) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { v.print(0, "&ast.ExprBinaryBitwiseOr{\n") v.indent++ @@ -1810,7 +1810,7 @@ func (v *Dump) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { +func (v *Dumper) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { v.print(0, "&ast.ExprBinaryBitwiseXor{\n") v.indent++ @@ -1823,7 +1823,7 @@ func (v *Dump) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { +func (v *Dumper) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { v.print(0, "&ast.ExprBinaryBooleanAnd{\n") v.indent++ @@ -1836,7 +1836,7 @@ func (v *Dump) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { +func (v *Dumper) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { v.print(0, "&ast.ExprBinaryBooleanOr{\n") v.indent++ @@ -1849,7 +1849,7 @@ func (v *Dump) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { +func (v *Dumper) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { v.print(0, "&ast.ExprBinaryCoalesce{\n") v.indent++ @@ -1862,7 +1862,7 @@ func (v *Dump) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { +func (v *Dumper) ExprBinaryConcat(n *ast.ExprBinaryConcat) { v.print(0, "&ast.ExprBinaryConcat{\n") v.indent++ @@ -1875,7 +1875,7 @@ func (v *Dump) ExprBinaryConcat(n *ast.ExprBinaryConcat) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { +func (v *Dumper) ExprBinaryDiv(n *ast.ExprBinaryDiv) { v.print(0, "&ast.ExprBinaryDiv{\n") v.indent++ @@ -1888,7 +1888,7 @@ func (v *Dump) ExprBinaryDiv(n *ast.ExprBinaryDiv) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { +func (v *Dumper) ExprBinaryEqual(n *ast.ExprBinaryEqual) { v.print(0, "&ast.ExprBinaryEqual{\n") v.indent++ @@ -1901,7 +1901,7 @@ func (v *Dump) ExprBinaryEqual(n *ast.ExprBinaryEqual) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { +func (v *Dumper) ExprBinaryGreater(n *ast.ExprBinaryGreater) { v.print(0, "&ast.ExprBinaryGreater{\n") v.indent++ @@ -1914,7 +1914,7 @@ func (v *Dump) ExprBinaryGreater(n *ast.ExprBinaryGreater) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { +func (v *Dumper) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { v.print(0, "&ast.ExprBinaryGreaterOrEqual{\n") v.indent++ @@ -1927,7 +1927,7 @@ func (v *Dump) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { +func (v *Dumper) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { v.print(0, "&ast.ExprBinaryIdentical{\n") v.indent++ @@ -1940,7 +1940,7 @@ func (v *Dump) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { +func (v *Dumper) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { v.print(0, "&ast.ExprBinaryLogicalAnd{\n") v.indent++ @@ -1953,7 +1953,7 @@ func (v *Dump) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { +func (v *Dumper) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { v.print(0, "&ast.ExprBinaryLogicalOr{\n") v.indent++ @@ -1966,7 +1966,7 @@ func (v *Dump) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { +func (v *Dumper) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { v.print(0, "&ast.ExprBinaryLogicalXor{\n") v.indent++ @@ -1979,7 +1979,7 @@ func (v *Dump) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { +func (v *Dumper) ExprBinaryMinus(n *ast.ExprBinaryMinus) { v.print(0, "&ast.ExprBinaryMinus{\n") v.indent++ @@ -1992,7 +1992,7 @@ func (v *Dump) ExprBinaryMinus(n *ast.ExprBinaryMinus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { +func (v *Dumper) ExprBinaryMod(n *ast.ExprBinaryMod) { v.print(0, "&ast.ExprBinaryMod{\n") v.indent++ @@ -2005,7 +2005,7 @@ func (v *Dump) ExprBinaryMod(n *ast.ExprBinaryMod) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { +func (v *Dumper) ExprBinaryMul(n *ast.ExprBinaryMul) { v.print(0, "&ast.ExprBinaryMul{\n") v.indent++ @@ -2018,7 +2018,7 @@ func (v *Dump) ExprBinaryMul(n *ast.ExprBinaryMul) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { +func (v *Dumper) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { v.print(0, "&ast.ExprBinaryNotEqual{\n") v.indent++ @@ -2031,7 +2031,7 @@ func (v *Dump) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { +func (v *Dumper) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { v.print(0, "&ast.ExprBinaryNotIdentical{\n") v.indent++ @@ -2044,7 +2044,7 @@ func (v *Dump) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { +func (v *Dumper) ExprBinaryPlus(n *ast.ExprBinaryPlus) { v.print(0, "&ast.ExprBinaryPlus{\n") v.indent++ @@ -2057,7 +2057,7 @@ func (v *Dump) ExprBinaryPlus(n *ast.ExprBinaryPlus) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { +func (v *Dumper) ExprBinaryPow(n *ast.ExprBinaryPow) { v.print(0, "&ast.ExprBinaryPow{\n") v.indent++ @@ -2070,7 +2070,7 @@ func (v *Dump) ExprBinaryPow(n *ast.ExprBinaryPow) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { +func (v *Dumper) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { v.print(0, "&ast.ExprBinaryShiftLeft{\n") v.indent++ @@ -2083,7 +2083,7 @@ func (v *Dump) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { +func (v *Dumper) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { v.print(0, "&ast.ExprBinaryShiftRight{\n") v.indent++ @@ -2096,7 +2096,7 @@ func (v *Dump) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { +func (v *Dumper) ExprBinarySmaller(n *ast.ExprBinarySmaller) { v.print(0, "&ast.ExprBinarySmaller{\n") v.indent++ @@ -2109,7 +2109,7 @@ func (v *Dump) ExprBinarySmaller(n *ast.ExprBinarySmaller) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { +func (v *Dumper) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { v.print(0, "&ast.ExprBinarySmallerOrEqual{\n") v.indent++ @@ -2122,7 +2122,7 @@ func (v *Dump) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { v.print(v.indent, "},\n") } -func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { +func (v *Dumper) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { v.print(0, "&ast.ExprBinarySpaceship{\n") v.indent++ @@ -2135,7 +2135,7 @@ func (v *Dump) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { +func (v *Dumper) ExprCastArray(n *ast.ExprCastArray) { v.print(0, "&ast.ExprCastArray{\n") v.indent++ @@ -2147,7 +2147,7 @@ func (v *Dump) ExprCastArray(n *ast.ExprCastArray) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { +func (v *Dumper) ExprCastBool(n *ast.ExprCastBool) { v.print(0, "&ast.ExprCastBool{\n") v.indent++ @@ -2159,7 +2159,7 @@ func (v *Dump) ExprCastBool(n *ast.ExprCastBool) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { +func (v *Dumper) ExprCastDouble(n *ast.ExprCastDouble) { v.print(0, "&ast.ExprCastDouble{\n") v.indent++ @@ -2171,7 +2171,7 @@ func (v *Dump) ExprCastDouble(n *ast.ExprCastDouble) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { +func (v *Dumper) ExprCastInt(n *ast.ExprCastInt) { v.print(0, "&ast.ExprCastInt{\n") v.indent++ @@ -2183,7 +2183,7 @@ func (v *Dump) ExprCastInt(n *ast.ExprCastInt) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { +func (v *Dumper) ExprCastObject(n *ast.ExprCastObject) { v.print(0, "&ast.ExprCastObject{\n") v.indent++ @@ -2195,7 +2195,7 @@ func (v *Dump) ExprCastObject(n *ast.ExprCastObject) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastString(n *ast.ExprCastString) { +func (v *Dumper) ExprCastString(n *ast.ExprCastString) { v.print(0, "&ast.ExprCastString{\n") v.indent++ @@ -2207,7 +2207,7 @@ func (v *Dump) ExprCastString(n *ast.ExprCastString) { v.print(v.indent, "},\n") } -func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { +func (v *Dumper) ExprCastUnset(n *ast.ExprCastUnset) { v.print(0, "&ast.ExprCastUnset{\n") v.indent++ @@ -2219,7 +2219,7 @@ func (v *Dump) ExprCastUnset(n *ast.ExprCastUnset) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { +func (v *Dumper) ScalarDnumber(n *ast.ScalarDnumber) { v.print(0, "&ast.ScalarDnumber{\n") v.indent++ @@ -2231,7 +2231,7 @@ func (v *Dump) ScalarDnumber(n *ast.ScalarDnumber) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { +func (v *Dumper) ScalarEncapsed(n *ast.ScalarEncapsed) { v.print(0, "&ast.ScalarEncapsed{\n") v.indent++ @@ -2244,7 +2244,7 @@ func (v *Dump) ScalarEncapsed(n *ast.ScalarEncapsed) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { +func (v *Dumper) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.print(0, "&ast.ScalarEncapsedStringPart{\n") v.indent++ @@ -2256,7 +2256,7 @@ func (v *Dump) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { +func (v *Dumper) ScalarHeredoc(n *ast.ScalarHeredoc) { v.print(0, "&ast.ScalarHeredoc{\n") v.indent++ @@ -2269,7 +2269,7 @@ func (v *Dump) ScalarHeredoc(n *ast.ScalarHeredoc) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { +func (v *Dumper) ScalarLnumber(n *ast.ScalarLnumber) { v.print(0, "&ast.ScalarLnumber{\n") v.indent++ @@ -2281,7 +2281,7 @@ func (v *Dump) ScalarLnumber(n *ast.ScalarLnumber) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { +func (v *Dumper) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.print(0, "&ast.ScalarMagicConstant{\n") v.indent++ @@ -2293,7 +2293,7 @@ func (v *Dump) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.print(v.indent, "},\n") } -func (v *Dump) ScalarString(n *ast.ScalarString) { +func (v *Dumper) ScalarString(n *ast.ScalarString) { v.print(0, "&ast.ScalarString{\n") v.indent++ @@ -2306,7 +2306,7 @@ func (v *Dump) ScalarString(n *ast.ScalarString) { v.print(v.indent, "},\n") } -func (v *Dump) NameName(n *ast.NameName) { +func (v *Dumper) NameName(n *ast.NameName) { v.print(0, "&ast.NameName{\n") v.indent++ @@ -2318,7 +2318,7 @@ func (v *Dump) NameName(n *ast.NameName) { v.print(v.indent, "},\n") } -func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { +func (v *Dumper) NameFullyQualified(n *ast.NameFullyQualified) { v.print(0, "&ast.NameFullyQualified{\n") v.indent++ @@ -2331,7 +2331,7 @@ func (v *Dump) NameFullyQualified(n *ast.NameFullyQualified) { v.print(v.indent, "},\n") } -func (v *Dump) NameRelative(n *ast.NameRelative) { +func (v *Dumper) NameRelative(n *ast.NameRelative) { v.print(0, "&ast.NameRelative{\n") v.indent++ @@ -2345,7 +2345,7 @@ func (v *Dump) NameRelative(n *ast.NameRelative) { v.print(v.indent, "},\n") } -func (v *Dump) NameNamePart(n *ast.NameNamePart) { +func (v *Dumper) NameNamePart(n *ast.NameNamePart) { v.print(0, "&ast.NameNamePart{\n") v.indent++ @@ -2357,7 +2357,7 @@ func (v *Dump) NameNamePart(n *ast.NameNamePart) { v.print(v.indent, "},\n") } -func (v *Dump) ParserBrackets(n *ast.ParserBrackets) { +func (v *Dumper) ParserBrackets(n *ast.ParserBrackets) { v.print(0, "&ast.ParserBrackets{\n") v.indent++ diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dumper_test.go similarity index 95% rename from pkg/ast/visitor/dump_test.go rename to pkg/ast/visitor/dumper_test.go index f3a26df..c9f3e8c 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dumper_test.go @@ -13,7 +13,7 @@ import ( func TestDumper_root(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewDump(o).WithTokens().WithPositions() + p := visitor.NewDumper(o).WithTokens().WithPositions() n := &ast.Root{ Position: &position.Position{ StartLine: 1, From 7b8b1ce7b970b6ddf1a894cc4081417dcb65a950 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 20 Dec 2020 01:28:47 +0200 Subject: [PATCH 114/140] refactoring: update formatter --- pkg/ast/visitor/formatter.go | 1997 ++++++++ pkg/ast/visitor/formatter_test.go | 6740 ++++++++++++++++++++++++++++ pkg/printer/pretty_printer.go | 2181 --------- pkg/printer/pretty_printer_test.go | 4097 ----------------- 4 files changed, 8737 insertions(+), 6278 deletions(-) create mode 100644 pkg/ast/visitor/formatter.go create mode 100644 pkg/ast/visitor/formatter_test.go delete mode 100644 pkg/printer/pretty_printer.go delete mode 100644 pkg/printer/pretty_printer_test.go diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go new file mode 100644 index 0000000..31b1475 --- /dev/null +++ b/pkg/ast/visitor/formatter.go @@ -0,0 +1,1997 @@ +package visitor + +import ( + "bytes" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" +) + +type formatterState int + +const ( + FormatterStateHTML formatterState = iota + FormatterStatePHP +) + +type formatter struct { + state formatterState + indent int + freeFloating []*token.Token + + lastSemiColon *token.Token +} + +func NewFormatter() *formatter { + return &formatter{} +} + +func (f *formatter) WithState(state formatterState) *formatter { + f.state = state + return f +} + +func (f *formatter) WithIndent(indent int) *formatter { + f.indent = indent + return f +} + +func (f *formatter) addFreeFloating(id token.ID, val []byte) { + f.freeFloating = append(f.freeFloating, &token.Token{ + ID: id, + Value: val, + }) +} + +func (f *formatter) addIndent() { + if f.indent < 1 { + return + } + + f.freeFloating = append(f.freeFloating, &token.Token{ + ID: token.T_WHITESPACE, + Value: bytes.Repeat([]byte(" "), f.indent), + }) +} + +func (f *formatter) resetFreeFloating() { + f.freeFloating = nil +} + +func (f *formatter) getFreeFloating() []*token.Token { + defer f.resetFreeFloating() + + if f.state == FormatterStateHTML { + t := &token.Token{ + ID: token.T_OPEN_TAG, + Value: []byte("') + } else { + *list = insert(*list, i+insertCounter, &ast.StmtNop{ + SemiColonTkn: &token.Token{ + Value: []byte("?>"), + }, + }) + insertCounter++ + } + } else { + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + stmt.Accept(f) + } +} + +func (f *formatter) newSemicolonTkn() *token.Token { + f.lastSemiColon = f.newToken(';', []byte(";")) + return f.lastSemiColon +} + +func insert(s []ast.Vertex, k int, vs ...ast.Vertex) []ast.Vertex { + if n := len(s) + len(vs); n <= cap(s) { + s2 := s[:n] + copy(s2[k+len(vs):], s[k:]) + copy(s2[k:], vs) + return s2 + } + s2 := make([]ast.Vertex, len(s)+len(vs)) + copy(s2, s[:k]) + copy(s2[k:], vs) + copy(s2[k+len(vs):], s[k:]) + return s2 +} + +func (f *formatter) Root(n *ast.Root) { + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + + f.formatStmts(&n.Stmts) +} + +func (f *formatter) Nullable(n *ast.Nullable) { + n.QuestionTkn = f.newToken('?', []byte("?")) + n.Expr.Accept(f) +} + +func (f *formatter) Parameter(n *ast.Parameter) { + if n.Type != nil { + n.Type.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + if n.VariadicTkn != nil { + n.VariadicTkn = f.newToken(token.T_ELLIPSIS, []byte("...")) + } + + n.Var.Accept(f) + + if n.DefaultValue != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.DefaultValue.Accept(f) + } +} + +func (f *formatter) Identifier(n *ast.Identifier) { + if n.IdentifierTkn == nil { + n.IdentifierTkn = f.newToken(token.T_STRING, n.Value) + } else { + n.IdentifierTkn.FreeFloating = f.getFreeFloating() + } +} + +func (f *formatter) Argument(n *ast.Argument) { + if n.VariadicTkn != nil { + n.VariadicTkn = f.newToken(token.T_ELLIPSIS, []byte("...")) + } + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.Expr.Accept(f) +} + +func (f *formatter) StmtBreak(n *ast.StmtBreak) { + n.BreakTkn = f.newToken(token.T_BREAK, []byte("break")) + + if n.Expr != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtCase(n *ast.StmtCase) { + n.CaseTkn = f.newToken(token.T_CASE, []byte("case")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Cond.Accept(f) + + n.CaseSeparatorTkn = f.newToken(':', []byte(":")) + + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- +} + +func (f *formatter) StmtCatch(n *ast.StmtCatch) { + n.CatchTkn = f.newToken(token.T_CATCH, []byte("catch")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.SeparatorTkns = make([]*token.Token, len(n.Types)-1) + for i, t := range n.Types { + t.Accept(f) + + if i != len(n.Types)-1 { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.SeparatorTkns[i] = f.newToken('|', []byte("|")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Var.Accept(f) + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtClass(n *ast.StmtClass) { + for _, m := range n.Modifiers { + m.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.ClassTkn = f.newToken(token.T_CLASS, []byte("class")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ClassName.Accept(f) + + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + if len(n.Arguments) > 0 { + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.SeparatorTkns = f.formatList(n.Arguments, ',') + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + if n.Extends != nil { + n.Extends.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + if n.Implements != nil { + n.Implements.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtClassConstList(n *ast.StmtClassConstList) { + for _, m := range n.Modifiers { + m.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.ConstTkn = f.newToken(token.T_CONST, []byte("const")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = f.formatList(n.Consts, ',') + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtClassExtends(n *ast.StmtClassExtends) { + n.ExtendTkn = f.newToken(token.T_EXTENDS, []byte("extends")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.ClassName.Accept(f) +} + +func (f *formatter) StmtClassImplements(n *ast.StmtClassImplements) { + n.ImplementsTkn = f.newToken(token.T_IMPLEMENTS, []byte("implements")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = f.formatList(n.InterfaceNames, ',') +} + +func (f *formatter) StmtClassMethod(n *ast.StmtClassMethod) { + for _, m := range n.Modifiers { + m.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.FunctionTkn = f.newToken(token.T_FUNCTION, []byte("function")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.MethodName.Accept(f) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.SeparatorTkns = nil + if len(n.Params) > 0 { + n.SeparatorTkns = f.formatList(n.Params, ',') + } + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + if n.ReturnType != nil { + n.ColonTkn = f.newToken(':', []byte(":")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ReturnType.Accept(f) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtConstList(n *ast.StmtConstList) { + n.ConstTkn = f.newToken(token.T_CONST, []byte("const")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = f.formatList(n.Consts, ',') + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtConstant(n *ast.StmtConstant) { + n.Name.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) StmtContinue(n *ast.StmtContinue) { + n.ContinueTkn = f.newToken(token.T_CONTINUE, []byte("continue")) + + if n.Expr != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtDeclare(n *ast.StmtDeclare) { + n.ColonTkn = nil + n.EndDeclareTkn = nil + n.SemiColonTkn = nil + + n.DeclareTkn = f.newToken(token.T_DECLARE, []byte("declare")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.SeparatorTkns = nil + if len(n.Consts) > 0 { + n.SeparatorTkns = f.formatList(n.Consts, ',') + } + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtDefault(n *ast.StmtDefault) { + n.DefaultTkn = f.newToken(token.T_DEFAULT, []byte("default")) + + n.CaseSeparatorTkn = f.newToken(':', []byte(":")) + + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- +} + +func (f *formatter) StmtDo(n *ast.StmtDo) { + n.DoTkn = f.newToken(token.T_DO, []byte("do")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.WhileTkn = f.newToken(token.T_WHILE, []byte("while")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Cond.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtEcho(n *ast.StmtEcho) { + n.EchoTkn = f.newToken(token.T_ECHO, []byte("echo")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = nil + if len(n.Exprs) > 0 { + n.SeparatorTkns = f.formatList(n.Exprs, ',') + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtElse(n *ast.StmtElse) { + n.ColonTkn = nil + + n.ElseTkn = f.newToken(token.T_ELSE, []byte("else")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtElseIf(n *ast.StmtElseIf) { + n.ColonTkn = nil + + n.ElseIfTkn = f.newToken(token.T_ELSEIF, []byte("elseif")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Cond.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtExpression(n *ast.StmtExpression) { + n.Expr.Accept(f) + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtFinally(n *ast.StmtFinally) { + n.FinallyTkn = f.newToken(token.T_FINALLY, []byte("finally")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtFor(n *ast.StmtFor) { + n.ColonTkn = nil + n.EndForTkn = nil + n.SemiColonTkn = nil + + n.ForTkn = f.newToken(token.T_FOR, []byte("for")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.InitSeparatorTkns = nil + if len(n.Init) > 0 { + n.InitSeparatorTkns = f.formatList(n.Init, ',') + } + + n.InitSemiColonTkn = f.newSemicolonTkn() + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.CondSeparatorTkns = nil + if len(n.Cond) > 0 { + n.CondSeparatorTkns = f.formatList(n.Cond, ',') + } + + n.CondSemiColonTkn = f.newSemicolonTkn() + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.LoopSeparatorTkns = nil + if len(n.Loop) > 0 { + n.LoopSeparatorTkns = f.formatList(n.Loop, ',') + } + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtForeach(n *ast.StmtForeach) { + n.ColonTkn = nil + n.EndForeachTkn = nil + n.SemiColonTkn = nil + + n.ForeachTkn = f.newToken(token.T_FOREACH, []byte("foreach")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.Expr.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.AsTkn = f.newToken(token.T_AS, []byte("as")) + + if n.Key != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Key.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.DoubleArrowTkn = f.newToken(token.T_DOUBLE_ARROW, []byte("=>")) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Var.Accept(f) + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) StmtFunction(n *ast.StmtFunction) { + n.FunctionTkn = f.newToken(token.T_FUNCTION, []byte("function")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.FunctionName.Accept(f) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + + n.SeparatorTkns = nil + if len(n.Params) > 0 { + n.SeparatorTkns = f.formatList(n.Params, ',') + } + + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + if n.ReturnType != nil { + n.ColonTkn = f.newToken(':', []byte(":")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ReturnType.Accept(f) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtGlobal(n *ast.StmtGlobal) { + n.GlobalTkn = f.newToken(token.T_GLOBAL, []byte("global")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = nil + if len(n.Vars) > 0 { + n.SeparatorTkns = f.formatList(n.Vars, ',') + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtGoto(n *ast.StmtGoto) { + n.GotoTkn = f.newToken(token.T_GOTO, []byte("goto")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Label.Accept(f) + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtHaltCompiler(n *ast.StmtHaltCompiler) { + n.HaltCompilerTkn = f.newToken(token.T_HALT_COMPILER, []byte("__halt_compiler")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtIf(n *ast.StmtIf) { + n.ColonTkn = nil + n.EndIfTkn = nil + n.SemiColonTkn = nil + + n.IfTkn = f.newToken(token.T_IF, []byte("if")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Cond.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) + + if len(n.ElseIf) > 0 { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + f.formatList(n.ElseIf, ' ') + } + + if n.Else != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Else.Accept(f) + } +} + +func (f *formatter) StmtInlineHtml(n *ast.StmtInlineHtml) { + n.InlineHtmlTkn = f.newToken(token.T_STRING, n.Value) + f.state = FormatterStateHTML +} + +func (f *formatter) StmtInterface(n *ast.StmtInterface) { + n.InterfaceTkn = f.newToken(token.T_INTERFACE, []byte("interface")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.InterfaceName.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.Extends != nil { + n.Extends.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { + n.ExtendsTkn = f.newToken(token.T_EXTENDS, []byte("extends")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = nil + if len(n.InterfaceNames) > 0 { + n.SeparatorTkns = f.formatList(n.InterfaceNames, ',') + } +} + +func (f *formatter) StmtLabel(n *ast.StmtLabel) { + n.LabelName.Accept(f) + n.ColonTkn = f.newToken(':', []byte(":")) +} + +func (f *formatter) StmtNamespace(n *ast.StmtNamespace) { + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + n.SemiColonTkn = nil + + n.NsTkn = f.newToken(token.T_NAMESPACE, []byte("namespace")) + + if n.Name != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Name.Accept(f) + } + + if len(n.Stmts) > 0 { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + } else { + n.SemiColonTkn = f.newSemicolonTkn() + } + +} + +func (f *formatter) StmtNop(n *ast.StmtNop) { + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtProperty(n *ast.StmtProperty) { + n.Var.Accept(f) + + if n.Expr != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) + } +} + +func (f *formatter) StmtPropertyList(n *ast.StmtPropertyList) { + for _, m := range n.Modifiers { + m.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + if n.Type != nil { + n.Type.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.SeparatorTkns = f.formatList(n.Properties, ',') + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtReturn(n *ast.StmtReturn) { + n.ReturnTkn = f.newToken(token.T_RETURN, []byte("return")) + + if n.Expr != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtStatic(n *ast.StmtStatic) { + n.StaticTkn = f.newToken(token.T_STATIC, []byte("static")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = nil + if len(n.Vars) > 0 { + n.SeparatorTkns = f.formatList(n.Vars, ',') + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtStaticVar(n *ast.StmtStaticVar) { + n.Var.Accept(f) + + if n.Expr != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) + } +} + +func (f *formatter) StmtStmtList(n *ast.StmtStmtList) { + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtSwitch(n *ast.StmtSwitch) { + n.CaseSeparatorTkn = nil + n.ColonTkn = nil + n.EndSwitchTkn = nil + n.SemiColonTkn = nil + + n.SwitchTkn = f.newToken(token.T_SWITCH, []byte("switch")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Cond.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.CaseList) > 0 { + f.indent++ + f.formatStmts(&n.CaseList) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtThrow(n *ast.StmtThrow) { + n.ThrowTkn = f.newToken(token.T_THROW, []byte("throw")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtTrait(n *ast.StmtTrait) { + n.TraitTkn = f.newToken(token.T_TRAIT, []byte("trait")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.TraitName.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.Extends != nil { + n.Extends.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + if n.Implements != nil { + n.Implements.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Adaptations) > 0 { + f.indent++ + f.formatStmts(&n.Adaptations) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { + if n.Trait != nil { + n.Trait.Accept(f) + n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) + } + + n.Method.Accept(f) +} + +func (f *formatter) StmtTraitUse(n *ast.StmtTraitUse) { + n.UseTkn = f.newToken(token.T_USE, []byte("use")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = f.formatList(n.Traits, ',') + + if _, ok := n.Adaptations.(*ast.StmtTraitAdaptationList); ok { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.Adaptations.Accept(f) +} + +func (f *formatter) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { + n.Ref.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.AsTkn = f.newToken(token.T_AS, []byte("as")) + + if n.Modifier != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Modifier.Accept(f) + } + + if n.Alias != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Alias.Accept(f) + } + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { + n.Ref.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.InsteadofTkn = f.newToken(token.T_INSTEADOF, []byte("insteadof")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.SeparatorTkns = f.formatList(n.Insteadof, ',') + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtTry(n *ast.StmtTry) { + n.TryTkn = f.newToken(token.T_TRY, []byte("try")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + + for _, catch := range n.Catches { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + catch.Accept(f) + } + + if n.Finally != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Finally.Accept(f) + } +} + +func (f *formatter) StmtUnset(n *ast.StmtUnset) { + n.UnsetTkn = f.newToken(token.T_UNSET, []byte("unset")) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Vars, ',') + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtUse(n *ast.StmtUse) { + n.UseTkn = f.newToken(token.T_USE, []byte("use")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.Type != nil { + n.Type.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.SeparatorTkns = f.formatList(n.UseDeclarations, ',') + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtGroupUse(n *ast.StmtGroupUse) { + n.UseTkn = f.newToken(token.T_USE, []byte("use")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.Type != nil { + n.Type.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.LeadingNsSeparatorTkn = nil + + n.Prefix.Accept(f) + n.NsSeparatorTkn = f.newToken(token.T_NS_SEPARATOR, []byte("\\")) + + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + n.SeparatorTkns = f.formatList(n.UseDeclarations, ',') + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + + n.SemiColonTkn = f.newSemicolonTkn() +} + +func (f *formatter) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + if n.Type != nil { + n.Type.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.NsSeparatorTkn = nil + + n.Use.Accept(f) + + if n.Alias != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.AsTkn = f.newToken(token.T_AS, []byte("as")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Alias.Accept(f) + } +} + +func (f *formatter) StmtWhile(n *ast.StmtWhile) { + n.ColonTkn = nil + n.EndWhileTkn = nil + n.SemiColonTkn = nil + + n.WhileTkn = f.newToken(token.T_WHILE, []byte("while")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Cond.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Stmt.Accept(f) +} + +func (f *formatter) ExprArray(n *ast.ExprArray) { + n.ArrayTkn = f.newToken(token.T_ARRAY, []byte("array")) + n.OpenBracketTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Items, ',') + n.CloseBracketTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { + n.Var.Accept(f) + n.OpenBracketTkn = f.newToken('[', []byte("[")) + n.Dim.Accept(f) + n.CloseBracketTkn = f.newToken(']', []byte("]")) +} + +func (f *formatter) ExprArrayItem(n *ast.ExprArrayItem) { + if n.EllipsisTkn != nil { + n.EllipsisTkn = f.newToken(token.T_ELLIPSIS, []byte("...")) + } + + if n.Key != nil { + n.Key.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.DoubleArrowTkn = f.newToken(token.T_DOUBLE_ARROW, []byte("=>")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.Val.Accept(f) +} + +func (f *formatter) ExprArrowFunction(n *ast.ExprArrowFunction) { + if n.StaticTkn != nil { + n.StaticTkn = f.newToken(token.T_STATIC, []byte("static")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.FnTkn = f.newToken(token.T_FN, []byte("fn")) + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = nil + if len(n.Params) > 0 { + n.SeparatorTkns = f.formatList(n.Params, ',') + } + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + n.ColonTkn = nil + if n.ReturnType != nil { + n.ColonTkn = f.newToken(':', []byte(":")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ReturnType.Accept(f) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.DoubleArrowTkn = f.newToken(token.T_DOUBLE_ARROW, []byte("=>")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprBitwiseNot(n *ast.ExprBitwiseNot) { + n.TildaTkn = f.newToken('~', []byte("~")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprBooleanNot(n *ast.ExprBooleanNot) { + n.ExclamationTkn = f.newToken('!', []byte("!")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprClassConstFetch(n *ast.ExprClassConstFetch) { + n.Class.Accept(f) + n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) + n.ConstantName.Accept(f) +} + +func (f *formatter) ExprClone(n *ast.ExprClone) { + n.CloneTkn = f.newToken(token.T_CLONE, []byte("clone")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprClosure(n *ast.ExprClosure) { + if n.StaticTkn != nil { + n.StaticTkn = f.newToken(token.T_STATIC, []byte("static")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.FunctionTkn = f.newToken(token.T_FN, []byte("function")) + + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = nil + if len(n.Params) > 0 { + n.SeparatorTkns = f.formatList(n.Params, ',') + } + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + + if n.ClosureUse != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ClosureUse.Accept(f) + } + + n.ColonTkn = nil + if n.ReturnType != nil { + n.ColonTkn = f.newToken(':', []byte(":")) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.ReturnType.Accept(f) + } + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + if len(n.Stmts) > 0 { + f.indent++ + f.formatStmts(&n.Stmts) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + +func (f *formatter) ExprClosureUse(n *ast.ExprClosureUse) { + n.UseTkn = f.newToken(token.T_USE, []byte("use")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Uses, ',') + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprConstFetch(n *ast.ExprConstFetch) { + n.Const.Accept(f) +} + +func (f *formatter) ExprEmpty(n *ast.ExprEmpty) { + n.EmptyTkn = f.newToken(token.T_EMPTY, []byte("empty")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Expr.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprErrorSuppress(n *ast.ExprErrorSuppress) { + n.AtTkn = f.newToken('@', []byte("@")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprEval(n *ast.ExprEval) { + n.EvalTkn = f.newToken(token.T_EVAL, []byte("eval")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Expr.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprExit(n *ast.ExprExit) { + n.DieTkn = f.newToken(token.T_EVAL, []byte("exit")) + + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + if n.Expr != nil { + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.Expr.Accept(f) + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + } +} + +func (f *formatter) ExprFunctionCall(n *ast.ExprFunctionCall) { + n.Function.Accept(f) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = nil + if len(n.Arguments) > 0 { + n.SeparatorTkns = f.formatList(n.Arguments, ',') + } + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprInclude(n *ast.ExprInclude) { + n.IncludeTkn = f.newToken(token.T_INCLUDE, []byte("include")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprIncludeOnce(n *ast.ExprIncludeOnce) { + n.IncludeTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprInstanceOf(n *ast.ExprInstanceOf) { + n.Expr.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.InstanceOfTkn = f.newToken(token.T_INSTANCEOF, []byte("instanceof")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Class.Accept(f) +} + +func (f *formatter) ExprIsset(n *ast.ExprIsset) { + n.IssetTkn = f.newToken(token.T_ISSET, []byte("isset")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Vars, ',') + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprList(n *ast.ExprList) { + n.ListTkn = f.newToken(token.T_LIST, []byte("list")) + n.OpenBracketTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Items, ',') + n.CloseBracketTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprMethodCall(n *ast.ExprMethodCall) { + n.Var.Accept(f) + n.ObjectOperatorTkn = f.newToken(token.T_OBJECT_OPERATOR, []byte("->")) + n.Method.Accept(f) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = nil + if len(n.Arguments) > 0 { + n.SeparatorTkns = f.formatList(n.Arguments, ',') + } + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprNew(n *ast.ExprNew) { + n.NewTkn = f.newToken(token.T_NEW, []byte("new")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Class.Accept(f) + + n.SeparatorTkns = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + if len(n.Arguments) > 0 { + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Arguments, ',') + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + } +} + +func (f *formatter) ExprPostDec(n *ast.ExprPostDec) { + n.Var.Accept(f) + n.DecTkn = f.newToken(token.T_DEC, []byte("--")) +} + +func (f *formatter) ExprPostInc(n *ast.ExprPostInc) { + n.Var.Accept(f) + n.IncTkn = f.newToken(token.T_INC, []byte("++")) +} + +func (f *formatter) ExprPreDec(n *ast.ExprPreDec) { + n.DecTkn = f.newToken(token.T_DEC, []byte("--")) + n.Var.Accept(f) +} + +func (f *formatter) ExprPreInc(n *ast.ExprPreInc) { + n.IncTkn = f.newToken(token.T_INC, []byte("++")) + n.Var.Accept(f) +} + +func (f *formatter) ExprPrint(n *ast.ExprPrint) { + n.PrintTkn = f.newToken(token.T_PRINT, []byte("print")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) { + n.Var.Accept(f) + n.ObjectOperatorTkn = f.newToken(token.T_OBJECT_OPERATOR, []byte("->")) + n.Property.Accept(f) +} + +func (f *formatter) ExprReference(n *ast.ExprReference) { + n.AmpersandTkn = f.newToken('&', []byte("&")) + n.Var.Accept(f) +} + +func (f *formatter) ExprRequire(n *ast.ExprRequire) { + n.RequireTkn = f.newToken(token.T_REQUIRE, []byte("require")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprRequireOnce(n *ast.ExprRequireOnce) { + n.RequireOnceTkn = f.newToken(token.T_REQUIRE_ONCE, []byte("require_once")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprShellExec(n *ast.ExprShellExec) { + n.OpenBacktickTkn = f.newToken('`', []byte("`")) + for _, p := range n.Parts { + p.Accept(f) + } + n.CloseBacktickTkn = f.newToken('`', []byte("`")) +} + +func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) { + n.Class.Accept(f) + n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) + n.Call.Accept(f) + + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = nil + if len(n.Arguments) > 0 { + n.SeparatorTkns = f.formatList(n.Arguments, ',') + } + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) +} + +func (f *formatter) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { + n.Class.Accept(f) + n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) + n.Property.Accept(f) +} + +func (f *formatter) ExprTernary(n *ast.ExprTernary) { + n.Condition.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.QuestionTkn = f.newToken('?', []byte("?")) + if n.IfTrue != nil { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.IfTrue.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + n.ColonTkn = f.newToken(':', []byte(":")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.IfFalse.Accept(f) +} + +func (f *formatter) ExprUnaryMinus(n *ast.ExprUnaryMinus) { + n.MinusTkn = f.newToken('-', []byte("-")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprUnaryPlus(n *ast.ExprUnaryPlus) { + n.PlusTkn = f.newToken('+', []byte("+")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprVariable(n *ast.ExprVariable) { + if _, ok := n.VarName.(*ast.Identifier); !ok { + n.DollarTkn = f.newToken('$', []byte("$")) + } + + n.VarName.Accept(f) +} + +func (f *formatter) ExprYield(n *ast.ExprYield) { + n.YieldTkn = f.newToken(token.T_YIELD, []byte("yield")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + if n.Key != nil { + n.Key.Accept(f) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.DoubleArrowTkn = f.newToken(token.T_DOUBLE_ARROW, []byte("=>")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + } + + n.Value.Accept(f) +} + +func (f *formatter) ExprYieldFrom(n *ast.ExprYieldFrom) { + n.YieldFromTkn = f.newToken(token.T_YIELD_FROM, []byte("yield from")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssign(n *ast.ExprAssign) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignReference(n *ast.ExprAssignReference) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken('=', []byte("=")) + n.AmpersandTkn = f.newToken('&', []byte("&")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_AND_EQUAL, []byte("&=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_OR_EQUAL, []byte("|=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_XOR_EQUAL, []byte("^=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_COALESCE_EQUAL, []byte("??=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignConcat(n *ast.ExprAssignConcat) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_CONCAT_EQUAL, []byte(".=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignDiv(n *ast.ExprAssignDiv) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_DIV_EQUAL, []byte("/=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignMinus(n *ast.ExprAssignMinus) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_MINUS_EQUAL, []byte("-=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignMod(n *ast.ExprAssignMod) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_MOD_EQUAL, []byte("%=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignMul(n *ast.ExprAssignMul) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_MUL_EQUAL, []byte("*=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignPlus(n *ast.ExprAssignPlus) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_PLUS_EQUAL, []byte("+=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignPow(n *ast.ExprAssignPow) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_POW_EQUAL, []byte("**=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_SL_EQUAL, []byte("<<=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { + n.Var.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.EqualTkn = f.newToken(token.T_SR_EQUAL, []byte(">>=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Expr.Accept(f) +} + +func (f *formatter) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('&', []byte("&")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('|', []byte("|")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('^', []byte("^")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_BOOLEAN_AND, []byte("&&")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_BOOLEAN_OR, []byte("||")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_COALESCE, []byte("??")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryConcat(n *ast.ExprBinaryConcat) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('.', []byte(".")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryDiv(n *ast.ExprBinaryDiv) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('/', []byte("/")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryEqual(n *ast.ExprBinaryEqual) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_EQUAL, []byte("==")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryGreater(n *ast.ExprBinaryGreater) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('>', []byte(">")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_GREATER_OR_EQUAL, []byte(">=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_IDENTICAL, []byte("===")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_LOGICAL_AND, []byte("and")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_LOGICAL_OR, []byte("or")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_LOGICAL_XOR, []byte("xor")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryMinus(n *ast.ExprBinaryMinus) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('-', []byte("-")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryMod(n *ast.ExprBinaryMod) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('%', []byte("%")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryMul(n *ast.ExprBinaryMul) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('*', []byte("*")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_NOT_EQUAL, []byte("!=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_NOT_IDENTICAL, []byte("!==")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryPlus(n *ast.ExprBinaryPlus) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('+', []byte("+")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryPow(n *ast.ExprBinaryPow) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_POW, []byte("**")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_SL, []byte("<<")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_SR, []byte(">>")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinarySmaller(n *ast.ExprBinarySmaller) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken('<', []byte("<")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_IS_SMALLER_OR_EQUAL, []byte("<=")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { + n.Left.Accept(f) + + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpTkn = f.newToken(token.T_SPACESHIP, []byte("<=>")) + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + + n.Right.Accept(f) +} + +func (f *formatter) ExprCastArray(n *ast.ExprCastArray) { + n.CastTkn = f.newToken(token.T_ARRAY_CAST, []byte("(array)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastBool(n *ast.ExprCastBool) { + n.CastTkn = f.newToken(token.T_BOOL_CAST, []byte("(bool)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastDouble(n *ast.ExprCastDouble) { + n.CastTkn = f.newToken(token.T_DOUBLE_CAST, []byte("(float)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastInt(n *ast.ExprCastInt) { + n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(integer)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastObject(n *ast.ExprCastObject) { + n.CastTkn = f.newToken(token.T_OBJECT_CAST, []byte("(object)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastString(n *ast.ExprCastString) { + n.CastTkn = f.newToken(token.T_STRING_CAST, []byte("(string)")) + n.Expr.Accept(f) +} + +func (f *formatter) ExprCastUnset(n *ast.ExprCastUnset) { + n.CastTkn = f.newToken(token.T_UNSET_CAST, []byte("(unset)")) + n.Expr.Accept(f) +} + +func (f *formatter) ScalarDnumber(n *ast.ScalarDnumber) { + if n.NumberTkn == nil { + n.NumberTkn = f.newToken(token.T_STRING, n.Value) + } else { + n.NumberTkn.FreeFloating = f.getFreeFloating() + } +} + +func (f *formatter) ScalarEncapsed(n *ast.ScalarEncapsed) { + n.OpenQuoteTkn = f.newToken('"', []byte("\"")) + for _, p := range n.Parts { + p.Accept(f) + } + n.CloseQuoteTkn = f.newToken('"', []byte("\"")) +} + +func (f *formatter) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { + if n.EncapsedStrTkn == nil { + n.EncapsedStrTkn = f.newToken(token.T_STRING, n.Value) + } else { + n.EncapsedStrTkn.FreeFloating = f.getFreeFloating() + } +} + +func (f *formatter) ScalarHeredoc(n *ast.ScalarHeredoc) { + n.OpenHeredocTkn = f.newToken(token.T_START_HEREDOC, []byte("<< $val) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtFunction(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtFunction{ + FunctionName: &ast.Identifier{ + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function foo() { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtFunction_Ref(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtFunction{ + AmpersandTkn: &token.Token{}, + FunctionName: &ast.Identifier{ + Value: []byte("foo"), + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function &foo() { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtFunction_Params(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtFunction{ + FunctionName: &ast.Identifier{ + Value: []byte("foo"), + }, + Params: []ast.Vertex{ + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function foo($a, $b) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtFunction_ReturnType(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtFunction{ + FunctionName: &ast.Identifier{ + Value: []byte("foo"), + }, + ReturnType: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("bar"), + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function foo(): bar { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtGlobal(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtGlobal{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `global $a, $b;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtGoto(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtGoto{ + Label: &ast.Identifier{ + Value: []byte("FOO"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `goto FOO;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtHaltCompiler(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtHaltCompiler{} + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `__halt_compiler();` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtIf(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `if ($foo) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtIf_ElseIf(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + ElseIf: []ast.Vertex{ + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + }, + &ast.StmtElseIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$baz"), + }, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `if ($foo) { + ; + } elseif($bar) { + ; + } elseif($baz) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtIf_Else(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.StmtIf{ + Cond: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + Else: &ast.StmtElse{ + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `if ($foo) { + ; + } else { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_StmtInlineHtml(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.Root{ + Stmts: []ast.Vertex{ + &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + &ast.StmtInlineHtml{ + Value: []byte("
"), + }, + &ast.StmtEcho{ + Exprs: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + }, + }, + &ast.StmtInlineHtml{ + Value: []byte("
"), + }, + &ast.StmtNop{}, + }, + }, + }, + } + + f := visitor.NewFormatter() + n.Accept(f) + + p := visitor.NewPrinter(o) + n.Accept(p) + + expected := `
$bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprArrayItem_Variadic(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprArrayItem{ + EllipsisTkn: &token.Token{}, + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `...$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprArrowFunction(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprArrowFunction{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `fn() => $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprArrowFunction_Ref(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprArrowFunction{ + AmpersandTkn: &token.Token{}, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `fn&() => $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprArrowFunction_Params(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprArrowFunction{ + Params: []ast.Vertex{ + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `fn($a, $b) => $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprArrowFunction_ReturnType(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprArrowFunction{ + ReturnType: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `fn(): foo => $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBitwiseNot(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBitwiseNot{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `~$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBooleanNot(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBooleanNot{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `!$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClassConstFetch(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClassConstFetch{ + Class: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + ConstantName: &ast.Identifier{ + Value: []byte("bar"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo::bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClone(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClone{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `clone $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosure(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosure{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function() { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosure_Ref(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosure{ + AmpersandTkn: &token.Token{}, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function&() { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosure_Params(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosure{ + Params: []ast.Vertex{ + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Parameter{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function($a, $b) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosure_ReturnType(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosure{ + ReturnType: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function(): foo { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosure_Use(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosure{ + ClosureUse: &ast.ExprClosureUse{ + Uses: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + }, + }, + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `function() use($foo) { + ; + }` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosureUse(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosureUse{ + Uses: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `use($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprConstFetch(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprConstFetch{ + Const: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("FOO"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `FOO` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprEmpty(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprEmpty{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `empty($foo)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprErrorSuppress(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprErrorSuppress{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `@$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprEval(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprEval{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `eval($foo)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprExit(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprExit{} + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `exit` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprExit_Expr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprExit{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `exit($foo)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprFunctionCall(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprFunctionCall{ + Function: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo()` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprFunctionCall_Arguments(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprFunctionCall{ + Function: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo($bar)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprInclude(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprInclude{ + Expr: &ast.ScalarString{ + Value: []byte("'foo.php'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `include 'foo.php'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprIncludeOnce(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprIncludeOnce{ + Expr: &ast.ScalarString{ + Value: []byte("'foo.php'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `include_once 'foo.php'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprInstanceOf(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprInstanceOf{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("bar"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo instanceof bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprIsset(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprIsset{ + Vars: []ast.Vertex{ + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `isset($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprList(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprList{ + Items: []ast.Vertex{ + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.ExprArrayItem{ + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `list($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprMethodCall(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprMethodCall{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Method: &ast.Identifier{ + Value: []byte("bar"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo->bar()` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprMethodCall_Arguments(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprMethodCall{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Method: &ast.Identifier{ + Value: []byte("bar"), + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo->bar($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprNew(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprNew{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `new foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprNew_Arguments(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprNew{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `new foo($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPreDec(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPreDec{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `--$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPreInc(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPreInc{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `++$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPostDec(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPostDec{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo--` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPostInc(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPostInc{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo++` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPrint(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPrint{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `print $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprPropertyFetch(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPropertyFetch{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Property: &ast.Identifier{ + Value: []byte("bar"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo->bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprReference(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprReference{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `&$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprRequire(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprRequire{ + Expr: &ast.ScalarString{ + Value: []byte("'foo.php'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `require 'foo.php'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprRequireOnce(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprRequireOnce{ + Expr: &ast.ScalarString{ + Value: []byte("'foo.php'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `require_once 'foo.php'` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprShellExec(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprShellExec{} + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := "``" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprShellExec_Part(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprShellExec{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Value: []byte("foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := "`foo`" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprShellExec_Parts(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprShellExec{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Value: []byte("foo "), + }, + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Value: []byte(" baz"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := "`foo $bar baz`" + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprStaticCall(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprStaticCall{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Value: []byte("bar"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo::bar()` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprStaticCall_Arguments(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprStaticCall{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Call: &ast.Identifier{ + Value: []byte("bar"), + }, + Arguments: []ast.Vertex{ + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + }, + &ast.Argument{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$b"), + }, + }, + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo::bar($a, $b)` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprStaticPropertyFetch(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprStaticPropertyFetch{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Property: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo::$bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprTernary(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprTernary{ + Condition: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + IfTrue: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + IfFalse: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$baz"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ? $bar : $baz` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprTernary_short(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprTernary{ + Condition: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + IfFalse: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ?: $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprUnaryMinus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprUnaryMinus{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `-$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprUnaryPlus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprUnaryPlus{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `+$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprYield(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprYield{ + Value: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `yield $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprYield_Key(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprYield{ + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Value: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `yield $foo => $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprYieldFrom(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprYieldFrom{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `yield from $foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssign(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssign{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo = $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignReference(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignReference{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo =& $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignBitwiseAnd(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignBitwiseAnd{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo &= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignBitwiseOr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignBitwiseOr{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo |= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignBitwiseXor(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignBitwiseXor{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ^= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignCoalesce(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignCoalesce{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ??= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignConcat(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignConcat{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo .= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignDiv(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignDiv{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo /= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignMinus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignMinus{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo -= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignMod(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignMod{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo %= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignMul(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignMul{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo *= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignPlus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignPlus{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo += $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignPow(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignPow{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo **= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignShiftLeft(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignShiftLeft{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo <<= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprAssignShiftRight(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprAssignShiftRight{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo >>= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryBitwiseAnd(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryBitwiseAnd{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo & $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryBitwiseOr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryBitwiseOr{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo | $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryBitwiseXor(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryBitwiseXor{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ^ $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryBooleanAnd(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryBooleanAnd{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo && $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryBooleanOr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryBooleanOr{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo || $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryCoalesce(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryCoalesce{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ?? $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryConcat(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryConcat{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo . $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryDiv(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryDiv{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo / $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryEqual(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryEqual{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo == $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryGreater(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryGreater{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo > $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryGreaterOrEqual(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryGreaterOrEqual{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo >= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryIdentical(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryIdentical{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo === $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryLogicalAnd(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryLogicalAnd{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo and $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryLogicalOr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryLogicalOr{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo or $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryLogicalXor(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryLogicalXor{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo xor $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryMinus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryMinus{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo - $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryMod(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryMod{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo % $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryMul(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryMul{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo * $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryNotEqual(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryNotEqual{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo != $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryNotIdentical(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryNotIdentical{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo !== $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryPlus(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryPlus{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo + $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryPow(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryPow{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo ** $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryShiftLeft(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryShiftLeft{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo << $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinaryShiftRight(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinaryShiftRight{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo >> $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinarySmaller(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinarySmaller{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo < $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinarySmallerOrEqual(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinarySmallerOrEqual{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo <= $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprBinarySpaceship(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprBinarySpaceship{ + Left: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Right: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo <=> $bar` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastArray(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastArray{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(array)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastBool(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastBool{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(bool)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastDouble(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastDouble{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(float)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastInt(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastInt{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(integer)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastObject(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastObject{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(object)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastString(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastString{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(string)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprCastUnset(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprCastUnset{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `(unset)$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarDnumber(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarDnumber{ + Value: []byte("1234"), + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `1234` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarEncapsed(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarEncapsed{} + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `""` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarEncapsed_Part(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarEncapsed{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Value: []byte("foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `"foo"` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarEncapsed_Parts(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarEncapsed{ + Parts: []ast.Vertex{ + &ast.ScalarEncapsedStringPart{ + Value: []byte("foo "), + }, + &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$bar"), + }, + }, + &ast.ScalarEncapsedStringPart{ + Value: []byte(" baz"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `"foo $bar baz"` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarEncapsedStringPart(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarEncapsedStringPart{ + Value: []byte("foo"), + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ScalarHeredoc(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ScalarHeredoc{} + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `<< 0 { - io.WriteString(p.w, glue) - } - - p.Print(n) - } -} - -func (p *PrettyPrinter) printNodes(nn []ast.Vertex) { - p.indentDepth++ - l := len(nn) - 1 - for k, n := range nn { - p.printIndent() - p.Print(n) - if k < l { - io.WriteString(p.w, "\n") - } - } - p.indentDepth-- -} - -func (p *PrettyPrinter) printIndent() { - for i := 0; i < p.indentDepth; i++ { - io.WriteString(p.w, p.indentStr) - } -} - -func (p *PrettyPrinter) printNode(n ast.Vertex) { - switch n.(type) { - - // node - - case *ast.Root: - p.printNodeRoot(n) - case *ast.Identifier: - p.printNodeIdentifier(n) - case *ast.Parameter: - p.printNodeParameter(n) - case *ast.Nullable: - p.printNodeNullable(n) - case *ast.Argument: - p.printNodeArgument(n) - - // name - - case *ast.NameNamePart: - p.printNameNamePart(n) - case *ast.NameName: - p.printNameName(n) - case *ast.NameFullyQualified: - p.printNameFullyQualified(n) - case *ast.NameRelative: - p.printNameRelative(n) - - // scalar - - case *ast.ScalarLnumber: - p.printScalarLNumber(n) - case *ast.ScalarDnumber: - p.printScalarDNumber(n) - case *ast.ScalarString: - p.printScalarString(n) - case *ast.ScalarEncapsedStringPart: - p.printScalarEncapsedStringPart(n) - case *ast.ScalarEncapsed: - p.printScalarEncapsed(n) - case *ast.ScalarHeredoc: - p.printScalarHeredoc(n) - case *ast.ScalarMagicConstant: - p.printScalarMagicConstant(n) - - // assign - - case *ast.ExprAssign: - p.printAssignAssign(n) - case *ast.ExprAssignReference: - p.printAssignReference(n) - case *ast.ExprAssignBitwiseAnd: - p.printAssignBitwiseAnd(n) - case *ast.ExprAssignBitwiseOr: - p.printAssignBitwiseOr(n) - case *ast.ExprAssignBitwiseXor: - p.printAssignBitwiseXor(n) - case *ast.ExprAssignConcat: - p.printAssignConcat(n) - case *ast.ExprAssignDiv: - p.printAssignDiv(n) - case *ast.ExprAssignMinus: - p.printAssignMinus(n) - case *ast.ExprAssignMod: - p.printAssignMod(n) - case *ast.ExprAssignMul: - p.printAssignMul(n) - case *ast.ExprAssignPlus: - p.printAssignPlus(n) - case *ast.ExprAssignPow: - p.printAssignPow(n) - case *ast.ExprAssignShiftLeft: - p.printAssignShiftLeft(n) - case *ast.ExprAssignShiftRight: - p.printAssignShiftRight(n) - - // binary - - case *ast.ExprBinaryBitwiseAnd: - p.printBinaryBitwiseAnd(n) - case *ast.ExprBinaryBitwiseOr: - p.printBinaryBitwiseOr(n) - case *ast.ExprBinaryBitwiseXor: - p.printBinaryBitwiseXor(n) - case *ast.ExprBinaryBooleanAnd: - p.printBinaryBooleanAnd(n) - case *ast.ExprBinaryBooleanOr: - p.printBinaryBooleanOr(n) - case *ast.ExprBinaryCoalesce: - p.printBinaryCoalesce(n) - case *ast.ExprBinaryConcat: - p.printBinaryConcat(n) - case *ast.ExprBinaryDiv: - p.printBinaryDiv(n) - case *ast.ExprBinaryEqual: - p.printBinaryEqual(n) - case *ast.ExprBinaryGreaterOrEqual: - p.printBinaryGreaterOrEqual(n) - case *ast.ExprBinaryGreater: - p.printBinaryGreater(n) - case *ast.ExprBinaryIdentical: - p.printBinaryIdentical(n) - case *ast.ExprBinaryLogicalAnd: - p.printBinaryLogicalAnd(n) - case *ast.ExprBinaryLogicalOr: - p.printBinaryLogicalOr(n) - case *ast.ExprBinaryLogicalXor: - p.printBinaryLogicalXor(n) - case *ast.ExprBinaryMinus: - p.printBinaryMinus(n) - case *ast.ExprBinaryMod: - p.printBinaryMod(n) - case *ast.ExprBinaryMul: - p.printBinaryMul(n) - case *ast.ExprBinaryNotEqual: - p.printBinaryNotEqual(n) - case *ast.ExprBinaryNotIdentical: - p.printBinaryNotIdentical(n) - case *ast.ExprBinaryPlus: - p.printBinaryPlus(n) - case *ast.ExprBinaryPow: - p.printBinaryPow(n) - case *ast.ExprBinaryShiftLeft: - p.printBinaryShiftLeft(n) - case *ast.ExprBinaryShiftRight: - p.printBinaryShiftRight(n) - case *ast.ExprBinarySmallerOrEqual: - p.printBinarySmallerOrEqual(n) - case *ast.ExprBinarySmaller: - p.printBinarySmaller(n) - case *ast.ExprBinarySpaceship: - p.printBinarySpaceship(n) - - // cast - - case *ast.ExprCastArray: - p.printArray(n) - case *ast.ExprCastBool: - p.printBool(n) - case *ast.ExprCastDouble: - p.printDouble(n) - case *ast.ExprCastInt: - p.printInt(n) - case *ast.ExprCastObject: - p.printObject(n) - case *ast.ExprCastString: - p.printString(n) - case *ast.ExprCastUnset: - p.printUnset(n) - - // expr - - case *ast.ExprArrayDimFetch: - p.printExprArrayDimFetch(n) - case *ast.ExprArrayItem: - p.printExprArrayItem(n) - case *ast.ExprArray: - p.printExprArray(n) - case *ast.ExprBitwiseNot: - p.printExprBitwiseNot(n) - case *ast.ExprBooleanNot: - p.printExprBooleanNot(n) - case *ast.ExprClassConstFetch: - p.printExprClassConstFetch(n) - case *ast.ExprClone: - p.printExprClone(n) - case *ast.ExprClosureUse: - p.printExprClosureUse(n) - case *ast.ExprClosure: - p.printExprClosure(n) - case *ast.ExprConstFetch: - p.printExprConstFetch(n) - case *ast.ExprEmpty: - p.printExprEmpty(n) - case *ast.ExprErrorSuppress: - p.printExprErrorSuppress(n) - case *ast.ExprEval: - p.printExprEval(n) - case *ast.ExprExit: - p.printExprExit(n) - case *ast.ExprFunctionCall: - p.printExprFunctionCall(n) - case *ast.ExprInclude: - p.printExprInclude(n) - case *ast.ExprIncludeOnce: - p.printExprIncludeOnce(n) - case *ast.ExprInstanceOf: - p.printExprInstanceOf(n) - case *ast.ExprIsset: - p.printExprIsset(n) - case *ast.ExprList: - p.printExprList(n) - case *ast.ExprMethodCall: - p.printExprMethodCall(n) - case *ast.ExprNew: - p.printExprNew(n) - case *ast.ExprPostDec: - p.printExprPostDec(n) - case *ast.ExprPostInc: - p.printExprPostInc(n) - case *ast.ExprPreDec: - p.printExprPreDec(n) - case *ast.ExprPreInc: - p.printExprPreInc(n) - case *ast.ExprPrint: - p.printExprPrint(n) - case *ast.ExprPropertyFetch: - p.printExprPropertyFetch(n) - case *ast.ExprReference: - p.printExprReference(n) - case *ast.ExprRequire: - p.printExprRequire(n) - case *ast.ExprRequireOnce: - p.printExprRequireOnce(n) - case *ast.ExprShellExec: - p.printExprShellExec(n) - case *ast.ExprStaticCall: - p.printExprStaticCall(n) - case *ast.ExprStaticPropertyFetch: - p.printExprStaticPropertyFetch(n) - case *ast.ExprTernary: - p.printExprTernary(n) - case *ast.ExprUnaryMinus: - p.printExprUnaryMinus(n) - case *ast.ExprUnaryPlus: - p.printExprUnaryPlus(n) - case *ast.ExprVariable: - p.printExprVariable(n) - case *ast.ExprYieldFrom: - p.printExprYieldFrom(n) - case *ast.ExprYield: - p.printExprYield(n) - - // stmt - - case *ast.StmtBreak: - p.printStmtBreak(n) - case *ast.StmtCase: - p.printStmtCase(n) - case *ast.StmtCatch: - p.printStmtCatch(n) - case *ast.StmtClassMethod: - p.printStmtClassMethod(n) - case *ast.StmtClass: - p.printStmtClass(n) - case *ast.StmtClassConstList: - p.printStmtClassConstList(n) - case *ast.StmtConstant: - p.printStmtConstant(n) - case *ast.StmtContinue: - p.printStmtContinue(n) - case *ast.StmtDeclare: - p.printStmtDeclare(n) - case *ast.StmtDefault: - p.printStmtDefault(n) - case *ast.StmtDo: - p.printStmtDo(n) - case *ast.StmtEcho: - p.printStmtEcho(n) - case *ast.StmtElseIf: - p.printStmtElseif(n) - case *ast.StmtElse: - p.printStmtElse(n) - case *ast.StmtExpression: - p.printStmtExpression(n) - case *ast.StmtFinally: - p.printStmtFinally(n) - case *ast.StmtFor: - p.printStmtFor(n) - case *ast.StmtForeach: - p.printStmtForeach(n) - case *ast.StmtFunction: - p.printStmtFunction(n) - case *ast.StmtGlobal: - p.printStmtGlobal(n) - case *ast.StmtGoto: - p.printStmtGoto(n) - case *ast.StmtHaltCompiler: - p.printStmtHaltCompiler(n) - case *ast.StmtIf: - p.printStmtIf(n) - case *ast.StmtInlineHtml: - p.printStmtInlineHTML(n) - case *ast.StmtInterface: - p.printStmtInterface(n) - case *ast.StmtLabel: - p.printStmtLabel(n) - case *ast.StmtNamespace: - p.printStmtNamespace(n) - case *ast.StmtNop: - p.printStmtNop(n) - case *ast.StmtPropertyList: - p.printStmtPropertyList(n) - case *ast.StmtProperty: - p.printStmtProperty(n) - case *ast.StmtReturn: - p.printStmtReturn(n) - case *ast.StmtStaticVar: - p.printStmtStaticVar(n) - case *ast.StmtStatic: - p.printStmtStatic(n) - case *ast.StmtStmtList: - p.printStmtStmtList(n) - case *ast.StmtSwitch: - p.printStmtSwitch(n) - case *ast.StmtThrow: - p.printStmtThrow(n) - case *ast.StmtTraitMethodRef: - p.printStmtTraitMethodRef(n) - case *ast.StmtTraitUseAlias: - p.printStmtTraitUseAlias(n) - case *ast.StmtTraitUsePrecedence: - p.printStmtTraitUsePrecedence(n) - case *ast.StmtTraitUse: - p.printStmtTraitUse(n) - case *ast.StmtTrait: - p.printStmtTrait(n) - case *ast.StmtTry: - p.printStmtTry(n) - case *ast.StmtUnset: - p.printStmtUnset(n) - case *ast.StmtUse: - p.printStmtUse(n) - case *ast.StmtGroupUse: - p.printStmtGroupUse(n) - case *ast.StmtUseDeclaration: - p.printStmtUseDeclaration(n) - case *ast.StmtWhile: - p.printStmtWhile(n) - } -} - -// node - -func (p *PrettyPrinter) printNodeRoot(n ast.Vertex) { - var stmts []ast.Vertex - v := n.(*ast.Root) - - if len(v.Stmts) > 0 { - firstStmt := v.Stmts[0] - stmts = v.Stmts[1:] - - switch fs := firstStmt.(type) { - case *ast.StmtInlineHtml: - io.WriteString(p.w, string(fs.Value)) - io.WriteString(p.w, " 0 { - io.WriteString(p.w, "\\") - } - - p.Print(part) - } -} - -func (p *PrettyPrinter) printNameFullyQualified(n ast.Vertex) { - nn := n.(*ast.NameFullyQualified) - - for _, part := range nn.Parts { - io.WriteString(p.w, "\\") - p.Print(part) - } -} - -func (p *PrettyPrinter) printNameRelative(n ast.Vertex) { - nn := n.(*ast.NameRelative) - - io.WriteString(p.w, "namespace") - for _, part := range nn.Parts { - io.WriteString(p.w, "\\") - p.Print(part) - } -} - -// scalar - -func (p *PrettyPrinter) printScalarLNumber(n ast.Vertex) { - v := string(n.(*ast.ScalarLnumber).Value) - io.WriteString(p.w, v) -} - -func (p *PrettyPrinter) printScalarDNumber(n ast.Vertex) { - v := string(n.(*ast.ScalarDnumber).Value) - io.WriteString(p.w, v) -} - -func (p *PrettyPrinter) printScalarString(n ast.Vertex) { - v := string(n.(*ast.ScalarString).Value) - - io.WriteString(p.w, v) -} - -func (p *PrettyPrinter) printScalarEncapsedStringPart(n ast.Vertex) { - v := string(n.(*ast.ScalarEncapsedStringPart).Value) - io.WriteString(p.w, v) -} - -func (p *PrettyPrinter) printScalarEncapsed(n ast.Vertex) { - nn := n.(*ast.ScalarEncapsed) - io.WriteString(p.w, "\"") - - for _, part := range nn.Parts { - switch part.(type) { - case *ast.ScalarEncapsedStringPart: - p.Print(part) - default: - io.WriteString(p.w, "{") - p.Print(part) - io.WriteString(p.w, "}") - } - } - - io.WriteString(p.w, "\"") -} - -func (p *PrettyPrinter) printScalarHeredoc(n ast.Vertex) { - nn := n.(*ast.ScalarHeredoc) - - io.WriteString(p.w, string(nn.OpenHeredocTkn.Value)) - - for _, part := range nn.Parts { - switch part.(type) { - case *ast.ScalarEncapsedStringPart: - p.Print(part) - default: - io.WriteString(p.w, "{") - p.Print(part) - io.WriteString(p.w, "}") - } - } - - io.WriteString(p.w, strings.Trim(string(nn.OpenHeredocTkn.Value), "<\"'\n")) -} - -func (p *PrettyPrinter) printScalarMagicConstant(n ast.Vertex) { - v := string(n.(*ast.ScalarMagicConstant).Value) - io.WriteString(p.w, v) -} - -// Assign - -func (p *PrettyPrinter) printAssignAssign(n ast.Vertex) { - nn := n.(*ast.ExprAssign) - p.Print(nn.Var) - io.WriteString(p.w, " = ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignReference(n ast.Vertex) { - nn := n.(*ast.ExprAssignReference) - p.Print(nn.Var) - io.WriteString(p.w, " =& ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignBitwiseAnd(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseAnd) - p.Print(nn.Var) - io.WriteString(p.w, " &= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignBitwiseOr(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseOr) - p.Print(nn.Var) - io.WriteString(p.w, " |= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignBitwiseXor(n ast.Vertex) { - nn := n.(*ast.ExprAssignBitwiseXor) - p.Print(nn.Var) - io.WriteString(p.w, " ^= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignConcat(n ast.Vertex) { - nn := n.(*ast.ExprAssignConcat) - p.Print(nn.Var) - io.WriteString(p.w, " .= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignDiv(n ast.Vertex) { - nn := n.(*ast.ExprAssignDiv) - p.Print(nn.Var) - io.WriteString(p.w, " /= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignMinus(n ast.Vertex) { - nn := n.(*ast.ExprAssignMinus) - p.Print(nn.Var) - io.WriteString(p.w, " -= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignMod(n ast.Vertex) { - nn := n.(*ast.ExprAssignMod) - p.Print(nn.Var) - io.WriteString(p.w, " %= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignMul(n ast.Vertex) { - nn := n.(*ast.ExprAssignMul) - p.Print(nn.Var) - io.WriteString(p.w, " *= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignPlus(n ast.Vertex) { - nn := n.(*ast.ExprAssignPlus) - p.Print(nn.Var) - io.WriteString(p.w, " += ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignPow(n ast.Vertex) { - nn := n.(*ast.ExprAssignPow) - p.Print(nn.Var) - io.WriteString(p.w, " **= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignShiftLeft(n ast.Vertex) { - nn := n.(*ast.ExprAssignShiftLeft) - p.Print(nn.Var) - io.WriteString(p.w, " <<= ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printAssignShiftRight(n ast.Vertex) { - nn := n.(*ast.ExprAssignShiftRight) - p.Print(nn.Var) - io.WriteString(p.w, " >>= ") - p.Print(nn.Expr) -} - -// binary - -func (p *PrettyPrinter) printBinaryBitwiseAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseAnd) - - p.Print(nn.Left) - io.WriteString(p.w, " & ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryBitwiseOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseOr) - - p.Print(nn.Left) - io.WriteString(p.w, " | ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryBitwiseXor(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBitwiseXor) - - p.Print(nn.Left) - io.WriteString(p.w, " ^ ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryBooleanAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBooleanAnd) - - p.Print(nn.Left) - io.WriteString(p.w, " && ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryBooleanOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryBooleanOr) - - p.Print(nn.Left) - io.WriteString(p.w, " || ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryCoalesce(n ast.Vertex) { - nn := n.(*ast.ExprBinaryCoalesce) - - p.Print(nn.Left) - io.WriteString(p.w, " ?? ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryConcat(n ast.Vertex) { - nn := n.(*ast.ExprBinaryConcat) - - p.Print(nn.Left) - io.WriteString(p.w, " . ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryDiv(n ast.Vertex) { - nn := n.(*ast.ExprBinaryDiv) - - p.Print(nn.Left) - io.WriteString(p.w, " / ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryEqual) - - p.Print(nn.Left) - io.WriteString(p.w, " == ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryGreaterOrEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryGreaterOrEqual) - - p.Print(nn.Left) - io.WriteString(p.w, " >= ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryGreater(n ast.Vertex) { - nn := n.(*ast.ExprBinaryGreater) - - p.Print(nn.Left) - io.WriteString(p.w, " > ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryIdentical(n ast.Vertex) { - nn := n.(*ast.ExprBinaryIdentical) - - p.Print(nn.Left) - io.WriteString(p.w, " === ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryLogicalAnd(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalAnd) - - p.Print(nn.Left) - io.WriteString(p.w, " and ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryLogicalOr(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalOr) - - p.Print(nn.Left) - io.WriteString(p.w, " or ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryLogicalXor(n ast.Vertex) { - nn := n.(*ast.ExprBinaryLogicalXor) - - p.Print(nn.Left) - io.WriteString(p.w, " xor ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryMinus(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMinus) - - p.Print(nn.Left) - io.WriteString(p.w, " - ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryMod(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMod) - - p.Print(nn.Left) - io.WriteString(p.w, " % ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryMul(n ast.Vertex) { - nn := n.(*ast.ExprBinaryMul) - - p.Print(nn.Left) - io.WriteString(p.w, " * ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryNotEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinaryNotEqual) - - p.Print(nn.Left) - io.WriteString(p.w, " != ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryNotIdentical(n ast.Vertex) { - nn := n.(*ast.ExprBinaryNotIdentical) - - p.Print(nn.Left) - io.WriteString(p.w, " !== ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryPlus(n ast.Vertex) { - nn := n.(*ast.ExprBinaryPlus) - - p.Print(nn.Left) - io.WriteString(p.w, " + ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryPow(n ast.Vertex) { - nn := n.(*ast.ExprBinaryPow) - - p.Print(nn.Left) - io.WriteString(p.w, " ** ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryShiftLeft(n ast.Vertex) { - nn := n.(*ast.ExprBinaryShiftLeft) - - p.Print(nn.Left) - io.WriteString(p.w, " << ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinaryShiftRight(n ast.Vertex) { - nn := n.(*ast.ExprBinaryShiftRight) - - p.Print(nn.Left) - io.WriteString(p.w, " >> ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinarySmallerOrEqual(n ast.Vertex) { - nn := n.(*ast.ExprBinarySmallerOrEqual) - - p.Print(nn.Left) - io.WriteString(p.w, " <= ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinarySmaller(n ast.Vertex) { - nn := n.(*ast.ExprBinarySmaller) - - p.Print(nn.Left) - io.WriteString(p.w, " < ") - p.Print(nn.Right) -} - -func (p *PrettyPrinter) printBinarySpaceship(n ast.Vertex) { - nn := n.(*ast.ExprBinarySpaceship) - - p.Print(nn.Left) - io.WriteString(p.w, " <=> ") - p.Print(nn.Right) -} - -// cast - -func (p *PrettyPrinter) printArray(n ast.Vertex) { - nn := n.(*ast.ExprCastArray) - - io.WriteString(p.w, "(array)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printBool(n ast.Vertex) { - nn := n.(*ast.ExprCastBool) - - io.WriteString(p.w, "(bool)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printDouble(n ast.Vertex) { - nn := n.(*ast.ExprCastDouble) - - io.WriteString(p.w, "(float)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printInt(n ast.Vertex) { - nn := n.(*ast.ExprCastInt) - - io.WriteString(p.w, "(int)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printObject(n ast.Vertex) { - nn := n.(*ast.ExprCastObject) - - io.WriteString(p.w, "(object)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printString(n ast.Vertex) { - nn := n.(*ast.ExprCastString) - - io.WriteString(p.w, "(string)") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printUnset(n ast.Vertex) { - nn := n.(*ast.ExprCastUnset) - - io.WriteString(p.w, "(unset)") - p.Print(nn.Expr) -} - -// expr - -func (p *PrettyPrinter) printExprArrayDimFetch(n ast.Vertex) { - nn := n.(*ast.ExprArrayDimFetch) - p.Print(nn.Var) - io.WriteString(p.w, "[") - p.Print(nn.Dim) - io.WriteString(p.w, "]") -} - -func (p *PrettyPrinter) printExprArrayItem(n ast.Vertex) { - nn := n.(*ast.ExprArrayItem) - - if nn.Key != nil { - p.Print(nn.Key) - io.WriteString(p.w, " => ") - } - - p.Print(nn.Val) -} - -func (p *PrettyPrinter) printExprArray(n ast.Vertex) { - nn := n.(*ast.ExprArray) - - io.WriteString(p.w, "array(") - p.joinPrint(", ", nn.Items) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprBitwiseNot(n ast.Vertex) { - nn := n.(*ast.ExprBitwiseNot) - io.WriteString(p.w, "~") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprBooleanNot(n ast.Vertex) { - nn := n.(*ast.ExprBooleanNot) - io.WriteString(p.w, "!") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprClassConstFetch(n ast.Vertex) { - nn := n.(*ast.ExprClassConstFetch) - - p.Print(nn.Class) - io.WriteString(p.w, "::") - io.WriteString(p.w, string(nn.ConstantName.(*ast.Identifier).Value)) -} - -func (p *PrettyPrinter) printExprClone(n ast.Vertex) { - nn := n.(*ast.ExprClone) - - io.WriteString(p.w, "clone ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprClosureUse(n ast.Vertex) { - nn := n.(*ast.ExprClosureUse) - - io.WriteString(p.w, "use (") - p.joinPrint(", ", nn.Uses) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprClosure(n ast.Vertex) { - nn := n.(*ast.ExprClosure) - - if nn.StaticTkn != nil { - io.WriteString(p.w, "static ") - } - - io.WriteString(p.w, "function ") - - if nn.AmpersandTkn != nil { - io.WriteString(p.w, "&") - } - - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) - io.WriteString(p.w, ")") - - if nn.ClosureUse != nil { - io.WriteString(p.w, " ") - p.Print(nn.ClosureUse) - } - - if nn.ReturnType != nil { - io.WriteString(p.w, ": ") - p.Print(nn.ReturnType) - } - - io.WriteString(p.w, " {\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printExprConstFetch(n ast.Vertex) { - nn := n.(*ast.ExprConstFetch) - - p.Print(nn.Const) -} - -func (p *PrettyPrinter) printExprEmpty(n ast.Vertex) { - nn := n.(*ast.ExprEmpty) - - io.WriteString(p.w, "empty(") - p.Print(nn.Expr) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprErrorSuppress(n ast.Vertex) { - nn := n.(*ast.ExprErrorSuppress) - - io.WriteString(p.w, "@") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprEval(n ast.Vertex) { - nn := n.(*ast.ExprEval) - - io.WriteString(p.w, "eval(") - p.Print(nn.Expr) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprExit(n ast.Vertex) { - nn := n.(*ast.ExprExit) - - io.WriteString(p.w, "exit(") - p.Print(nn.Expr) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprFunctionCall(n ast.Vertex) { - nn := n.(*ast.ExprFunctionCall) - - p.Print(nn.Function) - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprInclude(n ast.Vertex) { - nn := n.(*ast.ExprInclude) - - io.WriteString(p.w, "include ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprIncludeOnce(n ast.Vertex) { - nn := n.(*ast.ExprIncludeOnce) - - io.WriteString(p.w, "include_once ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprInstanceOf(n ast.Vertex) { - nn := n.(*ast.ExprInstanceOf) - - p.Print(nn.Expr) - io.WriteString(p.w, " instanceof ") - p.Print(nn.Class) -} - -func (p *PrettyPrinter) printExprIsset(n ast.Vertex) { - nn := n.(*ast.ExprIsset) - - io.WriteString(p.w, "isset(") - p.joinPrint(", ", nn.Vars) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprList(n ast.Vertex) { - nn := n.(*ast.ExprList) - - io.WriteString(p.w, "list(") - p.joinPrint(", ", nn.Items) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprMethodCall(n ast.Vertex) { - nn := n.(*ast.ExprMethodCall) - - p.Print(nn.Var) - io.WriteString(p.w, "->") - p.Print(nn.Method) - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprNew(n ast.Vertex) { - nn := n.(*ast.ExprNew) - - io.WriteString(p.w, "new ") - p.Print(nn.Class) - - if nn.Arguments != nil { - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) - io.WriteString(p.w, ")") - } -} - -func (p *PrettyPrinter) printExprPostDec(n ast.Vertex) { - nn := n.(*ast.ExprPostDec) - - p.Print(nn.Var) - io.WriteString(p.w, "--") -} - -func (p *PrettyPrinter) printExprPostInc(n ast.Vertex) { - nn := n.(*ast.ExprPostInc) - - p.Print(nn.Var) - io.WriteString(p.w, "++") -} - -func (p *PrettyPrinter) printExprPreDec(n ast.Vertex) { - nn := n.(*ast.ExprPreDec) - - io.WriteString(p.w, "--") - p.Print(nn.Var) -} - -func (p *PrettyPrinter) printExprPreInc(n ast.Vertex) { - nn := n.(*ast.ExprPreInc) - - io.WriteString(p.w, "++") - p.Print(nn.Var) -} - -func (p *PrettyPrinter) printExprPrint(n ast.Vertex) { - nn := n.(*ast.ExprPrint) - - io.WriteString(p.w, "print(") - p.Print(nn.Expr) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprPropertyFetch(n ast.Vertex) { - nn := n.(*ast.ExprPropertyFetch) - - p.Print(nn.Var) - io.WriteString(p.w, "->") - p.Print(nn.Property) -} - -func (p *PrettyPrinter) printExprReference(n ast.Vertex) { - nn := n.(*ast.ExprReference) - - io.WriteString(p.w, "&") - p.Print(nn.Var) -} - -func (p *PrettyPrinter) printExprRequire(n ast.Vertex) { - nn := n.(*ast.ExprRequire) - - io.WriteString(p.w, "require ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprRequireOnce(n ast.Vertex) { - nn := n.(*ast.ExprRequireOnce) - - io.WriteString(p.w, "require_once ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprShellExec(n ast.Vertex) { - nn := n.(*ast.ExprShellExec) - - io.WriteString(p.w, "`") - for _, part := range nn.Parts { - switch part.(type) { - case *ast.ScalarEncapsedStringPart: - p.Print(part) - default: - io.WriteString(p.w, "{") - p.Print(part) - io.WriteString(p.w, "}") - } - } - io.WriteString(p.w, "`") -} - -func (p *PrettyPrinter) printExprStaticCall(n ast.Vertex) { - nn := n.(*ast.ExprStaticCall) - - p.Print(nn.Class) - io.WriteString(p.w, "::") - p.Print(nn.Call) - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) - io.WriteString(p.w, ")") -} - -func (p *PrettyPrinter) printExprStaticPropertyFetch(n ast.Vertex) { - nn := n.(*ast.ExprStaticPropertyFetch) - - p.Print(nn.Class) - io.WriteString(p.w, "::") - p.Print(nn.Property) -} - -func (p *PrettyPrinter) printExprTernary(n ast.Vertex) { - nn := n.(*ast.ExprTernary) - - p.Print(nn.Condition) - io.WriteString(p.w, " ?") - - if nn.IfTrue != nil { - io.WriteString(p.w, " ") - p.Print(nn.IfTrue) - io.WriteString(p.w, " ") - } - - io.WriteString(p.w, ": ") - p.Print(nn.IfFalse) -} - -func (p *PrettyPrinter) printExprUnaryMinus(n ast.Vertex) { - nn := n.(*ast.ExprUnaryMinus) - - io.WriteString(p.w, "-") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprUnaryPlus(n ast.Vertex) { - nn := n.(*ast.ExprUnaryPlus) - - io.WriteString(p.w, "+") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprVariable(n ast.Vertex) { - nn := n.(*ast.ExprVariable) - io.WriteString(p.w, "$") - p.Print(nn.VarName) -} - -func (p *PrettyPrinter) printExprYieldFrom(n ast.Vertex) { - nn := n.(*ast.ExprYieldFrom) - - io.WriteString(p.w, "yield from ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printExprYield(n ast.Vertex) { - nn := n.(*ast.ExprYield) - - io.WriteString(p.w, "yield ") - - if nn.Key != nil { - p.Print(nn.Key) - io.WriteString(p.w, " => ") - } - - p.Print(nn.Value) -} - -// smtm - -func (p *PrettyPrinter) printStmtAltElseIf(n ast.Vertex) { - nn := n.(*ast.StmtElseIf) - - io.WriteString(p.w, "elseif (") - p.Print(nn.Cond) - io.WriteString(p.w, ") :") - - if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { - io.WriteString(p.w, "\n") - p.printNodes(s) - } -} - -func (p *PrettyPrinter) printStmtAltElse(n ast.Vertex) { - nn := n.(*ast.StmtElse) - - io.WriteString(p.w, "else :") - - if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { - io.WriteString(p.w, "\n") - p.printNodes(s) - } -} - -func (p *PrettyPrinter) printStmtAltIf(n ast.Vertex) { - nn := n.(*ast.StmtIf) - - io.WriteString(p.w, "if (") - p.Print(nn.Cond) - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - - for _, elseif := range nn.ElseIf { - io.WriteString(p.w, "\n") - p.printIndent() - p.Print(elseif) - } - - if nn.Else != nil { - io.WriteString(p.w, "\n") - p.printIndent() - p.Print(nn.Else) - } - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endif;") -} - -func (p *PrettyPrinter) printStmtBreak(n ast.Vertex) { - nn := n.(*ast.StmtBreak) - - io.WriteString(p.w, "break") - if nn.Expr != nil { - io.WriteString(p.w, " ") - p.Print(nn.Expr) - } - - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtCase(n ast.Vertex) { - nn := n.(*ast.StmtCase) - - io.WriteString(p.w, "case ") - p.Print(nn.Cond) - io.WriteString(p.w, ":") - - if len(nn.Stmts) > 0 { - io.WriteString(p.w, "\n") - p.printNodes(nn.Stmts) - } -} - -func (p *PrettyPrinter) printStmtCatch(n ast.Vertex) { - nn := n.(*ast.StmtCatch) - - io.WriteString(p.w, "catch (") - p.joinPrint(" | ", nn.Types) - io.WriteString(p.w, " ") - p.Print(nn.Var) - io.WriteString(p.w, ") {\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printStmtClassMethod(n ast.Vertex) { - nn := n.(*ast.StmtClassMethod) - - if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "function ") - - if nn.AmpersandTkn != nil { - io.WriteString(p.w, "&") - } - - p.Print(nn.MethodName) - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) - io.WriteString(p.w, ")") - - if nn.ReturnType != nil { - io.WriteString(p.w, ": ") - p.Print(nn.ReturnType) - } - - switch s := nn.Stmt.(type) { - case *ast.StmtStmtList: - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "{\n") - p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") - default: - p.Print(s) - } -} - -func (p *PrettyPrinter) printStmtClass(n ast.Vertex) { - nn := n.(*ast.StmtClass) - - if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "class") - - if nn.ClassName != nil { - io.WriteString(p.w, " ") - p.Print(nn.ClassName) - } - - if nn.Arguments != nil { - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Arguments) - io.WriteString(p.w, ")") - } - - if nn.Extends != nil { - io.WriteString(p.w, " extends ") - p.Print(nn.Extends.(*ast.StmtClassExtends).ClassName) - } - - if nn.Implements != nil { - io.WriteString(p.w, " implements ") - p.joinPrint(", ", nn.Implements.(*ast.StmtClassImplements).InterfaceNames) - } - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "{\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printStmtClassConstList(n ast.Vertex) { - nn := n.(*ast.StmtClassConstList) - - if nn.Modifiers != nil { - p.joinPrint(" ", nn.Modifiers) - io.WriteString(p.w, " ") - } - io.WriteString(p.w, "const ") - - p.joinPrint(", ", nn.Consts) - - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtConstant(n ast.Vertex) { - nn := n.(*ast.StmtConstant) - - p.Print(nn.Name) - io.WriteString(p.w, " = ") - p.Print(nn.Expr) -} - -func (p *PrettyPrinter) printStmtContinue(n ast.Vertex) { - nn := n.(*ast.StmtContinue) - - io.WriteString(p.w, "continue") - if nn.Expr != nil { - io.WriteString(p.w, " ") - p.Print(nn.Expr) - } - - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtDeclare(n ast.Vertex) { - nn := n.(*ast.StmtDeclare) - - io.WriteString(p.w, "declare(") - p.joinPrint(", ", nn.Consts) - io.WriteString(p.w, ")") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } -} - -func (p *PrettyPrinter) printStmtDefault(n ast.Vertex) { - nn := n.(*ast.StmtDefault) - io.WriteString(p.w, "default:") - - if len(nn.Stmts) > 0 { - io.WriteString(p.w, "\n") - p.printNodes(nn.Stmts) - } -} - -func (p *PrettyPrinter) printStmtDo(n ast.Vertex) { - nn := n.(*ast.StmtDo) - io.WriteString(p.w, "do") - - switch s := nn.Stmt.(type) { - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - io.WriteString(p.w, " ") - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - io.WriteString(p.w, "\n") - p.printIndent() - } - - io.WriteString(p.w, "while (") - p.Print(nn.Cond) - io.WriteString(p.w, ");") -} - -func (p *PrettyPrinter) printStmtEcho(n ast.Vertex) { - nn := n.(*ast.StmtEcho) - io.WriteString(p.w, "echo ") - p.joinPrint(", ", nn.Exprs) - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtElseif(n ast.Vertex) { - nn := n.(*ast.StmtElseIf) - - if nn.Alt { - p.printStmtAltElseIf(nn) - return - } - - io.WriteString(p.w, "elseif (") - p.Print(nn.Cond) - io.WriteString(p.w, ")") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } -} - -func (p *PrettyPrinter) printStmtElse(n ast.Vertex) { - nn := n.(*ast.StmtElse) - - if nn.Alt { - p.printStmtAltElse(nn) - return - } - - io.WriteString(p.w, "else") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } -} - -func (p *PrettyPrinter) printStmtExpression(n ast.Vertex) { - nn := n.(*ast.StmtExpression) - - p.Print(nn.Expr) - - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtFinally(n ast.Vertex) { - nn := n.(*ast.StmtFinally) - - io.WriteString(p.w, "finally {\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printStmtFor(n ast.Vertex) { - nn := n.(*ast.StmtFor) - - if nn.Alt { - p.printStmtAltFor(nn) - return - } - - io.WriteString(p.w, "for (") - p.joinPrint(", ", nn.Init) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Cond) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Loop) - io.WriteString(p.w, ")") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } -} - -func (p *PrettyPrinter) printStmtAltFor(n ast.Vertex) { - nn := n.(*ast.StmtFor) - - io.WriteString(p.w, "for (") - p.joinPrint(", ", nn.Init) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Cond) - io.WriteString(p.w, "; ") - p.joinPrint(", ", nn.Loop) - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - - io.WriteString(p.w, "endfor;") -} - -func (p *PrettyPrinter) printStmtForeach(n ast.Vertex) { - nn := n.(*ast.StmtForeach) - - if nn.Alt { - p.printStmtAltForeach(n) - return - } - - io.WriteString(p.w, "foreach (") - p.Print(nn.Expr) - io.WriteString(p.w, " as ") - - if nn.Key != nil { - p.Print(nn.Key) - io.WriteString(p.w, " => ") - } - - p.Print(nn.Var) - io.WriteString(p.w, ")") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } -} - -func (p *PrettyPrinter) printStmtAltForeach(n ast.Vertex) { - nn := n.(*ast.StmtForeach) - - io.WriteString(p.w, "foreach (") - p.Print(nn.Expr) - io.WriteString(p.w, " as ") - - if nn.Key != nil { - p.Print(nn.Key) - io.WriteString(p.w, " => ") - } - - p.Print(nn.Var) - - io.WriteString(p.w, ") :\n") - - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) - - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "endforeach;") -} - -func (p *PrettyPrinter) printStmtFunction(n ast.Vertex) { - nn := n.(*ast.StmtFunction) - - io.WriteString(p.w, "function ") - - if nn.AmpersandTkn != nil { - io.WriteString(p.w, "&") - } - - p.Print(nn.FunctionName) - - io.WriteString(p.w, "(") - p.joinPrint(", ", nn.Params) - io.WriteString(p.w, ")") - - if nn.ReturnType != nil { - io.WriteString(p.w, ": ") - p.Print(nn.ReturnType) - } - - io.WriteString(p.w, " {\n") - p.printNodes(nn.Stmts) - io.WriteString(p.w, "\n") - p.printIndent() - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printStmtGlobal(n ast.Vertex) { - nn := n.(*ast.StmtGlobal) - - io.WriteString(p.w, "global ") - p.joinPrint(", ", nn.Vars) - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtGoto(n ast.Vertex) { - nn := n.(*ast.StmtGoto) - - io.WriteString(p.w, "goto ") - p.Print(nn.Label) - io.WriteString(p.w, ";") -} - -func (p *PrettyPrinter) printStmtHaltCompiler(n ast.Vertex) { - io.WriteString(p.w, "__halt_compiler();") -} - -func (p *PrettyPrinter) printStmtIf(n ast.Vertex) { - nn := n.(*ast.StmtIf) - - if nn.Alt { - p.printStmtAltIf(nn) - return - } - - io.WriteString(p.w, "if (") - p.Print(nn.Cond) - io.WriteString(p.w, ")") - - switch s := nn.Stmt.(type) { - case *ast.StmtNop: - p.Print(s) - break - case *ast.StmtStmtList: - io.WriteString(p.w, " ") - p.Print(s) - default: - io.WriteString(p.w, "\n") - p.indentDepth++ - p.printIndent() - p.Print(s) - p.indentDepth-- - } - - if nn.ElseIf != nil { - io.WriteString(p.w, "\n") - p.indentDepth-- - p.printNodes(nn.ElseIf) - p.indentDepth++ - } - - if nn.Else != nil { - io.WriteString(p.w, "\n") - p.printIndent() - p.Print(nn.Else) - } -} - -func (p *PrettyPrinter) printStmtInlineHTML(n ast.Vertex) { - nn := n.(*ast.StmtInlineHtml) - - io.WriteString(p.w, "?>") - io.WriteString(p.w, string(nn.Value)) - io.WriteString(p.w, "HTML")}, - &ast.StmtExpression{ - Expr: &ast.ScalarHeredoc{ - Label: []byte("<<<\"LBL\"\n"), - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{Value: []byte("hello world\n")}, - }, - }, - }, - }, - }) - - expected := `
HTML
>= $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -// binary - -func TestPrintBinaryBitwiseAnd(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryBitwiseAnd{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a & $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryBitwiseOr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryBitwiseOr{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a | $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryBitwiseXor(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryBitwiseXor{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a ^ $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryBooleanAnd(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryBooleanAnd{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a && $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryBooleanOr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryBooleanOr{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a || $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryCoalesce(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryCoalesce{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a ?? $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryConcat(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryConcat{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a . $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryDiv(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryDiv{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a / $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryEqual(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryEqual{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a == $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryGreaterOrEqual(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryGreaterOrEqual{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a >= $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryGreater(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryGreater{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a > $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryIdentical(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryIdentical{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a === $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryLogicalAnd(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryLogicalAnd{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a and $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryLogicalOr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryLogicalOr{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a or $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryLogicalXor(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryLogicalXor{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a xor $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryMinus(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryMinus{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a - $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryMod(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryMod{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a % $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryMul(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryMul{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a * $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryNotEqual(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryNotEqual{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a != $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryNotIdentical(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryNotIdentical{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a !== $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryPlus(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryPlus{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a + $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryPow(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryPow{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a ** $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryShiftLeft(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryShiftLeft{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a << $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinaryShiftRight(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinaryShiftRight{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a >> $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinarySmallerOrEqual(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinarySmallerOrEqual{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a <= $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinarySmaller(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinarySmaller{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a < $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBinarySpaceship(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBinarySpaceship{ - Left: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Right: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a <=> $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -// cast - -func TestPrintArray(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastArray{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(array)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintBool(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastBool{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(bool)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintDouble(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastDouble{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(float)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintInt(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastInt{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(int)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintObject(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastObject{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(object)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintString(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastString{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(string)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintUnset(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprCastUnset{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `(unset)$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -// expr - -func TestPrintExprArrayDimFetch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprArrayDimFetch{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - Dim: &ast.ScalarLnumber{Value: []byte("1")}, - }) - - expected := `$var[1]` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprArrayItemWithKey(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprArrayItem{ - Key: &ast.ScalarString{Value: []byte("'Hello'")}, - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, - }) - - expected := `'Hello' => $world` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprArrayItem(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprArrayItem{ - Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}}, - }) - - expected := `&$world` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprArray(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprArray{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Key: &ast.ScalarString{Value: []byte("'Hello'")}, - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, - }, - &ast.ExprArrayItem{ - Key: &ast.ScalarLnumber{Value: []byte("2")}, - Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }, - }, - }) - - expected := `array('Hello' => $world, 2 => &$var, $var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprBitwiseNot(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBitwiseNot{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `~$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprBooleanNot(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprBooleanNot{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `!$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprClassConstFetch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprClassConstFetch{ - Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - ConstantName: &ast.Identifier{Value: []byte("CONST")}, - }) - - expected := `$var::CONST` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprClone(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprClone{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `clone $var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprClosureUse(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("bar")}}, - }, - }) - - expected := `use (&$foo, $bar)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprClosure(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.ExprClosure{ - Static: true, - ReturnsRef: true, - Params: []ast.Vertex{ - &ast.Parameter{ - Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, - }, - }, - ClosureUse: &ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - ReturnType: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }, - }, - }) - - expected := `namespace { - static function &(&$var) use (&$a, $b): \Foo { - $a; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprConstFetch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprConstFetch{ - Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}, - }) - - expected := "null" - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintEmpty(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprEmpty{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `empty($var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrettyPrinterrorSuppress(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprErrorSuppress{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `@$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintEval(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprEval{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `eval($var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExit(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprExit{Die: false, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `exit($var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintDie(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprExit{Die: true, Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `die($var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintFunctionCall(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprFunctionCall{ - Function: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - IsReference: true, - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.Argument{ - Variadic: true, - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - }, - }, - }) - - expected := `$var(&$a, ...$b, $c)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintInclude(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprInclude{Expr: &ast.ScalarString{Value: []byte("'path'")}}) - - expected := `include 'path'` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIncludeOnce(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprIncludeOnce{Expr: &ast.ScalarString{Value: []byte("'path'")}}) - - expected := `include_once 'path'` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintInstanceOf(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprInstanceOf{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - }) - - expected := `$var instanceof Foo` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIsset(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprIsset{ - Vars: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }) - - expected := `isset($a, $b)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprList{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprList{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - }, - }, - }, - }, - }) - - expected := `list($a, list($b, $c))` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintMethodCall(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprMethodCall{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, - Method: &ast.Identifier{Value: []byte("bar")}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - }, - }) - - expected := `$foo->bar($a, $b)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintNew(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprNew{ - Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - }, - }) - - expected := `new Foo($a, $b)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPostDec(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPostDec{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `$var--` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPostInc(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPostInc{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `$var++` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPreDec(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPreDec{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `--$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPreInc(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPreInc{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `++$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPrint(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPrint{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `print($var)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintPropertyFetch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprPropertyFetch{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, - Property: &ast.Identifier{Value: []byte("bar")}, - }) - - expected := `$foo->bar` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprReference(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprReference{ - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, - }) - - expected := `&$foo` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintRequire(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprRequire{Expr: &ast.ScalarString{Value: []byte("'path'")}}) - - expected := `require 'path'` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintRequireOnce(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprRequireOnce{Expr: &ast.ScalarString{Value: []byte("'path'")}}) - - expected := `require_once 'path'` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintShellExec(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprShellExec{ - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, - &ast.ScalarEncapsedStringPart{Value: []byte("!")}, - }, - }) - - expected := "`hello {$world}!`" - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExprShortArray(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprShortArray{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Key: &ast.ScalarString{Value: []byte("'Hello'")}, - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("world")}}, - }, - &ast.ExprArrayItem{ - Key: &ast.ScalarLnumber{Value: []byte("2")}, - Val: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }, - }, - }) - - expected := `['Hello' => $world, 2 => &$var, $var]` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintShortList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprShortList{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprList{ - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - &ast.ExprArrayItem{ - Val: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - }, - }, - }, - }, - }) - - expected := `[$a, list($b, $c)]` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStaticCall(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprStaticCall{ - Class: &ast.Identifier{Value: []byte("Foo")}, - Call: &ast.Identifier{Value: []byte("bar")}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - }, - }) - - expected := `Foo::bar($a, $b)` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStaticPropertyFetch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprStaticPropertyFetch{ - Class: &ast.Identifier{Value: []byte("Foo")}, - Property: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("bar")}}, - }) - - expected := `Foo::$bar` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintTernary(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprTernary{ - Condition: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - IfFalse: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }) - - expected := `$a ?: $b` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintTernaryFull(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprTernary{ - Condition: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - IfTrue: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - IfFalse: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }) - - expected := `$a ? $b : $c` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintUnaryMinus(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprUnaryMinus{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `-$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintUnaryPlus(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprUnaryPlus{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `+$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintVariable(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprVariable{VarName: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}) - - expected := `$$var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintYieldFrom(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprYieldFrom{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `yield from $var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintYield(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprYield{ - Value: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `yield $var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintYieldFull(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.ExprYield{ - Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, - Value: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - }) - - expected := `yield $k => $var` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -// stmt - -func TestPrintAltElseIf(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElseIf{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }) - - expected := `elseif ($a) : - $b;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltElseIfEmpty(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElseIf{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{}, - }) - - expected := `elseif ($a) :` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltElse(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElse{ - Alt: true, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }) - - expected := `else : - $b;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltElseEmpty(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElse{ - Alt: true, - Stmt: &ast.StmtStmtList{}, - }) - - expected := `else :` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltFor(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtFor{ - Alt: true, - Init: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - Cond: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - Loop: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, - }, - }, - }, - }, - }) - - expected := `namespace { - for ($a; $b; $c) : - $d; - endfor; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltForeach(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtForeach{ - Alt: true, - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("key")}}, - Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("val")}}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, - }, - }, - }, - }, - }) - - expected := `namespace { - foreach ($var as $key => &$val) : - $d; - endforeach; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltIf(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtIf{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}}, - }, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }, - &ast.StmtElseIf{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - Stmt: &ast.StmtStmtList{}, - }, - }, - Else: &ast.StmtElse{ - Alt: true, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - if ($a) : - $d; - elseif ($b) : - $b; - elseif ($c) : - else : - $b; - endif; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtAltSwitch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtSwitch{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Cond: &ast.ScalarString{Value: []byte("'a'")}, - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }, - &ast.StmtCase{ - Cond: &ast.ScalarString{Value: []byte("'b'")}, - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - switch ($var) : - case 'a': - $a; - case 'b': - $b; - endswitch; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintAltWhile(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtWhile{ - Alt: true, - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - }, - }, - }) - - expected := `namespace { - while ($a) : - $b; - endwhile; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtBreak(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtBreak{ - Expr: &ast.ScalarLnumber{Value: []byte("1")}, - }) - - expected := "break 1;" - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtCase(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtCase{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }) - - expected := `case $a: - $a;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtCaseEmpty(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtCase{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmts: []ast.Vertex{}, - }) - - expected := "case $a:" - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtCatch(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtCatch{ - Types: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, - &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, - }, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }, - }, - }) - - expected := `namespace { - catch (Exception | \RuntimeException $e) { - $a; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtClassMethod(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - ReturnsRef: true, - MethodName: &ast.Identifier{Value: []byte("foo")}, - Params: []ast.Vertex{ - &ast.Parameter{ - Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, - }, - &ast.Parameter{ - Var: &ast.Variadic{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }, - }) - - expected := `public function &foo(?int &$a = null, ...$b): void -{ - $a; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} -func TestPrintStmtAbstractClassMethod(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - ReturnsRef: true, - MethodName: &ast.Identifier{Value: []byte("foo")}, - Params: []ast.Vertex{ - &ast.Parameter{ - Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, - Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, - }, - &ast.Parameter{ - Var: &ast.Variadic{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}}, - }, - }, - ReturnType: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}}, - Stmt: &ast.StmtNop{}, - }) - - expected := `public function &foo(?int &$a = null, ...$b): void;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtClass(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtClass{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - ClassName: &ast.Identifier{Value: []byte("Foo")}, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtClassConstList{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, - }, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - abstract class Foo extends Bar implements Baz, Quuz - { - public const FOO = 'bar'; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtAnonymousClass(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtClass{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - ArgumentList: &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - &ast.Argument{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - }, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtClassConstList{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, - }, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - abstract class($a, $b) extends Bar implements Baz, Quuz - { - public const FOO = 'bar'; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtClassConstList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtClassConstList{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'a'")}, - }, - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("BAR")}, - Expr: &ast.ScalarString{Value: []byte("'b'")}, - }, - }, - }) - - expected := `public const FOO = 'a', BAR = 'b';` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtConstant(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'BAR'")}, - }) - - expected := "FOO = 'BAR'" - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtContinue(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtContinue{ - Expr: &ast.ScalarLnumber{Value: []byte("1")}, - }) - - expected := `continue 1;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDeclareStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtDeclare{ - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, - }, - }, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }, - }, - }) - - expected := `{ - declare(FOO = 'bar') { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDeclareExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtDeclare{ - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, - }, - }, - Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }, - }, - }) - - expected := `{ - declare(FOO = 'bar') - 'bar'; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDeclareNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtDeclare{ - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Name: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, - }, - }, - Stmt: &ast.StmtNop{}, - }) - - expected := `declare(FOO = 'bar');` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDefalut(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtDefault{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }) - - expected := `default: - $a;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDefalutEmpty(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtDefault{ - Stmts: []ast.Vertex{}, - }) - - expected := `default:` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDo_Expression(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtDo{ - Cond: &ast.ScalarLnumber{Value: []byte("1")}, - Stmt: &ast.StmtExpression{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - }, - }, - }) - - expected := `namespace { - do - $a; - while (1); -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtDo_StmtList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtDo{ - Cond: &ast.ScalarLnumber{Value: []byte("1")}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, - }, - }, - }, - }, - }) - - expected := `namespace { - do { - $a; - } while (1); -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtEcho(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtEcho{ - Exprs: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }) - - expected := `echo $a, $b;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseIfStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElseIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }) - - expected := `elseif ($a) { - ; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseIfExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElseIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }) - - expected := `elseif ($a) - 'bar';` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseIfNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElseIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtNop{}, - }) - - expected := `elseif ($a);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElse{ - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }) - - expected := `else { - ; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElse{ - Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }) - - expected := `else - 'bar';` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtElseNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtElse{ - Stmt: &ast.StmtNop{}, - }) - - expected := `else;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintExpression(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}) - - expected := `$a;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtFinally(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtFinally{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }, - }) - - expected := `namespace { - finally { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtFor{ - Init: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - Cond: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}, - }, - Loop: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("f")}}, - }, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }, - }, - }) - - expected := `namespace { - for ($a, $b; $c, $d; $e, $f) { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtFor{ - Init: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - Cond: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - Loop: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }, - }, - }) - - expected := `namespace { - for ($a; $b; $c) - 'bar'; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtFor{ - Init: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - }, - Cond: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - Loop: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - }, - Stmt: &ast.StmtNop{}, - }) - - expected := `for ($a; $b; $c);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForeachStmts(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtForeach{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }, - }, - }) - - expected := `namespace { - foreach ($a as $b) { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForeachExpr(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtForeach{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("v")}}, - Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, - }, - }, - }) - - expected := `namespace { - foreach ($a as $k => $v) - 'bar'; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtForeachNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtForeach{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Key: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("k")}}, - Var: &ast.ExprReference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("v")}}}, - Stmt: &ast.StmtNop{}, - }) - - expected := `foreach ($a as $k => &$v);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtFunction(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtFunction{ - ReturnsRef: true, - FunctionName: &ast.Identifier{Value: []byte("foo")}, - Params: []ast.Vertex{ - &ast.Parameter{ - Var: &ast.Reference{Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("var")}}}, - }, - }, - ReturnType: &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - }, - }, - }) - - expected := `namespace { - function &foo(&$var): \Foo { - ; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtGlobal(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtGlobal{ - Vars: []ast.Vertex{ - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }) - - expected := `global $a, $b;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtGoto(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtGoto{ - Label: &ast.Identifier{Value: []byte("FOO")}, - }) - - expected := `goto FOO;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintHaltCompiler(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtHaltCompiler{}) - - expected := `__halt_compiler();` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIfExpression(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtExpression{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("c")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("d")}}, - }, - }, - }, - }, - &ast.StmtElseIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("e")}}, - Stmt: &ast.StmtNop{}, - }, - }, - Else: &ast.StmtElse{ - Stmt: &ast.StmtExpression{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("f")}}, - }, - }, - }, - }, - }) - - expected := `namespace { - if ($a) - $b; - elseif ($c) { - $d; - } - elseif ($e); - else - $f; -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIfStmtList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtNamespace{ - Stmts: []ast.Vertex{ - &ast.StmtIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtStmtList{ - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("b")}}, - }, - }, - }, - }, - }, - }) - - expected := `namespace { - if ($a) { - $b; - } -}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintIfNop(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtIf{ - Cond: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}, - Stmt: &ast.StmtNop{}, - }) - - expected := `if ($a);` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintInlineHtml(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtInlineHtml{ - Value: []byte("test"), - }) - - expected := `?>test Date: Sun, 20 Dec 2020 11:38:13 +0200 Subject: [PATCH 115/140] refactoring: update php7 tests --- internal/php7/parser_test.go | 50330 +++++++++++++++++++++++------ internal/php7/php7.go | Bin 219167 -> 219246 bytes internal/php7/php7.y | 8 +- internal/php7/php7_bench_test.go | 378 +- internal/php7/php7_test.go | 19703 ----------- 5 files changed, 39857 insertions(+), 30562 deletions(-) delete mode 100644 internal/php7/php7_test.go diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 94835e1..6c94e47 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -1,6 +1,7 @@ package php7_test import ( + "github.com/z7zmey/php-parser/pkg/errors" "testing" "gotest.tools/assert" @@ -8,69 +9,101 @@ import ( "github.com/z7zmey/php-parser/internal/php7" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" ) func TestIdentifier(t *testing.T) { src := `bar($a, ...$b); @@ -78,729 +111,1424 @@ func TestPhp7ArgumentNode(t *testing.T) { $foo::bar($a, ...$b); new foo($a, ...$b); /** anonymous class */ - new class ($a, ...$b) {}; - ` + new class ($a, ...$b) {};` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 9, - StartPos: 6, - EndPos: 186, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 9, + StartPos: 5, + EndPos: 185, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 20, + }, + Expr: &ast.ExprFunctionCall{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 21, + StartPos: 5, + EndPos: 19, }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ + Function: &ast.NameName{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 20, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, + StartPos: 5, + EndPos: 8, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 9, + StartPos: 5, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 46, + EndPos: 48, + }, + }, Method: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 48, + EndPos: 51, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 49, - EndPos: 52, + StartPos: 48, + EndPos: 51, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 51, + EndPos: 52, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, - EndPos: 63, + EndPos: 54, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 53, - EndPos: 55, + StartPos: 52, + EndPos: 54, }, - }, - IsReference: false, - Variadic: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 62, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 60, - EndPos: 62, + StartPos: 52, + EndPos: 54, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 61, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 59, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 55, + EndPos: 56, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 54, + EndPos: 55, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 61, + EndPos: 62, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 62, + EndPos: 63, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 86, + }, + Expr: &ast.ExprStaticCall{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 87, + StartPos: 66, + EndPos: 85, }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ + Class: &ast.NameName{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 86, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, + StartPos: 66, + EndPos: 69, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 70, + StartPos: 66, + EndPos: 69, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 4, + EndLine: 5, + StartPos: 63, + EndPos: 66, + }, + }, }, }, Value: []byte("foo"), }, }, }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 69, + EndPos: 71, + }, + }, Call: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 72, - EndPos: 75, + StartPos: 71, + EndPos: 74, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 75, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, - EndPos: 86, + EndPos: 77, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 76, - EndPos: 78, + StartPos: 75, + EndPos: 77, }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 85, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 83, - EndPos: 85, + StartPos: 75, + EndPos: 77, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 84, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 82, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 78, + EndPos: 79, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 77, + EndPos: 78, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 84, + EndPos: 85, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 85, + EndPos: 86, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 110, + }, + Expr: &ast.ExprStaticCall{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 111, + StartPos: 89, + EndPos: 109, }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ + Class: &ast.ExprVariable{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 110, + StartPos: 89, + EndPos: 93, }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 94, + StartPos: 89, + EndPos: 93, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$foo"), Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 94, + StartPos: 89, + EndPos: 93, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 5, + EndLine: 6, + StartPos: 86, + EndPos: 89, + }, + }, }, }, Value: []byte("$foo"), }, }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 93, + EndPos: 95, + }, + }, Call: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 95, + EndPos: 98, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 96, - EndPos: 99, + StartPos: 95, + EndPos: 98, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 98, + EndPos: 99, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, - EndPos: 110, + EndPos: 101, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 100, - EndPos: 102, + StartPos: 99, + EndPos: 101, }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 109, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 107, - EndPos: 109, + StartPos: 99, + EndPos: 101, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 108, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 106, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 102, + EndPos: 103, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 101, + EndPos: 102, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 108, + EndPos: 109, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 109, + EndPos: 110, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 132, + }, + Expr: &ast.ExprNew{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 114, - EndPos: 133, + StartPos: 113, + EndPos: 131, }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ + NewTkn: &token.Token{ + ID: token.T_NEW, + Value: []byte("new"), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 114, - EndPos: 132, + StartPos: 113, + EndPos: 116, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 6, + EndLine: 7, + StartPos: 110, + EndPos: 113, + }, + }, }, }, Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 118, - EndPos: 121, + StartPos: 117, + EndPos: 120, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 116, + EndPos: 117, + }, + }, }, }, Value: []byte("foo"), }, }, }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 121, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, - EndPos: 132, + EndPos: 123, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("$a"), + }, + }, + }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 130, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 128, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 124, + EndPos: 125, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 123, + EndPos: 124, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 130, + EndPos: 131, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 131, + EndPos: 132, + }, + }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 185, + }, + Expr: &ast.ExprNew{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 184, + }, + NewTkn: &token.Token{ + ID: token.T_NEW, + Value: []byte("new"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 160, + EndPos: 163, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 7, + EndLine: 8, + StartPos: 132, + EndPos: 135, + }, + }, + { + ID: token.T_DOC_COMMENT, + Value: []byte("/** anonymous class */"), + Position: &position.Position{ + StartLine: 8, + EndLine: 8, + StartPos: 135, + EndPos: 157, + }, + }, + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 8, + EndLine: 9, + StartPos: 157, + EndPos: 160, + }, + }, + }, + }, + Class: &ast.StmtClass{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 184, + }, + ClassTkn: &token.Token{ + ID: token.T_CLASS, + Value: []byte("class"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 164, + EndPos: 169, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 163, + EndPos: 164, + }, + }, + }, + }, + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 170, + EndPos: 171, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 169, + EndPos: 170, + }, + }, }, }, Arguments: []ast.Vertex{ &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, }, - Variadic: false, - IsReference: false, Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, + StartLine: 9, + EndLine: 9, + StartPos: 171, + EndPos: 173, }, }, Value: []byte("$a"), @@ -808,32 +1536,56 @@ func TestPhp7ArgumentNode(t *testing.T) { }, }, &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 126, - EndPos: 131, - }, + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 175, + EndPos: 180, }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 175, + EndPos: 178, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 174, + EndPos: 175, + }, }, }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, + StartLine: 9, + EndLine: 9, + StartPos: 178, + EndPos: 180, }, }, Value: []byte("$b"), @@ -841,127 +1593,82 @@ func TestPhp7ArgumentNode(t *testing.T) { }, }, }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 186, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 161, - EndPos: 185, - }, - }, - Class: &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 165, - EndPos: 185, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), Position: &position.Position{ StartLine: 9, EndLine: 9, - StartPos: 171, - EndPos: 182, + StartPos: 173, + EndPos: 174, }, }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 172, - EndPos: 174, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 176, - EndPos: 181, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 181, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 179, - EndPos: 181, - }, - }, - Value: []byte("$b"), - }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 180, + EndPos: 181, + }, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 182, + EndPos: 183, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 181, + EndPos: 182, }, }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 183, + EndPos: 184, + }, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 9, + EndLine: 9, + StartPos: 184, + EndPos: 185, }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -974,66 +1681,136 @@ func TestPhp7ParameterNode(t *testing.T) { ` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 5, - StartPos: 5, - EndPos: 214, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 5, + StartPos: 5, + EndPos: 214, }, Stmts: []ast.Vertex{ &ast.StmtFunction{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 50, + }, + FunctionTkn: &token.Token{ + ID: token.T_FUNCTION, + Value: []byte("function"), Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 50, + EndPos: 13, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte("bar()";` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 22, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + Expr: &ast.ScalarEncapsed{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 22, + EndPos: 21, }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ + OpenQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 21, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 15, + }, + }, Property: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -2516,7 +4563,15 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, }, &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + EncapsedStrTkn: &token.Token{ + ID: token.T_ENCAPSED_AND_WHITESPACE, + Value: []byte("()"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -2527,17 +4582,36 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { Value: []byte("()"), }, }, + CloseQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 22, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2545,36 +4619,70 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { src := `bar()}";` +func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { + src := `bar()}";` + + expected := &ast.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + Expr: &ast.ScalarEncapsed{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + OpenQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 16, + }, + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("bar"), + }, + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 22, + }, + }, + }, + }, + CloseQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 23, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, + }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2837,37 +5224,70 @@ LBL; ` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 3, - StartPos: 3, - EndPos: 24, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 3, + EndPos: 24, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 3, + EndPos: 24, + }, + Expr: &ast.ScalarHeredoc{ Position: &position.Position{ StartLine: 1, EndLine: 3, StartPos: 3, - EndPos: 24, + EndPos: 23, }, - }, - Expr: &ast.ScalarHeredoc{ - Node: ast.Node{ + OpenHeredocTkn: &token.Token{ + ID: token.T_START_HEREDOC, + Value: []byte("<< $v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 30, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, }, Value: []byte("$v"), }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7217,98 +16061,284 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { src := ` $v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 30, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, }, Value: []byte("$v"), }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7316,35 +16346,91 @@ func TestStmtForeach_WithRef(t *testing.T) { src := ` &$v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 31, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprReference{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -7407,27 +16581,66 @@ func TestStmtForeach_WithRef(t *testing.T) { }, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, - EndPos: 31, + EndPos: 30, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7435,35 +16648,91 @@ func TestStmtForeach_WithList(t *testing.T) { src := ` list($v)) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 36, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 36, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 32, + }, + ListTkn: &token.Token{ + ID: token.T_LIST, + Value: []byte("list"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 32, + EndPos: 28, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, + }, + OpenBracketTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, }, }, Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, EndPos: 31, }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, EndPos: 31, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -7537,28 +16902,77 @@ func TestStmtForeach_WithList(t *testing.T) { }, }, }, + CloseBracketTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 31, + EndPos: 32, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 33, + }, }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 34, - EndPos: 36, + EndPos: 35, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 36, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7566,47 +16980,145 @@ func TestStmtFunction(t *testing.T) { src := `
` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, }, Stmts: []ast.Vertex{ &ast.StmtNop{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte("?>"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8958,14 +20585,13 @@ func TestStmtInlineHtml(t *testing.T) { Value: []byte("
"), }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8973,46 +20599,125 @@ func TestStmtInterface(t *testing.T) { src := `1, &$b,);` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 21, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + Expr: &ast.ExprArray{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 21, + EndPos: 20, }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ + ArrayTkn: &token.Token{ + ID: token.T_ARRAY, + Value: []byte("array"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 20, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, Val: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14828,34 +34768,58 @@ func TestExprArray_Items(t *testing.T) { }, }, &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + Val: &ast.ExprReference{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 18, }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, - EndPos: 18, + EndPos: 16, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14870,17 +34834,58 @@ func TestExprArray_Items(t *testing.T) { }, &ast.ExprArrayItem{}, }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + }, + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 19, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14888,55 +34893,104 @@ func TestExprArray_ItemUnpack(t *testing.T) { src := ` $a;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 14, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 14, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 14, + }, + Expr: &ast.ExprArrowFunction{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 14, + EndPos: 13, }, - }, - Expr: &ast.ExprArrowFunction{ - Node: ast.Node{ + FnTkn: &token.Token{ + ID: token.T_FN, + Value: []byte("fn"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 13, + EndPos: 5, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 8, + }, + }, }, }, - ReturnsRef: false, - Static: false, Expr: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + }, + }, }, Value: []byte("$a"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15035,90 +35201,257 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { src := ` $a;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 23, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + Expr: &ast.ExprArrowFunction{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 23, + EndPos: 22, }, - }, - Expr: &ast.ExprArrowFunction{ - Node: ast.Node{ + FnTkn: &token.Token{ + ID: token.T_FN, + Value: []byte("fn"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 22, + EndPos: 5, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 19, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, + }, + }, + }, + }, Expr: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 22, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 20, EndPos: 22, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 20, EndPos: 22, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + }, + }, }, Value: []byte("$a"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 23, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15126,44 +35459,76 @@ func TestExprBitwiseNot(t *testing.T) { src := `foo();` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + Expr: &ast.ExprMethodCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 13, + EndPos: 12, }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 12, + EndPos: 5, }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Method: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18910,27 +42553,46 @@ func TestExprMethodCall(t *testing.T) { }, Value: []byte("foo"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18938,67 +42600,120 @@ func TestExprNew(t *testing.T) { src := `foo;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + Expr: &ast.ExprPropertyFetch{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 11, + EndPos: 10, }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 10, + EndPos: 5, }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Property: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19422,16 +43549,25 @@ func TestExprPropertyFetch(t *testing.T) { Value: []byte("foo"), }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19440,35 +43576,91 @@ func TestExprReference_ForeachWithRef(t *testing.T) { src := ` &$v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 31, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprReference{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19531,27 +43811,66 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, - EndPos: 31, + EndPos: 30, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19559,36 +43878,70 @@ func TestExprShellExec(t *testing.T) { src := "1, &$b,];` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 16, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + Expr: &ast.ExprArray{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 16, + EndPos: 15, }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ + OpenBracketTkn: &token.Token{ + ID: token.ID(91), + Value: []byte("["), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 15, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Val: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 8, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19813,34 +44336,58 @@ func TestExprShortArray_Items(t *testing.T) { }, }, &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + Val: &ast.ExprReference{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, EndPos: 13, }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, - EndPos: 13, + EndPos: 11, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19855,17 +44402,58 @@ func TestExprShortArray_Items(t *testing.T) { }, &ast.ExprArrayItem{}, }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 9, + }, + }, + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(93), + Value: []byte("]"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19873,63 +44461,91 @@ func TestExprShortList(t *testing.T) { src := ` $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 18, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + Expr: &ast.ExprYield{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 18, + EndPos: 17, }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ + YieldTkn: &token.Token{ + ID: token.T_YIELD, + Value: []byte("yield"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 17, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + }, Value: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, }, Value: []byte("$b"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 18, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21929,55 +48233,110 @@ func TestExprYield_Expr(t *testing.T) { src := ` 1;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + Expr: &ast.ExprYield{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 17, + EndPos: 16, }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ + YieldTkn: &token.Token{ + ID: token.T_YIELD, + Value: []byte("yield"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 16, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + }, Value: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 16, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, }, Value: []byte("1"), }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22062,4082 +48516,6018 @@ func TestExprYieldFrom(t *testing.T) { src := `>= $b; + $a ??= $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 18, + StartPos: 5, + EndPos: 223, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 13, }, Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprAssign_Reference(t *testing.T) { - src := `>= $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, + StartLine: 16, + EndLine: 16, + StartPos: 196, + EndPos: 197, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 210, + }, Expr: &ast.ExprAssignShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 209, }, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 16, + EndLine: 17, + StartPos: 197, + EndPos: 200, + }, + }, }, }, Value: []byte("$a"), }, }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + EqualTkn: &token.Token{ + ID: token.T_SR_EQUAL, + Value: []byte(">>="), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 203, + EndPos: 206, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 202, + EndPos: 203, + }, }, }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 206, + EndPos: 207, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprAssign_Coalesce(t *testing.T) { - src := `= $b; + $a > $b; + $a === $b; + $a and $b; + $a or $b; + $a xor $b; + $a - $b; + $a % $b; + $a * $b; + $a != $b; + $a !== $b; + $a + $b; + $a ** $b; + $a << $b; + $a >> $b; + $a <= $b; + $a < $b; + $a <=> $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 28, + StartPos: 5, + EndPos: 320, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 13, }, Expr: &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 12, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte("= $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, + StartLine: 10, + EndLine: 10, + StartPos: 104, + EndPos: 105, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 117, + }, Expr: &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 116, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 10, + EndLine: 11, + StartPos: 105, + EndPos: 108, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + OpTkn: &token.Token{ + ID: token.T_IS_GREATER_OR_EQUAL, + Value: []byte(">="), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 111, + EndPos: 113, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 110, + EndPos: 111, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 114, + EndPos: 116, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 114, + EndPos: 116, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + StartLine: 11, + EndLine: 11, + StartPos: 114, + EndPos: 116, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 113, + EndPos: 114, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_Greater(t *testing.T) { - src := ` $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, + StartLine: 11, + EndLine: 11, + StartPos: 116, + EndPos: 117, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 120, + EndPos: 128, + }, Expr: &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 120, + EndPos: 127, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 120, + EndPos: 122, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 120, + EndPos: 122, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 12, + EndLine: 12, + StartPos: 120, + EndPos: 122, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 11, + EndLine: 12, + StartPos: 117, + EndPos: 120, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, + OpTkn: &token.Token{ + ID: token.ID(62), + Value: []byte(">"), + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 123, + EndPos: 124, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 122, + EndPos: 123, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 125, + EndPos: 127, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 125, + EndPos: 127, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, + StartLine: 12, + EndLine: 12, + StartPos: 125, + EndPos: 127, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 12, + EndLine: 12, + StartPos: 124, + EndPos: 125, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_Identical(t *testing.T) { - src := `> $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, + StartLine: 24, + EndLine: 24, + StartPos: 271, + EndPos: 272, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 275, + EndPos: 284, + }, Expr: &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 275, + EndPos: 283, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 275, + EndPos: 277, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 275, + EndPos: 277, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 25, + EndLine: 25, + StartPos: 275, + EndPos: 277, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 24, + EndLine: 25, + StartPos: 272, + EndPos: 275, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + OpTkn: &token.Token{ + ID: token.T_SR, + Value: []byte(">>"), + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 278, + EndPos: 280, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 277, + EndPos: 278, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 281, + EndPos: 283, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 281, + EndPos: 283, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + StartLine: 25, + EndLine: 25, + StartPos: 281, + EndPos: 283, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 25, + EndLine: 25, + StartPos: 280, + EndPos: 281, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_SmallerOrEqual(t *testing.T) { - src := ` $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, + StartLine: 27, + EndLine: 27, + StartPos: 306, + EndPos: 307, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 310, + EndPos: 320, + }, Expr: &ast.ExprBinarySpaceship{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 310, + EndPos: 319, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 310, + EndPos: 312, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 310, + EndPos: 312, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 28, + EndLine: 28, + StartPos: 310, + EndPos: 312, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 27, + EndLine: 28, + StartPos: 307, + EndPos: 310, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + OpTkn: &token.Token{ + ID: token.T_SPACESHIP, + Value: []byte("<=>"), + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 313, + EndPos: 316, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 312, + EndPos: 313, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 317, + EndPos: 319, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 317, + EndPos: 319, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + StartLine: 28, + EndLine: 28, + StartPos: 317, + EndPos: 319, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 316, + EndPos: 317, + }, + }, }, }, Value: []byte("$b"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 28, + EndLine: 28, + StartPos: 319, + EndPos: 320, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } // expr cast func TestExprCast_Array(t *testing.T) { - src := ``- zuhp@&b*FR)MO7I|(b5*7tziZe=2JnW=6mn+yl>LZfA3wMv)%9co^$W}){Z(ichuPt z70Jm-i((>mOeBr(AWMc)sGdKVK2Z`kfO_kKq4cAY=7Xs>rOU#h)W9sVhtf3$Z9LL= zBsGz;eHoi%GkEXuV$(@dS4AV)SIZDcM zc(9aWNGa~xgt62|%BE0bDIQDfIm0WPB9&KO8)x>2eu8>RWFB3oR9To!3HmqVsgh)7 zILAqg@suqKa;d*QK9Od!nQSEaQz=IBpP*ix;??-N8*yr)tE&4`Fk|L@?1HM{a{DRj z<2ovXCez!To-7A;QZu=+p6W=mDb$-gd1dkxdPYW1g{uvwQg1nBe!Vu8ddYxk_!Te> z)*m*%7EGfY={g+|f(g-5fd$9rSUqMsEg-3z0sl)<$fGM~(4!K)nb6K0W#TuV=Vk%p3dx!L#eg_p=fP;Z6vVv3-^)I@7t*%E4{yS+lf0V$5T%c!;HWi*Qe z(tP$elaAMV}u)o$WqZX29=FTjmR(4K*w48o4u5_OT&-bsS<*X9D zUb!@d8cBR#3YO`wQz@{PwT2e6FXmU)!eu9Vsq5&An&FRolinjrlU1#$qug6h{U}xU z+&~kRgAFV4@LRML4sN=N;LO-Sf%>^Z$|7l11f3CkC|oXV@?pvB*S(5pK2cH)qrQKe zmLP~mf?oL!<&ew@RKVwE;Ir1B@v%MG>3^mhN{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*!c%lT~(HfNTQuCmdt_lLIGKUE6nbA)c!vig`X$N`yh_fd2 zD6E(fY;`f5s4cu0f|GZJ;AF3b2{<_n=Q~9Q_Q2*}nqefxShyM5k&J7Ofm8)nMD72m z1%&9Ezvu%52mD(STVesOa}V(u$!lfx^7dQcE0;pW>FV@b5fw33jI?PD2{uLPX1rSz z>@^70%XNXeEw4vo380c9(J@v&dotCNG1f4rROl=gcN_e<6l)EZ{jqpPHK8wdTfG$S zp}k4&#z717zG&)Rf7um}0jJl}0u%(`<@tIZvCtiCr8>^Puq=!_tYoU zfdp$FN~(TS{@p%s@eq0OK`U6*C0gi6OhaRz*3NQ~m5P#T`iI}_>nzt3xV_rm-YPKs z9A`6_(ZsO3i9W=l9;BEz|VN^}}!}0@;492crXY@b7p4nOqi}PgI5<&l$X0UaOqG*oJ?h+a{x9d9?Su8{s%?Swv2)P% zB0w#mpM?vvIT(TWQS16!e!6==LIGy|ttRStp@rv7`%a>;r<8Q1F!=IOiw0UKHoCi2 ky9OZz0b29VkMzf^-juBDe|~&C#Lgn~x)~u|hFU5A3wmZ^S^xk5 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 4b5c149..2c14cff 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -541,7 +541,9 @@ use_type: group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + if $5 != nil { + $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), @@ -559,7 +561,9 @@ group_use_declaration: } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + if $6 != nil { + $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index d5f2636..3ba6578 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -1,6 +1,7 @@ package php7_test import ( + "io/ioutil" "testing" "github.com/z7zmey/php-parser/internal/php7" @@ -8,381 +9,14 @@ import ( ) func BenchmarkPhp7(b *testing.B) { - src := `bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - /** anonymous class */ - new class ($a, ...$b) {}; - new class {}; - new $foo; - new $foo[1]; - new $foo{$bar}; - new $foo->bar; - new $foo::$bar; - new static::$bar; + src, err := ioutil.ReadFile("test.php") - function foo(?bar $bar=null, baz &...$baz) {} - class foo {public function foo(?bar $bar=null, baz &...$baz) {}} - function(?bar $bar=null, baz &...$baz) {}; - static function(?bar $bar=null, baz &...$baz) {}; - - "test"; - "\$test"; - " - test - "; - '$test'; - ' - $test - '; - <<bar()"; - "test ${foo}"; - "test ${foo[0]}"; - "test ${$foo}"; - "test {$foo->bar()}"; - - if ($a) : - endif; - if ($a) : - elseif ($b): - endif; - if ($a) : - else: - endif; - if ($a) : - elseif ($b): - elseif ($c): - else: - endif; - - while (1) { break; } - while (1) { break 2; } - while (1) : break(3); endwhile; - class foo{ public const FOO = 1, BAR = 2; } - class foo{ const FOO = 1, BAR = 2; } - class foo{ function bar() {} } - class foo{ public static function &bar() {} } - class foo{ public static function &bar(): void {} } - abstract class foo{ } - final class foo extends bar { } - final class foo implements bar { } - final class foo implements bar, baz { } - new class() extends foo implements bar, baz { }; - - const FOO = 1, BAR = 2; - while (1) { continue; } - while (1) { continue 2; } - while (1) { continue(3); } - declare(ticks=1); - declare(ticks=1) {} - declare(ticks=1): enddeclare; - do {} while(1); - echo $a, 1; - echo($a); - for($i = 0; $i < 10; $i++, $i++) {} - for(; $i < 10; $i++, $i++) : endfor; - foreach ($a as $v) {} - foreach ($a as $v) : endforeach; - foreach ($a as $k => $v) {} - foreach ($a as $k => &$v) {} - foreach ($a as $k => list($v)) {} - foreach ($a as $k => [$v]) {} - function foo() {} - function foo() {return;} - function &foo() {return 1;} - function &foo(): void {} - global $a, $b; - a: - goto a; - __halt_compiler(); - if ($a) {} - if ($a) {} elseif ($b) {} - if ($a) {} else {} - if ($a) {} elseif ($b) {} elseif ($c) {} else {} - if ($a) {} elseif ($b) {} else if ($c) {} else {} - ?>
1, &$b,); - ~$a; - !$a; - - Foo::Bar; - $foo::Bar; - clone($a); - clone $a; - function(){}; - function($a, $b) use ($c, &$d) {}; - function(): void {}; - foo; - namespace\foo; - \foo; - - empty($a); - @$a; - eval($a); - exit; - exit($a); - die; - die($a); - foo(); - namespace\foo(); - \foo(); - $foo(); - - $a--; - $a++; - --$a; - ++$a; - - include $a; - include_once $a; - require $a; - require_once $a; - - $a instanceof Foo; - $a instanceof namespace\Foo; - $a instanceof \Foo; - - isset($a, $b); - list($a) = $b; - list($a[]) = $b; - list(list($a)) = $b; - - $a->foo(); - new Foo(); - new namespace\Foo(); - new \Foo(); - new class ($a, ...$b) {}; - print($a); - $a->foo; - ` + "`cmd $a`;" + ` - ` + "`cmd`;" + ` - ` + "``;" + ` - []; - [1]; - [1=>1, &$b,]; - - [$a] = $b; - [$a[]] = $b; - [list($a)] = $b; - Foo::bar(); - namespace\Foo::bar(); - \Foo::bar(); - Foo::$bar; - $foo::$bar; - namespace\Foo::$bar; - \Foo::$bar; - $a ? $b : $c; - $a ? : $c; - $a ? $b ? $c : $d : $e; - $a ? $b : $c ? $d : $e; - -$a; - +$a; - $$a; - yield; - yield $a; - yield $a => $b; - yield from $a; - - (array)$a; - (boolean)$a; - (bool)$a; - (double)$a; - (float)$a; - (integer)$a; - (int)$a; - (object)$a; - (string)$a; - (unset)$a; - - $a & $b; - $a | $b; - $a ^ $b; - $a && $b; - $a || $b; - $a ?? $b; - $a . $b; - $a / $b; - $a == $b; - $a >= $b; - $a > $b; - $a === $b; - $a and $b; - $a or $b; - $a xor $b; - $a - $b; - $a % $b; - $a * $b; - $a != $b; - $a !== $b; - $a + $b; - $a ** $b; - $a << $b; - $a >> $b; - $a <= $b; - $a < $b; - $a <=> $b; - - $a =& $b; - $a = $b; - $a &= $b; - $a |= $b; - $a ^= $b; - $a .= $b; - $a /= $b; - $a -= $b; - $a %= $b; - $a *= $b; - $a += $b; - $a **= $b; - $a <<= $b; - $a >>= $b; - - class foo {public function class() {} } - \foo\bar(); - - function foo(&$a, ...$b) { - __halt_compiler(); - function bar() {} - class Baz {} - trait Quux{} - interface Quuux {} - } - - function foo(&$a = 1, ...$b = 1, $c = 1) {} - function foo(array $a, callable $b) {} - abstract final class foo { abstract protected static function bar(); final private function baz() {} } - - (new Foo)->bar; - (new Foo)(); - [$foo][0](); - foo[1](); - "foo"(); - [1]{$foo}(); - ${foo()}; - - Foo::$bar(); - Foo::{$bar[0]}(); - - $foo->$bar; - $foo->{$bar[0]}; - - [1=>&$a, 2=>list($b)]; - ` + if err != nil { + b.Fatal("can not read test.php: " + err.Error()) + } for n := 0; n < b.N; n++ { - lexer := scanner.NewLexer([]byte(src), "7.4", nil) + lexer := scanner.NewLexer(src, "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go deleted file mode 100644 index 452a0a3..0000000 --- a/internal/php7/php7_test.go +++ /dev/null @@ -1,19703 +0,0 @@ -package php7_test - -import ( - "io/ioutil" - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/internal/php7" - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" - "github.com/z7zmey/php-parser/pkg/errors" - "github.com/z7zmey/php-parser/pkg/position" -) - -func TestPhp7(t *testing.T) { - src, err := ioutil.ReadFile("test.php") - assert.NilError(t, err) - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 348, - StartPos: 3, - EndPos: 5706, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 18, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 17, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 6, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 6, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 17, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 11, - EndPos: 16, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 16, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 16, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 35, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 34, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 23, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 23, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 34, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 33, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 31, - EndPos: 33, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 31, - EndPos: 33, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 57, - }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 56, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 40, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 40, - }, - }, - Value: []byte("$foo"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 45, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 45, - EndPos: 56, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 50, - EndPos: 55, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 78, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 77, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 61, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 61, - }, - }, - Value: []byte("foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 63, - EndPos: 66, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 77, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 76, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 76, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 76, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 100, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 99, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 83, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 83, - }, - }, - Value: []byte("$foo"), - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 85, - EndPos: 88, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 88, - EndPos: 99, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 93, - EndPos: 98, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 101, - EndPos: 120, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 101, - EndPos: 119, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 105, - EndPos: 108, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 105, - EndPos: 108, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 108, - EndPos: 119, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 118, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 116, - EndPos: 118, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 116, - EndPos: 118, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 144, - EndPos: 169, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 144, - EndPos: 168, - }, - }, - Class: &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 148, - EndPos: 168, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 165, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 155, - EndPos: 157, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 155, - EndPos: 157, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 155, - EndPos: 157, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 159, - EndPos: 164, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 162, - EndPos: 164, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 162, - EndPos: 164, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 170, - EndPos: 183, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 170, - EndPos: 182, - }, - }, - Class: &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 174, - EndPos: 182, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 184, - EndPos: 193, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 184, - EndPos: 192, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 188, - EndPos: 192, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 188, - EndPos: 192, - }, - }, - Value: []byte("$foo"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 194, - EndPos: 206, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 194, - EndPos: 205, - }, - }, - Class: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 198, - EndPos: 205, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 198, - EndPos: 202, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 198, - EndPos: 202, - }, - }, - Value: []byte("$foo"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 203, - EndPos: 204, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 207, - EndPos: 222, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 207, - EndPos: 221, - }, - }, - Class: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 211, - EndPos: 221, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 211, - EndPos: 215, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 211, - EndPos: 215, - }, - }, - Value: []byte("$foo"), - }, - }, - Dim: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 216, - EndPos: 220, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 13, - EndLine: 13, - StartPos: 216, - EndPos: 220, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 223, - EndPos: 237, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 223, - EndPos: 236, - }, - }, - Class: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 227, - EndPos: 236, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 227, - EndPos: 231, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 227, - EndPos: 231, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 233, - EndPos: 236, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 238, - EndPos: 253, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 238, - EndPos: 252, - }, - }, - Class: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 242, - EndPos: 252, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 242, - EndPos: 246, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 242, - EndPos: 246, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 248, - EndPos: 252, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 248, - EndPos: 252, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 254, - EndPos: 271, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 254, - EndPos: 270, - }, - }, - Class: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 258, - EndPos: 270, - }, - }, - Class: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 258, - EndPos: 264, - }, - }, - Value: []byte("static"), - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 266, - EndPos: 270, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 266, - EndPos: 270, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 273, - EndPos: 318, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 282, - EndPos: 285, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 286, - EndPos: 300, - }, - }, - Type: &ast.Nullable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 286, - EndPos: 290, - }, - }, - Expr: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 287, - EndPos: 290, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 287, - EndPos: 290, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 291, - EndPos: 295, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 291, - EndPos: 295, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 296, - EndPos: 300, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 296, - EndPos: 300, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 296, - EndPos: 300, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 302, - EndPos: 314, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 302, - EndPos: 305, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 302, - EndPos: 305, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 306, - EndPos: 314, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 307, - EndPos: 314, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 310, - EndPos: 314, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 310, - EndPos: 314, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 319, - EndPos: 383, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 325, - EndPos: 328, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 330, - EndPos: 382, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 346, - EndPos: 349, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 330, - EndPos: 336, - }, - }, - Value: []byte("public"), - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 350, - EndPos: 364, - }, - }, - Type: &ast.Nullable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 350, - EndPos: 354, - }, - }, - Expr: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 351, - EndPos: 354, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 351, - EndPos: 354, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 355, - EndPos: 359, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 355, - EndPos: 359, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 364, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 364, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 360, - EndPos: 364, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 366, - EndPos: 378, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 366, - EndPos: 369, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 366, - EndPos: 369, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 370, - EndPos: 378, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 371, - EndPos: 378, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 374, - EndPos: 378, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 374, - EndPos: 378, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 380, - EndPos: 382, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 384, - EndPos: 426, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 384, - EndPos: 425, - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 393, - EndPos: 407, - }, - }, - Type: &ast.Nullable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 393, - EndPos: 397, - }, - }, - Expr: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 394, - EndPos: 397, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 394, - EndPos: 397, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 398, - EndPos: 402, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 398, - EndPos: 402, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 403, - EndPos: 407, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 403, - EndPos: 407, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 403, - EndPos: 407, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 409, - EndPos: 421, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 409, - EndPos: 412, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 409, - EndPos: 412, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 413, - EndPos: 421, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 414, - EndPos: 421, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 417, - EndPos: 421, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 417, - EndPos: 421, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 427, - EndPos: 476, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 427, - EndPos: 475, - }, - }, - Static: true, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 443, - EndPos: 457, - }, - }, - Type: &ast.Nullable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 443, - EndPos: 447, - }, - }, - Expr: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 444, - EndPos: 447, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 444, - EndPos: 447, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 448, - EndPos: 452, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 448, - EndPos: 452, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 453, - EndPos: 457, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 453, - EndPos: 457, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 453, - EndPos: 457, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 459, - EndPos: 471, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 459, - EndPos: 462, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 459, - EndPos: 462, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 463, - EndPos: 471, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 464, - EndPos: 471, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 467, - EndPos: 471, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 467, - EndPos: 471, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 478, - EndPos: 498, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 478, - EndPos: 497, - }, - }, - Value: []byte("1234567890123456789"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 499, - EndPos: 520, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 499, - EndPos: 519, - }, - }, - Value: []byte("12345678901234567890"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 521, - EndPos: 524, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 521, - EndPos: 523, - }, - }, - Value: []byte("0."), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 525, - EndPos: 592, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 525, - EndPos: 591, - }, - }, - Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 593, - EndPos: 660, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 593, - EndPos: 659, - }, - }, - Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 661, - EndPos: 682, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 661, - EndPos: 681, - }, - }, - Value: []byte("0x007111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 683, - EndPos: 702, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 29, - EndLine: 29, - StartPos: 683, - EndPos: 701, - }, - }, - Value: []byte("0x8111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 703, - EndPos: 713, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 703, - EndPos: 712, - }, - }, - Value: []byte("__CLASS__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 714, - EndPos: 722, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 714, - EndPos: 721, - }, - }, - Value: []byte("__DIR__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 723, - EndPos: 732, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 723, - EndPos: 731, - }, - }, - Value: []byte("__FILE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 733, - EndPos: 746, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 733, - EndPos: 745, - }, - }, - Value: []byte("__FUNCTION__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 747, - EndPos: 756, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 747, - EndPos: 755, - }, - }, - Value: []byte("__LINE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 757, - EndPos: 771, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 757, - EndPos: 770, - }, - }, - Value: []byte("__NAMESPACE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 772, - EndPos: 783, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 772, - EndPos: 782, - }, - }, - Value: []byte("__METHOD__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 784, - EndPos: 794, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 784, - EndPos: 793, - }, - }, - Value: []byte("__TRAIT__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 796, - EndPos: 808, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 796, - EndPos: 807, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 797, - EndPos: 802, - }, - }, - Value: []byte("test "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 802, - EndPos: 806, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 802, - EndPos: 806, - }, - }, - Value: []byte("$var"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 809, - EndPos: 824, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 809, - EndPos: 823, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 810, - EndPos: 815, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 815, - EndPos: 822, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 815, - EndPos: 819, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 815, - EndPos: 819, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 40, - EndLine: 40, - StartPos: 820, - EndPos: 821, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 825, - EndPos: 841, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 825, - EndPos: 840, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 826, - EndPos: 831, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 831, - EndPos: 839, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 831, - EndPos: 835, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 831, - EndPos: 835, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 836, - EndPos: 838, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 836, - EndPos: 838, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 842, - EndPos: 896, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 842, - EndPos: 895, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 843, - EndPos: 848, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 848, - EndPos: 894, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 848, - EndPos: 852, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 848, - EndPos: 852, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 42, - EndLine: 42, - StartPos: 853, - EndPos: 893, - }, - }, - Value: []byte("1234567890123456789012345678901234567890"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 897, - EndPos: 952, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 897, - EndPos: 951, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 898, - EndPos: 903, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 903, - EndPos: 950, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 903, - EndPos: 907, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 903, - EndPos: 907, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 908, - EndPos: 949, - }, - }, - Value: []byte("-1234567890123456789012345678901234567890"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 953, - EndPos: 970, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 953, - EndPos: 969, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 954, - EndPos: 959, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 959, - EndPos: 968, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 959, - EndPos: 963, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 959, - EndPos: 963, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 964, - EndPos: 967, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 971, - EndPos: 989, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 971, - EndPos: 988, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 972, - EndPos: 977, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 977, - EndPos: 987, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 977, - EndPos: 981, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 977, - EndPos: 981, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 982, - EndPos: 986, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 45, - EndLine: 45, - StartPos: 982, - EndPos: 986, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 990, - EndPos: 1002, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 990, - EndPos: 1001, - }, - }, - Parts: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 991, - EndPos: 995, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 991, - EndPos: 995, - }, - }, - Value: []byte("$foo"), - }, - }, - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 995, - EndPos: 996, - }, - }, - Value: []byte(" "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 996, - EndPos: 1000, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 996, - EndPos: 1000, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1003, - EndPos: 1022, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1003, - EndPos: 1021, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1004, - EndPos: 1009, - }, - }, - Value: []byte("test "), - }, - &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1009, - EndPos: 1018, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1009, - EndPos: 1013, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1009, - EndPos: 1013, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1015, - EndPos: 1018, - }, - }, - Value: []byte("bar"), - }, - }, - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: 47, - StartPos: 1018, - EndPos: 1020, - }, - }, - Value: []byte("()"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1023, - EndPos: 1037, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1023, - EndPos: 1036, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1024, - EndPos: 1029, - }, - }, - Value: []byte("test "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1029, - EndPos: 1035, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 48, - EndLine: 48, - StartPos: 1031, - EndPos: 1034, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1038, - EndPos: 1055, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1038, - EndPos: 1054, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1039, - EndPos: 1044, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1044, - EndPos: 1053, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1046, - EndPos: 1049, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1046, - EndPos: 1049, - }, - }, - Value: []byte("foo"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 1050, - EndPos: 1051, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1056, - EndPos: 1071, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1056, - EndPos: 1070, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1057, - EndPos: 1062, - }, - }, - Value: []byte("test "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1062, - EndPos: 1069, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1064, - EndPos: 1068, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 1064, - EndPos: 1068, - }, - }, - Value: []byte("$foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1072, - EndPos: 1093, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1072, - EndPos: 1092, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1073, - EndPos: 1078, - }, - }, - Value: []byte("test "), - }, - &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1079, - EndPos: 1090, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1079, - EndPos: 1083, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1079, - EndPos: 1083, - }, - }, - Value: []byte("$foo"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1085, - EndPos: 1088, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 1088, - EndPos: 1090, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 53, - EndLine: 54, - StartPos: 1095, - EndPos: 1111, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1099, - EndPos: 1101, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 53, - EndLine: 53, - StartPos: 1099, - EndPos: 1101, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 57, - StartPos: 1112, - EndPos: 1141, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1116, - EndPos: 1118, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 1116, - EndPos: 1118, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: -1, - StartPos: 1122, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1130, - EndPos: 1132, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1130, - EndPos: 1132, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 60, - StartPos: 1142, - EndPos: 1164, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1146, - EndPos: 1148, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1146, - EndPos: 1148, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: -1, - StartPos: 1152, - EndPos: -1, - }, - }, - Alt: true, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 65, - StartPos: 1165, - EndPos: 1213, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1169, - EndPos: 1171, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1169, - EndPos: 1171, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: -1, - StartPos: 1175, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1183, - EndPos: 1185, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1183, - EndPos: 1185, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: -1, - StartPos: 1188, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1196, - EndPos: 1198, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1196, - EndPos: 1198, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: -1, - StartPos: 1201, - EndPos: -1, - }, - }, - Alt: true, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1215, - EndPos: 1235, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1222, - EndPos: 1223, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1225, - EndPos: 1235, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1227, - EndPos: 1233, - }, - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1236, - EndPos: 1258, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1243, - EndPos: 1244, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1246, - EndPos: 1258, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1248, - EndPos: 1256, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1254, - EndPos: 1255, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1259, - EndPos: 1290, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1266, - EndPos: 1267, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1271, - EndPos: 1280, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1271, - EndPos: 1280, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1277, - EndPos: 1278, - }, - }, - Value: []byte("3"), - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1291, - EndPos: 1334, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1297, - EndPos: 1300, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassConstList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1302, - EndPos: 1332, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1302, - EndPos: 1308, - }, - }, - Value: []byte("public"), - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1315, - EndPos: 1322, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1315, - EndPos: 1318, - }, - }, - Value: []byte("FOO"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1321, - EndPos: 1322, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1324, - EndPos: 1331, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1324, - EndPos: 1327, - }, - }, - Value: []byte("BAR"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1330, - EndPos: 1331, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1335, - EndPos: 1371, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1341, - EndPos: 1344, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassConstList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1346, - EndPos: 1369, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1352, - EndPos: 1359, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1352, - EndPos: 1355, - }, - }, - Value: []byte("FOO"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1358, - EndPos: 1359, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1361, - EndPos: 1368, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1361, - EndPos: 1364, - }, - }, - Value: []byte("BAR"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1367, - EndPos: 1368, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1372, - EndPos: 1402, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1378, - EndPos: 1381, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1383, - EndPos: 1400, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1392, - EndPos: 1395, - }, - }, - Value: []byte("bar"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1398, - EndPos: 1400, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1403, - EndPos: 1448, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1409, - EndPos: 1412, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1414, - EndPos: 1446, - }, - }, - ReturnsRef: true, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1438, - EndPos: 1441, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1414, - EndPos: 1420, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1421, - EndPos: 1427, - }, - }, - Value: []byte("static"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1444, - EndPos: 1446, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1449, - EndPos: 1500, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1455, - EndPos: 1458, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1460, - EndPos: 1498, - }, - }, - ReturnsRef: true, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1484, - EndPos: 1487, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1460, - EndPos: 1466, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1467, - EndPos: 1473, - }, - }, - Value: []byte("static"), - }, - }, - ReturnType: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1491, - EndPos: 1495, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1491, - EndPos: 1495, - }, - }, - Value: []byte("void"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1496, - EndPos: 1498, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1501, - EndPos: 1522, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1516, - EndPos: 1519, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1501, - EndPos: 1509, - }, - }, - Value: []byte("abstract"), - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1523, - EndPos: 1554, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1535, - EndPos: 1538, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1523, - EndPos: 1528, - }, - }, - Value: []byte("final"), - }, - }, - Extends: &ast.StmtClassExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1539, - EndPos: 1550, - }, - }, - ClassName: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1547, - EndPos: 1550, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1547, - EndPos: 1550, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1555, - EndPos: 1589, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1567, - EndPos: 1570, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1555, - EndPos: 1560, - }, - }, - Value: []byte("final"), - }, - }, - Implements: &ast.StmtClassImplements{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1571, - EndPos: 1585, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1582, - EndPos: 1585, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1582, - EndPos: 1585, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1590, - EndPos: 1629, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1602, - EndPos: 1605, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1590, - EndPos: 1595, - }, - }, - Value: []byte("final"), - }, - }, - Implements: &ast.StmtClassImplements{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1606, - EndPos: 1625, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1617, - EndPos: 1620, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1617, - EndPos: 1620, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1622, - EndPos: 1625, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1622, - EndPos: 1625, - }, - }, - Value: []byte("baz"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1630, - EndPos: 1678, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1630, - EndPos: 1677, - }, - }, - Class: &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1634, - EndPos: 1677, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1639, - EndPos: 1641, - }, - }, - }, - Extends: &ast.StmtClassExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1642, - EndPos: 1653, - }, - }, - ClassName: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1650, - EndPos: 1653, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1650, - EndPos: 1653, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - Implements: &ast.StmtClassImplements{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1654, - EndPos: 1673, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1665, - EndPos: 1668, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1665, - EndPos: 1668, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1670, - EndPos: 1673, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1670, - EndPos: 1673, - }, - }, - Value: []byte("baz"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtConstList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1680, - EndPos: 1703, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1686, - EndPos: 1693, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1686, - EndPos: 1689, - }, - }, - Value: []byte("FOO"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1692, - EndPos: 1693, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1695, - EndPos: 1702, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1695, - EndPos: 1698, - }, - }, - Value: []byte("BAR"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1701, - EndPos: 1702, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1704, - EndPos: 1727, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1711, - EndPos: 1712, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1714, - EndPos: 1727, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1716, - EndPos: 1725, - }, - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1728, - EndPos: 1753, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1735, - EndPos: 1736, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1738, - EndPos: 1753, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1740, - EndPos: 1751, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1749, - EndPos: 1750, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1754, - EndPos: 1780, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1761, - EndPos: 1762, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1764, - EndPos: 1780, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1766, - EndPos: 1778, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1775, - EndPos: 1776, - }, - }, - Value: []byte("3"), - }, - }, - }, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1781, - EndPos: 1798, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1789, - EndPos: 1796, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1789, - EndPos: 1794, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1795, - EndPos: 1796, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1797, - EndPos: 1798, - }, - }, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1799, - EndPos: 1818, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1807, - EndPos: 1814, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1807, - EndPos: 1812, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1813, - EndPos: 1814, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1816, - EndPos: 1818, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1819, - EndPos: 1848, - }, - }, - Alt: true, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1827, - EndPos: 1834, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1827, - EndPos: 1832, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 87, - EndLine: 87, - StartPos: 1833, - EndPos: 1834, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtDo{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 1849, - EndPos: 1864, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 1852, - EndPos: 1854, - }, - }, - Stmts: []ast.Vertex{}, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 1861, - EndPos: 1862, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtEcho{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1865, - EndPos: 1876, - }, - }, - Exprs: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1870, - EndPos: 1872, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1870, - EndPos: 1872, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1874, - EndPos: 1875, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtEcho{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 1877, - EndPos: 1886, - }, - }, - Exprs: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 1882, - EndPos: 1884, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 1882, - EndPos: 1884, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtFor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1887, - EndPos: 1922, - }, - }, - Init: []ast.Vertex{ - &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1891, - EndPos: 1897, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1891, - EndPos: 1893, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1891, - EndPos: 1893, - }, - }, - Value: []byte("$i"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1896, - EndPos: 1897, - }, - }, - Value: []byte("0"), - }, - }, - }, - Cond: []ast.Vertex{ - &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1899, - EndPos: 1906, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1899, - EndPos: 1901, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1899, - EndPos: 1901, - }, - }, - Value: []byte("$i"), - }, - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1904, - EndPos: 1906, - }, - }, - Value: []byte("10"), - }, - }, - }, - Loop: []ast.Vertex{ - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1908, - EndPos: 1912, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1908, - EndPos: 1910, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1908, - EndPos: 1910, - }, - }, - Value: []byte("$i"), - }, - }, - }, - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1914, - EndPos: 1918, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1914, - EndPos: 1916, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1914, - EndPos: 1916, - }, - }, - Value: []byte("$i"), - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1920, - EndPos: 1922, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtFor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1923, - EndPos: 1959, - }, - }, - Alt: true, - Cond: []ast.Vertex{ - &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1929, - EndPos: 1936, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1929, - EndPos: 1931, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1929, - EndPos: 1931, - }, - }, - Value: []byte("$i"), - }, - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1934, - EndPos: 1936, - }, - }, - Value: []byte("10"), - }, - }, - }, - Loop: []ast.Vertex{ - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1938, - EndPos: 1942, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1938, - EndPos: 1940, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1938, - EndPos: 1940, - }, - }, - Value: []byte("$i"), - }, - }, - }, - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1944, - EndPos: 1948, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1944, - EndPos: 1946, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 92, - EndLine: 92, - StartPos: 1944, - EndPos: 1946, - }, - }, - Value: []byte("$i"), - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1960, - EndPos: 1981, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1969, - EndPos: 1971, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1969, - EndPos: 1971, - }, - }, - Value: []byte("$a"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1975, - EndPos: 1977, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1975, - EndPos: 1977, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 93, - EndLine: 93, - StartPos: 1979, - EndPos: 1981, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1982, - EndPos: 2014, - }, - }, - Alt: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1991, - EndPos: 1993, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1991, - EndPos: 1993, - }, - }, - Value: []byte("$a"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1997, - EndPos: 1999, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1997, - EndPos: 1999, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2015, - EndPos: 2042, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2024, - EndPos: 2026, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2024, - EndPos: 2026, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2030, - EndPos: 2032, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2030, - EndPos: 2032, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2036, - EndPos: 2038, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2036, - EndPos: 2038, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2040, - EndPos: 2042, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2043, - EndPos: 2071, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2052, - EndPos: 2054, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2052, - EndPos: 2054, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2058, - EndPos: 2060, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2058, - EndPos: 2060, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2064, - EndPos: 2067, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2065, - EndPos: 2067, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2065, - EndPos: 2067, - }, - }, - Value: []byte("$v"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2069, - EndPos: 2071, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2072, - EndPos: 2105, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2081, - EndPos: 2083, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2081, - EndPos: 2083, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2087, - EndPos: 2089, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2087, - EndPos: 2089, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2093, - EndPos: 2101, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2098, - EndPos: 2100, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2098, - EndPos: 2100, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2098, - EndPos: 2100, - }, - }, - Value: []byte("$v"), - }, - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2103, - EndPos: 2105, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2106, - EndPos: 2135, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2115, - EndPos: 2117, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2115, - EndPos: 2117, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2121, - EndPos: 2123, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2121, - EndPos: 2123, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprShortList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2127, - EndPos: 2131, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2128, - EndPos: 2130, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2128, - EndPos: 2130, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2128, - EndPos: 2130, - }, - }, - Value: []byte("$v"), - }, - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2133, - EndPos: 2135, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2136, - EndPos: 2153, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2145, - EndPos: 2148, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2154, - EndPos: 2178, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2163, - EndPos: 2166, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtReturn{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2170, - EndPos: 2177, - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2179, - EndPos: 2206, - }, - }, - ReturnsRef: true, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2189, - EndPos: 2192, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtReturn{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2196, - EndPos: 2205, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2203, - EndPos: 2204, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2207, - EndPos: 2231, - }, - }, - ReturnsRef: true, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2217, - EndPos: 2220, - }, - }, - Value: []byte("foo"), - }, - ReturnType: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2224, - EndPos: 2228, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2224, - EndPos: 2228, - }, - }, - Value: []byte("void"), - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtGlobal{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2232, - EndPos: 2246, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2239, - EndPos: 2241, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2239, - EndPos: 2241, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2243, - EndPos: 2245, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2243, - EndPos: 2245, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtLabel{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2247, - EndPos: 2249, - }, - }, - LabelName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2247, - EndPos: 2248, - }, - }, - Value: []byte("a"), - }, - }, - &ast.StmtGoto{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2250, - EndPos: 2257, - }, - }, - Label: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2255, - EndPos: 2256, - }, - }, - Value: []byte("a"), - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2258, - EndPos: 2268, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2262, - EndPos: 2264, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2262, - EndPos: 2264, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2266, - EndPos: 2268, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2269, - EndPos: 2294, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2273, - EndPos: 2275, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2273, - EndPos: 2275, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2277, - EndPos: 2279, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2280, - EndPos: 2294, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2288, - EndPos: 2290, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2288, - EndPos: 2290, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2292, - EndPos: 2294, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2295, - EndPos: 2313, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2299, - EndPos: 2301, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2299, - EndPos: 2301, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2303, - EndPos: 2305, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2306, - EndPos: 2313, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2311, - EndPos: 2313, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2314, - EndPos: 2362, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2318, - EndPos: 2320, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2318, - EndPos: 2320, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2322, - EndPos: 2324, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2325, - EndPos: 2339, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2333, - EndPos: 2335, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2333, - EndPos: 2335, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2337, - EndPos: 2339, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2340, - EndPos: 2354, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2348, - EndPos: 2350, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2348, - EndPos: 2350, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2352, - EndPos: 2354, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2355, - EndPos: 2362, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2360, - EndPos: 2362, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2363, - EndPos: 2412, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2367, - EndPos: 2369, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2367, - EndPos: 2369, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2371, - EndPos: 2373, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2374, - EndPos: 2388, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2382, - EndPos: 2384, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2382, - EndPos: 2384, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2386, - EndPos: 2388, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2389, - EndPos: 2412, - }, - }, - Stmt: &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2394, - EndPos: 2412, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2398, - EndPos: 2400, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2398, - EndPos: 2400, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2402, - EndPos: 2404, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2405, - EndPos: 2412, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2410, - EndPos: 2412, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - }, - &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2413, - EndPos: 2415, - }, - }, - }, - &ast.StmtInlineHtml{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2415, - EndPos: 2428, - }, - }, - Value: []byte("
"), - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2431, - EndPos: 2447, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2441, - EndPos: 2444, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2448, - EndPos: 2476, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2458, - EndPos: 2461, - }, - }, - Value: []byte("Foo"), - }, - Extends: &ast.StmtInterfaceExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2462, - EndPos: 2473, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2470, - EndPos: 2473, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2470, - EndPos: 2473, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2477, - EndPos: 2510, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2487, - EndPos: 2490, - }, - }, - Value: []byte("Foo"), - }, - Extends: &ast.StmtInterfaceExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2491, - EndPos: 2507, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2499, - EndPos: 2502, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2499, - EndPos: 2502, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2504, - EndPos: 2507, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2504, - EndPos: 2507, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2511, - EndPos: 2525, - }, - }, - Name: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2521, - EndPos: 2524, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2521, - EndPos: 2524, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2526, - EndPos: 2542, - }, - }, - Name: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2536, - EndPos: 2539, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2536, - EndPos: 2539, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 117, - EndLine: 117, - StartPos: 2543, - EndPos: 2555, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2556, - EndPos: 2575, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2562, - EndPos: 2565, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtPropertyList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2567, - EndPos: 2574, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2567, - EndPos: 2570, - }, - }, - Value: []byte("var"), - }, - }, - Properties: []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2571, - EndPos: 2573, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2571, - EndPos: 2573, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2571, - EndPos: 2573, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2576, - EndPos: 2613, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2582, - EndPos: 2585, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtPropertyList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2587, - EndPos: 2612, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2587, - EndPos: 2593, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2594, - EndPos: 2600, - }, - }, - Value: []byte("static"), - }, - }, - Properties: []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2601, - EndPos: 2603, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2601, - EndPos: 2603, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2601, - EndPos: 2603, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2605, - EndPos: 2611, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2605, - EndPos: 2607, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2605, - EndPos: 2607, - }, - }, - Value: []byte("$b"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2610, - EndPos: 2611, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2614, - EndPos: 2632, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2621, - EndPos: 2623, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2621, - EndPos: 2623, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2621, - EndPos: 2623, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2625, - EndPos: 2631, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2625, - EndPos: 2627, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2625, - EndPos: 2627, - }, - }, - Value: []byte("$b"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: 120, - StartPos: 2630, - EndPos: 2631, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 122, - EndLine: 126, - StartPos: 2634, - EndPos: 2694, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 122, - EndLine: 122, - StartPos: 2642, - EndPos: 2643, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 123, - EndLine: -1, - StartPos: 2651, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 123, - EndLine: 123, - StartPos: 2656, - EndPos: 2657, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtDefault{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 124, - EndLine: -1, - StartPos: 2663, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2676, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 125, - EndLine: 125, - StartPos: 2681, - EndPos: 2682, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 128, - EndLine: 131, - StartPos: 2696, - EndPos: 2744, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 128, - EndLine: 128, - StartPos: 2704, - EndPos: 2705, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 129, - EndLine: -1, - StartPos: 2714, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2719, - EndPos: 2720, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 130, - EndLine: -1, - StartPos: 2726, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2731, - EndPos: 2732, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 133, - EndLine: 136, - StartPos: 2746, - EndPos: 2798, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 133, - EndLine: 133, - StartPos: 2754, - EndPos: 2755, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2763, - EndPos: 2777, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2768, - EndPos: 2769, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2771, - EndPos: 2777, - }, - }, - }, - }, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2782, - EndPos: 2796, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2787, - EndPos: 2788, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2790, - EndPos: 2796, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 138, - EndLine: 141, - StartPos: 2800, - EndPos: 2853, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2808, - EndPos: 2809, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2818, - EndPos: 2832, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2823, - EndPos: 2824, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2826, - EndPos: 2832, - }, - }, - }, - }, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2837, - EndPos: 2851, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2842, - EndPos: 2843, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2845, - EndPos: 2851, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtThrow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2855, - EndPos: 2864, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2861, - EndPos: 2863, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2861, - EndPos: 2863, - }, - }, - Value: []byte("$e"), - }, - }, - }, - &ast.StmtTrait{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 2866, - EndPos: 2878, - }, - }, - TraitName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 145, - EndLine: 145, - StartPos: 2872, - EndPos: 2875, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2879, - EndPos: 2901, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2885, - EndPos: 2888, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2891, - EndPos: 2899, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2895, - EndPos: 2898, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2895, - EndPos: 2898, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: 146, - StartPos: 2898, - EndPos: 2899, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2902, - EndPos: 2931, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2908, - EndPos: 2911, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2914, - EndPos: 2929, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2918, - EndPos: 2921, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2918, - EndPos: 2921, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2923, - EndPos: 2926, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2923, - EndPos: 2926, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 2927, - EndPos: 2929, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2932, - EndPos: 2978, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2938, - EndPos: 2941, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2944, - EndPos: 2976, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2948, - EndPos: 2951, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2948, - EndPos: 2951, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2953, - EndPos: 2956, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2953, - EndPos: 2956, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2957, - EndPos: 2976, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2959, - EndPos: 2973, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2959, - EndPos: 2962, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2959, - EndPos: 2962, - }, - }, - Value: []byte("one"), - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 2966, - EndPos: 2973, - }, - }, - Value: []byte("include"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 2979, - EndPos: 3024, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 2985, - EndPos: 2988, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 2991, - EndPos: 3022, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 2995, - EndPos: 2998, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 2995, - EndPos: 2998, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3000, - EndPos: 3003, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3000, - EndPos: 3003, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3004, - EndPos: 3022, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3006, - EndPos: 3019, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3006, - EndPos: 3009, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3006, - EndPos: 3009, - }, - }, - Value: []byte("one"), - }, - }, - Modifier: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3013, - EndPos: 3019, - }, - }, - Value: []byte("public"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3025, - EndPos: 3074, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3031, - EndPos: 3034, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3037, - EndPos: 3072, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3041, - EndPos: 3044, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3041, - EndPos: 3044, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3046, - EndPos: 3049, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3046, - EndPos: 3049, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3050, - EndPos: 3072, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3052, - EndPos: 3069, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3052, - EndPos: 3055, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3052, - EndPos: 3055, - }, - }, - Value: []byte("one"), - }, - }, - Modifier: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3059, - EndPos: 3065, - }, - }, - Value: []byte("public"), - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3066, - EndPos: 3069, - }, - }, - Value: []byte("two"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3075, - EndPos: 3152, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3081, - EndPos: 3084, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3087, - EndPos: 3150, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3091, - EndPos: 3094, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3091, - EndPos: 3094, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3096, - EndPos: 3099, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3096, - EndPos: 3099, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3100, - EndPos: 3150, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUsePrecedence{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3102, - EndPos: 3130, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3102, - EndPos: 3110, - }, - }, - Trait: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3102, - EndPos: 3105, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3102, - EndPos: 3105, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3107, - EndPos: 3110, - }, - }, - Value: []byte("one"), - }, - }, - Insteadof: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3121, - EndPos: 3124, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3121, - EndPos: 3124, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3126, - EndPos: 3130, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3126, - EndPos: 3130, - }, - }, - Value: []byte("Quux"), - }, - }, - }, - }, - }, - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3132, - EndPos: 3147, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3132, - EndPos: 3140, - }, - }, - Trait: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3132, - EndPos: 3135, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3132, - EndPos: 3135, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3137, - EndPos: 3140, - }, - }, - Value: []byte("one"), - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 151, - EndLine: 151, - StartPos: 3144, - EndPos: 3147, - }, - }, - Value: []byte("two"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 153, - EndLine: -1, - StartPos: 3154, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{}, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3161, - EndPos: 3191, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3168, - EndPos: 3191, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3175, - EndPos: 3184, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3175, - EndPos: 3184, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3185, - EndPos: 3187, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3185, - EndPos: 3187, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3192, - EndPos: 3239, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3199, - EndPos: 3239, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3206, - EndPos: 3215, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3206, - EndPos: 3215, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3216, - EndPos: 3232, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3216, - EndPos: 3232, - }, - }, - Value: []byte("RuntimeException"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3233, - EndPos: 3235, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3233, - EndPos: 3235, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3240, - EndPos: 3301, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3247, - EndPos: 3270, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3254, - EndPos: 3263, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3254, - EndPos: 3263, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3264, - EndPos: 3266, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3264, - EndPos: 3266, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3271, - EndPos: 3301, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3278, - EndPos: 3294, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3278, - EndPos: 3294, - }, - }, - Value: []byte("RuntimeException"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3295, - EndPos: 3297, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3295, - EndPos: 3297, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3302, - EndPos: 3343, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3309, - EndPos: 3332, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3316, - EndPos: 3325, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3316, - EndPos: 3325, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3328, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3328, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - Finally: &ast.StmtFinally{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3333, - EndPos: 3343, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtUnset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3345, - EndPos: 3360, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3351, - EndPos: 3353, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3351, - EndPos: 3353, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3355, - EndPos: 3357, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3355, - EndPos: 3357, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3362, - EndPos: 3370, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3371, - EndPos: 3380, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3375, - EndPos: 3379, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3381, - EndPos: 3397, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3385, - EndPos: 3396, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3389, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3389, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3393, - EndPos: 3396, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3398, - EndPos: 3411, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3412, - EndPos: 3432, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3431, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3424, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3424, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3428, - EndPos: 3431, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3433, - EndPos: 3456, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3437, - EndPos: 3445, - }, - }, - Value: []byte("function"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3451, - EndPos: 3455, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3452, - EndPos: 3455, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3452, - EndPos: 3455, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3457, - EndPos: 3494, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3461, - EndPos: 3469, - }, - }, - Value: []byte("function"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3480, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3473, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3473, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3477, - EndPos: 3480, - }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3482, - EndPos: 3493, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3483, - EndPos: 3486, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3483, - EndPos: 3486, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3490, - EndPos: 3493, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3495, - EndPos: 3515, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3499, - EndPos: 3504, - }, - }, - Value: []byte("const"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3510, - EndPos: 3514, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3511, - EndPos: 3514, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3511, - EndPos: 3514, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3516, - EndPos: 3550, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3520, - EndPos: 3525, - }, - }, - Value: []byte("const"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3536, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3529, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3529, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3533, - EndPos: 3536, - }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3538, - EndPos: 3549, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3539, - EndPos: 3542, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3539, - EndPos: 3542, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3546, - EndPos: 3549, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - &ast.StmtGroupUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3552, - EndPos: 3572, - }, - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3557, - EndPos: 3560, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3557, - EndPos: 3560, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - }, - &ast.StmtGroupUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3573, - EndPos: 3600, - }, - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3598, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3590, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3590, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3594, - EndPos: 3598, - }, - }, - Value: []byte("quux"), - }, - }, - }, - }, - &ast.StmtGroupUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3601, - EndPos: 3629, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3605, - EndPos: 3613, - }, - }, - Value: []byte("function"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3614, - EndPos: 3617, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3614, - EndPos: 3617, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - }, - &ast.StmtGroupUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3630, - EndPos: 3656, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3634, - EndPos: 3639, - }, - }, - Value: []byte("const"), - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3641, - EndPos: 3644, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3641, - EndPos: 3644, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - }, - &ast.StmtGroupUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3657, - EndPos: 3691, - }, - }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3661, - EndPos: 3664, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3661, - EndPos: 3664, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3666, - EndPos: 3675, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3666, - EndPos: 3671, - }, - }, - Value: []byte("const"), - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3672, - EndPos: 3675, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3672, - EndPos: 3675, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3677, - EndPos: 3689, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3677, - EndPos: 3685, - }, - }, - Value: []byte("function"), - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3693, - EndPos: 3699, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3693, - EndPos: 3698, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3693, - EndPos: 3695, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3693, - EndPos: 3695, - }, - }, - Value: []byte("$a"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3696, - EndPos: 3697, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3700, - EndPos: 3709, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3700, - EndPos: 3708, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3700, - EndPos: 3705, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3700, - EndPos: 3702, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3700, - EndPos: 3702, - }, - }, - Value: []byte("$a"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3703, - EndPos: 3704, - }, - }, - Value: []byte("1"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3706, - EndPos: 3707, - }, - }, - Value: []byte("2"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3710, - EndPos: 3718, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3710, - EndPos: 3717, - }, - }, - Items: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3719, - EndPos: 3728, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3719, - EndPos: 3727, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3725, - EndPos: 3726, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3725, - EndPos: 3726, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3729, - EndPos: 3747, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3729, - EndPos: 3746, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3735, - EndPos: 3739, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3735, - EndPos: 3736, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3738, - EndPos: 3739, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3741, - EndPos: 3744, - }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3741, - EndPos: 3744, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3742, - EndPos: 3744, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3742, - EndPos: 3744, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.ExprArrayItem{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3748, - EndPos: 3752, - }, - }, - Expr: &ast.ExprBitwiseNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3748, - EndPos: 3751, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3749, - EndPos: 3751, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3749, - EndPos: 3751, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3753, - EndPos: 3757, - }, - }, - Expr: &ast.ExprBooleanNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3753, - EndPos: 3756, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3754, - EndPos: 3756, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3754, - EndPos: 3756, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3759, - EndPos: 3768, - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3759, - EndPos: 3767, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3759, - EndPos: 3762, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3759, - EndPos: 3762, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3764, - EndPos: 3767, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3769, - EndPos: 3779, - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3769, - EndPos: 3778, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3769, - EndPos: 3773, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3769, - EndPos: 3773, - }, - }, - Value: []byte("$foo"), - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3775, - EndPos: 3778, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3780, - EndPos: 3790, - }, - }, - Expr: &ast.ExprClone{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3780, - EndPos: 3789, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3786, - EndPos: 3788, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3786, - EndPos: 3788, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3791, - EndPos: 3800, - }, - }, - Expr: &ast.ExprClone{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3791, - EndPos: 3799, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3797, - EndPos: 3799, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3797, - EndPos: 3799, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 3801, - EndPos: 3814, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 3801, - EndPos: 3813, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3815, - EndPos: 3849, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3815, - EndPos: 3848, - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3824, - EndPos: 3826, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3824, - EndPos: 3826, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3824, - EndPos: 3826, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3828, - EndPos: 3830, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3828, - EndPos: 3830, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3828, - EndPos: 3830, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - ClosureUse: &ast.ExprClosureUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3832, - EndPos: 3845, - }, - }, - Uses: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3837, - EndPos: 3839, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3837, - EndPos: 3839, - }, - }, - Value: []byte("$c"), - }, - }, - &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3841, - EndPos: 3844, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3842, - EndPos: 3844, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3842, - EndPos: 3844, - }, - }, - Value: []byte("$d"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3850, - EndPos: 3870, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3850, - EndPos: 3869, - }, - }, - ReturnType: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3862, - EndPos: 3866, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3862, - EndPos: 3866, - }, - }, - Value: []byte("void"), - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3871, - EndPos: 3875, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3871, - EndPos: 3874, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3871, - EndPos: 3874, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3871, - EndPos: 3874, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3876, - EndPos: 3890, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3876, - EndPos: 3889, - }, - }, - Const: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3876, - EndPos: 3889, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3886, - EndPos: 3889, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3891, - EndPos: 3896, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3891, - EndPos: 3895, - }, - }, - Const: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3891, - EndPos: 3895, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3892, - EndPos: 3895, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3898, - EndPos: 3908, - }, - }, - Expr: &ast.ExprEmpty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3898, - EndPos: 3907, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3904, - EndPos: 3906, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3904, - EndPos: 3906, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 3909, - EndPos: 3913, - }, - }, - Expr: &ast.ExprErrorSuppress{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 3909, - EndPos: 3912, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 3910, - EndPos: 3912, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 197, - EndLine: 197, - StartPos: 3910, - EndPos: 3912, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3914, - EndPos: 3923, - }, - }, - Expr: &ast.ExprEval{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3914, - EndPos: 3922, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3919, - EndPos: 3921, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3919, - EndPos: 3921, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3924, - EndPos: 3929, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3924, - EndPos: 3928, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3930, - EndPos: 3939, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3930, - EndPos: 3938, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3935, - EndPos: 3937, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3935, - EndPos: 3937, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3940, - EndPos: 3944, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3940, - EndPos: 3943, - }, - }, - Die: true, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 3945, - EndPos: 3953, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 3945, - EndPos: 3952, - }, - }, - Die: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 3949, - EndPos: 3951, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 202, - EndLine: 202, - StartPos: 3949, - EndPos: 3951, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3954, - EndPos: 3960, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3954, - EndPos: 3959, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3954, - EndPos: 3957, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3954, - EndPos: 3957, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3957, - EndPos: 3959, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3961, - EndPos: 3977, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3961, - EndPos: 3976, - }, - }, - Function: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3961, - EndPos: 3974, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3971, - EndPos: 3974, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3974, - EndPos: 3976, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3978, - EndPos: 3985, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3978, - EndPos: 3984, - }, - }, - Function: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3978, - EndPos: 3982, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3979, - EndPos: 3982, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3982, - EndPos: 3984, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3986, - EndPos: 3993, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3986, - EndPos: 3992, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3986, - EndPos: 3990, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3986, - EndPos: 3990, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3990, - EndPos: 3992, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3995, - EndPos: 4000, - }, - }, - Expr: &ast.ExprPostDec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3995, - EndPos: 3999, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3995, - EndPos: 3997, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3995, - EndPos: 3997, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4001, - EndPos: 4006, - }, - }, - Expr: &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4001, - EndPos: 4005, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4001, - EndPos: 4003, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 4001, - EndPos: 4003, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4007, - EndPos: 4012, - }, - }, - Expr: &ast.ExprPreDec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4007, - EndPos: 4011, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4009, - EndPos: 4011, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4009, - EndPos: 4011, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4013, - EndPos: 4018, - }, - }, - Expr: &ast.ExprPreInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4013, - EndPos: 4017, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4015, - EndPos: 4017, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 211, - EndLine: 211, - StartPos: 4015, - EndPos: 4017, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4020, - EndPos: 4031, - }, - }, - Expr: &ast.ExprInclude{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4020, - EndPos: 4030, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4028, - EndPos: 4030, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4028, - EndPos: 4030, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4032, - EndPos: 4048, - }, - }, - Expr: &ast.ExprIncludeOnce{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4032, - EndPos: 4047, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4045, - EndPos: 4047, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4045, - EndPos: 4047, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4049, - EndPos: 4060, - }, - }, - Expr: &ast.ExprRequire{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4049, - EndPos: 4059, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4057, - EndPos: 4059, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4057, - EndPos: 4059, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4061, - EndPos: 4077, - }, - }, - Expr: &ast.ExprRequireOnce{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4061, - EndPos: 4076, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4074, - EndPos: 4076, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4074, - EndPos: 4076, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4079, - EndPos: 4097, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4079, - EndPos: 4096, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4079, - EndPos: 4081, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4079, - EndPos: 4081, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4093, - EndPos: 4096, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 218, - EndLine: 218, - StartPos: 4093, - EndPos: 4096, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4098, - EndPos: 4126, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4098, - EndPos: 4125, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4098, - EndPos: 4100, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4098, - EndPos: 4100, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4112, - EndPos: 4125, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4122, - EndPos: 4125, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4127, - EndPos: 4146, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4127, - EndPos: 4145, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4127, - EndPos: 4129, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4127, - EndPos: 4129, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4141, - EndPos: 4145, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4142, - EndPos: 4145, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4148, - EndPos: 4162, - }, - }, - Expr: &ast.ExprIsset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4148, - EndPos: 4161, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4154, - EndPos: 4156, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4154, - EndPos: 4156, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4158, - EndPos: 4160, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4158, - EndPos: 4160, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4163, - EndPos: 4177, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4163, - EndPos: 4176, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4163, - EndPos: 4171, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4168, - EndPos: 4170, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4168, - EndPos: 4170, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4168, - EndPos: 4170, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4174, - EndPos: 4176, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4174, - EndPos: 4176, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4178, - EndPos: 4194, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4178, - EndPos: 4193, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4178, - EndPos: 4188, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4183, - EndPos: 4187, - }, - }, - Val: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4183, - EndPos: 4187, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4183, - EndPos: 4185, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4183, - EndPos: 4185, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4191, - EndPos: 4193, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4191, - EndPos: 4193, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4195, - EndPos: 4215, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4195, - EndPos: 4214, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4195, - EndPos: 4209, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4200, - EndPos: 4208, - }, - }, - Val: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4200, - EndPos: 4208, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4205, - EndPos: 4207, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4205, - EndPos: 4207, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4205, - EndPos: 4207, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4212, - EndPos: 4214, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4212, - EndPos: 4214, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4217, - EndPos: 4227, - }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4217, - EndPos: 4226, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4217, - EndPos: 4219, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4217, - EndPos: 4219, - }, - }, - Value: []byte("$a"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4221, - EndPos: 4224, - }, - }, - Value: []byte("foo"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4224, - EndPos: 4226, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4228, - EndPos: 4238, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4228, - EndPos: 4237, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4232, - EndPos: 4235, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4232, - EndPos: 4235, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4235, - EndPos: 4237, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4239, - EndPos: 4259, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4239, - EndPos: 4258, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4243, - EndPos: 4256, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4253, - EndPos: 4256, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4256, - EndPos: 4258, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4260, - EndPos: 4271, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4260, - EndPos: 4270, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4264, - EndPos: 4268, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4265, - EndPos: 4268, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4268, - EndPos: 4270, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4272, - EndPos: 4297, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4272, - EndPos: 4296, - }, - }, - Class: &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4276, - EndPos: 4296, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4282, - EndPos: 4293, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4283, - EndPos: 4285, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4283, - EndPos: 4285, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4283, - EndPos: 4285, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4287, - EndPos: 4292, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4290, - EndPos: 4292, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4290, - EndPos: 4292, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4298, - EndPos: 4308, - }, - }, - Expr: &ast.ExprPrint{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4298, - EndPos: 4307, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4304, - EndPos: 4306, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4304, - EndPos: 4306, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4309, - EndPos: 4317, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4309, - EndPos: 4316, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4309, - EndPos: 4311, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4309, - EndPos: 4311, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4313, - EndPos: 4316, - }, - }, - Value: []byte("foo"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4318, - EndPos: 4327, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4318, - EndPos: 4326, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4319, - EndPos: 4323, - }, - }, - Value: []byte("cmd "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4323, - EndPos: 4325, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 234, - EndLine: 234, - StartPos: 4323, - EndPos: 4325, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4328, - EndPos: 4334, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4328, - EndPos: 4333, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4329, - EndPos: 4332, - }, - }, - Value: []byte("cmd"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4335, - EndPos: 4338, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4335, - EndPos: 4337, - }, - }, - Parts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4339, - EndPos: 4342, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4339, - EndPos: 4341, - }, - }, - Items: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4343, - EndPos: 4347, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4343, - EndPos: 4346, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4344, - EndPos: 4345, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4344, - EndPos: 4345, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4348, - EndPos: 4361, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4348, - EndPos: 4360, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4349, - EndPos: 4353, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4349, - EndPos: 4350, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4352, - EndPos: 4353, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4355, - EndPos: 4358, - }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4355, - EndPos: 4358, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4356, - EndPos: 4358, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4356, - EndPos: 4358, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.ExprArrayItem{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4363, - EndPos: 4373, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4363, - EndPos: 4372, - }, - }, - Var: &ast.ExprShortList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4363, - EndPos: 4367, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4364, - EndPos: 4366, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4364, - EndPos: 4366, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4364, - EndPos: 4366, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4370, - EndPos: 4372, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4370, - EndPos: 4372, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4374, - EndPos: 4386, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4374, - EndPos: 4385, - }, - }, - Var: &ast.ExprShortList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4374, - EndPos: 4380, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4375, - EndPos: 4379, - }, - }, - Val: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4375, - EndPos: 4379, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4375, - EndPos: 4377, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4375, - EndPos: 4377, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4383, - EndPos: 4385, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4383, - EndPos: 4385, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4387, - EndPos: 4403, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4387, - EndPos: 4402, - }, - }, - Var: &ast.ExprShortList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4387, - EndPos: 4397, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4388, - EndPos: 4396, - }, - }, - Val: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4388, - EndPos: 4396, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4393, - EndPos: 4395, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4393, - EndPos: 4395, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4393, - EndPos: 4395, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4400, - EndPos: 4402, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4400, - EndPos: 4402, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4404, - EndPos: 4415, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4404, - EndPos: 4414, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4404, - EndPos: 4407, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4404, - EndPos: 4407, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4409, - EndPos: 4412, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4412, - EndPos: 4414, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4416, - EndPos: 4437, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4416, - EndPos: 4436, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4416, - EndPos: 4429, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4426, - EndPos: 4429, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4431, - EndPos: 4434, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4434, - EndPos: 4436, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4438, - EndPos: 4450, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4438, - EndPos: 4449, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4438, - EndPos: 4442, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4439, - EndPos: 4442, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4444, - EndPos: 4447, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4447, - EndPos: 4449, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4451, - EndPos: 4461, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4451, - EndPos: 4460, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4451, - EndPos: 4454, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4451, - EndPos: 4454, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4456, - EndPos: 4460, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4456, - EndPos: 4460, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4462, - EndPos: 4473, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4462, - EndPos: 4472, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4462, - EndPos: 4466, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4462, - EndPos: 4466, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4468, - EndPos: 4472, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4468, - EndPos: 4472, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4474, - EndPos: 4494, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4474, - EndPos: 4493, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4474, - EndPos: 4487, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4484, - EndPos: 4487, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4489, - EndPos: 4493, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4489, - EndPos: 4493, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4495, - EndPos: 4506, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4495, - EndPos: 4505, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4495, - EndPos: 4499, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4496, - EndPos: 4499, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4501, - EndPos: 4505, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4501, - EndPos: 4505, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4507, - EndPos: 4520, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4507, - EndPos: 4519, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4507, - EndPos: 4509, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4507, - EndPos: 4509, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4512, - EndPos: 4514, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4512, - EndPos: 4514, - }, - }, - Value: []byte("$b"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4517, - EndPos: 4519, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4517, - EndPos: 4519, - }, - }, - Value: []byte("$c"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4521, - EndPos: 4531, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4521, - EndPos: 4530, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4521, - EndPos: 4523, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4521, - EndPos: 4523, - }, - }, - Value: []byte("$a"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4528, - EndPos: 4530, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4528, - EndPos: 4530, - }, - }, - Value: []byte("$c"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4532, - EndPos: 4555, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4532, - EndPos: 4554, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4532, - EndPos: 4534, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4532, - EndPos: 4534, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4537, - EndPos: 4549, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4537, - EndPos: 4539, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4537, - EndPos: 4539, - }, - }, - Value: []byte("$b"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4542, - EndPos: 4544, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4542, - EndPos: 4544, - }, - }, - Value: []byte("$c"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4547, - EndPos: 4549, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4547, - EndPos: 4549, - }, - }, - Value: []byte("$d"), - }, - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4552, - EndPos: 4554, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4552, - EndPos: 4554, - }, - }, - Value: []byte("$e"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4556, - EndPos: 4579, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4556, - EndPos: 4578, - }, - }, - Condition: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4556, - EndPos: 4568, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4556, - EndPos: 4558, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4556, - EndPos: 4558, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4561, - EndPos: 4563, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4561, - EndPos: 4563, - }, - }, - Value: []byte("$b"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4566, - EndPos: 4568, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4566, - EndPos: 4568, - }, - }, - Value: []byte("$c"), - }, - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4571, - EndPos: 4573, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4571, - EndPos: 4573, - }, - }, - Value: []byte("$d"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4576, - EndPos: 4578, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4576, - EndPos: 4578, - }, - }, - Value: []byte("$e"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4580, - EndPos: 4584, - }, - }, - Expr: &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4580, - EndPos: 4583, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4581, - EndPos: 4583, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4581, - EndPos: 4583, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 4585, - EndPos: 4589, - }, - }, - Expr: &ast.ExprUnaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 4585, - EndPos: 4588, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 4586, - EndPos: 4588, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 256, - EndLine: 256, - StartPos: 4586, - EndPos: 4588, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4590, - EndPos: 4594, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4590, - EndPos: 4593, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4591, - EndPos: 4593, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4591, - EndPos: 4593, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4595, - EndPos: 4601, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4595, - EndPos: 4600, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4602, - EndPos: 4611, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4602, - EndPos: 4610, - }, - }, - Value: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4608, - EndPos: 4610, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4608, - EndPos: 4610, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4612, - EndPos: 4627, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4612, - EndPos: 4626, - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4618, - EndPos: 4620, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4618, - EndPos: 4620, - }, - }, - Value: []byte("$a"), - }, - }, - Value: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4624, - EndPos: 4626, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4624, - EndPos: 4626, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4628, - EndPos: 4642, - }, - }, - Expr: &ast.ExprYieldFrom{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4628, - EndPos: 4641, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4639, - EndPos: 4641, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4639, - EndPos: 4641, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4644, - EndPos: 4654, - }, - }, - Expr: &ast.ExprCastArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4644, - EndPos: 4653, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4651, - EndPos: 4653, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4651, - EndPos: 4653, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4655, - EndPos: 4667, - }, - }, - Expr: &ast.ExprCastBool{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4655, - EndPos: 4666, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4664, - EndPos: 4666, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4664, - EndPos: 4666, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4668, - EndPos: 4677, - }, - }, - Expr: &ast.ExprCastBool{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4668, - EndPos: 4676, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4674, - EndPos: 4676, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4674, - EndPos: 4676, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4678, - EndPos: 4689, - }, - }, - Expr: &ast.ExprCastDouble{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4678, - EndPos: 4688, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4686, - EndPos: 4688, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4686, - EndPos: 4688, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 4690, - EndPos: 4700, - }, - }, - Expr: &ast.ExprCastDouble{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 4690, - EndPos: 4699, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 4697, - EndPos: 4699, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 267, - EndLine: 267, - StartPos: 4697, - EndPos: 4699, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4701, - EndPos: 4713, - }, - }, - Expr: &ast.ExprCastInt{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4701, - EndPos: 4712, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4710, - EndPos: 4712, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4710, - EndPos: 4712, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4714, - EndPos: 4722, - }, - }, - Expr: &ast.ExprCastInt{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4714, - EndPos: 4721, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4719, - EndPos: 4721, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4719, - EndPos: 4721, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4723, - EndPos: 4734, - }, - }, - Expr: &ast.ExprCastObject{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4723, - EndPos: 4733, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4731, - EndPos: 4733, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4731, - EndPos: 4733, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4735, - EndPos: 4746, - }, - }, - Expr: &ast.ExprCastString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4735, - EndPos: 4745, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4743, - EndPos: 4745, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4743, - EndPos: 4745, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4747, - EndPos: 4757, - }, - }, - Expr: &ast.ExprCastUnset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4747, - EndPos: 4756, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4754, - EndPos: 4756, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4754, - EndPos: 4756, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4759, - EndPos: 4767, - }, - }, - Expr: &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4759, - EndPos: 4766, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4759, - EndPos: 4761, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4759, - EndPos: 4761, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4764, - EndPos: 4766, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4764, - EndPos: 4766, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4768, - EndPos: 4776, - }, - }, - Expr: &ast.ExprBinaryBitwiseOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4768, - EndPos: 4775, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4768, - EndPos: 4770, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4768, - EndPos: 4770, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4773, - EndPos: 4775, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4773, - EndPos: 4775, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4777, - EndPos: 4785, - }, - }, - Expr: &ast.ExprBinaryBitwiseXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4777, - EndPos: 4784, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4777, - EndPos: 4779, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4777, - EndPos: 4779, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4782, - EndPos: 4784, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4782, - EndPos: 4784, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4786, - EndPos: 4795, - }, - }, - Expr: &ast.ExprBinaryBooleanAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4786, - EndPos: 4794, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4786, - EndPos: 4788, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4786, - EndPos: 4788, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4792, - EndPos: 4794, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4792, - EndPos: 4794, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4805, - }, - }, - Expr: &ast.ExprBinaryBooleanOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4804, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4798, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4798, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4802, - EndPos: 4804, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4802, - EndPos: 4804, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4806, - EndPos: 4815, - }, - }, - Expr: &ast.ExprBinaryCoalesce{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4806, - EndPos: 4814, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4806, - EndPos: 4808, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4806, - EndPos: 4808, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4812, - EndPos: 4814, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4812, - EndPos: 4814, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4816, - EndPos: 4824, - }, - }, - Expr: &ast.ExprBinaryConcat{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4816, - EndPos: 4823, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4816, - EndPos: 4818, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4816, - EndPos: 4818, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4821, - EndPos: 4823, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4821, - EndPos: 4823, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4825, - EndPos: 4833, - }, - }, - Expr: &ast.ExprBinaryDiv{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4825, - EndPos: 4832, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4825, - EndPos: 4827, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4825, - EndPos: 4827, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4830, - EndPos: 4832, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4830, - EndPos: 4832, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4834, - EndPos: 4843, - }, - }, - Expr: &ast.ExprBinaryEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4834, - EndPos: 4842, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4834, - EndPos: 4836, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4834, - EndPos: 4836, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4840, - EndPos: 4842, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4840, - EndPos: 4842, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4844, - EndPos: 4853, - }, - }, - Expr: &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4844, - EndPos: 4852, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4844, - EndPos: 4846, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4844, - EndPos: 4846, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4850, - EndPos: 4852, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4850, - EndPos: 4852, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4854, - EndPos: 4862, - }, - }, - Expr: &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4854, - EndPos: 4861, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4854, - EndPos: 4856, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4854, - EndPos: 4856, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4859, - EndPos: 4861, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4859, - EndPos: 4861, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4863, - EndPos: 4873, - }, - }, - Expr: &ast.ExprBinaryIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4863, - EndPos: 4872, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4863, - EndPos: 4865, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4863, - EndPos: 4865, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4870, - EndPos: 4872, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4870, - EndPos: 4872, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4874, - EndPos: 4884, - }, - }, - Expr: &ast.ExprBinaryLogicalAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4874, - EndPos: 4883, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4874, - EndPos: 4876, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4874, - EndPos: 4876, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4881, - EndPos: 4883, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4881, - EndPos: 4883, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4894, - }, - }, - Expr: &ast.ExprBinaryLogicalOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4893, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4887, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4887, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4891, - EndPos: 4893, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4891, - EndPos: 4893, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4905, - }, - }, - Expr: &ast.ExprBinaryLogicalXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4904, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4897, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4897, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4902, - EndPos: 4904, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4902, - EndPos: 4904, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4906, - EndPos: 4914, - }, - }, - Expr: &ast.ExprBinaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4906, - EndPos: 4913, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4906, - EndPos: 4908, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4906, - EndPos: 4908, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4911, - EndPos: 4913, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4911, - EndPos: 4913, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4923, - }, - }, - Expr: &ast.ExprBinaryMod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4922, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4917, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4917, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4920, - EndPos: 4922, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4920, - EndPos: 4922, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4924, - EndPos: 4932, - }, - }, - Expr: &ast.ExprBinaryMul{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4924, - EndPos: 4931, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4924, - EndPos: 4926, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4924, - EndPos: 4926, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4929, - EndPos: 4931, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4929, - EndPos: 4931, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4933, - EndPos: 4942, - }, - }, - Expr: &ast.ExprBinaryNotEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4933, - EndPos: 4941, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4933, - EndPos: 4935, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4933, - EndPos: 4935, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4939, - EndPos: 4941, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4939, - EndPos: 4941, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4943, - EndPos: 4953, - }, - }, - Expr: &ast.ExprBinaryNotIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4943, - EndPos: 4952, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4943, - EndPos: 4945, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4943, - EndPos: 4945, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4950, - EndPos: 4952, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 293, - EndLine: 293, - StartPos: 4950, - EndPos: 4952, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4954, - EndPos: 4962, - }, - }, - Expr: &ast.ExprBinaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4954, - EndPos: 4961, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4954, - EndPos: 4956, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4954, - EndPos: 4956, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4959, - EndPos: 4961, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4959, - EndPos: 4961, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4963, - EndPos: 4972, - }, - }, - Expr: &ast.ExprBinaryPow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4963, - EndPos: 4971, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4963, - EndPos: 4965, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4963, - EndPos: 4965, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4969, - EndPos: 4971, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4969, - EndPos: 4971, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4973, - EndPos: 4982, - }, - }, - Expr: &ast.ExprBinaryShiftLeft{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4973, - EndPos: 4981, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4973, - EndPos: 4975, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4973, - EndPos: 4975, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4979, - EndPos: 4981, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4979, - EndPos: 4981, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4992, - }, - }, - Expr: &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4991, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4985, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4985, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4989, - EndPos: 4991, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4989, - EndPos: 4991, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4993, - EndPos: 5002, - }, - }, - Expr: &ast.ExprBinarySmallerOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4993, - EndPos: 5001, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4993, - EndPos: 4995, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4993, - EndPos: 4995, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4999, - EndPos: 5001, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4999, - EndPos: 5001, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5003, - EndPos: 5011, - }, - }, - Expr: &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5003, - EndPos: 5010, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5003, - EndPos: 5005, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5003, - EndPos: 5005, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5008, - EndPos: 5010, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5008, - EndPos: 5010, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5022, - }, - }, - Expr: &ast.ExprBinarySpaceship{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5021, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5014, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5014, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5019, - EndPos: 5021, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5019, - EndPos: 5021, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5024, - EndPos: 5033, - }, - }, - Expr: &ast.ExprAssignReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5024, - EndPos: 5032, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5024, - EndPos: 5026, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5024, - EndPos: 5026, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5030, - EndPos: 5032, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5030, - EndPos: 5032, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5034, - EndPos: 5042, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5034, - EndPos: 5041, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5034, - EndPos: 5036, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5034, - EndPos: 5036, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5039, - EndPos: 5041, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5039, - EndPos: 5041, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5043, - EndPos: 5052, - }, - }, - Expr: &ast.ExprAssignBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5043, - EndPos: 5051, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5043, - EndPos: 5045, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5043, - EndPos: 5045, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5049, - EndPos: 5051, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5049, - EndPos: 5051, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5053, - EndPos: 5062, - }, - }, - Expr: &ast.ExprAssignBitwiseOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5053, - EndPos: 5061, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5053, - EndPos: 5055, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5053, - EndPos: 5055, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5059, - EndPos: 5061, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5059, - EndPos: 5061, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5063, - EndPos: 5072, - }, - }, - Expr: &ast.ExprAssignBitwiseXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5063, - EndPos: 5071, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5063, - EndPos: 5065, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5063, - EndPos: 5065, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5069, - EndPos: 5071, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5069, - EndPos: 5071, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5073, - EndPos: 5082, - }, - }, - Expr: &ast.ExprAssignConcat{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5073, - EndPos: 5081, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5073, - EndPos: 5075, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5073, - EndPos: 5075, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5079, - EndPos: 5081, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5079, - EndPos: 5081, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5083, - EndPos: 5092, - }, - }, - Expr: &ast.ExprAssignDiv{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5083, - EndPos: 5091, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5083, - EndPos: 5085, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5083, - EndPos: 5085, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5089, - EndPos: 5091, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5089, - EndPos: 5091, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5093, - EndPos: 5102, - }, - }, - Expr: &ast.ExprAssignMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5093, - EndPos: 5101, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5093, - EndPos: 5095, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5093, - EndPos: 5095, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5099, - EndPos: 5101, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5099, - EndPos: 5101, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5103, - EndPos: 5112, - }, - }, - Expr: &ast.ExprAssignMod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5103, - EndPos: 5111, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5103, - EndPos: 5105, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5103, - EndPos: 5105, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5109, - EndPos: 5111, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 310, - EndLine: 310, - StartPos: 5109, - EndPos: 5111, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5113, - EndPos: 5122, - }, - }, - Expr: &ast.ExprAssignMul{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5113, - EndPos: 5121, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5113, - EndPos: 5115, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5113, - EndPos: 5115, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5119, - EndPos: 5121, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 311, - EndLine: 311, - StartPos: 5119, - EndPos: 5121, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5123, - EndPos: 5132, - }, - }, - Expr: &ast.ExprAssignPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5123, - EndPos: 5131, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5123, - EndPos: 5125, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5123, - EndPos: 5125, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5129, - EndPos: 5131, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5129, - EndPos: 5131, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5133, - EndPos: 5143, - }, - }, - Expr: &ast.ExprAssignPow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5133, - EndPos: 5142, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5133, - EndPos: 5135, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5133, - EndPos: 5135, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5140, - EndPos: 5142, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5140, - EndPos: 5142, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5144, - EndPos: 5154, - }, - }, - Expr: &ast.ExprAssignShiftLeft{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5144, - EndPos: 5153, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5144, - EndPos: 5146, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5144, - EndPos: 5146, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5151, - EndPos: 5153, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5151, - EndPos: 5153, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5155, - EndPos: 5165, - }, - }, - Expr: &ast.ExprAssignShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5155, - EndPos: 5164, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5155, - EndPos: 5157, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5155, - EndPos: 5157, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5162, - EndPos: 5164, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5162, - EndPos: 5164, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5167, - EndPos: 5206, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5173, - EndPos: 5176, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5178, - EndPos: 5204, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5194, - EndPos: 5199, - }, - }, - Value: []byte("class"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5178, - EndPos: 5184, - }, - }, - Value: []byte("public"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5202, - EndPos: 5204, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5207, - EndPos: 5218, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5207, - EndPos: 5217, - }, - }, - Function: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5207, - EndPos: 5215, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5208, - EndPos: 5211, - }, - }, - Value: []byte("foo"), - }, - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5211, - EndPos: 5215, - }, - }, - Value: []byte("bar"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5215, - EndPos: 5217, - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 326, - StartPos: 5220, - EndPos: 5328, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5229, - EndPos: 5232, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5233, - EndPos: 5236, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5233, - EndPos: 5236, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5234, - EndPos: 5236, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5234, - EndPos: 5236, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5238, - EndPos: 5243, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5238, - EndPos: 5243, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5241, - EndPos: 5243, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5241, - EndPos: 5243, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5252, - EndPos: 5269, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5261, - EndPos: 5264, - }, - }, - Value: []byte("bar"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5274, - EndPos: 5286, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5280, - EndPos: 5283, - }, - }, - Value: []byte("Baz"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtTrait{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5291, - EndPos: 5303, - }, - }, - TraitName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5297, - EndPos: 5301, - }, - }, - Value: []byte("Quux"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5308, - EndPos: 5326, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5318, - EndPos: 5323, - }, - }, - Value: []byte("Quuux"), - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5330, - EndPos: 5373, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5339, - EndPos: 5342, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5343, - EndPos: 5350, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5343, - EndPos: 5346, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5344, - EndPos: 5346, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5344, - EndPos: 5346, - }, - }, - Value: []byte("$a"), - }, - }, - }, - DefaultValue: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5349, - EndPos: 5350, - }, - }, - Value: []byte("1"), - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5352, - EndPos: 5361, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5352, - EndPos: 5357, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5355, - EndPos: 5357, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5355, - EndPos: 5357, - }, - }, - Value: []byte("$b"), - }, - }, - }, - DefaultValue: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5360, - EndPos: 5361, - }, - }, - Value: []byte("1"), - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5363, - EndPos: 5369, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5363, - EndPos: 5365, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5363, - EndPos: 5365, - }, - }, - Value: []byte("$c"), - }, - }, - DefaultValue: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5368, - EndPos: 5369, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5374, - EndPos: 5412, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5383, - EndPos: 5386, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5387, - EndPos: 5395, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5387, - EndPos: 5392, - }, - }, - Value: []byte("array"), - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5393, - EndPos: 5395, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5393, - EndPos: 5395, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5397, - EndPos: 5408, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5397, - EndPos: 5405, - }, - }, - Value: []byte("callable"), - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5406, - EndPos: 5408, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5406, - EndPos: 5408, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5413, - EndPos: 5515, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5434, - EndPos: 5437, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5413, - EndPos: 5421, - }, - }, - Value: []byte("abstract"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5422, - EndPos: 5427, - }, - }, - Value: []byte("final"), - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5440, - EndPos: 5481, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5475, - EndPos: 5478, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5440, - EndPos: 5448, - }, - }, - Value: []byte("abstract"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5449, - EndPos: 5458, - }, - }, - Value: []byte("protected"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5459, - EndPos: 5465, - }, - }, - Value: []byte("static"), - }, - }, - Stmt: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5480, - EndPos: 5481, - }, - }, - }, - }, - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5482, - EndPos: 5513, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5505, - EndPos: 5508, - }, - }, - Value: []byte("baz"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5482, - EndPos: 5487, - }, - }, - Value: []byte("final"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5488, - EndPos: 5495, - }, - }, - Value: []byte("private"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5511, - EndPos: 5513, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5517, - EndPos: 5532, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5517, - EndPos: 5531, - }, - }, - Var: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5518, - EndPos: 5525, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5522, - EndPos: 5525, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5522, - EndPos: 5525, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5528, - EndPos: 5531, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5533, - EndPos: 5545, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5533, - EndPos: 5544, - }, - }, - Function: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5534, - EndPos: 5541, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5538, - EndPos: 5541, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5538, - EndPos: 5541, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5542, - EndPos: 5544, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5546, - EndPos: 5558, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5546, - EndPos: 5557, - }, - }, - Function: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5546, - EndPos: 5555, - }, - }, - Var: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5546, - EndPos: 5552, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5547, - EndPos: 5551, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5547, - EndPos: 5551, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5547, - EndPos: 5551, - }, - }, - Value: []byte("$foo"), - }, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5553, - EndPos: 5554, - }, - }, - Value: []byte("0"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5555, - EndPos: 5557, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5568, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5567, - }, - }, - Function: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5565, - }, - }, - Var: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5562, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5562, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5559, - EndPos: 5562, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5563, - EndPos: 5564, - }, - }, - Value: []byte("1"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5565, - EndPos: 5567, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5569, - EndPos: 5577, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5569, - EndPos: 5576, - }, - }, - Function: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5569, - EndPos: 5574, - }, - }, - Value: []byte("\"foo\""), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5574, - EndPos: 5576, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5578, - EndPos: 5590, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5578, - EndPos: 5589, - }, - }, - Function: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5578, - EndPos: 5587, - }, - }, - Var: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5578, - EndPos: 5581, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5579, - EndPos: 5580, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5579, - EndPos: 5580, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - Dim: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5582, - EndPos: 5586, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5582, - EndPos: 5586, - }, - }, - Value: []byte("$foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5587, - EndPos: 5589, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5591, - EndPos: 5600, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5591, - EndPos: 5599, - }, - }, - VarName: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5593, - EndPos: 5598, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5593, - EndPos: 5596, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5593, - EndPos: 5596, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5596, - EndPos: 5598, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5602, - EndPos: 5614, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5602, - EndPos: 5613, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5602, - EndPos: 5605, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5602, - EndPos: 5605, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5607, - EndPos: 5611, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5607, - EndPos: 5611, - }, - }, - Value: []byte("$bar"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5611, - EndPos: 5613, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5615, - EndPos: 5632, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5615, - EndPos: 5631, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5615, - EndPos: 5618, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5615, - EndPos: 5618, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5621, - EndPos: 5628, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5621, - EndPos: 5625, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5621, - EndPos: 5625, - }, - }, - Value: []byte("$bar"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5626, - EndPos: 5627, - }, - }, - Value: []byte("0"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5629, - EndPos: 5631, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5634, - EndPos: 5645, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5634, - EndPos: 5644, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5634, - EndPos: 5638, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5634, - EndPos: 5638, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5640, - EndPos: 5644, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5640, - EndPos: 5644, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5646, - EndPos: 5662, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5646, - EndPos: 5660, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5646, - EndPos: 5650, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5646, - EndPos: 5650, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5653, - EndPos: 5660, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5653, - EndPos: 5657, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5653, - EndPos: 5657, - }, - }, - Value: []byte("$bar"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5658, - EndPos: 5659, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5664, - EndPos: 5686, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5664, - EndPos: 5685, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5665, - EndPos: 5671, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5665, - EndPos: 5666, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5668, - EndPos: 5671, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5669, - EndPos: 5671, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5669, - EndPos: 5671, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5673, - EndPos: 5684, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5673, - EndPos: 5674, - }, - }, - Value: []byte("2"), - }, - Val: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5676, - EndPos: 5684, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5681, - EndPos: 5683, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5681, - EndPos: 5683, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5681, - EndPos: 5683, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtHaltCompiler{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5688, - EndPos: 5706, - }, - }, - }, - }, - } - - lexer := scanner.NewLexer(src, "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestPhp5Strings(t *testing.T) { - src := ` Date: Sun, 20 Dec 2020 14:26:26 +0200 Subject: [PATCH 116/140] refactoring: update php5 tests --- internal/php5/parser_test.go | 45090 +++++++++++++++++++++++------ internal/php5/php5.go | Bin 264694 -> 264652 bytes internal/php5/php5.y | 2 +- internal/php5/php5_bench_test.go | 409 +- internal/php5/php5_test.go | 22460 -------------- 5 files changed, 35573 insertions(+), 32388 deletions(-) delete mode 100644 internal/php5/php5_test.go diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index a2b90ea..b4a4ee9 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -8,849 +8,1396 @@ import ( "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" + "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" ) func TestIdentifier(t *testing.T) { src := `bar($a, ...$b); foo::bar($a, ...$b); $foo::bar($a, ...$b); - new foo($a, ...$b); - ` + new foo($a, ...$b);` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 7, - StartPos: 6, - EndPos: 133, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 7, + StartPos: 5, + EndPos: 132, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 20, + }, + Expr: &ast.ExprFunctionCall{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 21, + StartPos: 5, + EndPos: 19, }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ + Function: &ast.NameName{ Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 20, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 9, - }, + StartPos: 5, + EndPos: 8, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 8, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 2, EndLine: 2, - StartPos: 6, - EndPos: 9, + StartPos: 5, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 46, + EndPos: 48, + }, + }, Method: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 48, + EndPos: 51, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 49, - EndPos: 52, + StartPos: 48, + EndPos: 51, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 51, + EndPos: 52, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 52, - EndPos: 63, + EndPos: 54, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 52, + EndPos: 54, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 53, - EndPos: 55, + StartPos: 52, + EndPos: 54, }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 57, - EndPos: 62, - }, - }, - IsReference: false, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 4, EndLine: 4, - StartPos: 60, - EndPos: 62, + StartPos: 52, + EndPos: 54, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 60, - EndPos: 62, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 61, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 56, + EndPos: 59, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 55, + EndPos: 56, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 59, + EndPos: 61, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 54, + EndPos: 55, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 61, + EndPos: 62, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 4, + EndLine: 4, + StartPos: 62, + EndPos: 63, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 86, + }, + Expr: &ast.ExprStaticCall{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 87, + StartPos: 66, + EndPos: 85, }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ + Class: &ast.NameName{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 86, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 70, - }, + StartPos: 66, + EndPos: 69, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 66, + EndPos: 69, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 67, - EndPos: 70, + StartPos: 66, + EndPos: 69, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 4, + EndLine: 5, + StartPos: 63, + EndPos: 66, + }, + }, }, }, Value: []byte("foo"), }, }, }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 69, + EndPos: 71, + }, + }, Call: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 71, + EndPos: 74, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 72, - EndPos: 75, + StartPos: 71, + EndPos: 74, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 74, + EndPos: 75, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 75, - EndPos: 86, + EndPos: 77, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 75, + EndPos: 77, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 76, - EndPos: 78, + StartPos: 75, + EndPos: 77, }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 76, - EndPos: 78, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 80, - EndPos: 85, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 5, EndLine: 5, - StartPos: 83, - EndPos: 85, + StartPos: 75, + EndPos: 77, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 83, - EndPos: 85, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 84, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 79, + EndPos: 82, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 78, + EndPos: 79, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 82, + EndPos: 84, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 77, + EndPos: 78, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 84, + EndPos: 85, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 5, + EndLine: 5, + StartPos: 85, + EndPos: 86, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 89, + EndPos: 110, + }, + Expr: &ast.ExprStaticCall{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 111, + StartPos: 89, + EndPos: 109, }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ + Class: &ast.ExprVariable{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 110, + StartPos: 89, + EndPos: 93, }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 94, + StartPos: 89, + EndPos: 93, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$foo"), Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 90, - EndPos: 94, + StartPos: 89, + EndPos: 93, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 5, + EndLine: 6, + StartPos: 86, + EndPos: 89, + }, + }, }, }, Value: []byte("$foo"), }, }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 93, + EndPos: 95, + }, + }, Call: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 95, + EndPos: 98, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 96, - EndPos: 99, + StartPos: 95, + EndPos: 98, }, }, Value: []byte("bar"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 98, + EndPos: 99, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 6, EndLine: 6, StartPos: 99, - EndPos: 110, + EndPos: 101, }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 99, + EndPos: 101, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 100, - EndPos: 102, + StartPos: 99, + EndPos: 101, }, - }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 100, - EndPos: 102, - }, - }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 104, - EndPos: 109, - }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ Position: &position.Position{ StartLine: 6, EndLine: 6, - StartPos: 107, - EndPos: 109, + StartPos: 99, + EndPos: 101, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 107, - EndPos: 109, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$a"), }, }, }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 108, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 103, + EndPos: 106, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 102, + EndPos: 103, + }, + }, + }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 106, + EndPos: 108, + }, + }, + Value: []byte("$b"), + }, + }, + }, + }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 101, + EndPos: 102, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 108, + EndPos: 109, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 6, + EndLine: 6, + StartPos: 109, + EndPos: 110, }, }, }, &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 113, + EndPos: 132, + }, + Expr: &ast.ExprNew{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 114, - EndPos: 133, + StartPos: 113, + EndPos: 131, }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ + NewTkn: &token.Token{ + ID: token.T_NEW, + Value: []byte("new"), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 114, - EndPos: 132, + StartPos: 113, + EndPos: 116, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 6, + EndLine: 7, + StartPos: 110, + EndPos: 113, + }, + }, }, }, Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 118, - EndPos: 121, - }, + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, }, Parts: []ast.Vertex{ &ast.NameNamePart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 117, + EndPos: 120, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 118, - EndPos: 121, + StartPos: 117, + EndPos: 120, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 116, + EndPos: 117, + }, + }, }, }, Value: []byte("foo"), }, }, }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 120, + EndPos: 121, + }, + }, + Arguments: []ast.Vertex{ + &ast.Argument{ Position: &position.Position{ StartLine: 7, EndLine: 7, StartPos: 121, - EndPos: 132, + EndPos: 123, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + VarName: &ast.Identifier{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 121, + EndPos: 123, + }, + }, + Value: []byte("$a"), + }, }, }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, + &ast.Argument{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 130, + }, + VariadicTkn: &token.Token{ + ID: token.T_ELLIPSIS, + Value: []byte("..."), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 125, + EndPos: 128, }, - Variadic: false, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 122, - EndPos: 124, + StartPos: 124, + EndPos: 125, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 122, - EndPos: 124, - }, - }, - Value: []byte("$a"), - }, }, }, - &ast.Argument{ - Node: ast.Node{ + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 128, + EndPos: 130, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 126, - EndPos: 131, + StartPos: 128, + EndPos: 130, }, - }, - Variadic: true, - IsReference: false, - Expr: &ast.ExprVariable{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 7, EndLine: 7, - StartPos: 129, - EndPos: 131, + StartPos: 128, + EndPos: 130, }, }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 129, - EndPos: 131, - }, - }, - Value: []byte("$b"), - }, + Value: []byte("$b"), }, }, }, }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 123, + EndPos: 124, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 130, + EndPos: 131, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 7, + EndLine: 7, + StartPos: 131, + EndPos: 132, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -859,61 +1406,122 @@ func TestPhp5ParameterNode(t *testing.T) { function foo(bar $bar=null, baz &...$baz) {} class foo {public function foo(bar $bar=null, baz &...$baz) {}} function(bar $bar=null, baz &...$baz) {}; - static function(bar $bar=null, baz &...$baz) {}; - ` + static function(bar $bar=null, baz &...$baz) {};` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 5, - StartPos: 5, - EndPos: 210, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 5, + StartPos: 5, + EndPos: 210, }, Stmts: []ast.Vertex{ &ast.StmtFunction{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 49, + }, + FunctionTkn: &token.Token{ + ID: token.T_FUNCTION, + Value: []byte("function"), Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 5, - EndPos: 49, + EndPos: 13, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte("bar()";` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 22, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 22, + }, + Expr: &ast.ScalarEncapsed{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 22, + EndPos: 21, }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ + OpenQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 21, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 15, + }, + }, Property: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -2365,7 +4206,15 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, }, &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 20, + }, + EncapsedStrTkn: &token.Token{ + ID: token.T_ENCAPSED_AND_WHITESPACE, + Value: []byte("()"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -2376,17 +4225,36 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { Value: []byte("()"), }, }, + CloseQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 22, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2394,36 +4262,70 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { src := `bar()}";` +func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { + src := `bar()}";` + + expected := &ast.Root{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + Stmts: []ast.Vertex{ + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 24, + }, + Expr: &ast.ScalarEncapsed{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 23, + }, + OpenQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 16, + }, + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, + }, + }, + Value: []byte("bar"), + }, + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 22, + }, + }, + }, + }, + CloseQuoteTkn: &token.Token{ + ID: token.ID(34), + Value: []byte("\""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 23, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, + }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2686,37 +4867,70 @@ LBL; ` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 3, - StartPos: 3, - EndPos: 24, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 3, + EndPos: 24, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 3, + StartPos: 3, + EndPos: 24, + }, + Expr: &ast.ScalarHeredoc{ Position: &position.Position{ StartLine: 1, EndLine: 3, StartPos: 3, - EndPos: 24, + EndPos: 23, }, - }, - Expr: &ast.ScalarHeredoc{ - Node: ast.Node{ + OpenHeredocTkn: &token.Token{ + ID: token.T_START_HEREDOC, + Value: []byte("<< $v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 30, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, }, Value: []byte("$v"), }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6620,98 +14582,284 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { src := ` $v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 30, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 30, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 30, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 26, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, EndPos: 26, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, }, Value: []byte("$v"), }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 30, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6719,35 +14867,91 @@ func TestStmtForeach_WithRef(t *testing.T) { src := ` &$v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 31, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprReference{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -6810,27 +15102,66 @@ func TestStmtForeach_WithRef(t *testing.T) { }, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, - EndPos: 31, + EndPos: 30, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6838,35 +15169,91 @@ func TestStmtForeach_WithList(t *testing.T) { src := ` list($v)) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 36, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 36, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 36, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 32, + }, + ListTkn: &token.Token{ + ID: token.T_LIST, + Value: []byte("list"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 32, + EndPos: 28, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, + }, + }, + OpenBracketTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, }, }, Items: []ast.Vertex{ &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, EndPos: 31, }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, EndPos: 31, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -6940,28 +15423,77 @@ func TestStmtForeach_WithList(t *testing.T) { }, }, }, + CloseBracketTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 31, + EndPos: 32, + }, + }, + }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 32, + EndPos: 33, + }, }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 34, - EndPos: 36, + EndPos: 35, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 36, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6969,47 +15501,145 @@ func TestStmtFunction(t *testing.T) { src := `
` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, }, Stmts: []ast.Vertex{ &ast.StmtNop{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 5, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte("?>"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8290,14 +18899,13 @@ func TestStmtInlineHtml(t *testing.T) { Value: []byte("
"), }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8305,46 +18913,125 @@ func TestStmtInterface(t *testing.T) { src := `1, &$b,);` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 21, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 21, + }, + Expr: &ast.ExprArray{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 21, + EndPos: 20, }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ + ArrayTkn: &token.Token{ + ID: token.T_ARRAY, + Value: []byte("array"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 20, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 12, + }, + }, Val: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13149,34 +30836,58 @@ func TestExprArray_Items(t *testing.T) { }, }, &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 18, + }, + Val: &ast.ExprReference{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 18, }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, - EndPos: 18, + EndPos: 16, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13191,17 +30902,58 @@ func TestExprArray_Items(t *testing.T) { }, &ast.ExprArrayItem{}, }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + }, + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 19, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 20, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13209,44 +30961,76 @@ func TestExprBitwiseNot(t *testing.T) { src := `foo();` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 13, + }, + Expr: &ast.ExprMethodCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 13, + EndPos: 12, }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 12, + EndPos: 5, }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Method: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16922,27 +37874,46 @@ func TestExprMethodCall(t *testing.T) { }, Value: []byte("foo"), }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, - }, + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 13, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16950,67 +37921,120 @@ func TestExprNew(t *testing.T) { src := `foo;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 11, + }, + Expr: &ast.ExprPropertyFetch{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 11, + EndPos: 10, }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 10, + EndPos: 5, }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Property: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17302,16 +38591,25 @@ func TestExprPropertyFetch(t *testing.T) { Value: []byte("foo"), }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 11, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17320,35 +38618,91 @@ func TestExprReference_ForeachWithRef(t *testing.T) { src := ` &$v) {}` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, }, Stmts: []ast.Vertex{ &ast.StmtForeach{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 31, + }, + ForeachTkn: &token.Token{ + ID: token.T_FOREACH, + Value: []byte("foreach"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 31, + EndPos: 10, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 23, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 21, + }, + }, + }, + }, Var: &ast.ExprReference{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 27, + }, + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17411,27 +38853,66 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, + }, + }, Stmt: &ast.StmtStmtList{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 31, + }, + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 29, - EndPos: 31, + EndPos: 30, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, + }, + }, }, }, Stmts: []ast.Vertex{}, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17439,36 +38920,70 @@ func TestExprShellExec(t *testing.T) { src := "1, &$b,];` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 16, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 16, + }, + Expr: &ast.ExprArray{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 16, + EndPos: 15, }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ + OpenBracketTkn: &token.Token{ + ID: token.ID(91), + Value: []byte("["), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 15, + EndPos: 4, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 5, + EndPos: 7, + }, + }, Val: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 8, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17693,34 +39378,58 @@ func TestExprShortArray_Items(t *testing.T) { }, }, &ast.ExprArrayItem{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 10, + EndPos: 13, + }, + Val: &ast.ExprReference{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, EndPos: 13, }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, - EndPos: 13, + EndPos: 11, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, + }, + }, }, }, Var: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17735,17 +39444,58 @@ func TestExprShortArray_Items(t *testing.T) { }, &ast.ExprArrayItem{}, }, + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 9, + }, + }, + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 14, + }, + }, + }, + CloseBracketTkn: &token.Token{ + ID: token.ID(93), + Value: []byte("]"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17753,58 +39503,98 @@ func TestExprStaticCall(t *testing.T) { src := ` $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 18, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 18, + }, + Expr: &ast.ExprYield{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 18, + EndPos: 17, }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ + YieldTkn: &token.Token{ + ID: token.T_YIELD, + Value: []byte("yield"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 17, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + }, Value: &ast.ExprVariable{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 17, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, }, Value: []byte("$b"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 17, + EndPos: 18, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19450,55 +42611,110 @@ func TestExprYield_Expr(t *testing.T) { src := ` 1;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 17, - }, + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 3, + EndPos: 17, + }, + Expr: &ast.ExprYield{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 17, + EndPos: 16, }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ + YieldTkn: &token.Token{ + ID: token.T_YIELD, + Value: []byte("yield"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 16, + EndPos: 8, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte(""), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 14, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 12, + }, + }, + }, + }, Value: &ast.ScalarLnumber{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("1"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 16, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, + }, + }, + }, }, Value: []byte("1"), }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } // expr assign -func TestExprAssign_Assign(t *testing.T) { - src := `>= $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 17, + StartPos: 5, + EndPos: 210, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 13, }, Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprAssign_Reference(t *testing.T) { - src := `>= $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 13, + StartLine: 16, + EndLine: 16, + StartPos: 196, + EndPos: 197, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 210, + }, Expr: &ast.ExprAssignShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 209, }, Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 17, + EndLine: 17, + StartPos: 200, + EndPos: 202, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 16, + EndLine: 17, + StartPos: 197, + EndPos: 200, + }, + }, }, }, Value: []byte("$a"), }, }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + EqualTkn: &token.Token{ + ID: token.T_SR_EQUAL, + Value: []byte(">>="), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 203, + EndPos: 206, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 202, + EndPos: 203, + }, }, }, + }, + Expr: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 12, + StartLine: 17, + EndLine: 17, + StartPos: 207, + EndPos: 209, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 206, + EndPos: 207, + }, + }, }, }, Value: []byte("$b"), }, }, }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 17, + EndLine: 17, + StartPos: 209, + EndPos: 210, + }, + }, }, }, + EndTkn: &token.Token{}, } lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } // expr binary func TestExprBinary_BitwiseAnd(t *testing.T) { - src := `= $b; + $a > $b; + $a === $b; + $a and $b; + $a or $b; + $a xor $b; + $a - $b; + $a % $b; + $a * $b; + $a != $b; + $a !== $b; + $a + $b; + $a ** $b; + $a << $b; + $a >> $b; + $a <= $b; + $a < $b;` expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 26, + StartPos: 5, + EndPos: 295, }, Stmts: []ast.Vertex{ &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 13, }, Expr: &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 12, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 2, + EndLine: 2, + StartPos: 5, + EndPos: 7, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_OPEN_TAG, + Value: []byte("= $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, + StartLine: 9, + EndLine: 9, + StartPos: 92, + EndPos: 93, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 96, + EndPos: 105, + }, Expr: &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 96, + EndPos: 104, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 96, + EndPos: 98, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 96, + EndPos: 98, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 10, + EndLine: 10, + StartPos: 96, + EndPos: 98, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 9, + EndLine: 10, + StartPos: 93, + EndPos: 96, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + OpTkn: &token.Token{ + ID: token.T_IS_GREATER_OR_EQUAL, + Value: []byte(">="), + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 99, + EndPos: 101, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 98, + EndPos: 99, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 102, + EndPos: 104, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 102, + EndPos: 104, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + StartLine: 10, + EndLine: 10, + StartPos: 102, + EndPos: 104, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 10, + EndLine: 10, + StartPos: 101, + EndPos: 102, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_Greater(t *testing.T) { - src := ` $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, + StartLine: 10, + EndLine: 10, + StartPos: 104, + EndPos: 105, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 116, + }, Expr: &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 115, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 11, + EndLine: 11, + StartPos: 108, + EndPos: 110, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 10, + EndLine: 11, + StartPos: 105, + EndPos: 108, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, + OpTkn: &token.Token{ + ID: token.ID(62), + Value: []byte(">"), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 111, + EndPos: 112, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 110, + EndPos: 111, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 113, + EndPos: 115, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 113, + EndPos: 115, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 10, + StartLine: 11, + EndLine: 11, + StartPos: 113, + EndPos: 115, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 11, + EndLine: 11, + StartPos: 112, + EndPos: 113, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_Identical(t *testing.T) { - src := `> $b;` - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 12, + StartLine: 23, + EndLine: 23, + StartPos: 259, + EndPos: 260, }, }, + }, + &ast.StmtExpression{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 263, + EndPos: 272, + }, Expr: &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 11, - }, + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 263, + EndPos: 271, }, Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, - }, + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 263, + EndPos: 265, }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 263, + EndPos: 265, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$a"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 5, + StartLine: 24, + EndLine: 24, + StartPos: 263, + EndPos: 265, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte("\n\t\t"), + Position: &position.Position{ + StartLine: 23, + EndLine: 24, + StartPos: 260, + EndPos: 263, + }, + }, }, }, Value: []byte("$a"), }, }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + OpTkn: &token.Token{ + ID: token.T_SR, + Value: []byte(">>"), + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 266, + EndPos: 268, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 265, + EndPos: 266, + }, }, }, + }, + Right: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 269, + EndPos: 271, + }, VarName: &ast.Identifier{ - Node: ast.Node{ + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 269, + EndPos: 271, + }, + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 11, + StartLine: 24, + EndLine: 24, + StartPos: 269, + EndPos: 271, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 24, + EndLine: 24, + StartPos: 268, + EndPos: 269, + }, + }, }, }, Value: []byte("$b"), }, }, }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestExprBinary_SmallerOrEqual(t *testing.T) { - src := `ViMfrb{w7N#xCS0+!NGM!mqJKq%M7o`B5p$k9& delta 60 ucmX>zS>W4bfrb{w7N#xCS0<|!6lLa>bar($a, ...$b); - foo::bar($a, ...$b); - $foo::bar($a, ...$b); - new foo($a, ...$b); - - function foo(bar $bar=null, baz &...$baz) {} - class foo {public function foo(bar $bar=null, baz &...$baz) {}} - function(bar $bar=null, baz &...$baz) {}; - static function(bar $bar=null, baz &...$baz) {}; - - "test"; - "\$test"; - " - test - "; - '$test'; - ' - $test - '; - <<bar()"; - "test ${foo}"; - "test ${foo[0]}"; - "test {$foo->bar()}"; - - if ($a) : - endif; - if ($a) : - elseif ($b): - endif; - if ($a) : - else: - endif; - if ($a) : - elseif ($b): - elseif ($c): - else: - endif; - - while (1) { break; } - while (1) { break 2; } - while (1) : break(3); endwhile; - class foo{ const FOO = 1, BAR = 2; } - class foo{ function bar() {} } - class foo{ public static function &bar() {} } - class foo{ final private function bar() {} protected function baz() {} } - abstract class foo{ abstract public function bar(); } - final class foo extends bar { } - final class foo implements bar { } - final class foo implements bar, baz { } - - const FOO = 1, BAR = 2; - while (1) { continue; } - while (1) { continue 2; } - while (1) { continue(3); } - declare(ticks=1); - declare(ticks=1, strict_types=1) {} - declare(ticks=1): enddeclare; - do {} while(1); - echo $a, 1; - echo($a); - for($i = 0; $i < 10; $i++, $i++) {} - for(; $i < 10; $i++) : endfor; - foreach ($a as $v) {} - foreach ([] as $v) {} - foreach ($a as $v) : endforeach; - foreach ($a as $k => $v) {} - foreach ([] as $k => $v) {} - foreach ($a as $k => &$v) {} - foreach ($a as $k => list($v)) {} - function foo() {} - - function foo() { - __halt_compiler(); - function bar() {} - class Baz {} - return $a; - } - - function foo(array $a, callable $b) {return;} - function &foo() {return 1;} - function &foo() {} - global $a, $b, $$c, ${foo()}; - a: - goto a; - __halt_compiler(); - if ($a) {} - if ($a) {} elseif ($b) {} - if ($a) {} else {} - if ($a) {} elseif ($b) {} elseif ($c) {} else {} - if ($a) {} elseif ($b) {} else if ($c) {} else {} - ?>
1, &$b,); - array(3 =>&$b); - array(&$b, 1=>1, 1, 3 =>&$b); - ~$a; - !$a; - - Foo::Bar; - clone($a); - clone $a; - function(){}; - function($a, $b) use ($c, &$d) {}; - function($a, $b) use (&$c, $d) {}; - function() {}; - foo; - namespace\foo; - \foo; - - empty($a); - empty(Foo); - @$a; - eval($a); - exit; - exit($a); - die(); - die($a); - foo(); - namespace\foo(&$a); - \foo([]); - $foo(yield $a); - - $a--; - $a++; - --$a; - ++$a; - - include $a; - include_once $a; - require $a; - require_once $a; - - $a instanceof Foo; - $a instanceof namespace\Foo; - $a instanceof \Foo; - - isset($a, $b); - isset(Foo); - list() = $b; - list($a, $b) = $b; - list($a[]) = $b; - list(list($a)) = $b; - - $a->foo(); - new Foo; - new namespace\Foo(); - new \Foo(); - print($a); - $a->foo; - $a->foo[1]; - $a->foo->bar->baz()->quux[0]; - $a->foo()[1][1]; - ` + "`cmd $a`;" + ` - ` + "`cmd`;" + ` - ` + "``;" + ` - []; - [1]; - [1=>1, &$b,]; - - Foo::bar(); - namespace\Foo::bar(); - \Foo::bar(); - Foo::$bar(); - $foo::$bar(); - Foo::$bar; - namespace\Foo::$bar; - \Foo::$bar; - $a ? $b : $c; - $a ? : $c; - $a ? $b ? $c : $d : $e; - $a ? $b : $c ? $d : $e; - -$a; - +$a; - $$a; - $$$a; - yield; - yield $a; - yield $a => $b; - yield Foo::class; - yield $a => Foo::class; - - (array)$a; - (boolean)$a; - (bool)$a; - (double)$a; - (float)$a; - (integer)$a; - (int)$a; - (object)$a; - (string)$a; - (unset)$a; - - $a & $b; - $a | $b; - $a ^ $b; - $a && $b; - $a || $b; - $a . $b; - $a / $b; - $a == $b; - $a >= $b; - $a > $b; - $a === $b; - $a and $b; - $a or $b; - $a xor $b; - $a - $b; - $a % $b; - $a * $b; - $a != $b; - $a !== $b; - $a + $b; - $a ** $b; - $a << $b; - $a >> $b; - $a <= $b; - $a < $b; - - $a =& $b; - $a =& new Foo; - $a =& new Foo($b); - $a = $b; - $a &= $b; - $a |= $b; - $a ^= $b; - $a .= $b; - $a /= $b; - $a -= $b; - $a %= $b; - $a *= $b; - $a += $b; - $a **= $b; - $a <<= $b; - $a >>= $b; - - - (new \Foo()); - (new \Foo())->bar()->baz; - (new \Foo())[0][0]; - (new \Foo())[0]->bar(); - - array([0])[0][0]; - "foo"[0]; - foo[0]; - static::foo; - - new $foo; - new $foo::$bar; - new $a->b[0]; - new $a->b{$b ?: null}->$c->d[0];static $a = [1][0]; - - static $a = !1; - static $a = ~1; - static $a = +1; - static $a = -1; - static $a = (1); - static $a = 1 ?: 2; - static $a = 1 ? 2 : 3; - static $a = 1 & 2; - static $a = 1 | 2; - static $a = 1 ^ 2; - static $a = 1 && 2; - static $a = 1 || 2; - static $a = 1 . 2; - static $a = 1 / 2; - static $a = 1 == 2; - static $a = 1 >= 2; - static $a = 1 > 2; - static $a = 1 === 2; - static $a = 1 and 2; - static $a = 1 or 2; - static $a = 1 xor 2; - static $a = 1 - 2; - static $a = 1 % 2; - static $a = 1 * 2; - static $a = 1 != 2; - static $a = 1 !== 2; - static $a = 1 + 2; - static $a = 1 ** 2; - static $a = 1 << 2; - static $a = 1 >> 2; - static $a = 1 <= 2; - static $a = 1 < 2; - static $a = Foo::bar; - static $a = Foo::class; - static $a = __CLASS__; - static $a = Foo; - static $a = namespace\Foo; - static $a = \Foo; - static $a = array(); - static $a = array(1 => 1, 2); - static $a = [1, 2 => 2][0]; - - if (yield 1) {} - Foo::$$bar; - - $foo(); - $foo()[0][0]; - $a{$b}; - ${$a}; - $foo::{$bar}(); - $foo::bar; - ` + src, err := ioutil.ReadFile("test.php") + if err != nil { + b.Fatal("can not read test.php: " + err.Error()) + } for n := 0; n < b.N; n++ { lexer := scanner.NewLexer([]byte(src), "5.6", nil) diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go deleted file mode 100644 index 406f860..0000000 --- a/internal/php5/php5_test.go +++ /dev/null @@ -1,22460 +0,0 @@ -package php5_test - -import ( - "io/ioutil" - "testing" - - "gotest.tools/assert" - - "github.com/z7zmey/php-parser/internal/php5" - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" - "github.com/z7zmey/php-parser/pkg/errors" - "github.com/z7zmey/php-parser/pkg/position" -) - -func TestPhp5(t *testing.T) { - src, err := ioutil.ReadFile("test.php") - assert.NilError(t, err) - - expected := &ast.Root{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 379, - StartPos: 3, - EndPos: 6285, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 18, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 17, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 6, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 3, - EndPos: 6, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 6, - EndPos: 17, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 7, - EndPos: 9, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 11, - EndPos: 16, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 16, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 2, - EndLine: 2, - StartPos: 14, - EndPos: 16, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 35, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 34, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 23, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 19, - EndPos: 23, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 23, - EndPos: 34, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 24, - EndPos: 26, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 28, - EndPos: 33, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 31, - EndPos: 33, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 3, - EndLine: 3, - StartPos: 31, - EndPos: 33, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 57, - }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 56, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 40, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 36, - EndPos: 40, - }, - }, - Value: []byte("$foo"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 42, - EndPos: 45, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 45, - EndPos: 56, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 46, - EndPos: 48, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 50, - EndPos: 55, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 4, - EndLine: 4, - StartPos: 53, - EndPos: 55, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 78, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 77, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 61, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 58, - EndPos: 61, - }, - }, - Value: []byte("foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 63, - EndPos: 66, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 66, - EndPos: 77, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 67, - EndPos: 69, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 71, - EndPos: 76, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 76, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 5, - EndLine: 5, - StartPos: 74, - EndPos: 76, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 100, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 99, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 83, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 79, - EndPos: 83, - }, - }, - Value: []byte("$foo"), - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 85, - EndPos: 88, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 88, - EndPos: 99, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 89, - EndPos: 91, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 93, - EndPos: 98, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 6, - EndLine: 6, - StartPos: 96, - EndPos: 98, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 101, - EndPos: 120, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 101, - EndPos: 119, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 105, - EndPos: 108, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 105, - EndPos: 108, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 108, - EndPos: 119, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 109, - EndPos: 111, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 113, - EndPos: 118, - }, - }, - Variadic: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 116, - EndPos: 118, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 7, - EndLine: 7, - StartPos: 116, - EndPos: 118, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 122, - EndPos: 166, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 131, - EndPos: 134, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 135, - EndPos: 148, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 135, - EndPos: 138, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 135, - EndPos: 138, - }, - }, - Value: []byte("bar"), - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 139, - EndPos: 143, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 139, - EndPos: 143, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 144, - EndPos: 148, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 144, - EndPos: 148, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 144, - EndPos: 148, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 162, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 153, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 150, - EndPos: 153, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 154, - EndPos: 162, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 155, - EndPos: 162, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 9, - EndLine: 9, - StartPos: 158, - EndPos: 162, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 167, - EndPos: 230, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 173, - EndPos: 176, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 178, - EndPos: 229, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 194, - EndPos: 197, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 178, - EndPos: 184, - }, - }, - Value: []byte("public"), - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 198, - EndPos: 211, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 198, - EndPos: 201, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 198, - EndPos: 201, - }, - }, - Value: []byte("bar"), - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 202, - EndPos: 206, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 202, - EndPos: 206, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 207, - EndPos: 211, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 207, - EndPos: 211, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 207, - EndPos: 211, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 213, - EndPos: 225, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 213, - EndPos: 216, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 213, - EndPos: 216, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 217, - EndPos: 225, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 218, - EndPos: 225, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 221, - EndPos: 225, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 221, - EndPos: 225, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 10, - EndLine: 10, - StartPos: 227, - EndPos: 229, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 231, - EndPos: 272, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 231, - EndPos: 271, - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 240, - EndPos: 253, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 240, - EndPos: 243, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 240, - EndPos: 243, - }, - }, - Value: []byte("bar"), - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 244, - EndPos: 248, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 244, - EndPos: 248, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 249, - EndPos: 253, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 249, - EndPos: 253, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 249, - EndPos: 253, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 255, - EndPos: 267, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 255, - EndPos: 258, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 255, - EndPos: 258, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 259, - EndPos: 267, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 260, - EndPos: 267, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 267, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 11, - EndLine: 11, - StartPos: 263, - EndPos: 267, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 273, - EndPos: 321, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 273, - EndPos: 320, - }, - }, - Static: true, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 289, - EndPos: 302, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 289, - EndPos: 292, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 289, - EndPos: 292, - }, - }, - Value: []byte("bar"), - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 293, - EndPos: 297, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 293, - EndPos: 297, - }, - }, - Value: []byte("$bar"), - }, - }, - DefaultValue: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 298, - EndPos: 302, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 298, - EndPos: 302, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 298, - EndPos: 302, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 304, - EndPos: 316, - }, - }, - Type: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 304, - EndPos: 307, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 304, - EndPos: 307, - }, - }, - Value: []byte("baz"), - }, - }, - }, - Var: &ast.Reference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 308, - EndPos: 316, - }, - }, - Var: &ast.Variadic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 309, - EndPos: 316, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 312, - EndPos: 316, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 12, - EndLine: 12, - StartPos: 312, - EndPos: 316, - }, - }, - Value: []byte("$baz"), - }, - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 323, - EndPos: 343, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 14, - EndLine: 14, - StartPos: 323, - EndPos: 342, - }, - }, - Value: []byte("1234567890123456789"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 344, - EndPos: 365, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 15, - EndLine: 15, - StartPos: 344, - EndPos: 364, - }, - }, - Value: []byte("12345678901234567890"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 366, - EndPos: 369, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 16, - EndLine: 16, - StartPos: 366, - EndPos: 368, - }, - }, - Value: []byte("0."), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 17, - EndLine: 17, - StartPos: 370, - EndPos: 437, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 17, - EndLine: 17, - StartPos: 370, - EndPos: 436, - }, - }, - Value: []byte("0b0111111111111111111111111111111111111111111111111111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 438, - EndPos: 505, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 18, - EndLine: 18, - StartPos: 438, - EndPos: 504, - }, - }, - Value: []byte("0b1111111111111111111111111111111111111111111111111111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 506, - EndPos: 527, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 19, - EndLine: 19, - StartPos: 506, - EndPos: 526, - }, - }, - Value: []byte("0x007111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 528, - EndPos: 547, - }, - }, - Expr: &ast.ScalarDnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 20, - EndLine: 20, - StartPos: 528, - EndPos: 546, - }, - }, - Value: []byte("0x8111111111111111"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 548, - EndPos: 558, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 21, - EndLine: 21, - StartPos: 548, - EndPos: 557, - }, - }, - Value: []byte("__CLASS__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 22, - EndLine: 22, - StartPos: 559, - EndPos: 567, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 22, - EndLine: 22, - StartPos: 559, - EndPos: 566, - }, - }, - Value: []byte("__DIR__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 568, - EndPos: 577, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 23, - EndLine: 23, - StartPos: 568, - EndPos: 576, - }, - }, - Value: []byte("__FILE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 578, - EndPos: 591, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 24, - EndLine: 24, - StartPos: 578, - EndPos: 590, - }, - }, - Value: []byte("__FUNCTION__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 592, - EndPos: 601, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 25, - EndLine: 25, - StartPos: 592, - EndPos: 600, - }, - }, - Value: []byte("__LINE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 602, - EndPos: 616, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 26, - EndLine: 26, - StartPos: 602, - EndPos: 615, - }, - }, - Value: []byte("__NAMESPACE__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 617, - EndPos: 628, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 27, - EndLine: 27, - StartPos: 617, - EndPos: 627, - }, - }, - Value: []byte("__METHOD__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 629, - EndPos: 639, - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 28, - EndLine: 28, - StartPos: 629, - EndPos: 638, - }, - }, - Value: []byte("__TRAIT__"), - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 641, - EndPos: 653, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 641, - EndPos: 652, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 642, - EndPos: 647, - }, - }, - Value: []byte("test "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 647, - EndPos: 651, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 30, - EndLine: 30, - StartPos: 647, - EndPos: 651, - }, - }, - Value: []byte("$var"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 654, - EndPos: 669, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 654, - EndPos: 668, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 655, - EndPos: 660, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 660, - EndPos: 667, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 660, - EndPos: 664, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 660, - EndPos: 664, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 31, - EndLine: 31, - StartPos: 665, - EndPos: 666, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 670, - EndPos: 724, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 670, - EndPos: 723, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 671, - EndPos: 676, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 676, - EndPos: 722, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 676, - EndPos: 680, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 676, - EndPos: 680, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 32, - EndLine: 32, - StartPos: 681, - EndPos: 721, - }, - }, - Value: []byte("1234567890123456789012345678901234567890"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 725, - EndPos: 742, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 725, - EndPos: 741, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 726, - EndPos: 731, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 731, - EndPos: 740, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 731, - EndPos: 735, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 731, - EndPos: 735, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 33, - EndLine: 33, - StartPos: 736, - EndPos: 739, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 743, - EndPos: 761, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 743, - EndPos: 760, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 744, - EndPos: 749, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 749, - EndPos: 759, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 749, - EndPos: 753, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 749, - EndPos: 753, - }, - }, - Value: []byte("$var"), - }, - }, - Dim: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 754, - EndPos: 758, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 34, - EndLine: 34, - StartPos: 754, - EndPos: 758, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 762, - EndPos: 774, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 762, - EndPos: 773, - }, - }, - Parts: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 763, - EndPos: 767, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 763, - EndPos: 767, - }, - }, - Value: []byte("$foo"), - }, - }, - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 767, - EndPos: 768, - }, - }, - Value: []byte(" "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 768, - EndPos: 772, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 35, - EndLine: 35, - StartPos: 768, - EndPos: 772, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 775, - EndPos: 794, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 775, - EndPos: 793, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 776, - EndPos: 781, - }, - }, - Value: []byte("test "), - }, - &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 781, - EndPos: 790, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 781, - EndPos: 785, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 781, - EndPos: 785, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 787, - EndPos: 790, - }, - }, - Value: []byte("bar"), - }, - }, - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 36, - EndLine: 36, - StartPos: 790, - EndPos: 792, - }, - }, - Value: []byte("()"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 795, - EndPos: 809, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 795, - EndPos: 808, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 796, - EndPos: 801, - }, - }, - Value: []byte("test "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 801, - EndPos: 807, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 37, - EndLine: 37, - StartPos: 803, - EndPos: 806, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 810, - EndPos: 827, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 810, - EndPos: 826, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 811, - EndPos: 816, - }, - }, - Value: []byte("test "), - }, - &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 816, - EndPos: 825, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 818, - EndPos: 821, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 818, - EndPos: 821, - }, - }, - Value: []byte("foo"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 38, - EndLine: 38, - StartPos: 822, - EndPos: 823, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 828, - EndPos: 849, - }, - }, - Expr: &ast.ScalarEncapsed{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 828, - EndPos: 848, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 829, - EndPos: 834, - }, - }, - Value: []byte("test "), - }, - &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 835, - EndPos: 846, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 835, - EndPos: 839, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 835, - EndPos: 839, - }, - }, - Value: []byte("$foo"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 841, - EndPos: 844, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 39, - EndLine: 39, - StartPos: 844, - EndPos: 846, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 42, - StartPos: 851, - EndPos: 867, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 855, - EndPos: 857, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 41, - EndLine: 41, - StartPos: 855, - EndPos: 857, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 45, - StartPos: 868, - EndPos: 897, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 872, - EndPos: 874, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 43, - EndLine: 43, - StartPos: 872, - EndPos: 874, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: -1, - StartPos: 878, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 886, - EndPos: 888, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 44, - EndLine: 44, - StartPos: 886, - EndPos: 888, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 48, - StartPos: 898, - EndPos: 920, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 902, - EndPos: 904, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 46, - EndLine: 46, - StartPos: 902, - EndPos: 904, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 47, - EndLine: -1, - StartPos: 908, - EndPos: -1, - }, - }, - Alt: true, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 53, - StartPos: 921, - EndPos: 969, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 925, - EndPos: 927, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 49, - EndLine: 49, - StartPos: 925, - EndPos: 927, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: -1, - StartPos: 931, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 939, - EndPos: 941, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 50, - EndLine: 50, - StartPos: 939, - EndPos: 941, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: -1, - StartPos: 944, - EndPos: -1, - }, - }, - Alt: true, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 952, - EndPos: 954, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 51, - EndLine: 51, - StartPos: 952, - EndPos: 954, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 52, - EndLine: -1, - StartPos: 957, - EndPos: -1, - }, - }, - Alt: true, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 971, - EndPos: 991, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 978, - EndPos: 979, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 981, - EndPos: 991, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 55, - EndLine: 55, - StartPos: 983, - EndPos: 989, - }, - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 992, - EndPos: 1014, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 999, - EndPos: 1000, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1002, - EndPos: 1014, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1004, - EndPos: 1012, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 56, - EndLine: 56, - StartPos: 1010, - EndPos: 1011, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1015, - EndPos: 1046, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1022, - EndPos: 1023, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1027, - EndPos: 1036, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1027, - EndPos: 1036, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 57, - EndLine: 57, - StartPos: 1033, - EndPos: 1034, - }, - }, - Value: []byte("3"), - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1047, - EndPos: 1083, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1053, - EndPos: 1056, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassConstList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1058, - EndPos: 1081, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1064, - EndPos: 1071, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1064, - EndPos: 1067, - }, - }, - Value: []byte("FOO"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1070, - EndPos: 1071, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1073, - EndPos: 1080, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1073, - EndPos: 1076, - }, - }, - Value: []byte("BAR"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 58, - EndLine: 58, - StartPos: 1079, - EndPos: 1080, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1084, - EndPos: 1114, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1090, - EndPos: 1093, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1095, - EndPos: 1112, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1104, - EndPos: 1107, - }, - }, - Value: []byte("bar"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 59, - EndLine: 59, - StartPos: 1110, - EndPos: 1112, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1115, - EndPos: 1160, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1121, - EndPos: 1124, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1126, - EndPos: 1158, - }, - }, - ReturnsRef: true, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1150, - EndPos: 1153, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1126, - EndPos: 1132, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1133, - EndPos: 1139, - }, - }, - Value: []byte("static"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 60, - EndLine: 60, - StartPos: 1156, - EndPos: 1158, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1161, - EndPos: 1233, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1167, - EndPos: 1170, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1172, - EndPos: 1203, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1195, - EndPos: 1198, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1172, - EndPos: 1177, - }, - }, - Value: []byte("final"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1178, - EndPos: 1185, - }, - }, - Value: []byte("private"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1201, - EndPos: 1203, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1204, - EndPos: 1231, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1223, - EndPos: 1226, - }, - }, - Value: []byte("baz"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1204, - EndPos: 1213, - }, - }, - Value: []byte("protected"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 61, - EndLine: 61, - StartPos: 1229, - EndPos: 1231, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1234, - EndPos: 1287, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1249, - EndPos: 1252, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1234, - EndPos: 1242, - }, - }, - Value: []byte("abstract"), - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtClassMethod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1254, - EndPos: 1285, - }, - }, - MethodName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1279, - EndPos: 1282, - }, - }, - Value: []byte("bar"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1254, - EndPos: 1262, - }, - }, - Value: []byte("abstract"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1263, - EndPos: 1269, - }, - }, - Value: []byte("public"), - }, - }, - Stmt: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 62, - EndLine: 62, - StartPos: 1284, - EndPos: 1285, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1288, - EndPos: 1319, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1300, - EndPos: 1303, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1288, - EndPos: 1293, - }, - }, - Value: []byte("final"), - }, - }, - Extends: &ast.StmtClassExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1304, - EndPos: 1315, - }, - }, - ClassName: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1315, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 63, - EndLine: 63, - StartPos: 1312, - EndPos: 1315, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1320, - EndPos: 1354, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1332, - EndPos: 1335, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1320, - EndPos: 1325, - }, - }, - Value: []byte("final"), - }, - }, - Implements: &ast.StmtClassImplements{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1336, - EndPos: 1350, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1347, - EndPos: 1350, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 64, - EndLine: 64, - StartPos: 1347, - EndPos: 1350, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1355, - EndPos: 1394, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1367, - EndPos: 1370, - }, - }, - Value: []byte("foo"), - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1355, - EndPos: 1360, - }, - }, - Value: []byte("final"), - }, - }, - Implements: &ast.StmtClassImplements{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1371, - EndPos: 1390, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1382, - EndPos: 1385, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1382, - EndPos: 1385, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1387, - EndPos: 1390, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 65, - EndLine: 65, - StartPos: 1387, - EndPos: 1390, - }, - }, - Value: []byte("baz"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtConstList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1396, - EndPos: 1419, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1402, - EndPos: 1409, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1402, - EndPos: 1405, - }, - }, - Value: []byte("FOO"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1408, - EndPos: 1409, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1411, - EndPos: 1418, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1411, - EndPos: 1414, - }, - }, - Value: []byte("BAR"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 67, - EndLine: 67, - StartPos: 1417, - EndPos: 1418, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1420, - EndPos: 1443, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1427, - EndPos: 1428, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1430, - EndPos: 1443, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 68, - EndLine: 68, - StartPos: 1432, - EndPos: 1441, - }, - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1444, - EndPos: 1469, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1451, - EndPos: 1452, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1454, - EndPos: 1469, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1456, - EndPos: 1467, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 69, - EndLine: 69, - StartPos: 1465, - EndPos: 1466, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtWhile{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1470, - EndPos: 1496, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1477, - EndPos: 1478, - }, - }, - Value: []byte("1"), - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1480, - EndPos: 1496, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtContinue{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1482, - EndPos: 1494, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 70, - EndLine: 70, - StartPos: 1491, - EndPos: 1492, - }, - }, - Value: []byte("3"), - }, - }, - }, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1497, - EndPos: 1514, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1505, - EndPos: 1512, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1505, - EndPos: 1510, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1511, - EndPos: 1512, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 71, - EndLine: 71, - StartPos: 1513, - EndPos: 1514, - }, - }, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1515, - EndPos: 1550, - }, - }, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1523, - EndPos: 1530, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1523, - EndPos: 1528, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1529, - EndPos: 1530, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1532, - EndPos: 1546, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1532, - EndPos: 1544, - }, - }, - Value: []byte("strict_types"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1545, - EndPos: 1546, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 72, - EndLine: 72, - StartPos: 1548, - EndPos: 1550, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtDeclare{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1551, - EndPos: 1580, - }, - }, - Alt: true, - Consts: []ast.Vertex{ - &ast.StmtConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1559, - EndPos: 1566, - }, - }, - Name: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1559, - EndPos: 1564, - }, - }, - Value: []byte("ticks"), - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 73, - EndLine: 73, - StartPos: 1565, - EndPos: 1566, - }, - }, - Value: []byte("1"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtDo{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1581, - EndPos: 1596, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1584, - EndPos: 1586, - }, - }, - Stmts: []ast.Vertex{}, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 74, - EndLine: 74, - StartPos: 1593, - EndPos: 1594, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtEcho{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1597, - EndPos: 1608, - }, - }, - Exprs: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1602, - EndPos: 1604, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1602, - EndPos: 1604, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 75, - EndLine: 75, - StartPos: 1606, - EndPos: 1607, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtEcho{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1609, - EndPos: 1618, - }, - }, - Exprs: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1614, - EndPos: 1616, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 76, - EndLine: 76, - StartPos: 1614, - EndPos: 1616, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtFor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1619, - EndPos: 1654, - }, - }, - Init: []ast.Vertex{ - &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1623, - EndPos: 1629, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1623, - EndPos: 1625, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1623, - EndPos: 1625, - }, - }, - Value: []byte("$i"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1628, - EndPos: 1629, - }, - }, - Value: []byte("0"), - }, - }, - }, - Cond: []ast.Vertex{ - &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1631, - EndPos: 1638, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1631, - EndPos: 1633, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1631, - EndPos: 1633, - }, - }, - Value: []byte("$i"), - }, - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1636, - EndPos: 1638, - }, - }, - Value: []byte("10"), - }, - }, - }, - Loop: []ast.Vertex{ - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1640, - EndPos: 1644, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1640, - EndPos: 1642, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1640, - EndPos: 1642, - }, - }, - Value: []byte("$i"), - }, - }, - }, - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1646, - EndPos: 1650, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1646, - EndPos: 1648, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1646, - EndPos: 1648, - }, - }, - Value: []byte("$i"), - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 77, - EndLine: 77, - StartPos: 1652, - EndPos: 1654, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtFor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1655, - EndPos: 1685, - }, - }, - Alt: true, - Cond: []ast.Vertex{ - &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1661, - EndPos: 1668, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1661, - EndPos: 1663, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1661, - EndPos: 1663, - }, - }, - Value: []byte("$i"), - }, - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1666, - EndPos: 1668, - }, - }, - Value: []byte("10"), - }, - }, - }, - Loop: []ast.Vertex{ - &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1670, - EndPos: 1674, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1670, - EndPos: 1672, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 78, - EndLine: 78, - StartPos: 1670, - EndPos: 1672, - }, - }, - Value: []byte("$i"), - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1686, - EndPos: 1707, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1695, - EndPos: 1697, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1695, - EndPos: 1697, - }, - }, - Value: []byte("$a"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1701, - EndPos: 1703, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1701, - EndPos: 1703, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 79, - EndLine: 79, - StartPos: 1705, - EndPos: 1707, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1708, - EndPos: 1729, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1717, - EndPos: 1719, - }, - }, - Items: []ast.Vertex{}, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1723, - EndPos: 1725, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1723, - EndPos: 1725, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 80, - EndLine: 80, - StartPos: 1727, - EndPos: 1729, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1730, - EndPos: 1762, - }, - }, - Alt: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1739, - EndPos: 1741, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1739, - EndPos: 1741, - }, - }, - Value: []byte("$a"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1745, - EndPos: 1747, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 81, - EndLine: 81, - StartPos: 1745, - EndPos: 1747, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: -1, - EndLine: -1, - StartPos: -1, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1763, - EndPos: 1790, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1772, - EndPos: 1774, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1772, - EndPos: 1774, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1778, - EndPos: 1780, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1778, - EndPos: 1780, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1784, - EndPos: 1786, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1784, - EndPos: 1786, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 82, - EndLine: 82, - StartPos: 1788, - EndPos: 1790, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1791, - EndPos: 1818, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1800, - EndPos: 1802, - }, - }, - Items: []ast.Vertex{}, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1806, - EndPos: 1808, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1806, - EndPos: 1808, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1812, - EndPos: 1814, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1812, - EndPos: 1814, - }, - }, - Value: []byte("$v"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 83, - EndLine: 83, - StartPos: 1816, - EndPos: 1818, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1819, - EndPos: 1847, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1828, - EndPos: 1830, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1828, - EndPos: 1830, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1834, - EndPos: 1836, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1834, - EndPos: 1836, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1840, - EndPos: 1843, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1841, - EndPos: 1843, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1841, - EndPos: 1843, - }, - }, - Value: []byte("$v"), - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 84, - EndLine: 84, - StartPos: 1845, - EndPos: 1847, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtForeach{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1848, - EndPos: 1881, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1857, - EndPos: 1859, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1857, - EndPos: 1859, - }, - }, - Value: []byte("$a"), - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1863, - EndPos: 1865, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1863, - EndPos: 1865, - }, - }, - Value: []byte("$k"), - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1869, - EndPos: 1877, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1874, - EndPos: 1876, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1874, - EndPos: 1876, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1874, - EndPos: 1876, - }, - }, - Value: []byte("$v"), - }, - }, - }, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 85, - EndLine: 85, - StartPos: 1879, - EndPos: 1881, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1882, - EndPos: 1899, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 86, - EndLine: 86, - StartPos: 1891, - EndPos: 1894, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 88, - EndLine: 92, - StartPos: 1901, - EndPos: 1973, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 88, - EndLine: 88, - StartPos: 1910, - EndPos: 1913, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1922, - EndPos: 1939, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 89, - EndLine: 89, - StartPos: 1931, - EndPos: 1934, - }, - }, - Value: []byte("bar"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 1944, - EndPos: 1956, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 90, - EndLine: 90, - StartPos: 1950, - EndPos: 1953, - }, - }, - Value: []byte("Baz"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtReturn{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1961, - EndPos: 1971, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1968, - EndPos: 1970, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 91, - EndLine: 91, - StartPos: 1968, - EndPos: 1970, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1975, - EndPos: 2020, - }, - }, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1984, - EndPos: 1987, - }, - }, - Value: []byte("foo"), - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1988, - EndPos: 1996, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1988, - EndPos: 1993, - }, - }, - Value: []byte("array"), - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1994, - EndPos: 1996, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1994, - EndPos: 1996, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1998, - EndPos: 2009, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 1998, - EndPos: 2006, - }, - }, - Value: []byte("callable"), - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2007, - EndPos: 2009, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2007, - EndPos: 2009, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtReturn{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 94, - EndLine: 94, - StartPos: 2012, - EndPos: 2019, - }, - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2021, - EndPos: 2048, - }, - }, - ReturnsRef: true, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2031, - EndPos: 2034, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtReturn{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2038, - EndPos: 2047, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 95, - EndLine: 95, - StartPos: 2045, - EndPos: 2046, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtFunction{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2049, - EndPos: 2067, - }, - }, - ReturnsRef: true, - FunctionName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 96, - EndLine: 96, - StartPos: 2059, - EndPos: 2062, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtGlobal{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2068, - EndPos: 2097, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2075, - EndPos: 2077, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2075, - EndPos: 2077, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2079, - EndPos: 2081, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2079, - EndPos: 2081, - }, - }, - Value: []byte("$b"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2083, - EndPos: 2086, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2084, - EndPos: 2086, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2084, - EndPos: 2086, - }, - }, - Value: []byte("$c"), - }, - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2088, - EndPos: 2096, - }, - }, - VarName: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2090, - EndPos: 2095, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2090, - EndPos: 2093, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2090, - EndPos: 2093, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 97, - EndLine: 97, - StartPos: 2093, - EndPos: 2095, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtLabel{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2098, - EndPos: 2100, - }, - }, - LabelName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 98, - EndLine: 98, - StartPos: 2098, - EndPos: 2099, - }, - }, - Value: []byte("a"), - }, - }, - &ast.StmtGoto{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2101, - EndPos: 2108, - }, - }, - Label: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 99, - EndLine: 99, - StartPos: 2106, - EndPos: 2107, - }, - }, - Value: []byte("a"), - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2109, - EndPos: 2119, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2113, - EndPos: 2115, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2113, - EndPos: 2115, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 100, - EndLine: 100, - StartPos: 2117, - EndPos: 2119, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2120, - EndPos: 2145, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2124, - EndPos: 2126, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2124, - EndPos: 2126, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2128, - EndPos: 2130, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2131, - EndPos: 2145, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2139, - EndPos: 2141, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2139, - EndPos: 2141, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 101, - EndLine: 101, - StartPos: 2143, - EndPos: 2145, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2146, - EndPos: 2164, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2150, - EndPos: 2152, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2150, - EndPos: 2152, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2154, - EndPos: 2156, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2157, - EndPos: 2164, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 102, - EndLine: 102, - StartPos: 2162, - EndPos: 2164, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2165, - EndPos: 2213, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2169, - EndPos: 2171, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2169, - EndPos: 2171, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2173, - EndPos: 2175, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2176, - EndPos: 2190, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2184, - EndPos: 2186, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2184, - EndPos: 2186, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2188, - EndPos: 2190, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2191, - EndPos: 2205, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2199, - EndPos: 2201, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2199, - EndPos: 2201, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2203, - EndPos: 2205, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2206, - EndPos: 2213, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 103, - EndLine: 103, - StartPos: 2211, - EndPos: 2213, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2214, - EndPos: 2263, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2218, - EndPos: 2220, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2218, - EndPos: 2220, - }, - }, - Value: []byte("$a"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2222, - EndPos: 2224, - }, - }, - Stmts: []ast.Vertex{}, - }, - ElseIf: []ast.Vertex{ - &ast.StmtElseIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2225, - EndPos: 2239, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2233, - EndPos: 2235, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2233, - EndPos: 2235, - }, - }, - Value: []byte("$b"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2237, - EndPos: 2239, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2240, - EndPos: 2263, - }, - }, - Stmt: &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2245, - EndPos: 2263, - }, - }, - Cond: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2249, - EndPos: 2251, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2249, - EndPos: 2251, - }, - }, - Value: []byte("$c"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2253, - EndPos: 2255, - }, - }, - Stmts: []ast.Vertex{}, - }, - Else: &ast.StmtElse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2256, - EndPos: 2263, - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 104, - EndLine: 104, - StartPos: 2261, - EndPos: 2263, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - }, - }, - &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2264, - EndPos: 2266, - }, - }, - }, - &ast.StmtInlineHtml{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 105, - EndLine: 105, - StartPos: 2266, - EndPos: 2279, - }, - }, - Value: []byte("
"), - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2282, - EndPos: 2298, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 106, - EndLine: 106, - StartPos: 2292, - EndPos: 2295, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2299, - EndPos: 2327, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2309, - EndPos: 2312, - }, - }, - Value: []byte("Foo"), - }, - Extends: &ast.StmtInterfaceExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2313, - EndPos: 2324, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2321, - EndPos: 2324, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 107, - EndLine: 107, - StartPos: 2321, - EndPos: 2324, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtInterface{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2328, - EndPos: 2361, - }, - }, - InterfaceName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2338, - EndPos: 2341, - }, - }, - Value: []byte("Foo"), - }, - Extends: &ast.StmtInterfaceExtends{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2342, - EndPos: 2358, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2350, - EndPos: 2353, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2350, - EndPos: 2353, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2355, - EndPos: 2358, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 108, - EndLine: 108, - StartPos: 2355, - EndPos: 2358, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2362, - EndPos: 2376, - }, - }, - Name: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2372, - EndPos: 2375, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 109, - EndLine: 109, - StartPos: 2372, - EndPos: 2375, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2377, - EndPos: 2397, - }, - }, - Name: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2387, - EndPos: 2394, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2387, - EndPos: 2390, - }, - }, - Value: []byte("Foo"), - }, - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 110, - EndLine: 110, - StartPos: 2390, - EndPos: 2394, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtNamespace{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 111, - EndLine: 111, - StartPos: 2398, - EndPos: 2410, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2411, - EndPos: 2430, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2417, - EndPos: 2420, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtPropertyList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2422, - EndPos: 2429, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2422, - EndPos: 2425, - }, - }, - Value: []byte("var"), - }, - }, - Properties: []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2426, - EndPos: 2428, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2426, - EndPos: 2428, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 112, - EndLine: 112, - StartPos: 2426, - EndPos: 2428, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2431, - EndPos: 2468, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2437, - EndPos: 2440, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtPropertyList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2442, - EndPos: 2467, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2442, - EndPos: 2448, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2449, - EndPos: 2455, - }, - }, - Value: []byte("static"), - }, - }, - Properties: []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2456, - EndPos: 2458, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2456, - EndPos: 2458, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2456, - EndPos: 2458, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2460, - EndPos: 2466, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2460, - EndPos: 2462, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2460, - EndPos: 2462, - }, - }, - Value: []byte("$b"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 113, - EndLine: 113, - StartPos: 2465, - EndPos: 2466, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2469, - EndPos: 2506, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2475, - EndPos: 2478, - }, - }, - Value: []byte("foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtPropertyList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2480, - EndPos: 2505, - }, - }, - Modifiers: []ast.Vertex{ - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2480, - EndPos: 2486, - }, - }, - Value: []byte("public"), - }, - &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2487, - EndPos: 2493, - }, - }, - Value: []byte("static"), - }, - }, - Properties: []ast.Vertex{ - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2494, - EndPos: 2500, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2494, - EndPos: 2496, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2494, - EndPos: 2496, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2499, - EndPos: 2500, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtProperty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2502, - EndPos: 2504, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2502, - EndPos: 2504, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 114, - EndLine: 114, - StartPos: 2502, - EndPos: 2504, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2507, - EndPos: 2525, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2514, - EndPos: 2516, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2514, - EndPos: 2516, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2514, - EndPos: 2516, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2518, - EndPos: 2524, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2518, - EndPos: 2520, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2518, - EndPos: 2520, - }, - }, - Value: []byte("$b"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 115, - EndLine: 115, - StartPos: 2523, - EndPos: 2524, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2526, - EndPos: 2544, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2533, - EndPos: 2539, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2533, - EndPos: 2535, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2533, - EndPos: 2535, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2538, - EndPos: 2539, - }, - }, - Value: []byte("1"), - }, - }, - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2541, - EndPos: 2543, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2541, - EndPos: 2543, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 116, - EndLine: 116, - StartPos: 2541, - EndPos: 2543, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 122, - StartPos: 2546, - EndPos: 2606, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 118, - EndLine: 118, - StartPos: 2554, - EndPos: 2555, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: -1, - StartPos: 2563, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 119, - EndLine: 119, - StartPos: 2568, - EndPos: 2569, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtDefault{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 120, - EndLine: -1, - StartPos: 2575, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 121, - EndLine: -1, - StartPos: 2588, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 121, - EndLine: 121, - StartPos: 2593, - EndPos: 2594, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 124, - EndLine: 127, - StartPos: 2608, - EndPos: 2656, - }, - }, - Alt: true, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 124, - EndLine: 124, - StartPos: 2616, - EndPos: 2617, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 125, - EndLine: -1, - StartPos: 2626, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 125, - EndLine: 125, - StartPos: 2631, - EndPos: 2632, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 126, - EndLine: -1, - StartPos: 2638, - EndPos: -1, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 126, - EndLine: 126, - StartPos: 2643, - EndPos: 2644, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 129, - EndLine: 132, - StartPos: 2658, - EndPos: 2710, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 129, - EndLine: 129, - StartPos: 2666, - EndPos: 2667, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2675, - EndPos: 2689, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2680, - EndPos: 2681, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 130, - EndLine: 130, - StartPos: 2683, - EndPos: 2689, - }, - }, - }, - }, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 131, - EndLine: 131, - StartPos: 2694, - EndPos: 2708, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 131, - EndLine: 131, - StartPos: 2699, - EndPos: 2700, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 131, - EndLine: 131, - StartPos: 2702, - EndPos: 2708, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtSwitch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 134, - EndLine: 137, - StartPos: 2712, - EndPos: 2765, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 134, - EndLine: 134, - StartPos: 2720, - EndPos: 2721, - }, - }, - Value: []byte("1"), - }, - CaseList: []ast.Vertex{ - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2730, - EndPos: 2744, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2735, - EndPos: 2736, - }, - }, - Value: []byte("1"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 135, - EndLine: 135, - StartPos: 2738, - EndPos: 2744, - }, - }, - }, - }, - }, - &ast.StmtCase{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 136, - EndLine: 136, - StartPos: 2749, - EndPos: 2763, - }, - }, - Cond: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 136, - EndLine: 136, - StartPos: 2754, - EndPos: 2755, - }, - }, - Value: []byte("2"), - }, - Stmts: []ast.Vertex{ - &ast.StmtBreak{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 136, - EndLine: 136, - StartPos: 2757, - EndPos: 2763, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtThrow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2766, - EndPos: 2775, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2772, - EndPos: 2774, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 138, - EndLine: 138, - StartPos: 2772, - EndPos: 2774, - }, - }, - Value: []byte("$e"), - }, - }, - }, - &ast.StmtTrait{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2776, - EndPos: 2788, - }, - }, - TraitName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 139, - EndLine: 139, - StartPos: 2782, - EndPos: 2785, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2789, - EndPos: 2811, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2795, - EndPos: 2798, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2801, - EndPos: 2809, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2805, - EndPos: 2808, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2805, - EndPos: 2808, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtNop{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 140, - EndLine: 140, - StartPos: 2808, - EndPos: 2809, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2812, - EndPos: 2841, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2818, - EndPos: 2821, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2824, - EndPos: 2839, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2828, - EndPos: 2831, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2828, - EndPos: 2831, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2833, - EndPos: 2836, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2833, - EndPos: 2836, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 141, - EndLine: 141, - StartPos: 2837, - EndPos: 2839, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2842, - EndPos: 2887, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2848, - EndPos: 2851, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2854, - EndPos: 2885, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2858, - EndPos: 2861, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2858, - EndPos: 2861, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2863, - EndPos: 2866, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2863, - EndPos: 2866, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2867, - EndPos: 2885, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2869, - EndPos: 2882, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2869, - EndPos: 2872, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2869, - EndPos: 2872, - }, - }, - Value: []byte("one"), - }, - }, - Modifier: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 142, - EndLine: 142, - StartPos: 2876, - EndPos: 2882, - }, - }, - Value: []byte("public"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2888, - EndPos: 2937, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2894, - EndPos: 2897, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2900, - EndPos: 2935, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2904, - EndPos: 2907, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2904, - EndPos: 2907, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2909, - EndPos: 2912, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2909, - EndPos: 2912, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2913, - EndPos: 2935, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2915, - EndPos: 2932, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2915, - EndPos: 2918, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2915, - EndPos: 2918, - }, - }, - Value: []byte("one"), - }, - }, - Modifier: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2922, - EndPos: 2928, - }, - }, - Value: []byte("public"), - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 143, - EndLine: 143, - StartPos: 2929, - EndPos: 2932, - }, - }, - Value: []byte("two"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtClass{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2938, - EndPos: 3015, - }, - }, - ClassName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2944, - EndPos: 2947, - }, - }, - Value: []byte("Foo"), - }, - Stmts: []ast.Vertex{ - &ast.StmtTraitUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2950, - EndPos: 3013, - }, - }, - Traits: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2954, - EndPos: 2957, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2954, - EndPos: 2957, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2959, - EndPos: 2962, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2959, - EndPos: 2962, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - TraitAdaptationList: &ast.StmtTraitAdaptationList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2963, - EndPos: 3013, - }, - }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUsePrecedence{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2965, - EndPos: 2993, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2965, - EndPos: 2973, - }, - }, - Trait: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2965, - EndPos: 2968, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2965, - EndPos: 2968, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2970, - EndPos: 2973, - }, - }, - Value: []byte("one"), - }, - }, - Insteadof: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2984, - EndPos: 2987, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2984, - EndPos: 2987, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2989, - EndPos: 2993, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2989, - EndPos: 2993, - }, - }, - Value: []byte("Quux"), - }, - }, - }, - }, - }, - &ast.StmtTraitUseAlias{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2995, - EndPos: 3010, - }, - }, - Ref: &ast.StmtTraitMethodRef{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2995, - EndPos: 3003, - }, - }, - Trait: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2995, - EndPos: 2998, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 2995, - EndPos: 2998, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3000, - EndPos: 3003, - }, - }, - Value: []byte("one"), - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 144, - EndLine: 144, - StartPos: 3007, - EndPos: 3010, - }, - }, - Value: []byte("two"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 146, - EndLine: -1, - StartPos: 3017, - EndPos: -1, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{}, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3024, - EndPos: 3054, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3031, - EndPos: 3054, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3038, - EndPos: 3047, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3038, - EndPos: 3047, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3048, - EndPos: 3050, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 147, - EndLine: 147, - StartPos: 3048, - EndPos: 3050, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3055, - EndPos: 3116, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3062, - EndPos: 3085, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3069, - EndPos: 3078, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3069, - EndPos: 3078, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3079, - EndPos: 3081, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3079, - EndPos: 3081, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3086, - EndPos: 3116, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3093, - EndPos: 3109, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3093, - EndPos: 3109, - }, - }, - Value: []byte("RuntimeException"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3110, - EndPos: 3112, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 148, - EndLine: 148, - StartPos: 3110, - EndPos: 3112, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3117, - EndPos: 3221, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3124, - EndPos: 3147, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3131, - EndPos: 3140, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3131, - EndPos: 3140, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3141, - EndPos: 3143, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3141, - EndPos: 3143, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3148, - EndPos: 3179, - }, - }, - Types: []ast.Vertex{ - &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3155, - EndPos: 3172, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3156, - EndPos: 3172, - }, - }, - Value: []byte("RuntimeException"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3173, - EndPos: 3175, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3173, - EndPos: 3175, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3180, - EndPos: 3221, - }, - }, - Types: []ast.Vertex{ - &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3187, - EndPos: 3214, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3197, - EndPos: 3214, - }, - }, - Value: []byte("AdditionException"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3215, - EndPos: 3217, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 149, - EndLine: 149, - StartPos: 3215, - EndPos: 3217, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - }, - &ast.StmtTry{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3222, - EndPos: 3263, - }, - }, - Stmts: []ast.Vertex{}, - Catches: []ast.Vertex{ - &ast.StmtCatch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3229, - EndPos: 3252, - }, - }, - Types: []ast.Vertex{ - &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3236, - EndPos: 3245, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3236, - EndPos: 3245, - }, - }, - Value: []byte("Exception"), - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3246, - EndPos: 3248, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3246, - EndPos: 3248, - }, - }, - Value: []byte("$e"), - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - Finally: &ast.StmtFinally{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 150, - EndLine: 150, - StartPos: 3253, - EndPos: 3263, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtUnset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3265, - EndPos: 3279, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3271, - EndPos: 3273, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3271, - EndPos: 3273, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3275, - EndPos: 3277, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 152, - EndLine: 152, - StartPos: 3275, - EndPos: 3277, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3281, - EndPos: 3289, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 154, - EndLine: 154, - StartPos: 3285, - EndPos: 3288, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3290, - EndPos: 3299, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3294, - EndPos: 3298, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 155, - EndLine: 155, - StartPos: 3295, - EndPos: 3298, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3300, - EndPos: 3316, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3304, - EndPos: 3315, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3308, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3305, - EndPos: 3308, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 156, - EndLine: 156, - StartPos: 3312, - EndPos: 3315, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3317, - EndPos: 3330, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3321, - EndPos: 3324, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 157, - EndLine: 157, - StartPos: 3326, - EndPos: 3329, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3331, - EndPos: 3351, - }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3335, - EndPos: 3338, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3350, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3343, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3340, - EndPos: 3343, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 158, - EndLine: 158, - StartPos: 3347, - EndPos: 3350, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3352, - EndPos: 3375, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3356, - EndPos: 3364, - }, - }, - Value: []byte("function"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3365, - EndPos: 3368, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3365, - EndPos: 3368, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3365, - EndPos: 3368, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3370, - EndPos: 3374, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 159, - EndLine: 159, - StartPos: 3371, - EndPos: 3374, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3376, - EndPos: 3413, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3380, - EndPos: 3388, - }, - }, - Value: []byte("function"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3389, - EndPos: 3399, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3389, - EndPos: 3392, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3389, - EndPos: 3392, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3396, - EndPos: 3399, - }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3401, - EndPos: 3412, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3405, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3402, - EndPos: 3405, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 160, - EndLine: 160, - StartPos: 3409, - EndPos: 3412, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3414, - EndPos: 3434, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3418, - EndPos: 3423, - }, - }, - Value: []byte("const"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3424, - EndPos: 3427, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3424, - EndPos: 3427, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3424, - EndPos: 3427, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3429, - EndPos: 3433, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3430, - EndPos: 3433, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - }, - }, - }, - &ast.StmtUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3435, - EndPos: 3469, - }, - }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3439, - EndPos: 3444, - }, - }, - Value: []byte("const"), - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3445, - EndPos: 3455, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3445, - EndPos: 3448, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3445, - EndPos: 3448, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3452, - EndPos: 3455, - }, - }, - Value: []byte("foo"), - }, - }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3457, - EndPos: 3468, - }, - }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3461, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3458, - EndPos: 3461, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3465, - EndPos: 3468, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3471, - EndPos: 3477, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3471, - EndPos: 3476, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3471, - EndPos: 3473, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3471, - EndPos: 3473, - }, - }, - Value: []byte("$a"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3474, - EndPos: 3475, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3478, - EndPos: 3487, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3478, - EndPos: 3486, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3478, - EndPos: 3483, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3478, - EndPos: 3480, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3478, - EndPos: 3480, - }, - }, - Value: []byte("$a"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3481, - EndPos: 3482, - }, - }, - Value: []byte("1"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3484, - EndPos: 3485, - }, - }, - Value: []byte("2"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3488, - EndPos: 3496, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3488, - EndPos: 3495, - }, - }, - Items: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3497, - EndPos: 3506, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3497, - EndPos: 3505, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3503, - EndPos: 3504, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3503, - EndPos: 3504, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3507, - EndPos: 3525, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3507, - EndPos: 3524, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3513, - EndPos: 3517, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3513, - EndPos: 3514, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3516, - EndPos: 3517, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3519, - EndPos: 3522, - }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3519, - EndPos: 3522, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3520, - EndPos: 3522, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3520, - EndPos: 3522, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.ExprArrayItem{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3541, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3540, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3532, - EndPos: 3539, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3532, - EndPos: 3533, - }, - }, - Value: []byte("3"), - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3536, - EndPos: 3539, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3537, - EndPos: 3539, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3537, - EndPos: 3539, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3542, - EndPos: 3571, - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3542, - EndPos: 3570, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3548, - EndPos: 3551, - }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3548, - EndPos: 3551, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3549, - EndPos: 3551, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3549, - EndPos: 3551, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3553, - EndPos: 3557, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3553, - EndPos: 3554, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3556, - EndPos: 3557, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3559, - EndPos: 3560, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3559, - EndPos: 3560, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3562, - EndPos: 3569, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3562, - EndPos: 3563, - }, - }, - Value: []byte("3"), - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3566, - EndPos: 3569, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3567, - EndPos: 3569, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 170, - EndLine: 170, - StartPos: 3567, - EndPos: 3569, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3572, - EndPos: 3576, - }, - }, - Expr: &ast.ExprBitwiseNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3572, - EndPos: 3575, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3573, - EndPos: 3575, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3573, - EndPos: 3575, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3581, - }, - }, - Expr: &ast.ExprBooleanNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3578, - EndPos: 3580, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3578, - EndPos: 3580, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3583, - EndPos: 3592, - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3583, - EndPos: 3591, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3583, - EndPos: 3586, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3583, - EndPos: 3586, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3588, - EndPos: 3591, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3593, - EndPos: 3603, - }, - }, - Expr: &ast.ExprClone{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3593, - EndPos: 3602, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3599, - EndPos: 3601, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3599, - EndPos: 3601, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3604, - EndPos: 3613, - }, - }, - Expr: &ast.ExprClone{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3604, - EndPos: 3612, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3610, - EndPos: 3612, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 176, - EndLine: 176, - StartPos: 3610, - EndPos: 3612, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3614, - EndPos: 3627, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 177, - EndLine: 177, - StartPos: 3614, - EndPos: 3626, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3628, - EndPos: 3662, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3628, - EndPos: 3661, - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3637, - EndPos: 3639, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3637, - EndPos: 3639, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3637, - EndPos: 3639, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3641, - EndPos: 3643, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3641, - EndPos: 3643, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3641, - EndPos: 3643, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - ClosureUse: &ast.ExprClosureUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3645, - EndPos: 3658, - }, - }, - Uses: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3650, - EndPos: 3652, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3650, - EndPos: 3652, - }, - }, - Value: []byte("$c"), - }, - }, - &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3654, - EndPos: 3657, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3655, - EndPos: 3657, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 178, - EndLine: 178, - StartPos: 3655, - EndPos: 3657, - }, - }, - Value: []byte("$d"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3663, - EndPos: 3697, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3663, - EndPos: 3696, - }, - }, - Params: []ast.Vertex{ - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3672, - EndPos: 3674, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3672, - EndPos: 3674, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3672, - EndPos: 3674, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.Parameter{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3676, - EndPos: 3678, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3676, - EndPos: 3678, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3676, - EndPos: 3678, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - ClosureUse: &ast.ExprClosureUse{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3680, - EndPos: 3693, - }, - }, - Uses: []ast.Vertex{ - &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3685, - EndPos: 3688, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3686, - EndPos: 3688, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3686, - EndPos: 3688, - }, - }, - Value: []byte("$c"), - }, - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3690, - EndPos: 3692, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 179, - EndLine: 179, - StartPos: 3690, - EndPos: 3692, - }, - }, - Value: []byte("$d"), - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3698, - EndPos: 3712, - }, - }, - Expr: &ast.ExprClosure{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 180, - EndLine: 180, - StartPos: 3698, - EndPos: 3711, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3713, - EndPos: 3717, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3713, - EndPos: 3716, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3713, - EndPos: 3716, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 181, - EndLine: 181, - StartPos: 3713, - EndPos: 3716, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3718, - EndPos: 3732, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3718, - EndPos: 3731, - }, - }, - Const: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3718, - EndPos: 3731, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 182, - EndLine: 182, - StartPos: 3728, - EndPos: 3731, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3733, - EndPos: 3738, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3733, - EndPos: 3737, - }, - }, - Const: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3733, - EndPos: 3737, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 183, - EndLine: 183, - StartPos: 3734, - EndPos: 3737, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3740, - EndPos: 3750, - }, - }, - Expr: &ast.ExprEmpty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3740, - EndPos: 3749, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3746, - EndPos: 3748, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 185, - EndLine: 185, - StartPos: 3746, - EndPos: 3748, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3751, - EndPos: 3762, - }, - }, - Expr: &ast.ExprEmpty{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3751, - EndPos: 3761, - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3757, - EndPos: 3760, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3757, - EndPos: 3760, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 186, - EndLine: 186, - StartPos: 3757, - EndPos: 3760, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3763, - EndPos: 3767, - }, - }, - Expr: &ast.ExprErrorSuppress{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3763, - EndPos: 3766, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3764, - EndPos: 3766, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 187, - EndLine: 187, - StartPos: 3764, - EndPos: 3766, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3768, - EndPos: 3777, - }, - }, - Expr: &ast.ExprEval{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3768, - EndPos: 3776, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3773, - EndPos: 3775, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 188, - EndLine: 188, - StartPos: 3773, - EndPos: 3775, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 3778, - EndPos: 3783, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 189, - EndLine: 189, - StartPos: 3778, - EndPos: 3782, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3784, - EndPos: 3793, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3784, - EndPos: 3792, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3789, - EndPos: 3791, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 190, - EndLine: 190, - StartPos: 3789, - EndPos: 3791, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3794, - EndPos: 3800, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 191, - EndLine: 191, - StartPos: 3794, - EndPos: 3799, - }, - }, - Die: true, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3801, - EndPos: 3809, - }, - }, - Expr: &ast.ExprExit{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3801, - EndPos: 3808, - }, - }, - Die: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3805, - EndPos: 3807, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 192, - EndLine: 192, - StartPos: 3805, - EndPos: 3807, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3810, - EndPos: 3816, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3810, - EndPos: 3815, - }, - }, - Function: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3810, - EndPos: 3813, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3810, - EndPos: 3813, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 193, - EndLine: 193, - StartPos: 3813, - EndPos: 3815, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3817, - EndPos: 3836, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3817, - EndPos: 3835, - }, - }, - Function: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3817, - EndPos: 3830, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3827, - EndPos: 3830, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3830, - EndPos: 3835, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3832, - EndPos: 3834, - }, - }, - IsReference: true, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3832, - EndPos: 3834, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 194, - EndLine: 194, - StartPos: 3832, - EndPos: 3834, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3837, - EndPos: 3846, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3837, - EndPos: 3845, - }, - }, - Function: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3837, - EndPos: 3841, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3838, - EndPos: 3841, - }, - }, - Value: []byte("foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3841, - EndPos: 3845, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3842, - EndPos: 3844, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 195, - EndLine: 195, - StartPos: 3842, - EndPos: 3844, - }, - }, - Items: []ast.Vertex{}, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3847, - EndPos: 3862, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3847, - EndPos: 3861, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3847, - EndPos: 3851, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3847, - EndPos: 3851, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3851, - EndPos: 3861, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3852, - EndPos: 3860, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3852, - EndPos: 3860, - }, - }, - Value: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3858, - EndPos: 3860, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 196, - EndLine: 196, - StartPos: 3858, - EndPos: 3860, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3864, - EndPos: 3869, - }, - }, - Expr: &ast.ExprPostDec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3864, - EndPos: 3868, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3864, - EndPos: 3866, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 198, - EndLine: 198, - StartPos: 3864, - EndPos: 3866, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3870, - EndPos: 3875, - }, - }, - Expr: &ast.ExprPostInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3870, - EndPos: 3874, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3870, - EndPos: 3872, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 199, - EndLine: 199, - StartPos: 3870, - EndPos: 3872, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3876, - EndPos: 3881, - }, - }, - Expr: &ast.ExprPreDec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3876, - EndPos: 3880, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3878, - EndPos: 3880, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 200, - EndLine: 200, - StartPos: 3878, - EndPos: 3880, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3882, - EndPos: 3887, - }, - }, - Expr: &ast.ExprPreInc{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3882, - EndPos: 3886, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3884, - EndPos: 3886, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 201, - EndLine: 201, - StartPos: 3884, - EndPos: 3886, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3889, - EndPos: 3900, - }, - }, - Expr: &ast.ExprInclude{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3889, - EndPos: 3899, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3897, - EndPos: 3899, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 203, - EndLine: 203, - StartPos: 3897, - EndPos: 3899, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3901, - EndPos: 3917, - }, - }, - Expr: &ast.ExprIncludeOnce{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3901, - EndPos: 3916, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3914, - EndPos: 3916, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 204, - EndLine: 204, - StartPos: 3914, - EndPos: 3916, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3918, - EndPos: 3929, - }, - }, - Expr: &ast.ExprRequire{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3918, - EndPos: 3928, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3926, - EndPos: 3928, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 205, - EndLine: 205, - StartPos: 3926, - EndPos: 3928, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3930, - EndPos: 3946, - }, - }, - Expr: &ast.ExprRequireOnce{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3930, - EndPos: 3945, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3943, - EndPos: 3945, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 206, - EndLine: 206, - StartPos: 3943, - EndPos: 3945, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3948, - EndPos: 3966, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3948, - EndPos: 3965, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3948, - EndPos: 3950, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3948, - EndPos: 3950, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3962, - EndPos: 3965, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 208, - EndLine: 208, - StartPos: 3962, - EndPos: 3965, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3967, - EndPos: 3995, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3967, - EndPos: 3994, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3967, - EndPos: 3969, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3967, - EndPos: 3969, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3981, - EndPos: 3994, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 209, - EndLine: 209, - StartPos: 3991, - EndPos: 3994, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 3996, - EndPos: 4015, - }, - }, - Expr: &ast.ExprInstanceOf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 3996, - EndPos: 4014, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 3996, - EndPos: 3998, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 3996, - EndPos: 3998, - }, - }, - Value: []byte("$a"), - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4010, - EndPos: 4014, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 210, - EndLine: 210, - StartPos: 4011, - EndPos: 4014, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4017, - EndPos: 4031, - }, - }, - Expr: &ast.ExprIsset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4017, - EndPos: 4030, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4023, - EndPos: 4025, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4023, - EndPos: 4025, - }, - }, - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4027, - EndPos: 4029, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 212, - EndLine: 212, - StartPos: 4027, - EndPos: 4029, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4032, - EndPos: 4043, - }, - }, - Expr: &ast.ExprIsset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4032, - EndPos: 4042, - }, - }, - Vars: []ast.Vertex{ - &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4038, - EndPos: 4041, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4038, - EndPos: 4041, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 213, - EndLine: 213, - StartPos: 4038, - EndPos: 4041, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4044, - EndPos: 4056, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4044, - EndPos: 4055, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4044, - EndPos: 4050, - }, - }, - Items: []ast.Vertex{}, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4053, - EndPos: 4055, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 214, - EndLine: 214, - StartPos: 4053, - EndPos: 4055, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4057, - EndPos: 4075, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4057, - EndPos: 4074, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4057, - EndPos: 4069, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4062, - EndPos: 4064, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4062, - EndPos: 4064, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4062, - EndPos: 4064, - }, - }, - Value: []byte("$a"), - }, - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4066, - EndPos: 4068, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4066, - EndPos: 4068, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4066, - EndPos: 4068, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4072, - EndPos: 4074, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 215, - EndLine: 215, - StartPos: 4072, - EndPos: 4074, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4076, - EndPos: 4092, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4076, - EndPos: 4091, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4076, - EndPos: 4086, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4081, - EndPos: 4085, - }, - }, - Val: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4081, - EndPos: 4085, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4081, - EndPos: 4083, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4081, - EndPos: 4083, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4089, - EndPos: 4091, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 216, - EndLine: 216, - StartPos: 4089, - EndPos: 4091, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4093, - EndPos: 4113, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4093, - EndPos: 4112, - }, - }, - Var: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4093, - EndPos: 4107, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4098, - EndPos: 4106, - }, - }, - Val: &ast.ExprList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4098, - EndPos: 4106, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4103, - EndPos: 4105, - }, - }, - Val: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4103, - EndPos: 4105, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4103, - EndPos: 4105, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - }, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4110, - EndPos: 4112, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 217, - EndLine: 217, - StartPos: 4110, - EndPos: 4112, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4115, - EndPos: 4125, - }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4115, - EndPos: 4124, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4115, - EndPos: 4117, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4115, - EndPos: 4117, - }, - }, - Value: []byte("$a"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4119, - EndPos: 4122, - }, - }, - Value: []byte("foo"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 219, - EndLine: 219, - StartPos: 4122, - EndPos: 4124, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4126, - EndPos: 4134, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4126, - EndPos: 4133, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4130, - EndPos: 4133, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 220, - EndLine: 220, - StartPos: 4130, - EndPos: 4133, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4135, - EndPos: 4155, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4135, - EndPos: 4154, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4139, - EndPos: 4152, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4149, - EndPos: 4152, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 221, - EndLine: 221, - StartPos: 4152, - EndPos: 4154, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4156, - EndPos: 4167, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4156, - EndPos: 4166, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4160, - EndPos: 4164, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4161, - EndPos: 4164, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 222, - EndLine: 222, - StartPos: 4164, - EndPos: 4166, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4168, - EndPos: 4178, - }, - }, - Expr: &ast.ExprPrint{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4168, - EndPos: 4177, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4174, - EndPos: 4176, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 223, - EndLine: 223, - StartPos: 4174, - EndPos: 4176, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4179, - EndPos: 4187, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4179, - EndPos: 4186, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4179, - EndPos: 4181, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4179, - EndPos: 4181, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 224, - EndLine: 224, - StartPos: 4183, - EndPos: 4186, - }, - }, - Value: []byte("foo"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4188, - EndPos: 4199, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4188, - EndPos: 4197, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4188, - EndPos: 4195, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4188, - EndPos: 4190, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4188, - EndPos: 4190, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4192, - EndPos: 4195, - }, - }, - Value: []byte("foo"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 225, - EndLine: 225, - StartPos: 4196, - EndPos: 4197, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4229, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4227, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4225, - }, - }, - Var: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4219, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4212, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4207, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4202, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4200, - EndPos: 4202, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4204, - EndPos: 4207, - }, - }, - Value: []byte("foo"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4209, - EndPos: 4212, - }, - }, - Value: []byte("bar"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4214, - EndPos: 4217, - }, - }, - Value: []byte("baz"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4217, - EndPos: 4219, - }, - }, - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4221, - EndPos: 4225, - }, - }, - Value: []byte("quux"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 226, - EndLine: 226, - StartPos: 4226, - EndPos: 4227, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4246, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4244, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4241, - }, - }, - Var: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4239, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4232, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4230, - EndPos: 4232, - }, - }, - Value: []byte("$a"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4234, - EndPos: 4237, - }, - }, - Value: []byte("foo"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4237, - EndPos: 4239, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4240, - EndPos: 4241, - }, - }, - Value: []byte("1"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 227, - EndLine: 227, - StartPos: 4243, - EndPos: 4244, - }, - }, - Value: []byte("1"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4247, - EndPos: 4256, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4247, - EndPos: 4255, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4248, - EndPos: 4252, - }, - }, - Value: []byte("cmd "), - }, - &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4252, - EndPos: 4254, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 228, - EndLine: 228, - StartPos: 4252, - EndPos: 4254, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4257, - EndPos: 4263, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4257, - EndPos: 4262, - }, - }, - Parts: []ast.Vertex{ - &ast.ScalarEncapsedStringPart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 229, - EndLine: 229, - StartPos: 4258, - EndPos: 4261, - }, - }, - Value: []byte("cmd"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4264, - EndPos: 4267, - }, - }, - Expr: &ast.ExprShellExec{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 230, - EndLine: 230, - StartPos: 4264, - EndPos: 4266, - }, - }, - Parts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4268, - EndPos: 4271, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 231, - EndLine: 231, - StartPos: 4268, - EndPos: 4270, - }, - }, - Items: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4272, - EndPos: 4276, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4272, - EndPos: 4275, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4273, - EndPos: 4274, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 232, - EndLine: 232, - StartPos: 4273, - EndPos: 4274, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4277, - EndPos: 4290, - }, - }, - Expr: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4277, - EndPos: 4289, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4278, - EndPos: 4282, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4278, - EndPos: 4279, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4281, - EndPos: 4282, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4284, - EndPos: 4287, - }, - }, - Val: &ast.ExprReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4284, - EndPos: 4287, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4285, - EndPos: 4287, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 233, - EndLine: 233, - StartPos: 4285, - EndPos: 4287, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.ExprArrayItem{}, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4292, - EndPos: 4303, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4292, - EndPos: 4302, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4292, - EndPos: 4295, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4292, - EndPos: 4295, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4297, - EndPos: 4300, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 235, - EndLine: 235, - StartPos: 4300, - EndPos: 4302, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4304, - EndPos: 4325, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4304, - EndPos: 4324, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4304, - EndPos: 4317, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4314, - EndPos: 4317, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4319, - EndPos: 4322, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 236, - EndLine: 236, - StartPos: 4322, - EndPos: 4324, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4326, - EndPos: 4338, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4326, - EndPos: 4337, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4326, - EndPos: 4330, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4327, - EndPos: 4330, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4332, - EndPos: 4335, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 237, - EndLine: 237, - StartPos: 4335, - EndPos: 4337, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4339, - EndPos: 4351, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4339, - EndPos: 4350, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4339, - EndPos: 4342, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4339, - EndPos: 4342, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Call: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4344, - EndPos: 4348, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4344, - EndPos: 4348, - }, - }, - Value: []byte("$bar"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 238, - EndLine: 238, - StartPos: 4348, - EndPos: 4350, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4352, - EndPos: 4365, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4352, - EndPos: 4364, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4352, - EndPos: 4356, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4352, - EndPos: 4356, - }, - }, - Value: []byte("$foo"), - }, - }, - Call: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4358, - EndPos: 4362, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4358, - EndPos: 4362, - }, - }, - Value: []byte("$bar"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 239, - EndLine: 239, - StartPos: 4362, - EndPos: 4364, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4366, - EndPos: 4376, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4366, - EndPos: 4375, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4366, - EndPos: 4369, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4366, - EndPos: 4369, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4371, - EndPos: 4375, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 240, - EndLine: 240, - StartPos: 4371, - EndPos: 4375, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4377, - EndPos: 4397, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4377, - EndPos: 4396, - }, - }, - Class: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4377, - EndPos: 4390, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4387, - EndPos: 4390, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4392, - EndPos: 4396, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 241, - EndLine: 241, - StartPos: 4392, - EndPos: 4396, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4398, - EndPos: 4409, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4398, - EndPos: 4408, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4398, - EndPos: 4402, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4399, - EndPos: 4402, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4404, - EndPos: 4408, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 242, - EndLine: 242, - StartPos: 4404, - EndPos: 4408, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4410, - EndPos: 4423, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4410, - EndPos: 4422, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4410, - EndPos: 4412, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4410, - EndPos: 4412, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4415, - EndPos: 4417, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4415, - EndPos: 4417, - }, - }, - Value: []byte("$b"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4420, - EndPos: 4422, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 243, - EndLine: 243, - StartPos: 4420, - EndPos: 4422, - }, - }, - Value: []byte("$c"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4424, - EndPos: 4434, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4424, - EndPos: 4433, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4424, - EndPos: 4426, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4424, - EndPos: 4426, - }, - }, - Value: []byte("$a"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4431, - EndPos: 4433, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 244, - EndLine: 244, - StartPos: 4431, - EndPos: 4433, - }, - }, - Value: []byte("$c"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4435, - EndPos: 4458, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4435, - EndPos: 4457, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4435, - EndPos: 4437, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4435, - EndPos: 4437, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4440, - EndPos: 4452, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4440, - EndPos: 4442, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4440, - EndPos: 4442, - }, - }, - Value: []byte("$b"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4445, - EndPos: 4447, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4445, - EndPos: 4447, - }, - }, - Value: []byte("$c"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4450, - EndPos: 4452, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4450, - EndPos: 4452, - }, - }, - Value: []byte("$d"), - }, - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4455, - EndPos: 4457, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 245, - EndLine: 245, - StartPos: 4455, - EndPos: 4457, - }, - }, - Value: []byte("$e"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4459, - EndPos: 4482, - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4459, - EndPos: 4481, - }, - }, - Condition: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4459, - EndPos: 4471, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4459, - EndPos: 4461, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4459, - EndPos: 4461, - }, - }, - Value: []byte("$a"), - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4464, - EndPos: 4466, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4464, - EndPos: 4466, - }, - }, - Value: []byte("$b"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4469, - EndPos: 4471, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4469, - EndPos: 4471, - }, - }, - Value: []byte("$c"), - }, - }, - }, - IfTrue: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4474, - EndPos: 4476, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4474, - EndPos: 4476, - }, - }, - Value: []byte("$d"), - }, - }, - IfFalse: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4479, - EndPos: 4481, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 246, - EndLine: 246, - StartPos: 4479, - EndPos: 4481, - }, - }, - Value: []byte("$e"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4483, - EndPos: 4487, - }, - }, - Expr: &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4483, - EndPos: 4486, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4484, - EndPos: 4486, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 247, - EndLine: 247, - StartPos: 4484, - EndPos: 4486, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4488, - EndPos: 4492, - }, - }, - Expr: &ast.ExprUnaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4488, - EndPos: 4491, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4489, - EndPos: 4491, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 248, - EndLine: 248, - StartPos: 4489, - EndPos: 4491, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4493, - EndPos: 4497, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4493, - EndPos: 4496, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4494, - EndPos: 4496, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 249, - EndLine: 249, - StartPos: 4494, - EndPos: 4496, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4498, - EndPos: 4503, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4498, - EndPos: 4502, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4499, - EndPos: 4502, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4500, - EndPos: 4502, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 250, - EndLine: 250, - StartPos: 4500, - EndPos: 4502, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4504, - EndPos: 4510, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 251, - EndLine: 251, - StartPos: 4504, - EndPos: 4509, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4511, - EndPos: 4520, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4511, - EndPos: 4519, - }, - }, - Value: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4517, - EndPos: 4519, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 252, - EndLine: 252, - StartPos: 4517, - EndPos: 4519, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4521, - EndPos: 4536, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4521, - EndPos: 4535, - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4527, - EndPos: 4529, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4527, - EndPos: 4529, - }, - }, - Value: []byte("$a"), - }, - }, - Value: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4533, - EndPos: 4535, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 253, - EndLine: 253, - StartPos: 4533, - EndPos: 4535, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4537, - EndPos: 4554, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4537, - EndPos: 4553, - }, - }, - Value: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4543, - EndPos: 4553, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4543, - EndPos: 4546, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4543, - EndPos: 4546, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 254, - EndLine: 254, - StartPos: 4548, - EndPos: 4553, - }, - }, - Value: []byte("class"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4555, - EndPos: 4578, - }, - }, - Expr: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4555, - EndPos: 4577, - }, - }, - Key: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4561, - EndPos: 4563, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4561, - EndPos: 4563, - }, - }, - Value: []byte("$a"), - }, - }, - Value: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4567, - EndPos: 4577, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4567, - EndPos: 4570, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4567, - EndPos: 4570, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 255, - EndLine: 255, - StartPos: 4572, - EndPos: 4577, - }, - }, - Value: []byte("class"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4580, - EndPos: 4590, - }, - }, - Expr: &ast.ExprCastArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4580, - EndPos: 4589, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4587, - EndPos: 4589, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 257, - EndLine: 257, - StartPos: 4587, - EndPos: 4589, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4591, - EndPos: 4603, - }, - }, - Expr: &ast.ExprCastBool{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4591, - EndPos: 4602, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4600, - EndPos: 4602, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 258, - EndLine: 258, - StartPos: 4600, - EndPos: 4602, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4604, - EndPos: 4613, - }, - }, - Expr: &ast.ExprCastBool{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4604, - EndPos: 4612, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4610, - EndPos: 4612, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 259, - EndLine: 259, - StartPos: 4610, - EndPos: 4612, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4614, - EndPos: 4625, - }, - }, - Expr: &ast.ExprCastDouble{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4614, - EndPos: 4624, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4622, - EndPos: 4624, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 260, - EndLine: 260, - StartPos: 4622, - EndPos: 4624, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4626, - EndPos: 4636, - }, - }, - Expr: &ast.ExprCastDouble{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4626, - EndPos: 4635, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4633, - EndPos: 4635, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 261, - EndLine: 261, - StartPos: 4633, - EndPos: 4635, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 4637, - EndPos: 4649, - }, - }, - Expr: &ast.ExprCastInt{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 4637, - EndPos: 4648, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 4646, - EndPos: 4648, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 262, - EndLine: 262, - StartPos: 4646, - EndPos: 4648, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4650, - EndPos: 4658, - }, - }, - Expr: &ast.ExprCastInt{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4650, - EndPos: 4657, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4655, - EndPos: 4657, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 263, - EndLine: 263, - StartPos: 4655, - EndPos: 4657, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4659, - EndPos: 4670, - }, - }, - Expr: &ast.ExprCastObject{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4659, - EndPos: 4669, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4667, - EndPos: 4669, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 264, - EndLine: 264, - StartPos: 4667, - EndPos: 4669, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4671, - EndPos: 4682, - }, - }, - Expr: &ast.ExprCastString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4671, - EndPos: 4681, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4679, - EndPos: 4681, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 265, - EndLine: 265, - StartPos: 4679, - EndPos: 4681, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4683, - EndPos: 4693, - }, - }, - Expr: &ast.ExprCastUnset{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4683, - EndPos: 4692, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4690, - EndPos: 4692, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 266, - EndLine: 266, - StartPos: 4690, - EndPos: 4692, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4695, - EndPos: 4703, - }, - }, - Expr: &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4695, - EndPos: 4702, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4695, - EndPos: 4697, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4695, - EndPos: 4697, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4700, - EndPos: 4702, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 268, - EndLine: 268, - StartPos: 4700, - EndPos: 4702, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4704, - EndPos: 4712, - }, - }, - Expr: &ast.ExprBinaryBitwiseOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4704, - EndPos: 4711, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4704, - EndPos: 4706, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4704, - EndPos: 4706, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4709, - EndPos: 4711, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 269, - EndLine: 269, - StartPos: 4709, - EndPos: 4711, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4713, - EndPos: 4721, - }, - }, - Expr: &ast.ExprBinaryBitwiseXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4713, - EndPos: 4720, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4713, - EndPos: 4715, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4713, - EndPos: 4715, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4718, - EndPos: 4720, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 270, - EndLine: 270, - StartPos: 4718, - EndPos: 4720, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4722, - EndPos: 4731, - }, - }, - Expr: &ast.ExprBinaryBooleanAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4722, - EndPos: 4730, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4722, - EndPos: 4724, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4722, - EndPos: 4724, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4728, - EndPos: 4730, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 271, - EndLine: 271, - StartPos: 4728, - EndPos: 4730, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4732, - EndPos: 4741, - }, - }, - Expr: &ast.ExprBinaryBooleanOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4732, - EndPos: 4740, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4732, - EndPos: 4734, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4732, - EndPos: 4734, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4738, - EndPos: 4740, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 272, - EndLine: 272, - StartPos: 4738, - EndPos: 4740, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4742, - EndPos: 4750, - }, - }, - Expr: &ast.ExprBinaryConcat{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4742, - EndPos: 4749, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4742, - EndPos: 4744, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4742, - EndPos: 4744, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4747, - EndPos: 4749, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 273, - EndLine: 273, - StartPos: 4747, - EndPos: 4749, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4751, - EndPos: 4759, - }, - }, - Expr: &ast.ExprBinaryDiv{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4751, - EndPos: 4758, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4751, - EndPos: 4753, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4751, - EndPos: 4753, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4756, - EndPos: 4758, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 274, - EndLine: 274, - StartPos: 4756, - EndPos: 4758, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4760, - EndPos: 4769, - }, - }, - Expr: &ast.ExprBinaryEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4760, - EndPos: 4768, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4760, - EndPos: 4762, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4760, - EndPos: 4762, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4766, - EndPos: 4768, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 275, - EndLine: 275, - StartPos: 4766, - EndPos: 4768, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4770, - EndPos: 4779, - }, - }, - Expr: &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4770, - EndPos: 4778, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4770, - EndPos: 4772, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4770, - EndPos: 4772, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4776, - EndPos: 4778, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 276, - EndLine: 276, - StartPos: 4776, - EndPos: 4778, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4780, - EndPos: 4788, - }, - }, - Expr: &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4780, - EndPos: 4787, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4780, - EndPos: 4782, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4780, - EndPos: 4782, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4785, - EndPos: 4787, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 277, - EndLine: 277, - StartPos: 4785, - EndPos: 4787, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4789, - EndPos: 4799, - }, - }, - Expr: &ast.ExprBinaryIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4789, - EndPos: 4798, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4789, - EndPos: 4791, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4789, - EndPos: 4791, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4798, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 278, - EndLine: 278, - StartPos: 4796, - EndPos: 4798, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4800, - EndPos: 4810, - }, - }, - Expr: &ast.ExprBinaryLogicalAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4800, - EndPos: 4809, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4800, - EndPos: 4802, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4800, - EndPos: 4802, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4807, - EndPos: 4809, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 279, - EndLine: 279, - StartPos: 4807, - EndPos: 4809, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4811, - EndPos: 4820, - }, - }, - Expr: &ast.ExprBinaryLogicalOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4811, - EndPos: 4819, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4811, - EndPos: 4813, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4811, - EndPos: 4813, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4817, - EndPos: 4819, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 280, - EndLine: 280, - StartPos: 4817, - EndPos: 4819, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4821, - EndPos: 4831, - }, - }, - Expr: &ast.ExprBinaryLogicalXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4821, - EndPos: 4830, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4821, - EndPos: 4823, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4821, - EndPos: 4823, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4828, - EndPos: 4830, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 281, - EndLine: 281, - StartPos: 4828, - EndPos: 4830, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4832, - EndPos: 4840, - }, - }, - Expr: &ast.ExprBinaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4832, - EndPos: 4839, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4832, - EndPos: 4834, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4832, - EndPos: 4834, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4837, - EndPos: 4839, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 282, - EndLine: 282, - StartPos: 4837, - EndPos: 4839, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4841, - EndPos: 4849, - }, - }, - Expr: &ast.ExprBinaryMod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4841, - EndPos: 4848, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4841, - EndPos: 4843, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4841, - EndPos: 4843, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4846, - EndPos: 4848, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 283, - EndLine: 283, - StartPos: 4846, - EndPos: 4848, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4850, - EndPos: 4858, - }, - }, - Expr: &ast.ExprBinaryMul{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4850, - EndPos: 4857, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4850, - EndPos: 4852, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4850, - EndPos: 4852, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4855, - EndPos: 4857, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 284, - EndLine: 284, - StartPos: 4855, - EndPos: 4857, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4859, - EndPos: 4868, - }, - }, - Expr: &ast.ExprBinaryNotEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4859, - EndPos: 4867, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4859, - EndPos: 4861, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4859, - EndPos: 4861, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4865, - EndPos: 4867, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 285, - EndLine: 285, - StartPos: 4865, - EndPos: 4867, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4869, - EndPos: 4879, - }, - }, - Expr: &ast.ExprBinaryNotIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4869, - EndPos: 4878, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4869, - EndPos: 4871, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4869, - EndPos: 4871, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4876, - EndPos: 4878, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 286, - EndLine: 286, - StartPos: 4876, - EndPos: 4878, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4880, - EndPos: 4888, - }, - }, - Expr: &ast.ExprBinaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4880, - EndPos: 4887, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4880, - EndPos: 4882, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4880, - EndPos: 4882, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4887, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 287, - EndLine: 287, - StartPos: 4885, - EndPos: 4887, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4889, - EndPos: 4898, - }, - }, - Expr: &ast.ExprBinaryPow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4889, - EndPos: 4897, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4889, - EndPos: 4891, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4889, - EndPos: 4891, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4897, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 288, - EndLine: 288, - StartPos: 4895, - EndPos: 4897, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4899, - EndPos: 4908, - }, - }, - Expr: &ast.ExprBinaryShiftLeft{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4899, - EndPos: 4907, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4899, - EndPos: 4901, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4899, - EndPos: 4901, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4905, - EndPos: 4907, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 289, - EndLine: 289, - StartPos: 4905, - EndPos: 4907, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4909, - EndPos: 4918, - }, - }, - Expr: &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4909, - EndPos: 4917, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4909, - EndPos: 4911, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4909, - EndPos: 4911, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4917, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 290, - EndLine: 290, - StartPos: 4915, - EndPos: 4917, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4919, - EndPos: 4928, - }, - }, - Expr: &ast.ExprBinarySmallerOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4919, - EndPos: 4927, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4919, - EndPos: 4921, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4919, - EndPos: 4921, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4925, - EndPos: 4927, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 291, - EndLine: 291, - StartPos: 4925, - EndPos: 4927, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4929, - EndPos: 4937, - }, - }, - Expr: &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4929, - EndPos: 4936, - }, - }, - Left: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4929, - EndPos: 4931, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4929, - EndPos: 4931, - }, - }, - Value: []byte("$a"), - }, - }, - Right: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4934, - EndPos: 4936, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 292, - EndLine: 292, - StartPos: 4934, - EndPos: 4936, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4939, - EndPos: 4948, - }, - }, - Expr: &ast.ExprAssignReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4939, - EndPos: 4947, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4939, - EndPos: 4941, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4939, - EndPos: 4941, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4945, - EndPos: 4947, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 294, - EndLine: 294, - StartPos: 4945, - EndPos: 4947, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4949, - EndPos: 4963, - }, - }, - Expr: &ast.ExprAssignReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4949, - EndPos: 4962, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4949, - EndPos: 4951, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4949, - EndPos: 4951, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4955, - EndPos: 4962, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4959, - EndPos: 4962, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 295, - EndLine: 295, - StartPos: 4959, - EndPos: 4962, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4964, - EndPos: 4982, - }, - }, - Expr: &ast.ExprAssignReference{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4964, - EndPos: 4981, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4964, - EndPos: 4966, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4964, - EndPos: 4966, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4970, - EndPos: 4981, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4974, - EndPos: 4977, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4974, - EndPos: 4977, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4977, - EndPos: 4981, - }, - }, - Arguments: []ast.Vertex{ - &ast.Argument{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4978, - EndPos: 4980, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4978, - EndPos: 4980, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 296, - EndLine: 296, - StartPos: 4978, - EndPos: 4980, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4991, - }, - }, - Expr: &ast.ExprAssign{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4990, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4985, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4983, - EndPos: 4985, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4988, - EndPos: 4990, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 297, - EndLine: 297, - StartPos: 4988, - EndPos: 4990, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4992, - EndPos: 5001, - }, - }, - Expr: &ast.ExprAssignBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4992, - EndPos: 5000, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4992, - EndPos: 4994, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4992, - EndPos: 4994, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4998, - EndPos: 5000, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 298, - EndLine: 298, - StartPos: 4998, - EndPos: 5000, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5002, - EndPos: 5011, - }, - }, - Expr: &ast.ExprAssignBitwiseOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5002, - EndPos: 5010, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5002, - EndPos: 5004, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5002, - EndPos: 5004, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5008, - EndPos: 5010, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 299, - EndLine: 299, - StartPos: 5008, - EndPos: 5010, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5021, - }, - }, - Expr: &ast.ExprAssignBitwiseXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5020, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5014, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5012, - EndPos: 5014, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5018, - EndPos: 5020, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 300, - EndLine: 300, - StartPos: 5018, - EndPos: 5020, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5022, - EndPos: 5031, - }, - }, - Expr: &ast.ExprAssignConcat{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5022, - EndPos: 5030, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5022, - EndPos: 5024, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5022, - EndPos: 5024, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5028, - EndPos: 5030, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 301, - EndLine: 301, - StartPos: 5028, - EndPos: 5030, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5032, - EndPos: 5041, - }, - }, - Expr: &ast.ExprAssignDiv{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5032, - EndPos: 5040, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5032, - EndPos: 5034, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5032, - EndPos: 5034, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5038, - EndPos: 5040, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 302, - EndLine: 302, - StartPos: 5038, - EndPos: 5040, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5042, - EndPos: 5051, - }, - }, - Expr: &ast.ExprAssignMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5042, - EndPos: 5050, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5042, - EndPos: 5044, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5042, - EndPos: 5044, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5048, - EndPos: 5050, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 303, - EndLine: 303, - StartPos: 5048, - EndPos: 5050, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5052, - EndPos: 5061, - }, - }, - Expr: &ast.ExprAssignMod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5052, - EndPos: 5060, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5052, - EndPos: 5054, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5052, - EndPos: 5054, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5058, - EndPos: 5060, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 304, - EndLine: 304, - StartPos: 5058, - EndPos: 5060, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5062, - EndPos: 5071, - }, - }, - Expr: &ast.ExprAssignMul{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5062, - EndPos: 5070, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5062, - EndPos: 5064, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5062, - EndPos: 5064, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5068, - EndPos: 5070, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 305, - EndLine: 305, - StartPos: 5068, - EndPos: 5070, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5072, - EndPos: 5081, - }, - }, - Expr: &ast.ExprAssignPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5072, - EndPos: 5080, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5072, - EndPos: 5074, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5072, - EndPos: 5074, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5078, - EndPos: 5080, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 306, - EndLine: 306, - StartPos: 5078, - EndPos: 5080, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5082, - EndPos: 5092, - }, - }, - Expr: &ast.ExprAssignPow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5082, - EndPos: 5091, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5082, - EndPos: 5084, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5082, - EndPos: 5084, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5089, - EndPos: 5091, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 307, - EndLine: 307, - StartPos: 5089, - EndPos: 5091, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5093, - EndPos: 5103, - }, - }, - Expr: &ast.ExprAssignShiftLeft{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5093, - EndPos: 5102, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5093, - EndPos: 5095, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5093, - EndPos: 5095, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5100, - EndPos: 5102, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 308, - EndLine: 308, - StartPos: 5100, - EndPos: 5102, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5104, - EndPos: 5114, - }, - }, - Expr: &ast.ExprAssignShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5104, - EndPos: 5113, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5104, - EndPos: 5106, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5104, - EndPos: 5106, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5111, - EndPos: 5113, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 309, - EndLine: 309, - StartPos: 5111, - EndPos: 5113, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5118, - EndPos: 5130, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5118, - EndPos: 5128, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5122, - EndPos: 5126, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5123, - EndPos: 5126, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 312, - EndLine: 312, - StartPos: 5126, - EndPos: 5128, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5152, - EndPos: 5156, - }, - }, - Expr: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5152, - EndPos: 5155, - }, - }, - Var: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5148, - EndPos: 5150, - }, - }, - Var: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5132, - EndPos: 5142, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5136, - EndPos: 5140, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5137, - EndPos: 5140, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5140, - EndPos: 5142, - }, - }, - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5145, - EndPos: 5148, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5148, - EndPos: 5150, - }, - }, - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 313, - EndLine: 313, - StartPos: 5152, - EndPos: 5155, - }, - }, - Value: []byte("baz"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5173, - EndPos: 5176, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5173, - EndPos: 5174, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5170, - EndPos: 5171, - }, - }, - Var: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5158, - EndPos: 5168, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5162, - EndPos: 5166, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5163, - EndPos: 5166, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5166, - EndPos: 5168, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5170, - EndPos: 5171, - }, - }, - Value: []byte("0"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 314, - EndLine: 314, - StartPos: 5173, - EndPos: 5174, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5197, - EndPos: 5200, - }, - }, - Expr: &ast.ExprMethodCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5197, - EndPos: 5199, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5190, - EndPos: 5191, - }, - }, - Var: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5178, - EndPos: 5188, - }, - }, - Class: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5182, - EndPos: 5186, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5183, - EndPos: 5186, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5186, - EndPos: 5188, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5190, - EndPos: 5191, - }, - }, - Value: []byte("0"), - }, - }, - Method: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5194, - EndPos: 5197, - }, - }, - Value: []byte("bar"), - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 315, - EndLine: 315, - StartPos: 5197, - EndPos: 5199, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5202, - EndPos: 5219, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5202, - EndPos: 5218, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5202, - EndPos: 5215, - }, - }, - Var: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5202, - EndPos: 5212, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5208, - EndPos: 5211, - }, - }, - Val: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5208, - EndPos: 5211, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5209, - EndPos: 5210, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5209, - EndPos: 5210, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5213, - EndPos: 5214, - }, - }, - Value: []byte("0"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 317, - EndLine: 317, - StartPos: 5216, - EndPos: 5217, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5220, - EndPos: 5229, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5220, - EndPos: 5228, - }, - }, - Var: &ast.ScalarString{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5220, - EndPos: 5225, - }, - }, - Value: []byte("\"foo\""), - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 318, - EndLine: 318, - StartPos: 5226, - EndPos: 5227, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5230, - EndPos: 5237, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5230, - EndPos: 5236, - }, - }, - Var: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5230, - EndPos: 5233, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5230, - EndPos: 5233, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5230, - EndPos: 5233, - }, - }, - Value: []byte("foo"), - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 319, - EndLine: 319, - StartPos: 5234, - EndPos: 5235, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5238, - EndPos: 5250, - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5238, - EndPos: 5249, - }, - }, - Class: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5238, - EndPos: 5244, - }, - }, - Value: []byte("static"), - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 320, - EndLine: 320, - StartPos: 5246, - EndPos: 5249, - }, - }, - Value: []byte("foo"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5252, - EndPos: 5261, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5252, - EndPos: 5260, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5256, - EndPos: 5260, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 322, - EndLine: 322, - StartPos: 5256, - EndPos: 5260, - }, - }, - Value: []byte("$foo"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5262, - EndPos: 5277, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5262, - EndPos: 5276, - }, - }, - Class: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5266, - EndPos: 5276, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5266, - EndPos: 5270, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5266, - EndPos: 5270, - }, - }, - Value: []byte("$foo"), - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5272, - EndPos: 5276, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 323, - EndLine: 323, - StartPos: 5272, - EndPos: 5276, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5278, - EndPos: 5291, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5278, - EndPos: 5289, - }, - }, - Class: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5288, - EndPos: 5289, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5286, - EndPos: 5289, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5282, - EndPos: 5287, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5282, - EndPos: 5284, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5286, - EndPos: 5287, - }, - }, - Value: []byte("b"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 324, - EndLine: 324, - StartPos: 5288, - EndPos: 5289, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5292, - EndPos: 5324, - }, - }, - Expr: &ast.ExprNew{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5292, - EndPos: 5322, - }, - }, - Class: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5321, - EndPos: 5322, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5319, - EndPos: 5322, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5315, - EndPos: 5320, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5302, - EndPos: 5317, - }, - }, - Var: &ast.ExprPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5300, - EndPos: 5312, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5296, - EndPos: 5301, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5296, - EndPos: 5298, - }, - }, - Value: []byte("$a"), - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5300, - EndPos: 5301, - }, - }, - Value: []byte("b"), - }, - }, - Dim: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5302, - EndPos: 5312, - }, - }, - Condition: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5302, - EndPos: 5304, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5302, - EndPos: 5304, - }, - }, - Value: []byte("$b"), - }, - }, - IfFalse: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5308, - EndPos: 5312, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5308, - EndPos: 5312, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5308, - EndPos: 5312, - }, - }, - Value: []byte("null"), - }, - }, - }, - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5315, - EndPos: 5317, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5315, - EndPos: 5317, - }, - }, - Value: []byte("$c"), - }, - }, - }, - Property: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5319, - EndPos: 5320, - }, - }, - Value: []byte("d"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5321, - EndPos: 5322, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5324, - EndPos: 5343, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5331, - EndPos: 5342, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5331, - EndPos: 5333, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5331, - EndPos: 5333, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5336, - EndPos: 5342, - }, - }, - Var: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5336, - EndPos: 5339, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5337, - EndPos: 5338, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5337, - EndPos: 5338, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 325, - EndLine: 325, - StartPos: 5340, - EndPos: 5341, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5345, - EndPos: 5360, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5352, - EndPos: 5359, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5352, - EndPos: 5354, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5352, - EndPos: 5354, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBooleanNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5357, - EndPos: 5359, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 327, - EndLine: 327, - StartPos: 5358, - EndPos: 5359, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5361, - EndPos: 5376, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5368, - EndPos: 5375, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5368, - EndPos: 5370, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5368, - EndPos: 5370, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBitwiseNot{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5373, - EndPos: 5375, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 328, - EndLine: 328, - StartPos: 5374, - EndPos: 5375, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5377, - EndPos: 5392, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5384, - EndPos: 5391, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5384, - EndPos: 5386, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5384, - EndPos: 5386, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprUnaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5389, - EndPos: 5391, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 329, - EndLine: 329, - StartPos: 5390, - EndPos: 5391, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5393, - EndPos: 5408, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5400, - EndPos: 5407, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5400, - EndPos: 5402, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5400, - EndPos: 5402, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprUnaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5405, - EndPos: 5407, - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 330, - EndLine: 330, - StartPos: 5406, - EndPos: 5407, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5409, - EndPos: 5425, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5416, - EndPos: 5423, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5416, - EndPos: 5418, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5416, - EndPos: 5418, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 331, - EndLine: 331, - StartPos: 5422, - EndPos: 5423, - }, - }, - Value: []byte("1"), - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5426, - EndPos: 5445, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5433, - EndPos: 5444, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5433, - EndPos: 5435, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5433, - EndPos: 5435, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5438, - EndPos: 5444, - }, - }, - Condition: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5438, - EndPos: 5439, - }, - }, - Value: []byte("1"), - }, - IfFalse: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 332, - EndLine: 332, - StartPos: 5443, - EndPos: 5444, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5446, - EndPos: 5468, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5453, - EndPos: 5467, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5453, - EndPos: 5455, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5453, - EndPos: 5455, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprTernary{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5458, - EndPos: 5467, - }, - }, - Condition: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5458, - EndPos: 5459, - }, - }, - Value: []byte("1"), - }, - IfTrue: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5462, - EndPos: 5463, - }, - }, - Value: []byte("2"), - }, - IfFalse: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 333, - EndLine: 333, - StartPos: 5466, - EndPos: 5467, - }, - }, - Value: []byte("3"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5469, - EndPos: 5487, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5476, - EndPos: 5486, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5476, - EndPos: 5478, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5476, - EndPos: 5478, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryBitwiseAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5481, - EndPos: 5486, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5481, - EndPos: 5482, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 334, - EndLine: 334, - StartPos: 5485, - EndPos: 5486, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5488, - EndPos: 5506, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5495, - EndPos: 5505, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5495, - EndPos: 5497, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5495, - EndPos: 5497, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryBitwiseOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5500, - EndPos: 5505, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5500, - EndPos: 5501, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 335, - EndLine: 335, - StartPos: 5504, - EndPos: 5505, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5507, - EndPos: 5525, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5514, - EndPos: 5524, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5514, - EndPos: 5516, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5514, - EndPos: 5516, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryBitwiseXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5519, - EndPos: 5524, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5519, - EndPos: 5520, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 336, - EndLine: 336, - StartPos: 5523, - EndPos: 5524, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5526, - EndPos: 5545, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5533, - EndPos: 5544, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5533, - EndPos: 5535, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5533, - EndPos: 5535, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryBooleanAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5538, - EndPos: 5544, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5538, - EndPos: 5539, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 337, - EndLine: 337, - StartPos: 5543, - EndPos: 5544, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5546, - EndPos: 5565, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5553, - EndPos: 5564, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5553, - EndPos: 5555, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5553, - EndPos: 5555, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryBooleanOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5558, - EndPos: 5564, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5558, - EndPos: 5559, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 338, - EndLine: 338, - StartPos: 5563, - EndPos: 5564, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5566, - EndPos: 5584, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5573, - EndPos: 5583, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5573, - EndPos: 5575, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5573, - EndPos: 5575, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryConcat{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5578, - EndPos: 5583, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5578, - EndPos: 5579, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 339, - EndLine: 339, - StartPos: 5582, - EndPos: 5583, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5585, - EndPos: 5603, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5592, - EndPos: 5602, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5592, - EndPos: 5594, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5592, - EndPos: 5594, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryDiv{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5597, - EndPos: 5602, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5597, - EndPos: 5598, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 340, - EndLine: 340, - StartPos: 5601, - EndPos: 5602, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5604, - EndPos: 5623, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5611, - EndPos: 5622, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5611, - EndPos: 5613, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5611, - EndPos: 5613, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5616, - EndPos: 5622, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5616, - EndPos: 5617, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 341, - EndLine: 341, - StartPos: 5621, - EndPos: 5622, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5624, - EndPos: 5643, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5631, - EndPos: 5642, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5631, - EndPos: 5633, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5631, - EndPos: 5633, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryGreaterOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5636, - EndPos: 5642, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5636, - EndPos: 5637, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 342, - EndLine: 342, - StartPos: 5641, - EndPos: 5642, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5644, - EndPos: 5662, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5651, - EndPos: 5661, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5651, - EndPos: 5653, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5651, - EndPos: 5653, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryGreater{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5656, - EndPos: 5661, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5656, - EndPos: 5657, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 343, - EndLine: 343, - StartPos: 5660, - EndPos: 5661, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5663, - EndPos: 5683, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5670, - EndPos: 5682, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5670, - EndPos: 5672, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5670, - EndPos: 5672, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5675, - EndPos: 5682, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5675, - EndPos: 5676, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 344, - EndLine: 344, - StartPos: 5681, - EndPos: 5682, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5684, - EndPos: 5704, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5691, - EndPos: 5703, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5691, - EndPos: 5693, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5691, - EndPos: 5693, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryLogicalAnd{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5696, - EndPos: 5703, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5696, - EndPos: 5697, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 345, - EndLine: 345, - StartPos: 5702, - EndPos: 5703, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5705, - EndPos: 5724, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5712, - EndPos: 5723, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5712, - EndPos: 5714, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5712, - EndPos: 5714, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryLogicalOr{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5717, - EndPos: 5723, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5717, - EndPos: 5718, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 346, - EndLine: 346, - StartPos: 5722, - EndPos: 5723, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5725, - EndPos: 5745, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5732, - EndPos: 5744, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5732, - EndPos: 5734, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5732, - EndPos: 5734, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryLogicalXor{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5737, - EndPos: 5744, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5737, - EndPos: 5738, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 347, - EndLine: 347, - StartPos: 5743, - EndPos: 5744, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5746, - EndPos: 5764, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5753, - EndPos: 5763, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5753, - EndPos: 5755, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5753, - EndPos: 5755, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryMinus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5758, - EndPos: 5763, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5758, - EndPos: 5759, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 348, - EndLine: 348, - StartPos: 5762, - EndPos: 5763, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5765, - EndPos: 5783, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5772, - EndPos: 5782, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5772, - EndPos: 5774, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5772, - EndPos: 5774, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryMod{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5777, - EndPos: 5782, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5777, - EndPos: 5778, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 349, - EndLine: 349, - StartPos: 5781, - EndPos: 5782, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5784, - EndPos: 5802, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5791, - EndPos: 5801, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5791, - EndPos: 5793, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5791, - EndPos: 5793, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryMul{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5796, - EndPos: 5801, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5796, - EndPos: 5797, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 350, - EndLine: 350, - StartPos: 5800, - EndPos: 5801, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5803, - EndPos: 5822, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5810, - EndPos: 5821, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5810, - EndPos: 5812, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5810, - EndPos: 5812, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryNotEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5815, - EndPos: 5821, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5815, - EndPos: 5816, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 351, - EndLine: 351, - StartPos: 5820, - EndPos: 5821, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5823, - EndPos: 5843, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5830, - EndPos: 5842, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5830, - EndPos: 5832, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5830, - EndPos: 5832, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryNotIdentical{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5835, - EndPos: 5842, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5835, - EndPos: 5836, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 352, - EndLine: 352, - StartPos: 5841, - EndPos: 5842, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5844, - EndPos: 5862, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5851, - EndPos: 5861, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5851, - EndPos: 5853, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5851, - EndPos: 5853, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryPlus{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5856, - EndPos: 5861, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5856, - EndPos: 5857, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 353, - EndLine: 353, - StartPos: 5860, - EndPos: 5861, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5863, - EndPos: 5882, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5870, - EndPos: 5881, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5870, - EndPos: 5872, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5870, - EndPos: 5872, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryPow{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5875, - EndPos: 5881, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5875, - EndPos: 5876, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 354, - EndLine: 354, - StartPos: 5880, - EndPos: 5881, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5883, - EndPos: 5902, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5890, - EndPos: 5901, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5890, - EndPos: 5892, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5890, - EndPos: 5892, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryShiftLeft{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5895, - EndPos: 5901, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5895, - EndPos: 5896, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 355, - EndLine: 355, - StartPos: 5900, - EndPos: 5901, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5903, - EndPos: 5922, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5910, - EndPos: 5921, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5910, - EndPos: 5912, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5910, - EndPos: 5912, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinaryShiftRight{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5915, - EndPos: 5921, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5915, - EndPos: 5916, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 356, - EndLine: 356, - StartPos: 5920, - EndPos: 5921, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5923, - EndPos: 5942, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5930, - EndPos: 5941, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5930, - EndPos: 5932, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5930, - EndPos: 5932, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinarySmallerOrEqual{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5935, - EndPos: 5941, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5935, - EndPos: 5936, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 357, - EndLine: 357, - StartPos: 5940, - EndPos: 5941, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5943, - EndPos: 5961, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5950, - EndPos: 5960, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5950, - EndPos: 5952, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5950, - EndPos: 5952, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprBinarySmaller{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5955, - EndPos: 5960, - }, - }, - Left: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5955, - EndPos: 5956, - }, - }, - Value: []byte("1"), - }, - Right: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 358, - EndLine: 358, - StartPos: 5959, - EndPos: 5960, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5962, - EndPos: 5983, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5969, - EndPos: 5982, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5969, - EndPos: 5971, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5969, - EndPos: 5971, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5974, - EndPos: 5982, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5974, - EndPos: 5977, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5974, - EndPos: 5977, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 359, - EndLine: 359, - StartPos: 5979, - EndPos: 5982, - }, - }, - Value: []byte("bar"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5984, - EndPos: 6007, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5991, - EndPos: 6006, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5991, - EndPos: 5993, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5991, - EndPos: 5993, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5996, - EndPos: 6006, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5996, - EndPos: 5999, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 5996, - EndPos: 5999, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 360, - EndLine: 360, - StartPos: 6001, - EndPos: 6006, - }, - }, - Value: []byte("class"), - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6008, - EndPos: 6030, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6015, - EndPos: 6029, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6015, - EndPos: 6017, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6015, - EndPos: 6017, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ScalarMagicConstant{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 361, - EndLine: 361, - StartPos: 6020, - EndPos: 6029, - }, - }, - Value: []byte("__CLASS__"), - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6031, - EndPos: 6047, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6038, - EndPos: 6046, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6038, - EndPos: 6040, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6038, - EndPos: 6040, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6043, - EndPos: 6046, - }, - }, - Const: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6043, - EndPos: 6046, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 362, - EndLine: 362, - StartPos: 6043, - EndPos: 6046, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6048, - EndPos: 6074, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6055, - EndPos: 6073, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6055, - EndPos: 6057, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6055, - EndPos: 6057, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6060, - EndPos: 6073, - }, - }, - Const: &ast.NameRelative{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6060, - EndPos: 6073, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 363, - EndLine: 363, - StartPos: 6070, - EndPos: 6073, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6075, - EndPos: 6092, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6082, - EndPos: 6091, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6082, - EndPos: 6084, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6082, - EndPos: 6084, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6087, - EndPos: 6091, - }, - }, - Const: &ast.NameFullyQualified{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6087, - EndPos: 6091, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 364, - EndLine: 364, - StartPos: 6088, - EndPos: 6091, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6093, - EndPos: 6113, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6100, - EndPos: 6112, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6100, - EndPos: 6102, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6100, - EndPos: 6102, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 365, - EndLine: 365, - StartPos: 6105, - EndPos: 6112, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6114, - EndPos: 6143, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6121, - EndPos: 6142, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6121, - EndPos: 6123, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6121, - EndPos: 6123, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6126, - EndPos: 6142, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6132, - EndPos: 6138, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6132, - EndPos: 6133, - }, - }, - Value: []byte("1"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6137, - EndPos: 6138, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6140, - EndPos: 6141, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 366, - EndLine: 366, - StartPos: 6140, - EndPos: 6141, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - }, - }, - }, - &ast.StmtStatic{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6144, - EndPos: 6171, - }, - }, - Vars: []ast.Vertex{ - &ast.StmtStaticVar{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6151, - EndPos: 6170, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6151, - EndPos: 6153, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6151, - EndPos: 6153, - }, - }, - Value: []byte("$a"), - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6156, - EndPos: 6170, - }, - }, - Var: &ast.ExprShortArray{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6156, - EndPos: 6167, - }, - }, - Items: []ast.Vertex{ - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6157, - EndPos: 6158, - }, - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6157, - EndPos: 6158, - }, - }, - Value: []byte("1"), - }, - }, - &ast.ExprArrayItem{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6160, - EndPos: 6166, - }, - }, - Key: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6160, - EndPos: 6161, - }, - }, - Value: []byte("2"), - }, - Val: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6165, - EndPos: 6166, - }, - }, - Value: []byte("2"), - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 367, - EndLine: 367, - StartPos: 6168, - EndPos: 6169, - }, - }, - Value: []byte("0"), - }, - }, - }, - }, - }, - &ast.StmtIf{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6173, - EndPos: 6188, - }, - }, - Cond: &ast.ExprYield{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6177, - EndPos: 6184, - }, - }, - Value: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6183, - EndPos: 6184, - }, - }, - Value: []byte("1"), - }, - }, - Stmt: &ast.StmtStmtList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 369, - EndLine: 369, - StartPos: 6186, - EndPos: 6188, - }, - }, - Stmts: []ast.Vertex{}, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6189, - EndPos: 6200, - }, - }, - Expr: &ast.ExprStaticPropertyFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6189, - EndPos: 6199, - }, - }, - Class: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6189, - EndPos: 6192, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6189, - EndPos: 6192, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Property: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6194, - EndPos: 6199, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6195, - EndPos: 6199, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 370, - EndLine: 370, - StartPos: 6195, - EndPos: 6199, - }, - }, - Value: []byte("$bar"), - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6202, - EndPos: 6209, - }, - }, - Expr: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6202, - EndPos: 6208, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6202, - EndPos: 6206, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6202, - EndPos: 6206, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 372, - EndLine: 372, - StartPos: 6206, - EndPos: 6208, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6223, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6222, - }, - }, - Var: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6219, - }, - }, - Var: &ast.ExprFunctionCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6216, - }, - }, - Function: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6214, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6210, - EndPos: 6214, - }, - }, - Value: []byte("$foo"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6214, - EndPos: 6216, - }, - }, - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6217, - EndPos: 6218, - }, - }, - Value: []byte("0"), - }, - }, - Dim: &ast.ScalarLnumber{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 373, - EndLine: 373, - StartPos: 6220, - EndPos: 6221, - }, - }, - Value: []byte("0"), - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6224, - EndPos: 6231, - }, - }, - Expr: &ast.ExprArrayDimFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6224, - EndPos: 6230, - }, - }, - Var: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6224, - EndPos: 6226, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6224, - EndPos: 6226, - }, - }, - Value: []byte("$a"), - }, - }, - Dim: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6227, - EndPos: 6229, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 374, - EndLine: 374, - StartPos: 6227, - EndPos: 6229, - }, - }, - Value: []byte("$b"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6232, - EndPos: 6238, - }, - }, - Expr: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6232, - EndPos: 6237, - }, - }, - VarName: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6234, - EndPos: 6236, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 375, - EndLine: 375, - StartPos: 6234, - EndPos: 6236, - }, - }, - Value: []byte("$a"), - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6239, - EndPos: 6254, - }, - }, - Expr: &ast.ExprStaticCall{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6239, - EndPos: 6253, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6239, - EndPos: 6243, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6239, - EndPos: 6243, - }, - }, - Value: []byte("$foo"), - }, - }, - Call: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6245, - EndPos: 6251, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6246, - EndPos: 6250, - }, - }, - Value: []byte("$bar"), - }, - }, - ArgumentList: &ast.ArgumentList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 376, - EndLine: 376, - StartPos: 6251, - EndPos: 6253, - }, - }, - }, - }, - }, - &ast.StmtExpression{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6255, - EndPos: 6265, - }, - }, - Expr: &ast.ExprClassConstFetch{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6255, - EndPos: 6264, - }, - }, - Class: &ast.ExprVariable{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6255, - EndPos: 6259, - }, - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6255, - EndPos: 6259, - }, - }, - Value: []byte("$foo"), - }, - }, - ConstantName: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 377, - EndLine: 377, - StartPos: 6261, - EndPos: 6264, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.StmtHaltCompiler{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 379, - EndLine: 379, - StartPos: 6267, - EndPos: 6285, - }, - }, - }, - }, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) - traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) - assert.DeepEqual(t, expected, actual) -} - -func TestPhp5Strings(t *testing.T) { - src := ` Date: Sun, 20 Dec 2020 14:34:09 +0200 Subject: [PATCH 117/140] refactoring: update position builder tests --- internal/position/position_test.go | 36 +++++----- pkg/ast/ast_test.go | 102 ----------------------------- 2 files changed, 18 insertions(+), 120 deletions(-) delete mode 100644 pkg/ast/ast_test.go diff --git a/internal/position/position_test.go b/internal/position/position_test.go index fcd2681..4609179 100644 --- a/internal/position/position_test.go +++ b/internal/position/position_test.go @@ -21,7 +21,7 @@ func TestNewTokenPosition(t *testing.T) { }, } - pos := builder.NewTokenPosition(tkn) + pos := builder.NewBuilder().NewTokenPosition(tkn) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 1, EndPos: 3}, pos) } @@ -46,7 +46,7 @@ func TestNewTokensPosition(t *testing.T) { }, } - pos := builder.NewTokensPosition(token1, token2) + pos := builder.NewBuilder().NewTokensPosition(token1, token2) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 6}, pos) } @@ -61,7 +61,7 @@ func TestNewNodePosition(t *testing.T) { }, } - pos := builder.NewNodePosition(n) + pos := builder.NewBuilder().NewNodePosition(n) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 1, EndPos: 3}, pos) } @@ -85,7 +85,7 @@ func TestNewTokenNodePosition(t *testing.T) { }, } - pos := builder.NewTokenNodePosition(tkn, n) + pos := builder.NewBuilder().NewTokenNodePosition(tkn, n) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 12}, pos) } @@ -110,7 +110,7 @@ func TestNewNodeTokenPosition(t *testing.T) { }, } - pos := builder.NewNodeTokenPosition(n, tkn) + pos := builder.NewBuilder().NewNodeTokenPosition(n, tkn) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 12}, pos) } @@ -134,7 +134,7 @@ func TestNewNodeListPosition(t *testing.T) { }, } - pos := builder.NewNodeListPosition([]ast.Vertex{n1, n2}) + pos := builder.NewBuilder().NewNodeListPosition([]ast.Vertex{n1, n2}) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 19}, pos) } @@ -158,7 +158,7 @@ func TestNewNodesPosition(t *testing.T) { }, } - pos := builder.NewNodesPosition(n1, n2) + pos := builder.NewBuilder().NewNodesPosition(n1, n2) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 19}, pos) } @@ -192,7 +192,7 @@ func TestNewNodeListTokenPosition(t *testing.T) { }, } - pos := builder.NewNodeListTokenPosition([]ast.Vertex{n1, n2}, tkn) + pos := builder.NewBuilder().NewNodeListTokenPosition([]ast.Vertex{n1, n2}, tkn) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 22}, pos) } @@ -226,7 +226,7 @@ func TestNewTokenNodeListPosition(t *testing.T) { }, } - pos := builder.NewTokenNodeListPosition(tkn, []ast.Vertex{n1, n2}) + pos := builder.NewBuilder().NewTokenNodeListPosition(tkn, []ast.Vertex{n1, n2}) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 20}, pos) } @@ -259,7 +259,7 @@ func TestNewNodeNodeListPosition(t *testing.T) { }, } - pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{n2, n3}) + pos := builder.NewBuilder().NewNodeNodeListPosition(n1, []ast.Vertex{n2, n3}) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 26}, pos) } @@ -290,7 +290,7 @@ func TestNewNodeListNodePosition(t *testing.T) { }, } - pos := builder.NewNodeListNodePosition([]ast.Vertex{n1, n2}, n3) + pos := builder.NewBuilder().NewNodeListNodePosition([]ast.Vertex{n1, n2}, n3) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 3, EndPos: 26}, pos) } @@ -315,7 +315,7 @@ func TestNewOptionalListTokensPosition(t *testing.T) { }, } - pos := builder.NewOptionalListTokensPosition(nil, token1, token2) + pos := builder.NewBuilder().NewOptionalListTokensPosition(nil, token1, token2) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: 2, EndPos: 6}, pos) } @@ -357,13 +357,13 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { }, } - pos := builder.NewOptionalListTokensPosition([]ast.Vertex{n2, n3}, token1, token2) + pos := builder.NewBuilder().NewOptionalListTokensPosition([]ast.Vertex{n2, n3}, token1, token2) assert.DeepEqual(t, &position.Position{StartLine: 2, EndLine: 5, StartPos: 9, EndPos: 32}, pos) } func TestNilNodePos(t *testing.T) { - pos := builder.NewNodesPosition(nil, nil) + pos := builder.NewBuilder().NewNodesPosition(nil, nil) assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: -1, StartPos: -1, EndPos: -1}, pos) } @@ -378,7 +378,7 @@ func TestNilNodeListPos(t *testing.T) { }, } - pos := builder.NewNodeNodeListPosition(n1, nil) + pos := builder.NewBuilder().NewNodeNodeListPosition(n1, nil) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: -1, EndPos: -1}, pos) } @@ -394,7 +394,7 @@ func TestNilNodeListTokenPos(t *testing.T) { }, } - pos := builder.NewNodeListTokenPosition(nil, tkn) + pos := builder.NewBuilder().NewNodeListTokenPosition(nil, tkn) assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: 1, StartPos: -1, EndPos: 3}, pos) } @@ -409,7 +409,7 @@ func TestEmptyNodeListPos(t *testing.T) { }, } - pos := builder.NewNodeNodeListPosition(n1, []ast.Vertex{}) + pos := builder.NewBuilder().NewNodeNodeListPosition(n1, []ast.Vertex{}) assert.DeepEqual(t, &position.Position{StartLine: 1, EndLine: -1, EndPos: -1}, pos) } @@ -425,7 +425,7 @@ func TestEmptyNodeListTokenPos(t *testing.T) { }, } - pos := builder.NewNodeListTokenPosition([]ast.Vertex{}, tkn) + pos := builder.NewBuilder().NewNodeListTokenPosition([]ast.Vertex{}, tkn) assert.DeepEqual(t, &position.Position{StartLine: -1, EndLine: 1, StartPos: -1, EndPos: 3}, pos) } diff --git a/pkg/ast/ast_test.go b/pkg/ast/ast_test.go deleted file mode 100644 index 923106a..0000000 --- a/pkg/ast/ast_test.go +++ /dev/null @@ -1,102 +0,0 @@ -package ast_test - -import ( - "fmt" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" - "os" - "strings" -) - -func ExampleStxTree() { - stxTree := &ast.Root{ - Stmts: []ast.Vertex{ - &ast.Nullable{ - Expr: &ast.Parameter{ - Type: nil, - Var: nil, - DefaultValue: nil, - }, - }, - &ast.Identifier{}, - &ast.ArgumentList{ - Arguments: []ast.Vertex{ - &ast.Argument{}, - &ast.Argument{ - Expr: &ast.ScalarDnumber{}, - }, - }, - }, - }, - } - - traverser.NewDFS(&testVisitor{}).Traverse(stxTree) - - //output: - //=> *ast.Root - //=> Stmts: - //=> *ast.Nullable - //=> Expr: - //=> *ast.Parameter - //=> *ast.Identifier - //=> *ast.ArgumentList - //=> Arguments: - //=> *ast.Argument - //=> *ast.Argument - //=> Expr: - //=> *ast.ScalarDnumber -} - -type testVisitor struct { - visitor.Null - depth int -} - -func (v *testVisitor) Enter(key string, _ bool) { - v.depth++ - fmt.Fprint(os.Stdout, "=>", strings.Repeat(" ", v.depth), key, ":\n") -} - -func (v *testVisitor) Leave(key string, _ bool) { - v.depth-- -} - -func (v *testVisitor) EnterNode(n ast.Vertex) bool { - v.depth++ - n.Accept(v) - - return true -} - -func (v *testVisitor) LeaveNode(_ ast.Vertex) { - v.depth-- -} - -func (v *testVisitor) Root(_ *ast.Root) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Root") -} - -func (v *testVisitor) Nullable(_ *ast.Nullable) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Nullable") -} - -func (v *testVisitor) Parameter(_ *ast.Parameter) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Parameter") -} - -func (v *testVisitor) Identifier(_ *ast.Identifier) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Identifier") -} - -func (v *testVisitor) ArgumentList(_ *ast.ArgumentList) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ArgumentList") -} - -func (v *testVisitor) Argument(_ *ast.Argument) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.Argument") -} - -func (v *testVisitor) ScalarDnumber(_ *ast.ScalarDnumber) { - fmt.Fprintln(os.Stdout, "=>", strings.Repeat(" ", v.depth-1), "*ast.ScalarDnumber") -} From eda7ae1c87036852f6186b99bd13c3a9d5730c25 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 20 Dec 2020 14:39:37 +0200 Subject: [PATCH 118/140] refactoring: update scanner tests --- internal/scanner/scanner_test.go | 57 +++++++++++--------------------- 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index c49b785..04888c4 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -386,8 +386,7 @@ func TestShebang(t *testing.T) { tkn := lexer.Lex() assert.Equal(t, tkn.ID, token.T_DNUMBER) - l := len(tkn.FreeFloating) - for _, tt := range tkn.FreeFloating[:l-1] { + for _, tt := range tkn.FreeFloating { actual = append(actual, string(tt.Value)) } @@ -1137,8 +1136,7 @@ func TestCommentEnd(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1169,8 +1167,7 @@ func TestCommentNewLine(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1201,8 +1198,7 @@ func TestCommentNewLine1(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1233,8 +1229,7 @@ func TestCommentNewLine2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1266,8 +1261,7 @@ func TestCommentWithPhpEndTag(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1299,8 +1293,7 @@ func TestInlineComment(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1332,8 +1325,7 @@ func TestInlineComment2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1369,8 +1361,7 @@ func TestEmptyInlineComment(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1402,8 +1393,7 @@ func TestEmptyInlineComment2(t *testing.T) { tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1428,8 +1418,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1442,8 +1431,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1456,8 +1444,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1470,8 +1457,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1484,8 +1470,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1498,8 +1483,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1512,8 +1496,7 @@ func TestMethodCallTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1537,8 +1520,7 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn := lexer.Lex() - l := len(tkn.FreeFloating) - actual := tkn.FreeFloating[:l-1] + actual := tkn.FreeFloating for _, v := range actual { v.Position = nil } @@ -1551,8 +1533,7 @@ func TestYieldFromTokens(t *testing.T) { }, } tkn = lexer.Lex() - l = len(tkn.FreeFloating) - actual = tkn.FreeFloating[:l-1] + actual = tkn.FreeFloating for _, v := range actual { v.Position = nil } From 74b094925550f6ff6b5a007e60be545a40ae1c72 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 20 Dec 2020 22:11:16 +0200 Subject: [PATCH 119/140] refactoring: test variable formatter --- pkg/ast/visitor/formatter_test.go | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index c6f493f..d4b2c0a 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -4855,6 +4855,54 @@ func TestFormatter_ExprUnaryPlus(t *testing.T) { } } +func TestFormatter_ExprVariable(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprVariable_Variable(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprVariable{ + VarName: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestFormatter_ExprYield(t *testing.T) { o := bytes.NewBufferString("") From 03c7979ccd26eeb0d52ce92cad2ec44293a2a9fb Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 20 Dec 2020 23:04:23 +0200 Subject: [PATCH 120/140] refactoring: remove StmtTraitAdaptationList node --- internal/php5/parser_test.go | 1138 ++++++++++---------- internal/php5/php5.go | Bin 264652 -> 264939 bytes internal/php5/php5.y | 16 +- internal/php7/parser_test.go | 1138 ++++++++++---------- internal/php7/php7.go | Bin 219246 -> 219529 bytes internal/php7/php7.y | 18 +- pkg/ast/ast.go | 1 - pkg/ast/node.go | 45 +- pkg/ast/traverser/dfs.go | 22 +- pkg/ast/visitor/dumper.go | 18 +- pkg/ast/visitor/formatter.go | 39 +- pkg/ast/visitor/formatter_test.go | 88 +- pkg/ast/visitor/namespace_resolver.go | 30 +- pkg/ast/visitor/namespace_resolver_test.go | 26 +- pkg/ast/visitor/null.go | 4 - pkg/ast/visitor/printer.go | 11 +- pkg/ast/visitor/printer_test.go | 40 +- 17 files changed, 1221 insertions(+), 1413 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index b4a4ee9..a60a8fb 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -23235,23 +23235,15 @@ func TestStmtTraitUse(t *testing.T) { }, }, }, - Adaptations: &ast.StmtNop{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 22, EndPos: 23, }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 23, - }, - }, }, }, }, @@ -23518,23 +23510,15 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - Adaptations: &ast.StmtNop{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 27, EndPos: 28, }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, - }, }, }, }, @@ -23801,44 +23785,36 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, @@ -24106,120 +24082,59 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 46, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 43, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 43, + EndPos: 33, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, - }, - }, - }, - Value: []byte("one"), - }, - }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 34, - EndPos: 36, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 34, - }, - }, - }, - }, - Modifier: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - IdentifierTkn: &token.Token{ - ID: token.T_PUBLIC, - Value: []byte("public"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, FreeFloating: []*token.Token{ { ID: token.T_WHITESPACE, @@ -24227,45 +24142,98 @@ func TestStmtTraitUse_Modifier(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 36, - EndPos: 37, + StartPos: 29, + EndPos: 30, }, }, }, }, - Value: []byte("public"), + Value: []byte("one"), }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, + }, + }, + }, + Modifier: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 37, + EndPos: 43, + }, + IdentifierTkn: &token.Token{ + ID: token.T_PUBLIC, + Value: []byte("public"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 43, - EndPos: 44, + StartPos: 37, + EndPos: 43, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 37, + }, + }, + }, + }, + Value: []byte("public"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 43, + EndPos: 44, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 45, - EndPos: 46, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 44, - EndPos: 45, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 45, + EndPos: 46, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 44, + EndPos: 45, }, }, }, @@ -24535,90 +24503,112 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 50, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 47, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 47, + EndPos: 33, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), + }, + Value: []byte("one"), + }, + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, }, }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), + }, + Modifier: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 37, + EndPos: 43, + }, + IdentifierTkn: &token.Token{ + ID: token.T_PUBLIC, + Value: []byte("public"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 34, - EndPos: 36, + StartPos: 37, + EndPos: 43, }, FreeFloating: []*token.Token{ { @@ -24627,105 +24617,75 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 33, - EndPos: 34, + StartPos: 36, + EndPos: 37, }, }, }, }, - Modifier: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - IdentifierTkn: &token.Token{ - ID: token.T_PUBLIC, - Value: []byte("public"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 37, - }, - }, - }, - }, - Value: []byte("public"), + Value: []byte("public"), + }, + Alias: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 44, + EndPos: 47, }, - Alias: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("two"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 44, EndPos: 47, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("two"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 44, - EndPos: 47, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 43, - EndPos: 44, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 43, + EndPos: 44, }, }, }, - Value: []byte("two"), }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 47, - EndPos: 48, - }, + Value: []byte("two"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 47, + EndPos: 48, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 49, - EndPos: 50, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 48, - EndPos: 49, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 50, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 48, + EndPos: 49, }, }, }, @@ -24995,343 +24955,365 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 78, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUsePrecedence{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 58, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 58, + EndPos: 38, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 38, + EndPos: 33, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 35, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 35, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, - InsteadofTkn: &token.Token{ - ID: token.T_INSTEADOF, - Value: []byte("insteadof"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 39, - EndPos: 48, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 38, - EndPos: 39, - }, - }, - }, + }, + InsteadofTkn: &token.Token{ + ID: token.T_INSTEADOF, + Value: []byte("insteadof"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 39, + EndPos: 48, }, - Insteadof: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 49, - EndPos: 52, + StartPos: 38, + EndPos: 39, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 52, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 52, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 49, EndPos: 52, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 49, - EndPos: 52, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 48, - EndPos: 49, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 48, + EndPos: 49, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 54, - EndPos: 58, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 54, + EndPos: 58, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 54, + EndPos: 58, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Quux"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 54, EndPos: 58, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Quux"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 54, - EndPos: 58, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 53, - EndPos: 54, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 53, + EndPos: 54, }, }, }, - Value: []byte("Quux"), }, + Value: []byte("Quux"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 52, - EndPos: 53, - }, - }, - }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 58, - EndPos: 59, - }, - }, }, - &ast.StmtTraitUseAlias{ + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 52, + EndPos: 53, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 58, + EndPos: 59, + }, + }, + }, + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 75, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 75, + EndPos: 68, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 68, + EndPos: 63, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 63, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, EndPos: 63, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 59, - EndPos: 60, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 59, + EndPos: 60, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 63, - EndPos: 65, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 63, + EndPos: 65, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 65, + EndPos: 68, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 65, EndPos: 68, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 65, - EndPos: 68, - }, + }, + Value: []byte("one"), + }, + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 69, + EndPos: 71, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 68, + EndPos: 69, }, - Value: []byte("one"), }, }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), + }, + Alias: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 72, + EndPos: 75, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("two"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 69, - EndPos: 71, + StartPos: 72, + EndPos: 75, }, FreeFloating: []*token.Token{ { @@ -25340,74 +25322,44 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 68, - EndPos: 69, + StartPos: 71, + EndPos: 72, }, }, }, }, - Alias: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 72, - EndPos: 75, - }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("two"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 72, - EndPos: 75, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 71, - EndPos: 72, - }, - }, - }, - }, - Value: []byte("two"), - }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 75, - EndPos: 76, - }, + Value: []byte("two"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 75, + EndPos: 76, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 77, - EndPos: 78, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 76, - EndPos: 77, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 77, + EndPos: 78, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 76, + EndPos: 77, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 59fe0b9cf7c6bc77e336ab56ff7309a7de9ad3b0..0aaa2b98cc24a2c01681465b5e0078ac2d616f02 100644 GIT binary patch delta 6265 zcma)Adsx*~)_(Tdpn%FHO+`Tt-loj(oC6%rQBm*$mZf<4v@C=ZG6otKAxoVp6E&Tt zi8NT24d9qDW;vLb9jS?prsb9N)4WWYJ|q z=@X@63X5*FB5p$N6M4f6XBHMfuUXnkz*Y64Yf!VnJMWZQJel2=%yHr}rG=S2DhZ_%z?kaBpWeRfGc~z~rlmBL?N#sbd24kyacg}Ut zDB54Bo%w7p z0h1Im-6OHLn>YN?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*4=YfJ;ngtV4H}4sExOGt76w9(pj&ic4 z|G#69%P4Nketp+DoA$xT6jQdJjAh$^q1G8bc6}uxNebD33N*Qhv)UFP|!N zTmX9SZ+N7hah&fpsB_yrR}U#UsfHMe5Gq>_qjf-QtYjWkaq`n~?kL+{;4n$3<7JeN z@!NMtI$lb$(I8N#LAvl1_rp}1VHn{;@&H85g&}z0XY$Efj*##@xY&L84BX=zIR01e zo&OR#c8Kf!Ut^JAEDDgNx72W{xk%ws*^%q6W7 zw|scXo~?+aWh z1VH#F9wd9NbDXUC7wF0CpBQ6w^M(g;E7S1oVEyS0gC|>VV6e>pnK3!zlE{()(;AC! zfM&Uz_ScuECO@p?om$d-IC9HBJxp@H!=Lxu9=n n#8^XrHz?U0=*mXR$1R-ONWL?sSssI1fB^H?TS`7?>GJ*up5`=o diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 727d486..7867d5c 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2150,13 +2150,23 @@ class_statement: trait_use_statement: T_USE trait_list trait_adaptations { - $$ = &ast.StmtTraitUse{ + traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, Traits: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, - Adaptations: $3, } + + switch n := $3.(type) { + case *ast.TraitAdaptationList : + traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn + traitUse.Adaptations = n.Adaptations + traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn + case *ast.StmtNop : + traitUse.SemiColonTkn = n.SemiColonTkn + }; + + $$ = traitUse } ; @@ -2186,7 +2196,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.StmtTraitAdaptationList{ + $$ = &ast.TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 6c94e47..76706ed 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -25219,23 +25219,15 @@ func TestStmtTraitUse(t *testing.T) { }, }, }, - Adaptations: &ast.StmtNop{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 22, EndPos: 23, }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 23, - }, - }, }, }, }, @@ -25502,23 +25494,15 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - Adaptations: &ast.StmtNop{ + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 27, EndPos: 28, }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, - }, }, }, }, @@ -25785,44 +25769,36 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 30, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, @@ -26090,120 +26066,59 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 46, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 43, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 43, + EndPos: 33, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, - }, - }, - }, - Value: []byte("one"), - }, - }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 34, - EndPos: 36, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 34, - }, - }, - }, - }, - Modifier: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - IdentifierTkn: &token.Token{ - ID: token.T_PUBLIC, - Value: []byte("public"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, FreeFloating: []*token.Token{ { ID: token.T_WHITESPACE, @@ -26211,45 +26126,98 @@ func TestStmtTraitUse_Modifier(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 36, - EndPos: 37, + StartPos: 29, + EndPos: 30, }, }, }, }, - Value: []byte("public"), + Value: []byte("one"), }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, + }, + }, + }, + Modifier: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 37, + EndPos: 43, + }, + IdentifierTkn: &token.Token{ + ID: token.T_PUBLIC, + Value: []byte("public"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 43, - EndPos: 44, + StartPos: 37, + EndPos: 43, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 37, + }, + }, + }, + }, + Value: []byte("public"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 43, + EndPos: 44, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 45, - EndPos: 46, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 44, - EndPos: 45, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 45, + EndPos: 46, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 44, + EndPos: 45, }, }, }, @@ -26519,90 +26487,112 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 50, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 47, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 47, + EndPos: 33, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), + }, + Value: []byte("one"), + }, + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 36, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, + }, }, }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), + }, + Modifier: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 37, + EndPos: 43, + }, + IdentifierTkn: &token.Token{ + ID: token.T_PUBLIC, + Value: []byte("public"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 34, - EndPos: 36, + StartPos: 37, + EndPos: 43, }, FreeFloating: []*token.Token{ { @@ -26611,105 +26601,75 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 33, - EndPos: 34, + StartPos: 36, + EndPos: 37, }, }, }, }, - Modifier: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - IdentifierTkn: &token.Token{ - ID: token.T_PUBLIC, - Value: []byte("public"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 43, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 37, - }, - }, - }, - }, - Value: []byte("public"), + Value: []byte("public"), + }, + Alias: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 44, + EndPos: 47, }, - Alias: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("two"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 44, EndPos: 47, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("two"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 44, - EndPos: 47, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 43, - EndPos: 44, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 43, + EndPos: 44, }, }, }, - Value: []byte("two"), }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 47, - EndPos: 48, - }, + Value: []byte("two"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 47, + EndPos: 48, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 49, - EndPos: 50, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 48, - EndPos: 49, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 50, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 48, + EndPos: 49, }, }, }, @@ -26979,343 +26939,365 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 28, - EndPos: 78, + EndPos: 29, }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 28, }, }, }, - Adaptations: []ast.Vertex{ - &ast.StmtTraitUsePrecedence{ + }, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 58, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 58, + EndPos: 38, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 38, + EndPos: 33, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 35, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 35, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, - InsteadofTkn: &token.Token{ - ID: token.T_INSTEADOF, - Value: []byte("insteadof"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 39, - EndPos: 48, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 38, - EndPos: 39, - }, - }, - }, + }, + InsteadofTkn: &token.Token{ + ID: token.T_INSTEADOF, + Value: []byte("insteadof"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 39, + EndPos: 48, }, - Insteadof: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 49, - EndPos: 52, + StartPos: 38, + EndPos: 39, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Insteadof: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 52, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 49, + EndPos: 52, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 49, EndPos: 52, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 49, - EndPos: 52, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 48, - EndPos: 49, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 48, + EndPos: 49, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 54, - EndPos: 58, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 54, + EndPos: 58, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 54, + EndPos: 58, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Quux"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 54, EndPos: 58, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Quux"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 54, - EndPos: 58, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 53, - EndPos: 54, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 53, + EndPos: 54, }, }, }, - Value: []byte("Quux"), }, + Value: []byte("Quux"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 52, - EndPos: 53, - }, - }, - }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 58, - EndPos: 59, - }, - }, }, - &ast.StmtTraitUseAlias{ + SeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 52, + EndPos: 53, + }, + }, + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 58, + EndPos: 59, + }, + }, + }, + &ast.StmtTraitUseAlias{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 75, + }, + Ref: &ast.StmtTraitMethodRef{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 75, + EndPos: 68, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 68, + EndPos: 63, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 63, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, EndPos: 63, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 59, - EndPos: 60, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 59, + EndPos: 60, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 63, - EndPos: 65, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 63, + EndPos: 65, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 65, + EndPos: 68, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 65, EndPos: 68, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 65, - EndPos: 68, - }, + }, + Value: []byte("one"), + }, + }, + AsTkn: &token.Token{ + ID: token.T_AS, + Value: []byte("as"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 69, + EndPos: 71, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 68, + EndPos: 69, }, - Value: []byte("one"), }, }, - AsTkn: &token.Token{ - ID: token.T_AS, - Value: []byte("as"), + }, + Alias: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 72, + EndPos: 75, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("two"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 69, - EndPos: 71, + StartPos: 72, + EndPos: 75, }, FreeFloating: []*token.Token{ { @@ -27324,74 +27306,44 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 68, - EndPos: 69, + StartPos: 71, + EndPos: 72, }, }, }, }, - Alias: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 72, - EndPos: 75, - }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("two"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 72, - EndPos: 75, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 71, - EndPos: 72, - }, - }, - }, - }, - Value: []byte("two"), - }, - SemiColonTkn: &token.Token{ - ID: token.ID(59), - Value: []byte(";"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 75, - EndPos: 76, - }, + Value: []byte("two"), + }, + SemiColonTkn: &token.Token{ + ID: token.ID(59), + Value: []byte(";"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 75, + EndPos: 76, }, }, }, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 77, - EndPos: 78, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 76, - EndPos: 77, - }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 77, + EndPos: 78, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 76, + EndPos: 77, }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 82fd500097cc4aea6ed76dd483fc23d9c33a45f0..3c139f281daa4756c9e24fce21900fa911f0983a 100644 GIT binary patch delta 4553 zcmZWtdsLNG7GGx{KtNCo0hP<;f{)Zn;c~fLd;pem$rq58X=6%0W_%$j=A@aJm6_A1 zmF{w~L0f7zW@s%>)2b2eVU5njls4+BQJQIbnaZq2jY{XY&-Y!FHU9u-fBWpSAHV%O z`*5})arLW-4e8xgV5O(K@pMAag94LaNiU`1rWExP^;n)lU1B zubL~0RBB4?{WUZC`IgFuX;skeU$wAy0I&B_a;HHejEh*|b?av)BZpOS>x6GeAzk2+f zYPcYRv(H(h!57vU*@(HDKQeSlw@5-k* ze%nW3D#+&*2Pu;qV_|h*7VV@^ZhJ{AM`zP>s*v}Dp?5l&V$BEH^k+r6Ih?ynxuQ3F z(fdl}^51eIO1t`q#Ltz3BRbFZrLPp{tWrM5%&z{Ft|%WK3_~EW9Bt0rK=&!Q3Nxwf zyM(|u+(cnj&~{QZL!~=U?Wf0b%~vXpOG;FXSv-JdDHY=8fpkt48tkr7=>%UYpi(%EY@|D1(+ZLB0;j%KJv2xJX2l@#iJz#etGQ$d>=cF!icqFFp@_md zFDIXyklh!s-0C4>Z)45JX&wW=&rS4{QDtH~NhQ;7nRt%rv@4%wZ{M_^~r?letd zdRX!7FqQI_Z1Tw(#VZUtRh~MM;?29a(jX<_s!_B9Cjv~V+%TLn_|s8{ELUon&P~5i zU3twJmB>>@!@Qrf=Hb)v(QrJ^WR0Qq%0a9PX>U1{0uCTH?^3B;H(GV%MlY3`Gv&04 zRM0$o8!gim0(vKtmpk7MP!``o{{_}i!E{qGf$B-+nwE+5BuRH5_Y)|e>mH;6Zmg!c zym&H|ap4s5andA;F<(rk@ya<9?rx=Mo-~E7pgUHS>r6*w`Bds50CQ?J0m1LD0t!(q zoYH&WGyntjL1Vi5#nVM%!Hcb-R?3L&&P%#cKziPboho4-|Q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>TX(7?^ZqAvGg!eQ-)E}#)60q@`vpH^ z^(Owu0o#0CD2&x{TzrsDxP^ugh+uLjouDvk{tN2l5uf3>^(NCaeMX6v)(TMqSnS|M z|3df*JzUA%HxJQU{PO2CjzX|py0=wn#d{8eBSX?`tSR>JHa>d<57U^6o`a-Ht zCIU||=_mxEXRF;0>)}Eca2tMJmDCKBhmY#RvHCLcc(LA>^0wh21^3%vW`XQzk(VBP$ zx5A7=L2i`)cKFO-d-m`T5JcU&vZrg$T7fE`viRPjQsOL-J&$9%3esv{_v^^9ze(`7Owd*%#^*Wv`?6XX^651KaU#94|@Ct$~$ zH!VM*KJyhf_15LwS?ZA%Lzrfg`{+Hkhj(tL2xFD)lG81H^l)xY)H8)pQg))}Rt(hN za$b@y)zPBpPeczT<1xRD%BmFn4Y+fz=Vq?rNBikAQ~j{TB0CF3b-v-vouB_XM4%u(k}FBj}mZb zrP2jnGwivT#@7r(+-<)Op%uedp1^>>NK$=7w# z5SvEo}Z|To|=VkJ?03sLu83!70U_|kl2Gp*Lq1Qtad`tAcmAj#8 zOju7P`NXqh4AMH7Au2Uap%LD%Vx0_*JnO@b(t#)oua&KN<`)j8uHGL}&2sX_UyVgLNXWyBtaMUU$K&R08I&SLp;%+yis-*+kvf{QxjYll9$-k4-|&?fRvTZ&`P( tmYEk^>=+2rdL{~syQ*qL9^a)u{q#p`{ge7qXg&fkEUw0epT{tuN^Lva8A diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 2c14cff..00582e4 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1970,13 +1970,23 @@ class_statement: } | T_USE name_list trait_adaptations { - $$ = &ast.StmtTraitUse{ + traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, Traits: $2.(*ast.ParserSeparatedList).Items, SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, - Adaptations: $3, } + + switch n := $3.(type) { + case *ast.TraitAdaptationList : + traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn + traitUse.Adaptations = n.Adaptations + traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn + case *ast.StmtNop : + traitUse.SemiColonTkn = n.SemiColonTkn + }; + + $$ = traitUse } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { @@ -2032,7 +2042,7 @@ trait_adaptations: } | '{' '}' { - $$ = &ast.StmtTraitAdaptationList{ + $$ = &ast.TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenCurlyBracketTkn: $1, CloseCurlyBracketTkn: $2, @@ -2040,7 +2050,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.StmtTraitAdaptationList{ + $$ = &ast.TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index fad100c..0cdb4b0 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -67,7 +67,6 @@ type NodeVisitor interface { StmtSwitch(n *StmtSwitch) StmtThrow(n *StmtThrow) StmtTrait(n *StmtTrait) - StmtTraitAdaptationList(n *StmtTraitAdaptationList) StmtTraitMethodRef(n *StmtTraitMethodRef) StmtTraitUse(n *StmtTraitUse) StmtTraitUseAlias(n *StmtTraitUseAlias) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 7497f9a..3e3e428 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -945,22 +945,6 @@ func (n *StmtTrait) GetPosition() *position.Position { return n.Position } -// StmtTraitAdaptationList node -type StmtTraitAdaptationList struct { - Position *position.Position - OpenCurlyBracketTkn *token.Token - Adaptations []Vertex - CloseCurlyBracketTkn *token.Token -} - -func (n *StmtTraitAdaptationList) Accept(v NodeVisitor) { - v.StmtTraitAdaptationList(n) -} - -func (n *StmtTraitAdaptationList) GetPosition() *position.Position { - return n.Position -} - // StmtTraitMethodRef node type StmtTraitMethodRef struct { Position *position.Position @@ -979,11 +963,14 @@ func (n *StmtTraitMethodRef) GetPosition() *position.Position { // StmtTraitUse node type StmtTraitUse struct { - Position *position.Position - UseTkn *token.Token - Traits []Vertex - SeparatorTkns []*token.Token - Adaptations Vertex + Position *position.Position + UseTkn *token.Token + Traits []Vertex + SeparatorTkns []*token.Token + OpenCurlyBracketTkn *token.Token + Adaptations []Vertex + CloseCurlyBracketTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtTraitUse) Accept(v NodeVisitor) { @@ -2699,6 +2686,22 @@ func (n *ParserSeparatedList) GetPosition() *position.Position { return n.Position } +// TraitAdaptationList node +type TraitAdaptationList struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *TraitAdaptationList) Accept(v NodeVisitor) { + // do nothing +} + +func (n *TraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + // ArgumentList node type ArgumentList struct { Position *position.Position diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index d9e198e..f980c7f 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -812,20 +812,6 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Stmts", false) } - case *ast.StmtTraitAdaptationList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Adaptations != nil { - t.visitor.Enter("Adaptations", false) - for _, c := range nn.Adaptations { - t.Traverse(c) - } - t.visitor.Leave("Adaptations", false) - } case *ast.StmtTraitMethodRef: if nn == nil { return @@ -858,9 +844,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.visitor.Leave("Traits", false) } if nn.Adaptations != nil { - t.visitor.Enter("Adaptations", true) - t.Traverse(nn.Adaptations) - t.visitor.Leave("Adaptations", true) + t.visitor.Enter("Adaptations", false) + for _, c := range nn.Adaptations { + t.Traverse(c) + } + t.visitor.Leave("Adaptations", false) } case *ast.StmtTraitUseAlias: if nn == nil { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 98ef5ef..c086d47 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -858,19 +858,6 @@ func (v *Dumper) StmtTrait(n *ast.StmtTrait) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { - v.print(0, "&ast.StmtTraitAdaptationList{\n") - v.indent++ - - v.dumpPosition(n.Position) - v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) - v.dumpVertexList("Adaptations", n.Adaptations) - v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) - - v.indent-- - v.print(v.indent, "},\n") -} - func (v *Dumper) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { v.print(0, "&ast.StmtTraitMethodRef{\n") v.indent++ @@ -892,7 +879,10 @@ func (v *Dumper) StmtTraitUse(n *ast.StmtTraitUse) { v.dumpToken("UseTkn", n.UseTkn) v.dumpVertexList("Traits", n.Traits) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) - v.dumpVertex("Adaptations", n.Adaptations) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertexList("Adaptations", n.Adaptations) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + v.dumpToken("SemiColonTkn", n.SemiColonTkn) v.indent-- v.print(v.indent, "},\n") diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 31b1475..5d2d202 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -886,21 +886,6 @@ func (f *formatter) StmtTrait(n *ast.StmtTrait) { n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) } -func (f *formatter) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { - n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) - - if len(n.Adaptations) > 0 { - f.indent++ - f.formatStmts(&n.Adaptations) - f.indent-- - - f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) - f.addIndent() - } - - n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) -} - func (f *formatter) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { if n.Trait != nil { n.Trait.Accept(f) @@ -916,11 +901,27 @@ func (f *formatter) StmtTraitUse(n *ast.StmtTraitUse) { n.SeparatorTkns = f.formatList(n.Traits, ',') - if _, ok := n.Adaptations.(*ast.StmtTraitAdaptationList); ok { - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - } + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + n.SemiColonTkn = nil - n.Adaptations.Accept(f) + if len(n.Adaptations) > 0 { + f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + + if len(n.Adaptations) > 0 { + f.indent++ + f.formatStmts(&n.Adaptations) + f.indent-- + + f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) + f.addIndent() + } + + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + } else { + n.SemiColonTkn = f.newToken(';', []byte(";")) + } } func (f *formatter) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index d4b2c0a..ee8637b 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -2503,76 +2503,6 @@ func TestFormatter_StmtTrait_Implements(t *testing.T) { } } -func TestFormatter_StmtTraitAdaptationList(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtTraitAdaptationList{} - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `{}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestFormatter_StmtTraitAdaptationList_List(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtTraitAdaptationList{ - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Ref: &ast.StmtTraitMethodRef{ - Method: &ast.Identifier{ - Value: []byte("foo"), - }, - }, - Alias: &ast.Identifier{ - Value: []byte("bar"), - }, - }, - &ast.StmtTraitUsePrecedence{ - Ref: &ast.StmtTraitMethodRef{ - Method: &ast.Identifier{ - Value: []byte("foo"), - }, - }, - Insteadof: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, - }, - }, - }, - }, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `{ - foo as bar; - foo insteadof bar; - }` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestFormatter_StmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") @@ -2646,7 +2576,6 @@ func TestFormatter_StmtTraitUse(t *testing.T) { }, }, }, - Adaptations: &ast.StmtNop{}, } f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) @@ -2683,7 +2612,18 @@ func TestFormatter_StmtTraitUse_Adaptations(t *testing.T) { }, }, }, - Adaptations: &ast.StmtTraitAdaptationList{}, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ + Value: []byte("foo"), + }, + }, + Alias: &ast.Identifier{ + Value: []byte("baz"), + }, + }, + }, } f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) @@ -2692,7 +2632,9 @@ func TestFormatter_StmtTraitUse_Adaptations(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n.Accept(p) - expected := `use foo, bar {}` + expected := `use foo, bar { + foo as baz; + }` actual := o.String() if expected != actual { diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 5bc82ca..9e4e6a2 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -184,23 +184,21 @@ func (nsr *NamespaceResolver) StmtTraitUse(n *ast.StmtTraitUse) { nsr.ResolveName(t, "") } - if adaptationList, ok := n.Adaptations.(*ast.StmtTraitAdaptationList); ok { - for _, a := range adaptationList.Adaptations { - switch aa := a.(type) { - case *ast.StmtTraitUsePrecedence: - refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait - if refTrait != nil { - nsr.ResolveName(refTrait, "") - } - for _, insteadOf := range aa.Insteadof { - nsr.ResolveName(insteadOf, "") - } + for _, a := range n.Adaptations { + switch aa := a.(type) { + case *ast.StmtTraitUsePrecedence: + refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait + if refTrait != nil { + nsr.ResolveName(refTrait, "") + } + for _, insteadOf := range aa.Insteadof { + nsr.ResolveName(insteadOf, "") + } - case *ast.StmtTraitUseAlias: - refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait - if refTrait != nil { - nsr.ResolveName(refTrait, "") - } + case *ast.StmtTraitUseAlias: + refTrait := aa.Ref.(*ast.StmtTraitMethodRef).Trait + if refTrait != nil { + nsr.ResolveName(refTrait, "") } } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index fa7043a..f42f11e 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -354,22 +354,20 @@ func TestResolveTraitUse(t *testing.T) { nameB, relativeNameB, }, - Adaptations: &ast.StmtTraitAdaptationList{ - Adaptations: []ast.Vertex{ - &ast.StmtTraitUsePrecedence{ - Ref: &ast.StmtTraitMethodRef{ - Trait: fullyQualifiedNameB, - Method: &ast.Identifier{Value: []byte("foo")}, - }, - Insteadof: []ast.Vertex{fullyQualifiedNameBC}, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUsePrecedence{ + Ref: &ast.StmtTraitMethodRef{ + Trait: fullyQualifiedNameB, + Method: &ast.Identifier{Value: []byte("foo")}, }, - &ast.StmtTraitUseAlias{ - Ref: &ast.StmtTraitMethodRef{ - Trait: relativeNameBC, - Method: &ast.Identifier{Value: []byte("foo")}, - }, - Alias: &ast.Identifier{Value: []byte("bar")}, + Insteadof: []ast.Vertex{fullyQualifiedNameBC}, + }, + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: relativeNameBC, + Method: &ast.Identifier{Value: []byte("foo")}, }, + Alias: &ast.Identifier{Value: []byte("bar")}, }, }, }, diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index bba280c..cef3d73 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -206,10 +206,6 @@ func (v *Null) StmtTrait(_ *ast.StmtTrait) { // do nothing } -func (v *Null) StmtTraitAdaptationList(_ *ast.StmtTraitAdaptationList) { - // do nothing -} - func (v *Null) StmtTraitMethodRef(_ *ast.StmtTraitMethodRef) { // do nothing } diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index ae85256..255ffe9 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -531,12 +531,6 @@ func (p *printer) StmtTrait(n *ast.StmtTrait) { p.printToken(n.CloseCurlyBracketTkn, []byte("}")) } -func (p *printer) StmtTraitAdaptationList(n *ast.StmtTraitAdaptationList) { - p.printToken(n.OpenCurlyBracketTkn, []byte("{")) - p.printList(n.Adaptations) - p.printToken(n.CloseCurlyBracketTkn, []byte("}")) -} - func (p *printer) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { p.printNode(n.Trait) p.printToken(n.DoubleColonTkn, p.ifNode(n.Trait, []byte("::"))) @@ -546,7 +540,10 @@ func (p *printer) StmtTraitMethodRef(n *ast.StmtTraitMethodRef) { func (p *printer) StmtTraitUse(n *ast.StmtTraitUse) { p.printToken(n.UseTkn, []byte("use")) p.printSeparatedList(n.Traits, n.SeparatorTkns, []byte(",")) - p.printNode(n.Adaptations) + p.printToken(n.OpenCurlyBracketTkn, p.ifNodeList(n.Adaptations, []byte("{"))) + p.printList(n.Adaptations) + p.printToken(n.CloseCurlyBracketTkn, p.ifNodeList(n.Adaptations, []byte("}"))) + p.printToken(n.SemiColonTkn, p.ifNotToken(n.OpenCurlyBracketTkn, p.ifNotNodeList(n.Adaptations, []byte(";")))) } func (p *printer) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 7920cb2..d918f0a 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -4339,31 +4339,6 @@ func TestPrinterPrintStmtThrow(t *testing.T) { } } -func TestPrinterPrintStmtTraitAdaptationList(t *testing.T) { - o := bytes.NewBufferString("") - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n := &ast.StmtTraitAdaptationList{ - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Ref: &ast.StmtTraitMethodRef{ - Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Method: &ast.Identifier{Value: []byte("a")}, - }, - Alias: &ast.Identifier{Value: []byte("b")}, - }, - }, - } - n.Accept(p) - - expected := `{Foo::a as b;}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestPrinterPrintStmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") @@ -4454,7 +4429,6 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Adaptations: &ast.StmtNop{}, } n.Accept(p) @@ -4475,15 +4449,13 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, }, - Adaptations: &ast.StmtTraitAdaptationList{ - Adaptations: []ast.Vertex{ - &ast.StmtTraitUseAlias{ - Ref: &ast.StmtTraitMethodRef{ - Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Method: &ast.Identifier{Value: []byte("a")}, - }, - Alias: &ast.Identifier{Value: []byte("b")}, + Adaptations: []ast.Vertex{ + &ast.StmtTraitUseAlias{ + Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Method: &ast.Identifier{Value: []byte("a")}, }, + Alias: &ast.Identifier{Value: []byte("b")}, }, }, } From b85bae2ec11a36eb6cdd9ae08132b01ed93cecf3 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 18:20:10 +0200 Subject: [PATCH 121/140] refactoring: update ast structure of "Closure" and "ClosureUse" nodes --- internal/php5/parser_test.go | 426 +++++++++++---------- internal/php5/php5.go | Bin 264939 -> 265070 bytes internal/php5/php5.y | 131 ++++--- internal/php7/parser_test.go | 426 +++++++++++---------- internal/php7/php7.go | Bin 219529 -> 219555 bytes internal/php7/php7.y | 59 +-- pkg/ast/node.go | 41 +- pkg/ast/traverser/dfs.go | 20 +- pkg/ast/visitor/dumper.go | 13 +- pkg/ast/visitor/formatter.go | 20 +- pkg/ast/visitor/formatter_test.go | 47 ++- pkg/ast/visitor/namespace_resolver_test.go | 1 - pkg/ast/visitor/printer.go | 11 +- pkg/ast/visitor/printer_test.go | 48 ++- 14 files changed, 654 insertions(+), 589 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index a60a8fb..6ff6707 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -31770,7 +31770,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 36, }, FunctionTkn: &token.Token{ - ID: token.T_FUNCTION, + ID: token.T_FUNCTION, Value: []byte("function"), Position: &position.Position{ StartLine: 1, @@ -31780,7 +31780,7 @@ func TestExprClosure_Use(t *testing.T) { }, FreeFloating: []*token.Token{ { - ID: token.T_OPEN_TAG, + ID: token.T_OPEN_TAG, Value: []byte("J|5qr%FXj$ZAUz)u{=2(25X|1XXD(Eyb)NUfC^E zlBs7YValm$D$%LwXc3~-K}WR4YH3NBRv(7>&i~(=T-we|*2-G!OI1XejE#LUDr{j?m{3t+@(*tXAjG_!D$wSO|(X3NmfAx{?+K4{8%1_b!~ z`@0m_zDzvInY)F5h=(*Lb!L7}aqjed4w@w*f?T>WgQgWsDlE#%pU59Crce)ku9Ota z$9!b_;1<&{=~;zY(~7LgeEg_%1bV2)uyu|I<19ynNjr?OGwMJWz?i zW=XVyWQh{3dzmkY8C5*37>2EL<_w-bb!t}OxWtT@skueP9(VBcKC(S0?-PL{iO>4T zux4w?b#hF*c&N_xP`CEy82I!*;uL;d2DI`x#np?%J#F0KF@wfUu`)cwBMcr<^O3(A zwLpG;wg_ytW5$hl&K8M&Zrf(W_Rki-6|vy>jF{r-d6V)z-7^BWeU1q1?Y8ra$R+)k z$Vt2H&d_Dn%h7y%J4LJddMN}yI!Z)vO_20b*H7y8j7V~=gFls-g0ru=_puHY{KjW; z7}wsw`Nr+kRdC#Cna1r_N%y+;4Ay#|u^+{aVbaPe14SICY$9(}aaNWJk;uoBC2o01 zdaHG(WjDc3os&adS8L(XbMmC%^8;Ni>t_)}{O4p9O|m+F92XmH;F)a zC)&`MqDfr(1NHI4kN#Htap@+Qw>W`a>j~M)P)P47J8{E(WMnbe5DmIP2^@VjJJbo?e$BI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D%qu#f%}vzXp4P0f7+Cm9M=)78 z_s%Cm&xa(kiW935Z=cc-870DY6&_8zh{yi&VBw{_ zFH$6$94CyB+d(|{+lQ^FLMxi8`xs68s|4F8qN&0gG`Pj1mGNkGx> zQ~6iuH`jyXA)+p6C*Z}F3~h?*s1+~&fi~zoFuQ66)_lh3^bE5MZk(oi{Y3X9*XuU3 zMeF@IG7IrmMe4NdcFTE8lcv2mwZ4gFIiEykCXTyp0N<#`Rk!K7Fw^qOJ2X#FToM>) zsSHsV#t2?@7fFb;G^T#PORdBo*s$|Gw0}kmr$*eT`OeSp@K6@!tE$Zd-ME0#)48~} z?7VuVMYFG&8x_Lxcatq*_&sTHJ{pRpC7AumlEzo01(p7aY^};XE$<7q{YkiSm>V|g hp9oa7jXo6I%fkY;GMj*wdmWxw!{bf2wXU_3;(u1HSp5J1 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 7867d5c..50edcc3 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3367,36 +3367,38 @@ expr_without_variable: } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $9), - FunctionTkn: $1, - AmpersandTkn: $2, - OpenParenthesisTkn: $3, - Params: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, - CloseParenthesisTkn: $5, - ClosureUse: $6, - OpenCurlyBracketTkn: $7, - Stmts: $8, - CloseCurlyBracketTkn: $9, - } + closure := $6.(*ast.ExprClosure) + + closure.Position = yylex.(*Parser).builder.NewTokensPosition($1, $9) + closure.FunctionTkn = $1 + closure.AmpersandTkn = $2 + closure.OpenParenthesisTkn = $3 + closure.Params = $4.(*ast.ParserSeparatedList).Items + closure.SeparatorTkns = $4.(*ast.ParserSeparatedList).SeparatorTkns + closure.CloseParenthesisTkn = $5 + closure.OpenCurlyBracketTkn = $7 + closure.Stmts = $8 + closure.CloseCurlyBracketTkn = $9 + + $$ = closure } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $10), - StaticTkn: $1, - FunctionTkn: $2, - AmpersandTkn: $3, - OpenParenthesisTkn: $4, - Params: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, - CloseParenthesisTkn: $6, - ClosureUse: $7, - OpenCurlyBracketTkn: $8, - Stmts: $9, - CloseCurlyBracketTkn: $10, - } + closure := $7.(*ast.ExprClosure) + + closure.Position = yylex.(*Parser).builder.NewTokensPosition($1, $10) + closure.StaticTkn = $1 + closure.FunctionTkn = $2 + closure.AmpersandTkn = $3 + closure.OpenParenthesisTkn = $4 + closure.Params = $5.(*ast.ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.CloseParenthesisTkn = $6 + closure.OpenCurlyBracketTkn = $8 + closure.Stmts = $9 + closure.CloseCurlyBracketTkn = $10 + + $$ = closure } ; @@ -3520,17 +3522,16 @@ function: lexical_vars: /* empty */ { - $$ = nil + $$ = &ast.ExprClosure{} } | T_USE '(' lexical_var_list ')' { - $$ = &ast.ExprClosureUse{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - UseTkn: $1, - OpenParenthesisTkn: $2, - Uses: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, - CloseParenthesisTkn: $4, + $$ = &ast.ExprClosure{ + UseTkn: $1, + UseOpenParenthesisTkn: $2, + Use: $3.(*ast.ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseCloseParenthesisTkn: $4, } } ; @@ -3538,12 +3539,15 @@ lexical_vars: lexical_var_list: lexical_var_list ',' T_VARIABLE { - variable := &ast.ExprVariable{ + variable := &ast.ExprClosureUse{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - IdentifierTkn: $3, - Value: $3.Value, + VarName: &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($3), + IdentifierTkn: $3, + Value: $3.Value, + }, }, } @@ -3554,7 +3558,7 @@ lexical_var_list: } | lexical_var_list ',' '&' T_VARIABLE { - reference := &ast.ExprReference{ + variable := &ast.ExprClosureUse{ Position: yylex.(*Parser).builder.NewTokensPosition($3, $4), AmpersandTkn: $3, Var: &ast.ExprVariable{ @@ -3568,43 +3572,46 @@ lexical_var_list: } $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, reference) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) $$ = $1 } | T_VARIABLE { - $$ = &ast.ParserSeparatedList{ - Items: []ast.Vertex{ - &ast.ExprVariable{ + variable := &ast.ExprClosureUse{ + Position: yylex.(*Parser).builder.NewTokenPosition($1), + Var: &ast.ExprVariable{ + Position: yylex.(*Parser).builder.NewTokenPosition($1), + VarName: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($1), - IdentifierTkn: $1, - Value: $1.Value, - }, + IdentifierTkn: $1, + Value: $1.Value, }, }, } + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ variable }, + } } | '&' T_VARIABLE { - $$ = &ast.ParserSeparatedList{ - Items: []ast.Vertex{ - &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), - AmpersandTkn: $1, - Var: &ast.ExprVariable{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), - VarName: &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), - IdentifierTkn: $2, - Value: $2.Value, - }, - }, + variable := &ast.ExprClosureUse{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), + AmpersandTkn: $1, + Var: &ast.ExprVariable{ + Position: yylex.(*Parser).builder.NewTokenPosition($2), + VarName: &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($2), + IdentifierTkn: $2, + Value: $2.Value, }, }, } + + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{ variable }, + } } ; diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 76706ed..c33bafd 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -36268,7 +36268,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 36, }, FunctionTkn: &token.Token{ - ID: token.T_FUNCTION, + ID: token.T_FUNCTION, Value: []byte("function"), Position: &position.Position{ StartLine: 1, @@ -36278,7 +36278,7 @@ func TestExprClosure_Use(t *testing.T) { }, FreeFloating: []*token.Token{ { - ID: token.T_OPEN_TAG, + ID: token.T_OPEN_TAG, Value: []byte("jcmV;SBJzD-KMY$d|o#%b;#p^%&>wTW{ z@tkvh=XcI~7=vMd4EUj*1Cq~T}`#t()M3a`t;R%8k<%+ zl6i4)v9TdF4lJiCxZk9>lzYNjPwB4utu4 z8){p2HPu(|ZLGDHp|_i7Pci2R3$(sYR$$2!o|cB~we=ASPgTo~mS$_2wRi8ThPt|7 z(_=pG6P~(fn_D7`Fffg$VeEB^XP*znvp9VsyLbP@)mUFdnP?4iw9Y@pq$nRVq9_$f zHI#^&9$t%`E?R_7&1s~Qtr!R4U+%-=UalrTF22ETS4fDGVsYIbrKV!|3QtxWn`?3C zL!N=g)0`N!)UqrDqf|!w8S>aV-@~ffJ|thK92|X!()ETj{5Ipay_^B-K`zlfalDrB z;8|XSws$xWUA;UVIR~f|>;BDCwCe-bga=NsTlfE!7qL^$a1}@Cg?)UOrJOc5XCf>q zVNAcsWmJguHJqdOT{J#Tn+1Z()pQCkd@9lW*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ujZ4@}PyBl_`MxHFgkc?o*+ts1+V2O;suS+bp%8dt=_g&ijQK zc6S!FijA!BPD<0R>8gx{AMljg(*Zv_kbFIpcSySh@6f zMT#BVw8+7t5~TF#dFloK@$h`rpJcu)4McG1>m@48;BNnvmQTwbQZvZ+f70DvC@hmD KHx}iKRLZ|&@FlPS diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 00582e4..580e9d4 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3178,21 +3178,22 @@ expr_without_variable: inline_function: T_FUNCTION returns_ref backup_doc_comment '(' parameter_list ')' lexical_vars return_type '{' inner_statement_list '}' { - $$ = &ast.ExprClosure{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $11), - FunctionTkn: $1, - AmpersandTkn: $2, - OpenParenthesisTkn: $4, - Params: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, - CloseParenthesisTkn: $6, - ClosureUse: $7, - ColonTkn: $8.(*ast.ReturnType).ColonTkn, - ReturnType: $8.(*ast.ReturnType).Type, - OpenCurlyBracketTkn: $9, - Stmts: $10, - CloseCurlyBracketTkn: $11, - } + closure := $7.(*ast.ExprClosure) + + closure.Position = yylex.(*Parser).builder.NewTokensPosition($1, $11) + closure.FunctionTkn = $1 + closure.AmpersandTkn = $2 + closure.OpenParenthesisTkn = $4 + closure.Params = $5.(*ast.ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.CloseParenthesisTkn = $6 + closure.ColonTkn = $8.(*ast.ReturnType).ColonTkn + closure.ReturnType = $8.(*ast.ReturnType).Type + closure.OpenCurlyBracketTkn = $9 + closure.Stmts = $10 + closure.CloseCurlyBracketTkn = $11 + + $$ = closure } | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr { @@ -3230,17 +3231,16 @@ returns_ref: lexical_vars: /* empty */ { - $$ = nil + $$ = &ast.ExprClosure{} } | T_USE '(' lexical_var_list ')' { - $$ = &ast.ExprClosureUse{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - UseTkn: $1, - OpenParenthesisTkn: $2, - Uses: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, - CloseParenthesisTkn: $4, + $$ = &ast.ExprClosure{ + UseTkn: $1, + UseOpenParenthesisTkn: $2, + Use: $3.(*ast.ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseCloseParenthesisTkn: $4, } } ; @@ -3264,18 +3264,21 @@ lexical_var_list: lexical_var: T_VARIABLE { - $$ = &ast.ExprVariable{ + $$ = &ast.ExprClosureUse{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - IdentifierTkn: $1, - Value: $1.Value, + VarName: &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($1), + IdentifierTkn: $1, + Value: $1.Value, + }, }, } } | '&' T_VARIABLE { - $$ = &ast.ExprReference{ + $$ = &ast.ExprClosureUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), AmpersandTkn: $1, Var: &ast.ExprVariable{ diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 3e3e428..bb90d78 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1274,20 +1274,24 @@ func (n *ExprClone) GetPosition() *position.Position { // ExprClosure node type ExprClosure struct { - Position *position.Position - StaticTkn *token.Token - FunctionTkn *token.Token - AmpersandTkn *token.Token - OpenParenthesisTkn *token.Token - Params []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token - ClosureUse Vertex - ColonTkn *token.Token - ReturnType Vertex - OpenCurlyBracketTkn *token.Token - Stmts []Vertex - CloseCurlyBracketTkn *token.Token + Position *position.Position + StaticTkn *token.Token + FunctionTkn *token.Token + AmpersandTkn *token.Token + OpenParenthesisTkn *token.Token + Params []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token + UseTkn *token.Token + UseOpenParenthesisTkn *token.Token + Use []Vertex + UseSeparatorTkns []*token.Token + UseCloseParenthesisTkn *token.Token + ColonTkn *token.Token + ReturnType Vertex + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *ExprClosure) Accept(v NodeVisitor) { @@ -1300,12 +1304,9 @@ func (n *ExprClosure) GetPosition() *position.Position { // ExprClosureUse node type ExprClosureUse struct { - Position *position.Position - UseTkn *token.Token - OpenParenthesisTkn *token.Token - Uses []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token + Position *position.Position + AmpersandTkn *token.Token + Var Vertex } func (n *ExprClosureUse) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index f980c7f..5c8f792 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -1152,10 +1152,12 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Params", false) } - if nn.ClosureUse != nil { - t.visitor.Enter("ClosureUse", true) - t.Traverse(nn.ClosureUse) - t.visitor.Leave("ClosureUse", true) + if nn.Use != nil { + t.visitor.Enter("Use", false) + for _, c := range nn.Use { + t.Traverse(c) + } + t.visitor.Leave("Use", false) } if nn.ReturnType != nil { t.visitor.Enter("ReturnType", true) @@ -1176,12 +1178,10 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - if nn.Uses != nil { - t.visitor.Enter("Uses", false) - for _, c := range nn.Uses { - t.Traverse(c) - } - t.visitor.Leave("Uses", false) + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) } case *ast.ExprConstFetch: if nn == nil { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index c086d47..6bc24c3 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1143,7 +1143,11 @@ func (v *Dumper) ExprClosure(n *ast.ExprClosure) { v.dumpVertexList("Params", n.Params) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) - v.dumpVertex("ClosureUse", n.ClosureUse) + v.dumpToken("UseTkn", n.UseTkn) + v.dumpToken("UseOpenParenthesisTkn", n.UseOpenParenthesisTkn) + v.dumpVertexList("Use", n.Use) + v.dumpTokenList("UseSeparatorTkns", n.UseSeparatorTkns) + v.dumpToken("UseCloseParenthesisTkn", n.UseCloseParenthesisTkn) v.dumpToken("ColonTkn", n.ColonTkn) v.dumpVertex("ReturnType", n.ReturnType) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) @@ -1159,11 +1163,8 @@ func (v *Dumper) ExprClosureUse(n *ast.ExprClosureUse) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("UseTkn", n.UseTkn) - v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Uses", n.Uses) - v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) - v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) + v.dumpVertex("Var", n.Var) v.indent-- v.print(v.indent, "},\n") diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 5d2d202..9484b66 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1162,9 +1162,16 @@ func (f *formatter) ExprClosure(n *ast.ExprClosure) { } n.CloseParenthesisTkn = f.newToken(')', []byte(")")) - if n.ClosureUse != nil { + n.UseTkn = nil + n.UseOpenParenthesisTkn = nil + n.UseCloseParenthesisTkn = nil + n.UseSeparatorTkns = nil + if len(n.Use) > 0 { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - n.ClosureUse.Accept(f) + n.UseTkn = f.newToken(token.T_USE, []byte("use")) + n.OpenParenthesisTkn = f.newToken('(', []byte("(")) + n.SeparatorTkns = f.formatList(n.Use, ',') + n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } n.ColonTkn = nil @@ -1189,10 +1196,11 @@ func (f *formatter) ExprClosure(n *ast.ExprClosure) { } func (f *formatter) ExprClosureUse(n *ast.ExprClosureUse) { - n.UseTkn = f.newToken(token.T_USE, []byte("use")) - n.OpenParenthesisTkn = f.newToken('(', []byte("(")) - n.SeparatorTkns = f.formatList(n.Uses, ',') - n.CloseParenthesisTkn = f.newToken(')', []byte(")")) + if n.AmpersandTkn != nil { + n.AmpersandTkn = f.newToken('&', []byte("&")) + } + + n.Var.Accept(f) } func (f *formatter) ExprConstFetch(n *ast.ExprConstFetch) { diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index ee8637b..b917aea 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -3714,9 +3714,9 @@ func TestFormatter_ExprClosure_Use(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprClosure{ - ClosureUse: &ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprVariable{ + Use: []ast.Vertex{ + &ast.ExprClosureUse{ + Var: &ast.ExprVariable{ VarName: &ast.Identifier{ Value: []byte("$foo"), }, @@ -3748,16 +3748,9 @@ func TestFormatter_ExprClosureUse(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprVariable{ - VarName: &ast.Identifier{ - Value: []byte("$a"), - }, - }, - &ast.ExprVariable{ - VarName: &ast.Identifier{ - Value: []byte("$b"), - }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), }, }, } @@ -3768,7 +3761,33 @@ func TestFormatter_ExprClosureUse(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n.Accept(p) - expected := `use($a, $b)` + expected := `$a` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestFormatter_ExprClosureUse_Reference(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprClosureUse{ + AmpersandTkn: &token.Token{}, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$a"), + }, + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `&$a` actual := o.String() if expected != actual { diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index f42f11e..8a8bb14 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -562,7 +562,6 @@ func TestResolveClosureName(t *testing.T) { Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, }, }, - ClosureUse: nil, ReturnType: &ast.Nullable{Expr: nameBC}, Stmts: []ast.Vertex{}, } diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 255ffe9..8802a43 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -684,7 +684,10 @@ func (p *printer) ExprClosure(n *ast.ExprClosure) { p.printToken(n.OpenParenthesisTkn, []byte("(")) p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) - p.printNode(n.ClosureUse) + p.printToken(n.UseTkn, p.ifNodeList(n.Use, []byte("use"))) + p.printToken(n.UseOpenParenthesisTkn, p.ifNodeList(n.Use, []byte("("))) + p.printSeparatedList(n.Use, n.UseSeparatorTkns, []byte(",")) + p.printToken(n.UseCloseParenthesisTkn, p.ifNodeList(n.Use, []byte(")"))) p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":"))) p.printNode(n.ReturnType) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) @@ -693,10 +696,8 @@ func (p *printer) ExprClosure(n *ast.ExprClosure) { } func (p *printer) ExprClosureUse(n *ast.ExprClosureUse) { - p.printToken(n.UseTkn, []byte("use")) - p.printToken(n.OpenParenthesisTkn, []byte("(")) - p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(",")) - p.printToken(n.CloseParenthesisTkn, []byte(")")) + p.printToken(n.AmpersandTkn, nil) + p.printNode(n.Var) } func (p *printer) ExprConstFetch(n *ast.ExprConstFetch) { diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index d918f0a..571f51e 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -1717,18 +1717,35 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n := &ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprReference{Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$foo")}, - }}, - &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$bar")}, - }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$foo")}, }, } n.Accept(p) - expected := `use(&$foo,$bar)` + expected := `$foo` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintExprClosureUse_Reference(t *testing.T) { + o := bytes.NewBufferString("") + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprClosureUse{ + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$foo")}, + }, + } + n.Accept(p) + + expected := `&$foo` actual := o.String() if expected != actual { @@ -1754,12 +1771,17 @@ func TestPrinterPrintExprClosure(t *testing.T) { }, }, }, - ClosureUse: &ast.ExprClosureUse{ - Uses: []ast.Vertex{ - &ast.ExprReference{Var: &ast.ExprVariable{ + Use: []ast.Vertex{ + &ast.ExprClosureUse{ + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, - }}, - &ast.ExprVariable{ + }, + }, + &ast.ExprClosureUse{ + Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$b")}, }, }, From 8bf1fa822dd9bb3d91ead43ec08e506285f8168b Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 19:38:45 +0200 Subject: [PATCH 122/140] refactoring: update ast structure of "Foreach" node --- internal/php5/parser_test.go | 461 +++++------------------------- internal/php5/php5.go | Bin 265070 -> 265275 bytes internal/php5/php5.y | 81 ++++-- internal/php7/parser_test.go | 461 +++++------------------------- internal/php7/php7.go | Bin 219555 -> 219466 bytes internal/php7/php7.y | 50 ++-- pkg/ast/node.go | 1 + pkg/ast/visitor/dumper.go | 1 + pkg/ast/visitor/formatter.go | 3 + pkg/ast/visitor/formatter_test.go | 38 +++ pkg/ast/visitor/printer.go | 1 + pkg/ast/visitor/printer_test.go | 33 +++ 12 files changed, 310 insertions(+), 820 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 6ff6707..10e9084 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -15045,61 +15045,53 @@ func TestStmtForeach_WithRef(t *testing.T) { }, }, }, - Var: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 24, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, }, }, }, - Var: &ast.ExprVariable{ + }, + Var: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$v"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - }, - Value: []byte("$v"), }, + Value: []byte("$v"), }, }, CloseParenthesisTkn: &token.Token{ @@ -31770,7 +31762,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 36, }, FunctionTkn: &token.Token{ - ID: token.T_FUNCTION, + ID: token.T_FUNCTION, Value: []byte("function"), Position: &position.Position{ StartLine: 1, @@ -31780,7 +31772,7 @@ func TestExprClosure_Use(t *testing.T) { }, FreeFloating: []*token.Token{ { - ID: token.T_OPEN_TAG, + ID: token.T_OPEN_TAG, Value: []byte(" &$v) {}` - - expected := &ast.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Stmts: []ast.Vertex{ - &ast.StmtForeach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - ForeachTkn: &token.Token{ - ID: token.T_FOREACH, - Value: []byte("foreach"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_OPEN_TAG, - Value: []byte(""), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 21, - EndPos: 23, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 21, - }, - }, - }, - }, - Var: &ast.ExprReference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 27, - }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 24, - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - VarName: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$v"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - }, - Value: []byte("$v"), - }, - }, - }, - CloseParenthesisTkn: &token.Token{ - ID: token.ID(41), - Value: []byte(")"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, - }, - Stmt: &ast.StmtStmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 31, - }, - }, - }, - }, - }, - EndTkn: &token.Token{}, - } - - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) - php5parser.Parse() - actual := php5parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - func TestExprShellExec(t *testing.T) { src := "L0jG_}Ng;j&c(lz_{mWIE%Frl4S&3JBV+Qc8PJ(;8*`j3TWSjGS&imdAPEDWr{Xc)*_w3Jk*6;J2dwOyB z>raK($B1?%6%}O_l?yK1AUqrM#i7nJHDhjcR~_9|tWhFO?~M`zg-mzRjv_Igs$)d1 zNTn5ZB9Sh{h&;+k5Rud{QfAU-r?`wh8zw`jf4s_};x*)L-`!If7>O6-TU7Vt7JVYFH_XG$!~7 zI*_lrQ_B$HPh;I8oC;5?G5X$q;woV;(4*ZVO44~3Xjw4Vo~to;oWzU;VKSa##^9tc zlSMZnQmE*dc%KUQiV7N*iX|(~VM%?eSnONegQ{v|EV;r}uKs9%ND&m3;hhLNT8AB! z885q$>#TI?;HyNrB=>6E@a6#`hH73=aa10xk{16U`%_3qb-7-WC3*{LNddbTUklD0 zC|2DyHry_0bB@RtNj}o1Q{MHMfZYsf1@!&(Ai!`IoBu3)=j2>UL0?IUgD~^5h0?HW zAcYqS2bG7aIc-m$Kg5OEZ4RSUM3cATmfRe=UmTjr}=_cmO__O~FUqa}CQJ|hT{!f%$C#i0<$P=mh^k~sh zvGT?0xN%}B%Np9R!9}C^E5~D}<2|6kQ4>Jyz2CwFTGl|x7frxGPPIy=&|;Cxl-UE- z#XPWDMN)a52w)YSEm$Yaa5OzT5wl;}3FW>xQLGXojhZq+=Obkzl!D@A7}dMvL)37+ zET*Q(U`K}TdaHOsS)y7tMMP8cIhCjTm5Mi|UwU9bz}@uCUD&PjbTL9&vVFK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%F$ z+>j2_qt8acztb=S?tmP2DdIL+eL8zgJ$m0;#>m~ubieUl^rw|;u^`3zAAtC|Ckv+sZq7W+p8#!t9RpS~{m^y5`%&oz zmHH7gdRhEuJthE5q84Qweh_=7sA)Rr3so#xrRH2wLgXKSNhkY8vS}) z)!;r@WqSJ*#Jc}$1N!~VF!Qb&OwWA-v$5k9CR@hnl5bQ73MqqK(<$=|H~}_b)Jj0D zhpEO2^xtys;lGvN8qY8Vpk=%*zJokwpHY#Nw@KhHfZ%}y53KcYnOEtGOchkTM$Mq( zKft{3xWd7s zr2a5f55hVi{vE1x4J#hP*BdD5Iz;An=;7DZFiG970jK%19o|gp--Ogq#lo)>^!%IZ zCqZBSjH2IuTR8+B{LLuA$PFXoIKA-)UHtsb= z^PlWbR$oh>x(D=yn9hlupTRm)Z(%dR+v>Sqkv7f*Cgi-JYyi&YxylNC-(vuK(bG-T w?>Qh;x*WtytT!DE{Jm1p?TR+vOTNJa7`!BC*#Tr^v^|1&-+O2^gxQ?`3#VndQ~&?~ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 50edcc3..6b33687 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5,6 +5,7 @@ import ( "strconv" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/token" ) @@ -983,39 +984,63 @@ unticked_statement: } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { - $8.(*ast.StmtForeach).ForeachTkn = $1 - $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 - $8.(*ast.StmtForeach).Expr = $3 - $8.(*ast.StmtForeach).AsTkn = $4 - if $6 == nil { - $8.(*ast.StmtForeach).Var = $5 - } else { - $8.(*ast.StmtForeach).Key = $5 - $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn - $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var - } - $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) + foreach := $8.(*ast.StmtForeach) - $$ = $8 + foreach.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) + foreach.ForeachTkn = $1 + foreach.OpenParenthesisTkn = $2 + foreach.Expr = $3 + foreach.AsTkn = $4 + foreach.Var = $5 + foreach.CloseParenthesisTkn = $7 + + if $6 != nil { + foreach.Key = foreach.Var + foreach.DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + foreach.Var = $6.(*ast.StmtForeach).Var + } + + if val, ok := foreach.Key.(*ast.ExprReference); ok { + yylex.(*Parser).errHandlerFunc(errors.NewError("Key element cannot be a reference", val.AmpersandTkn.Position)) + foreach.Key = val.Var + } + + if val, ok := foreach.Var.(*ast.ExprReference); ok { + foreach.AmpersandTkn = val.AmpersandTkn + foreach.Var = val.Var + } + + $$ = foreach } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { - $8.(*ast.StmtForeach).ForeachTkn = $1 - $8.(*ast.StmtForeach).OpenParenthesisTkn = $2 - $8.(*ast.StmtForeach).Expr = $3 - $8.(*ast.StmtForeach).AsTkn = $4 - if $6 == nil { - $8.(*ast.StmtForeach).Var = $5 - } else { - $8.(*ast.StmtForeach).Key = $5 - $8.(*ast.StmtForeach).DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn - $8.(*ast.StmtForeach).Var = $6.(*ast.StmtForeach).Var - } - $8.(*ast.StmtForeach).CloseParenthesisTkn = $7 - $8.(*ast.StmtForeach).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) + foreach := $8.(*ast.StmtForeach) - $$ = $8 + foreach.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $8) + foreach.ForeachTkn = $1 + foreach.OpenParenthesisTkn = $2 + foreach.Expr = $3 + foreach.AsTkn = $4 + foreach.Var = $5 + foreach.CloseParenthesisTkn = $7 + + if $6 != nil { + foreach.Key = foreach.Var + foreach.DoubleArrowTkn = $6.(*ast.StmtForeach).DoubleArrowTkn + foreach.Var = $6.(*ast.StmtForeach).Var + } + + if val, ok := foreach.Key.(*ast.ExprReference); ok { + yylex.(*Parser).errHandlerFunc(errors.NewError("Key element cannot be a reference", val.AmpersandTkn.Position)) + foreach.Key = val.Var + } + + if val, ok := foreach.Var.(*ast.ExprReference); ok { + foreach.AmpersandTkn = val.AmpersandTkn + foreach.Var = val.Var + } + + $$ = foreach } | T_DECLARE '(' declare_list ')' declare_statement { diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index c33bafd..eb10949 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -16524,61 +16524,53 @@ func TestStmtForeach_WithRef(t *testing.T) { }, }, }, - Var: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 27, + EndPos: 25, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 24, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 24, }, }, }, - Var: &ast.ExprVariable{ + }, + Var: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 27, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$v"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 27, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$v"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - }, - Value: []byte("$v"), }, + Value: []byte("$v"), }, }, CloseParenthesisTkn: &token.Token{ @@ -36268,7 +36260,7 @@ func TestExprClosure_Use(t *testing.T) { EndPos: 36, }, FunctionTkn: &token.Token{ - ID: token.T_FUNCTION, + ID: token.T_FUNCTION, Value: []byte("function"), Position: &position.Position{ StartLine: 1, @@ -36278,7 +36270,7 @@ func TestExprClosure_Use(t *testing.T) { }, FreeFloating: []*token.Token{ { - ID: token.T_OPEN_TAG, + ID: token.T_OPEN_TAG, Value: []byte(" &$v) {}` - - expected := &ast.Root{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - Stmts: []ast.Vertex{ - &ast.StmtForeach{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 31, - }, - ForeachTkn: &token.Token{ - ID: token.T_FOREACH, - Value: []byte("foreach"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 3, - EndPos: 10, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_OPEN_TAG, - Value: []byte(""), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 21, - EndPos: 23, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 21, - }, - }, - }, - }, - Var: &ast.ExprReference{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 27, - }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 24, - }, - }, - }, - }, - Var: &ast.ExprVariable{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - VarName: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$v"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 27, - }, - }, - Value: []byte("$v"), - }, - }, - }, - CloseParenthesisTkn: &token.Token{ - ID: token.ID(41), - Value: []byte(")"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 28, - }, - }, - Stmt: &ast.StmtStmtList{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 31, - }, - OpenCurlyBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - }, - }, - }, - Stmts: []ast.Vertex{}, - CloseCurlyBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 31, - }, - }, - }, - }, - }, - EndTkn: &token.Token{}, - } - - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) - php7parser.Parse() - actual := php7parser.GetRootNode() - assert.DeepEqual(t, expected, actual) -} - func TestExprShellExec(t *testing.T) { src := "cBzk{Fn#o9`9`h4#s-8ci@`hjgN7mg*X>xBZb?erpOJZUh zU0RmYw9f0&Wi%kxUXritDO(o5!rg{?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.printToken(n.CloseParenthesisTkn, []byte(")")) p.printToken(n.ColonTkn, nil) diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 571f51e..8671134 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -3799,6 +3799,39 @@ func TestPrinterPrintStmtForeach(t *testing.T) { } } +func TestPrinterPrintStmtForeach_Reference(t *testing.T) { + o := bytes.NewBufferString("") + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtForeach{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$a")}, + }, + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$k")}, + }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$v")}, + }, + Stmt: &ast.StmtStmtList{ + Stmts: []ast.Vertex{ + &ast.StmtNop{}, + }, + }, + } + n.Accept(p) + + expected := `foreach($a as$k=>&$v){;}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestPrinterPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") From 0f5f5e7dc7980e0466c1dffada468c91756ff688 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 20:13:50 +0200 Subject: [PATCH 123/140] refactoring: update ast structure of "ArrayItem" node --- internal/php5/parser_test.go | 120 ++++++++++++++------------------ internal/php5/php5.go | Bin 265275 -> 264719 bytes internal/php5/php5.y | 36 ++++------ internal/php7/parser_test.go | 120 ++++++++++++++------------------ internal/php7/php7.go | Bin 219466 -> 219194 bytes internal/php7/php7.y | 18 ++--- pkg/ast/node.go | 1 + pkg/ast/visitor/dumper.go | 1 + pkg/ast/visitor/printer.go | 1 + pkg/ast/visitor/printer_test.go | 26 ++++++- 10 files changed, 149 insertions(+), 174 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 10e9084..eeca77d 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -30786,61 +30786,53 @@ func TestExprArray_Items(t *testing.T) { StartPos: 15, EndPos: 18, }, - Val: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, - EndPos: 18, + EndPos: 16, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 16, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 14, - EndPos: 15, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, }, }, }, - Var: &ast.ExprVariable{ + }, + Val: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$b"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 18, - }, - }, - Value: []byte("$b"), }, + Value: []byte("$b"), }, }, }, @@ -39025,61 +39017,53 @@ func TestExprShortArray_Items(t *testing.T) { StartPos: 10, EndPos: 13, }, - Val: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, - EndPos: 13, + EndPos: 11, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 11, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 10, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, }, }, }, - Var: &ast.ExprVariable{ + }, + Val: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$b"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - }, - Value: []byte("$b"), }, + Value: []byte("$b"), }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 7fbb547dfe6a9c3326b662fc5364e4b8f1cdc961..392b1132d53396f555d692f1c4d9e96d9fca5d7f 100644 GIT binary patch delta 885 zcmY*XTS!z<6lL#yb!JE{%hX}i8G9%bWHaN8*P$f)8E^Da5WNd=I zM1yek)dK~8dMHE}>Bqi;qLN5M6f=t~G#`YdO=V}sNAz(o=d82$+Iz3HpWIy6a${Xr z#K|E&ZaA+QPEsFRhEwu;&~S;fP=Ak{_|_;+Oncd8(IjUQcD92rulHx6wB%&02UA6I2oC_Q*GC^Z}iqp5^k@RafPwz!n7 zwx;9Ika*>A^c0Mi zrccuGYm3~+rdg#&MbJ7oD`y!Llsv?egDGjs2wUfrSHUo%wW{RkdDg7vIhiE(Eeq&d z5I^DhyhPal4{Aud(U*`C>(x&oQcf%_O_FyyAsM7v&VIyh%k^6>l9E1k>HZ^jq6%E^ zS1*H$l21vc^`#}*kK?2ntm~FPL6 l>rfeKT5^5%oRAe{!KRQv%J*cv{Ht76!t-9KF{4;e({o;p;Zgmo&`#Dowm zD4#$GtxFe6A$pN0te}%$*as?#ACMU2M@6Ql)w^p2f`|7o^UnNu=9y`{o&4->a(mFu z{=!<*UT@k-KUSt)(mIV3;qygk?;$(PY}$&-cj6}>(l4_c@2fc#MHe{>0A0&jT1xiK4Nr%wVFHXz{#EpuxvKM`El7wruauOXqT2H8)x1jwH8Bx*Y7^vnw zIMz!$@egfb>lN50Bn2gPvIQA~668D&YI@iKR}LR+s+E1H$Y2*LQaFHL{bJdG>_>lt zHp4rli?t7#hSjDA{m2lQ*fy!?K$=-vf7xlwkXa z?#Rza>kB!cZj5Ndwc{Nh*r~=xYWlI^hXW2naJCaF(n<8i<&HQG@X-7M3&e3kD%?NoPwv5veEZ|!lG|(=L@0U2V%}XK@c1tT3X7#`UzdAf8=NQLV zwK_dS4q@r59?}PC311=y@r(}821Pf7scb17$KBRQo8cQ8xILRaYjh1 Y)u44{gBG3EcW|5>(Zc(LQLEwo1F3^JApigX diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 6b33687..a1bb134 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5255,14 +5255,11 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewNodesPosition($3, $6), + Position: yylex.(*Parser).builder.NewNodesPosition($3, $6), Key: $3, DoubleArrowTkn: $4, - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($5, $6), - AmpersandTkn: $5, - Var: $6, - }, + AmpersandTkn: $5, + Val: $6, } $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) @@ -5273,12 +5270,9 @@ non_empty_array_pair_list: | non_empty_array_pair_list ',' '&' w_variable { arrayItem := &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), - AmpersandTkn: $3, - Var: $4, - }, + Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), + AmpersandTkn: $3, + Val: $4, } $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) @@ -5291,14 +5285,11 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), - AmpersandTkn: $3, - Var: $4, - }, + AmpersandTkn: $3, + Val: $4, }, }, } @@ -5308,12 +5299,9 @@ non_empty_array_pair_list: $$ = &ast.ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - AmpersandTkn: $1, - Var: $2, - }, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + AmpersandTkn: $1, + Val: $2, }, }, } diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index eb10949..cd532ff 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -34718,61 +34718,53 @@ func TestExprArray_Items(t *testing.T) { StartPos: 15, EndPos: 18, }, - Val: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, - EndPos: 18, + EndPos: 16, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 16, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 14, - EndPos: 15, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, }, }, }, - Var: &ast.ExprVariable{ + }, + Val: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 18, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 18, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$b"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 18, - }, - }, - Value: []byte("$b"), }, + Value: []byte("$b"), }, }, }, @@ -43983,61 +43975,53 @@ func TestExprShortArray_Items(t *testing.T) { StartPos: 10, EndPos: 13, }, - Val: &ast.ExprReference{ + AmpersandTkn: &token.Token{ + ID: token.ID(38), + Value: []byte("&"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 10, - EndPos: 13, + EndPos: 11, }, - AmpersandTkn: &token.Token{ - ID: token.ID(38), - Value: []byte("&"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 10, - EndPos: 11, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 9, - EndPos: 10, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 9, + EndPos: 10, }, }, }, - Var: &ast.ExprVariable{ + }, + Val: &ast.ExprVariable{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 11, + EndPos: 13, + }, + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_VARIABLE, + Value: []byte("$b"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 13, }, - IdentifierTkn: &token.Token{ - ID: token.T_VARIABLE, - Value: []byte("$b"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 13, - }, - }, - Value: []byte("$b"), }, + Value: []byte("$b"), }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 85bc3917dc5228361faa2af1ba26b9f2b17a051c..2e0135be48ae0af5829c12c6c46f36a10850cf1b 100644 GIT binary patch delta 763 zcmZ8fTSyaN6y}_xPIH^LQs=Zy?Bb+wb55P&t;|cN&ZsOXG@-&7!%WF#ro!+c1JB8;fFK#4-gsDDWaJ^T;naL#u-|BDBvCm~ZP(?ae*mSs50 zLi(}FvdCK_+S}QTMlL@}3vBadC4HB}68Ftowx3%P_NVFO;vX?M4#Tn>NkuIbaYe6m#K3-+J@)yewX1539n_Lkb z)h5<9`3Ra?C=Q{AWJZ6bB;w~H7sCIIqHt}Al5wSp4Dfg8yl<7s9Sj6H6X6Q!M!1L) z;9Q`@{{WN*$R|9m7Asb#*n-{)ZOt`IR;BkY2(nAJAogIbl1>FPB!K3_Qp+wc$jesv zK5-1JwPM8AySxJ*jFOEi6K5l#MyA;5QTJ=4m#IKm>*SbFA=U$10cqApjXG(k`rRnc znT!AW-mN}2%MfkR&a_Ir3iyNxhs)Tibe%*vG_5o3zr=AWd^|GRInFkWo)m-XJ0V2m zLTedW5lWUQrP~(5>@!`5&r%DL+BBmZzuxPA7pjk(y+r>uf2`K~uQaRGHi@S#rKy;2 L*GEr3BL#l|4xH|{ delta 782 zcmaKqO-NKx6vsK|IH>4M>Zmp5==7mxqP`iNu}L&PK&K%a?L%EC%@78enMozJFhNL& zN+I;WC)>iae~DP}y;PdmXQ1vBWg%@Bm15eaJG@pV0rH`)Oq}X- znbZEidAsTYAVJM^H5$IZy01uy`>J z_BJrANfk(>lWRddzs@QJF&8l+9q>k1U2>2h#7`PUgt- z)qJZAZY(i$L=sikVIg9VcOzQAau9-T`X5~%;WR9CQV7&00X=sL5^lCjz~or{$t6hY G5YKNP?fV!2 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index f85ad45..3e7e479 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3994,25 +3994,19 @@ array_pair: | expr T_DOUBLE_ARROW '&' variable { $$ = &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), + Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Key: $1, DoubleArrowTkn: $2, - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $4), - AmpersandTkn: $3, - Var: $4, - }, + AmpersandTkn: $3, + Val: $4, } } | '&' variable { $$ = &ast.ExprArrayItem{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - Val: &ast.ExprReference{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - AmpersandTkn: $1, - Var: $2, - }, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + AmpersandTkn: $1, + Val: $2, } } | T_ELLIPSIS expr diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 8a020b6..62d26a5 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1177,6 +1177,7 @@ type ExprArrayItem struct { EllipsisTkn *token.Token Key Vertex DoubleArrowTkn *token.Token + AmpersandTkn *token.Token Val Vertex } diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index dfb5a64..598ab1f 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1056,6 +1056,7 @@ func (v *Dumper) ExprArrayItem(n *ast.ExprArrayItem) { v.dumpToken("EllipsisTkn", n.EllipsisTkn) v.dumpVertex("Key", n.Key) v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) + v.dumpToken("AmpersandTkn", n.AmpersandTkn) v.dumpVertex("Val", n.Val) v.indent-- diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index ff0fac5..479c98c 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -641,6 +641,7 @@ func (p *printer) ExprArrayItem(n *ast.ExprArrayItem) { p.printToken(n.EllipsisTkn, nil) p.printNode(n.Key) p.printToken(n.DoubleArrowTkn, p.ifNode(n.Key, []byte("=>"))) + p.printToken(n.AmpersandTkn, nil) p.printNode(n.Val) } diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 8671134..187c173 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -1559,9 +1559,31 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n := &ast.ExprArrayItem{ - Val: &ast.ExprReference{Var: &ast.ExprVariable{ + Val: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$world")}, - }}, + }, + } + n.Accept(p) + + expected := `$world` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintExprArrayItem_Reference(t *testing.T) { + o := bytes.NewBufferString("") + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.ExprArrayItem{ + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Val: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$world")}, + }, } n.Accept(p) From a593760569778bbd0a4f091e80288f78fd57bc98 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 22:38:35 +0200 Subject: [PATCH 124/140] refactoring: remove ExprReference node --- internal/php5/php5.go | Bin 264719 -> 264709 bytes internal/php5/php5.y | 10 ++-- internal/php7/php7.go | Bin 219194 -> 219188 bytes internal/php7/php7.y | 6 +-- pkg/ast/ast.go | 1 - pkg/ast/node.go | 15 ------ pkg/ast/traverser/dfs.go | 12 ----- pkg/ast/visitor/dumper.go | 12 ----- pkg/ast/visitor/formatter.go | 5 -- pkg/ast/visitor/formatter_test.go | 25 ---------- pkg/ast/visitor/null.go | 4 -- pkg/ast/visitor/printer.go | 5 -- pkg/ast/visitor/printer_test.go | 75 +++++++++++++++++++----------- 13 files changed, 57 insertions(+), 113 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 392b1132d53396f555d692f1c4d9e96d9fca5d7f..f002d9350497d3cb23729743b41107726741b937 100644 GIT binary patch delta 87 zcmeC5BG5WTpkWK+_DRz%CNc6%e=&`5ADFd$;$%ioW;DU+K*7@Onll)CO{XVZWt5)& ap@mUpdV&a(dAr^@Mj&R|u6K_4p)~;XVj>0r delta 138 zcmZpjBG5lYpkWK+_DQ_16$M2>scET2sd>q%(;rS_+>a`>y=O9`7c;6D7G=|c%F4DY z&S2~{o&I486U+32l}r}X8{!%DrZ@008Bd>ohLLajgi$val):$d;endforeach;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrinterPrintAltForeach_Reference(t *testing.T) { + o := bytes.NewBufferString("") + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n := &ast.StmtForeach{ + Expr: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$var")}, + }, + Key: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$key")}, + }, + AmpersandTkn: &token.Token{ + Value: []byte("&"), + }, + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{Value: []byte("$val")}, + }, ColonTkn: &token.Token{ Value: []byte(":"), }, From 616fd4448ee4d96dc914698081218c09d6fbd576 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 22:41:25 +0200 Subject: [PATCH 125/140] 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{ From 115d481a576c8f787543eeb84d4c1c1c1a700b19 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 22:44:14 +0200 Subject: [PATCH 126/140] refactoring: update ast structure of "IncludeOnce" node --- internal/php5/parser_test.go | 2 +- internal/php5/php5.go | Bin 264710 -> 264722 bytes internal/php5/php5.y | 6 +++--- internal/php7/parser_test.go | 2 +- internal/php7/php7.go | Bin 219189 -> 219201 bytes internal/php7/php7.y | 6 +++--- pkg/ast/node.go | 6 +++--- pkg/ast/visitor/dumper.go | 4 ++-- pkg/ast/visitor/formatter.go | 2 +- pkg/ast/visitor/printer.go | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 7cf63ec..f4b35d8 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -35182,7 +35182,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 3, EndPos: 18, }, - IncludeTkn: &token.Token{ + IncludeOnceTkn: &token.Token{ ID: token.T_INCLUDE_ONCE, Value: []byte("include_once"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index fb7f8dbbb4330434f8362d59d47419ac58ec7ce1..09a19308ced0fc3ff5d7791a98ff3fc56485e676 100644 GIT binary patch delta 56 zcmV-80LTA^ln|1X5P*aMgaWh!*ZG$)$^##lu>1o&moEAP2Lw-UV`Z0dJpmk-AcO%9 Om)}bRBe#C~1BefKE)`Y) delta 26 icmbOp!Qj{=vLrd-pHqc76bzr3@_q diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 8a66936..f08fbff 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5533,9 +5533,9 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - IncludeTkn: $1, - Expr: $2, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + IncludeOnceTkn: $1, + Expr: $2, } } | T_EVAL '(' expr ')' diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 02bf256..2854d9a 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -39864,7 +39864,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 3, EndPos: 18, }, - IncludeTkn: &token.Token{ + IncludeOnceTkn: &token.Token{ ID: token.T_INCLUDE_ONCE, Value: []byte("include_once"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 9503f811bf9f1defe6ebb5abd691334b115512e9..2c5e9d0db325f02e2b2c819acf5fdad03faa2be9 100644 GIT binary patch delta 61 zcmV-D0K)&Zunobm4S<9JgaWh!tWcMb>jET~picun1W#^bWtX8k0vwl6wgL{9D_%pBEo*2mdfDHha!3vWA diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 44d8880..4e44911 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4292,9 +4292,9 @@ internal_functions_in_yacc: | T_INCLUDE_ONCE expr { $$ = &ast.ExprIncludeOnce{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - IncludeTkn: $1, - Expr: $2, + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + IncludeOnceTkn: $1, + Expr: $2, } } | T_EVAL '(' expr ')' diff --git a/pkg/ast/node.go b/pkg/ast/node.go index a3f60d8..e85fde6 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1434,9 +1434,9 @@ func (n *ExprInclude) GetPosition() *position.Position { // ExprIncludeOnce node type ExprIncludeOnce struct { - Position *position.Position - IncludeTkn *token.Token - Expr Vertex + Position *position.Position + IncludeOnceTkn *token.Token + Expr Vertex } func (n *ExprIncludeOnce) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 689274d..dc5536d 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1257,7 +1257,7 @@ func (v *Dumper) ExprInclude(n *ast.ExprInclude) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpToken("IncludeOnceTkn", n.IncludeTkn) v.dumpVertex("Expr", n.Expr) v.indent-- @@ -1269,7 +1269,7 @@ func (v *Dumper) ExprIncludeOnce(n *ast.ExprIncludeOnce) { v.indent++ v.dumpPosition(n.Position) - v.dumpToken("IncludeTkn", n.IncludeTkn) + v.dumpToken("IncludeOnceTkn", n.IncludeOnceTkn) v.dumpVertex("Expr", n.Expr) v.indent-- diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 8ce9363..3831228 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1258,7 +1258,7 @@ func (f *formatter) ExprInclude(n *ast.ExprInclude) { } func (f *formatter) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - n.IncludeTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once")) + n.IncludeOnceTkn = f.newToken(token.T_INCLUDE_ONCE, []byte("include_once")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.Expr.Accept(f) } diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 524c1e8..22e0cae 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -745,7 +745,7 @@ func (p *printer) ExprInclude(n *ast.ExprInclude) { } func (p *printer) ExprIncludeOnce(n *ast.ExprIncludeOnce) { - p.printToken(n.IncludeTkn, []byte("include_once")) + p.printToken(n.IncludeOnceTkn, []byte("include_once")) p.printNode(n.Expr) } From 69919594fde5177ff74528a66dfc8455e4ba5a42 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 26 Dec 2020 22:48:02 +0200 Subject: [PATCH 127/140] refactoring: short int cast --- pkg/ast/visitor/formatter.go | 2 +- pkg/ast/visitor/formatter_test.go | 2 +- pkg/ast/visitor/printer.go | 2 +- pkg/ast/visitor/printer_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 3831228..f66c766 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1878,7 +1878,7 @@ func (f *formatter) ExprCastDouble(n *ast.ExprCastDouble) { } func (f *formatter) ExprCastInt(n *ast.ExprCastInt) { - n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(integer)")) + n.CastTkn = f.newToken(token.T_INT_CAST, []byte("(int)")) n.Expr.Accept(f) } diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index d99fbfa..6a72c6b 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -6309,7 +6309,7 @@ func TestFormatter_ExprCastInt(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n.Accept(p) - expected := `(integer)$foo` + expected := `(int)$foo` actual := o.String() if expected != actual { diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 22e0cae..7fba6a1 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -1152,7 +1152,7 @@ func (p *printer) ExprCastDouble(n *ast.ExprCastDouble) { } func (p *printer) ExprCastInt(n *ast.ExprCastInt) { - p.printToken(n.CastTkn, []byte("(integer)")) + p.printToken(n.CastTkn, []byte("(int)")) p.printNode(n.Expr) } diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 55b56d6..3f75246 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -1447,7 +1447,7 @@ func TestPrinterPrintInt(t *testing.T) { } n.Accept(p) - expected := `(integer)$var` + expected := `(int)$var` actual := o.String() if expected != actual { From 2c09138600a57f3a0bbfb1563177a18a2de063fd Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 27 Dec 2020 21:55:36 +0200 Subject: [PATCH 128/140] refactoring: update ast structure of "Variable" node --- internal/php5/parser_test.go | 108 ++++++++++++++---------------- internal/php5/php5.go | Bin 264722 -> 264502 bytes internal/php5/php5.y | 26 +++---- internal/php7/parser_test.go | 108 ++++++++++++++---------------- internal/php7/php7.go | Bin 219201 -> 219091 bytes internal/php7/php7.y | 13 ++-- pkg/ast/node.go | 8 ++- pkg/ast/visitor/dumper.go | 2 + pkg/ast/visitor/formatter.go | 10 +++ pkg/ast/visitor/formatter_test.go | 23 +++++++ pkg/ast/visitor/printer.go | 2 + pkg/ast/visitor/printer_test.go | 8 ++- 12 files changed, 164 insertions(+), 144 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index f4b35d8..889fb3c 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -16726,90 +16726,82 @@ func TestStmtGlobal_Vars(t *testing.T) { }, }, }, - VarName: &ast.ParserBrackets{ + OpenCurlyBracketTkn: &token.Token{ + ID: token.ID(123), + Value: []byte("{"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 24, - EndPos: 31, + EndPos: 25, }, - OpenBracketTkn: &token.Token{ - ID: token.ID(123), - Value: []byte("{"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, + }, + VarName: &ast.ExprFunctionCall{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 30, }, - Child: &ast.ExprFunctionCall{ + Function: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, - EndPos: 30, + EndPos: 28, }, - Function: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 28, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("foo"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - }, - Value: []byte("foo"), }, - }, - }, - OpenParenthesisTkn: &token.Token{ - ID: token.ID(40), - Value: []byte("("), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, - }, - CloseParenthesisTkn: &token.Token{ - ID: token.ID(41), - Value: []byte(")"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, + Value: []byte("foo"), }, }, }, - CloseBracketTkn: &token.Token{ - ID: token.ID(125), - Value: []byte("}"), + OpenParenthesisTkn: &token.Token{ + ID: token.ID(40), + Value: []byte("("), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 30, - EndPos: 31, + StartPos: 28, + EndPos: 29, }, }, + CloseParenthesisTkn: &token.Token{ + ID: token.ID(41), + Value: []byte(")"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, + }, + }, + }, + CloseCurlyBracketTkn: &token.Token{ + ID: token.ID(125), + Value: []byte("}"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 31, + }, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 09a19308ced0fc3ff5d7791a98ff3fc56485e676..9cc409a8f4aa551c370ddaf821d5df6d8dd76199 100644 GIT binary patch delta 6544 zcmbtYdsLNG+F$$Ghl_}CyaXa32N12i9j*sW1v3TwQqWRM^Ma;mTI%%ac*z7ynJ#}fDnCYa_=#O9B8)4xh|&C)Kg!m;e75Mo-mw(QxjjUB=;-2K z4KIFpYF|$5A)?tko!ary8KM(=8z_b^MNvMbdpI>yB=FKs&`NY56%>=_{RjA!E<)VB;^`I!v!x&pvgSfBN7y5DoJGW+$M1g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fo!m@p zolHeo z%-kC7LVg&DN80cdcl9uGa6%#KeEGdM0r{?BA)YnYDbRu+@{iw*5 z6&T+nl{i)-&G@lEfcP2mqH(z_;9yY(XC4$u8^QXU!{~8K2Yrke{Twj=EO0g9fu)(I z#hLv}r2~}-F2~3qXPYSv34>Slhe|Yu`V!?Gs+CN5x>V7Wka8s2=?=zM$Y#W^sfg*_ zl!N(Eeud&P%?-^^31T^lJ6Wa#ms=EKSB!b3lfoGKl}nJ^M%jxB^L&czjZ&#octS&J zF;hO-PAb{1cz%d;k*t+GB>d9nG)1 z$`O>TmaP~M$}(s2?jg4Dc~x3-t+ZfdANle9OAa7hEr-w+k!n1uQt-%M96bMsf*AdV zix3UUv&{7Ob2fgjQg2cdbQ}+B^Car7USy)9kM<> z2;}Mi(ko=9>tun{viJZkN8*m^RK7LyG!OcBI?<2Q(hWWeS# zx+M*Sxv=9}^|{k3>^(h{-ZBTG(n{EF$#I-*Qk=a+Y4f4xmpka^A#O64e&SX#W6jb< z4(Of971%qYiWRgL({o&az3XKcM)q)4dUQ*0pqpH9uag^CxkOj`|H_P(-6MpC7wu1m z+P0p@VnTxgeW zLFh9bx-*$bmvnHn(R|q@cQcG?RF?UqTaIM9wBxrulB-wrg%(yOq?9<)=yWz}c;7puJ=IbeW26Vi97i-mT!pKJ_n}S Date: Sun, 27 Dec 2020 23:04:09 +0200 Subject: [PATCH 129/140] refactoring: update ast structure of "MethodCall" and "PropertyFetch" nodes --- internal/php5/php5.go | Bin 264502 -> 265114 bytes internal/php5/php5.y | 20 ++++++++--- internal/php7/php7.go | Bin 219091 -> 219920 bytes internal/php7/php7.y | 30 ++++++++++++++-- pkg/ast/node.go | 28 ++++++++------- pkg/ast/visitor/dumper.go | 4 +++ pkg/ast/visitor/formatter.go | 22 ++++++++++++ pkg/ast/visitor/formatter_test.go | 56 ++++++++++++++++++++++++++++++ pkg/ast/visitor/printer.go | 4 +++ 9 files changed, 144 insertions(+), 20 deletions(-) diff --git a/internal/php5/php5.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%{{@4`I6?pb diff --git a/internal/php5/php5.y b/internal/php5/php5.y index ac247f2..ba55690 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -4709,7 +4709,9 @@ variable: ) $3 = append($3, $4[1:len($4)]...) case *ast.ExprPropertyFetch: + $4[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn $4[0].(*ast.ExprMethodCall).Method = l.Property + $4[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn $4[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn $3 = append($3[:len($3)-1], $4...) } @@ -4801,7 +4803,9 @@ variable_property: ) $2 = append($2, $3[1:len($3)]...) case *ast.ExprPropertyFetch: + $3[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn $3[0].(*ast.ExprMethodCall).Method = l.Property + $3[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn $3[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn $2 = append($2[:len($2)-1], $3...) } @@ -5078,12 +5082,18 @@ object_dim_list: } | variable_name { - $$ = []ast.Vertex{ - &ast.ExprPropertyFetch{ - Position: yylex.(*Parser).builder.NewNodePosition($1), - Property: $1, - }, + property := &ast.ExprPropertyFetch{ + Position: yylex.(*Parser).builder.NewNodePosition($1), + Property: $1, } + + if brackets, ok := $1.(*ast.ParserBrackets); ok { + property.OpenCurlyBracketTkn = brackets.OpenBracketTkn + property.Property = brackets.Child + property.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = []ast.Vertex{ property } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index da378e52f82b1a5f6b914f0bf15a24ea0f49c5e7..bdd9dc602c500972979286197865b835c79bda2e 100644 GIT binary patch delta 1776 zcmds%T}+#06vuO(Gw9j@qrkupN?)8X46|!Xp)CYM#|DfD6vkwk8f1e7Qd|Mi#9)G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6lL#iJDC|Xxn|lV)0xTKiAhas#JQR0H7$0)OcF`WGzo1}s#GksHK-{* ze#DaEM^&VbC|Lxgq!wB~M59;_iiLopeuxSZ6-C9LLQ1NYf=Ek>`_4FR@XNn*);(wM zwf0))Rz7I__MOK0XoRz==i-rL@d%lCgde|vE4#SGoD#`0?5{Y03u|SNvPeEk4)*(G z2pwf^ndy)ie)Y)!<#4hC&L~$uYeq7B^6qWnAh$a#ruJus} zQ(+0>fM3S2FQTg-1A6zjBW&Z|Z5%QqL3x-s?}FasL=}QU0Zb)$6mxG-lPNdKT0-+< zRPE+pb>?_TepjwX7rDhF;>U_5R{={()LX4*6etpCiCe2W4mWG>pDnSm&?RfmzAQFj zC9K%|g7Ue6y|7;OX7TQVQYyF-|DWP+MzBpva1tCt>Hy#5@wtM@h!)GE_^OWP2Kwa& zWm&-VGR08tr*l}2$^aMK>N!)6$vs4=`o!b-BCdtQQTYi=?NTzCm~0>n*$TcEmkd7f zR-twYm~c|cgu{EZ?7ns4$MYRBQ8zVws|<23Ws(yzL^$24!jr>l?>BpC1iQPWBxyH~ z2RF$UB)YZW^el%k)+3{6->jux+9-$gM4=|7T0M4~e5#PU$^)I^LwNmtz4=79TvQF$ z?J?7v#3D89WS8{ej}sil{71AEowv)ZqQ%oXpnBDHs9fgz@ZwnwfHLS~R5ptXJD@(< z*Jxuc8nHVy0IKelZfZgKJzec|RAM%Z;v}ty)lEM0u_N1vb2$&{fSs28oKKgrBq5)Z5~pfbc#M+&?Q7+wfmbCjX!HsE#gwjzog1e$PzyWF)D}5L zm@9ZD>mIsaK-uM1G|iG_+VA$vN|rS*_0J_(cSsXfzGDm9NAyYA=XI196XG*YQOCn;D{-&R$8*e!w3!)~rwKbQ tvu%2IN`q&zGsOurzDwG?dqh=#QoczwD9Te*lk0U0whH diff --git a/internal/php7/php7.y b/internal/php7/php7.y index ae5f176..078c6eb 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -3738,7 +3738,7 @@ callable_variable: } | dereferencable T_OBJECT_OPERATOR property_name argument_list { - $$ = &ast.ExprMethodCall{ + methodCall := &ast.ExprMethodCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Var: $1, ObjectOperatorTkn: $2, @@ -3748,6 +3748,14 @@ callable_variable: SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + methodCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn + methodCall.Method = brackets.Child + methodCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = methodCall } | function_call { @@ -3766,12 +3774,20 @@ variable: } | dereferencable T_OBJECT_OPERATOR property_name { - $$ = &ast.ExprPropertyFetch{ + propertyFetch := &ast.ExprPropertyFetch{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn + propertyFetch.Property = brackets.Child + propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = propertyFetch } ; @@ -3855,12 +3871,20 @@ new_variable: } | new_variable T_OBJECT_OPERATOR property_name { - $$ = &ast.ExprPropertyFetch{ + propertyFetch := &ast.ExprPropertyFetch{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, Property: $3, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn + propertyFetch.Property = brackets.Child + propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = propertyFetch } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 400537f..7a89a90 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1501,14 +1501,16 @@ func (n *ExprList) GetPosition() *position.Position { // ExprMethodCall node type ExprMethodCall struct { - Position *position.Position - Var Vertex - ObjectOperatorTkn *token.Token - Method Vertex - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token + Position *position.Position + Var Vertex + ObjectOperatorTkn *token.Token + OpenCurlyBracketTkn *token.Token + Method Vertex + CloseCurlyBracketTkn *token.Token + OpenParenthesisTkn *token.Token + Arguments []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token } func (n *ExprMethodCall) Accept(v NodeVisitor) { @@ -1615,10 +1617,12 @@ func (n *ExprPrint) GetPosition() *position.Position { // ExprPropertyFetch node type ExprPropertyFetch struct { - Position *position.Position - Var Vertex - ObjectOperatorTkn *token.Token - Property Vertex + Position *position.Position + Var Vertex + ObjectOperatorTkn *token.Token + OpenCurlyBracketTkn *token.Token + Property Vertex + CloseCurlyBracketTkn *token.Token } func (n *ExprPropertyFetch) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 9778215..11f3159 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1326,7 +1326,9 @@ func (v *Dumper) ExprMethodCall(n *ast.ExprMethodCall) { v.dumpPosition(n.Position) v.dumpVertex("Var", n.Var) v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertex("Method", n.Method) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) v.dumpVertexList("Arguments", n.Arguments) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) @@ -1419,7 +1421,9 @@ func (v *Dumper) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.dumpPosition(n.Position) v.dumpVertex("Var", n.Var) v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertex("Property", n.Property) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- v.print(v.indent, "},\n") diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 7fde3cb..9dd5d00 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1290,6 +1290,17 @@ func (f *formatter) ExprList(n *ast.ExprList) { func (f *formatter) ExprMethodCall(n *ast.ExprMethodCall) { n.Var.Accept(f) n.ObjectOperatorTkn = f.newToken(token.T_OBJECT_OPERATOR, []byte("->")) + + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + switch n.Method.(type) { + case *ast.Identifier: + case *ast.ExprVariable: + default: + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + } + n.Method.Accept(f) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) @@ -1346,6 +1357,17 @@ func (f *formatter) ExprPrint(n *ast.ExprPrint) { func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) { n.Var.Accept(f) n.ObjectOperatorTkn = f.newToken(token.T_OBJECT_OPERATOR, []byte("->")) + + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + switch n.Property.(type) { + case *ast.Identifier: + case *ast.ExprVariable: + default: + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + } + n.Property.Accept(f) } diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index 62580e7..bc08e81 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -4216,6 +4216,34 @@ func TestFormatter_ExprMethodCall(t *testing.T) { } } +func TestFormatter_ExprMethodCall_Expr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprMethodCall{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Method: &ast.ScalarString{ + Value: []byte("'bar'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo->{'bar'}()` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestFormatter_ExprMethodCall_Arguments(t *testing.T) { o := bytes.NewBufferString("") @@ -4483,6 +4511,34 @@ func TestFormatter_ExprPropertyFetch(t *testing.T) { } } +func TestFormatter_ExprPropertyFetch_Expr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprPropertyFetch{ + Var: &ast.ExprVariable{ + VarName: &ast.Identifier{ + Value: []byte("$foo"), + }, + }, + Property: &ast.ScalarString{ + Value: []byte("'bar'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `$foo->{'bar'}` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestFormatter_ExprRequire(t *testing.T) { o := bytes.NewBufferString("") diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index 99db93a..d4ac78a 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -772,7 +772,9 @@ func (p *printer) ExprList(n *ast.ExprList) { func (p *printer) ExprMethodCall(n *ast.ExprMethodCall) { p.printNode(n.Var) p.printToken(n.ObjectOperatorTkn, []byte("->")) + p.printToken(n.OpenCurlyBracketTkn, nil) p.printNode(n.Method) + p.printToken(n.CloseCurlyBracketTkn, nil) p.printToken(n.OpenParenthesisTkn, []byte("(")) p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) @@ -814,7 +816,9 @@ func (p *printer) ExprPrint(n *ast.ExprPrint) { func (p *printer) ExprPropertyFetch(n *ast.ExprPropertyFetch) { p.printNode(n.Var) p.printToken(n.ObjectOperatorTkn, []byte("->")) + p.printToken(n.OpenCurlyBracketTkn, nil) p.printNode(n.Property) + p.printToken(n.CloseCurlyBracketTkn, nil) } func (p *printer) ExprRequire(n *ast.ExprRequire) { From ad884c99df00ca08f49513739f12a26bda696aa6 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 27 Dec 2020 23:19:49 +0200 Subject: [PATCH 130/140] refactoring: update ast structure of "StaticCall" node --- internal/php5/php5.go | Bin 265114 -> 265640 bytes internal/php5/php5.y | 20 ++++++++++++++++++-- internal/php7/php7.go | Bin 219920 -> 220446 bytes internal/php7/php7.y | 20 ++++++++++++++++++-- pkg/ast/node.go | 18 ++++++++++-------- pkg/ast/visitor/dumper.go | 2 ++ pkg/ast/visitor/formatter.go | 11 +++++++++++ pkg/ast/visitor/formatter_test.go | 30 ++++++++++++++++++++++++++++++ pkg/ast/visitor/printer.go | 2 ++ 9 files changed, 91 insertions(+), 12 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a2bd33cfae51cbd291beebc187308c51052d3e7a..4e5baf8f419e80c834553b73dc282d4902ff0ba6 100644 GIT binary patch delta 3913 zcmcgvYgE-$7GLM=%Tq*HCWu_)qJUP4_XQU+muL!PY0wk%0XJM}J_<*N9L0j^p|x6z zR*h_D8b!uuiV9Yqe4#G0a`J(XG80pD9D52iMwU*_@0>rEYajYL_tXFEv(J9--`@9c z9JB7tn1GM6GpRg!DL8$x$`S%M^bLRTzK3RIVf96cbovQ7+%#l2FCpq}8zlvM9 z`Lc-UHPrF+499}V2>gP~>>ng=;o6;))FVht*JAj{PKt{R64~{h=*=O!XdpKn5n(sq zq~DMa3Kx%9CX-Z~ji9!^$j%2z?&7*g$`@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laS>|ZN)W+n@EQ8tj4|vL_i{lcQKq_aj;xLh8lI?qP*}DK=O&Ov zLo;nd7-nH?NR{baf8O5Q=AH*6Za0f44(}sF)sRmqN!Q*a8tvua4WA*2sT{S2Oy)xw zYu*vQ)Iu};Q|%rYt-XlL8NP%|2?1+e?$7lbgPj z$*ZqY1YeH_lJ1bxL zXl}UyBjxXk68#j#&QC=&M{a<*{Nvbzo!4k5Px*qDa&bLmKlVt$ql3~wO<@LR3j_@N zzGczBoo?V)ZfZ<c%a)=3n*H_y4A6v3a@tvl?f& z-~+coyM|KYIsXn;m6Uc8!d|TPe;fs2wBX=&a;o3nrTKc{Fyl+V+||PZ{pkNM=Ks)} zJ**%#R#;J*>Prf2EZP0?k+eXH&Eo9pkzy`Swyaz(lvXqkv#dBiZCRtBR`WBD3$XMs rHYAA^c%$ISL6(_QzNHwF(hw_G{W-`wi0v^9kJTa8KEd-lS)Ts_3R}A) diff --git a/internal/php5/php5.y b/internal/php5/php5.y index ba55690..a9d05ee 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -3688,7 +3688,7 @@ function_call: } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = &ast.ExprStaticCall{ + staticCall := &ast.ExprStaticCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, @@ -3698,6 +3698,14 @@ function_call: SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn + staticCall.Call = brackets.Child + staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = staticCall } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { @@ -3714,7 +3722,7 @@ function_call: } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { - $$ = &ast.ExprStaticCall{ + staticCall := &ast.ExprStaticCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, @@ -3724,6 +3732,14 @@ function_call: SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn + staticCall.Call = brackets.Child + staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = staticCall } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { diff --git a/internal/php7/php7.go b/internal/php7/php7.go index bdd9dc602c500972979286197865b835c79bda2e..72e8ddc19ce3bc761f1a6662688f62ada9d60d6c 100644 GIT binary patch delta 2138 zcmcIlYfzMB6rT4SQ7!_DC`v4_OCTzyy9>**Dgq@7H5jXqLem9@NlnzzH2Yy8YNJzA zh{MD)HjSY)I{nB|OFy+VohGWWDQZI0GDQI+kkp2}aGB2cEjR6VKX&GQ&v!1*dCv2m ztvVXK`$X`;s7P|#wnj&8kB(GYbR-=+Ja*msCF@@D8GQ=FaLAh z`UWacsmQ8UQLrtgQJVWFa*%Ri!ECX3v(-t=`-O5*(Wxfl^owFUrC)DV(!e#Xk#dzA zS^HFk@B86K%0Yb-g~3~`#^6Gk3PJ2SvCTa%HcJMLLscfn;AVze1WO-n!KNlj;lR!* zY9{W;nH)|n>pbNtN_HZvOih5>Nm2Ong1Dt%b0bBdwov)O%jA!wi&QMuuwJs`=tY5M z+DI0hPGCPwyhP7y6~EFeN;=#*jpH@3>{rsTBsH6S1B7?TICepB40mgqZXvM%Bkr(UBl8g$)eijRCQfW zNq@@M&;O9G&vZzZAKT~*TG}Z`Ik6yt%&2XpdW3X{!JywT_-U_oP!OTHTpT`ZrO}Xk zv`$qHR=%%7(cVEOBz94?O4BJH2>PvyQk4v0Ft6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/php7.y +++ b/internal/php7/php7.y @@ -3321,7 +3321,7 @@ function_call: } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = &ast.ExprStaticCall{ + staticCall := &ast.ExprStaticCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, @@ -3331,10 +3331,18 @@ function_call: SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn + staticCall.Call = brackets.Child + staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = staticCall } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { - $$ = &ast.ExprStaticCall{ + staticCall := &ast.ExprStaticCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), Class: $1, DoubleColonTkn: $2, @@ -3344,6 +3352,14 @@ function_call: SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } + + if brackets, ok := $3.(*ast.ParserBrackets); ok { + staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn + staticCall.Call = brackets.Child + staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn + } + + $$ = staticCall } | callable_expr argument_list { diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 7a89a90..290a51a 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -1681,14 +1681,16 @@ func (n *ExprShellExec) GetPosition() *position.Position { // ExprStaticCall node type ExprStaticCall struct { - Position *position.Position - Class Vertex - DoubleColonTkn *token.Token - Call Vertex - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token + Position *position.Position + Class Vertex + DoubleColonTkn *token.Token + OpenCurlyBracketTkn *token.Token + Call Vertex + CloseCurlyBracketTkn *token.Token + OpenParenthesisTkn *token.Token + Arguments []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token } func (n *ExprStaticCall) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 11f3159..dde094a 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -1473,7 +1473,9 @@ func (v *Dumper) ExprStaticCall(n *ast.ExprStaticCall) { v.dumpPosition(n.Position) v.dumpVertex("Class", n.Class) v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertex("Call", n.Call) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) v.dumpVertexList("Arguments", n.Arguments) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 9dd5d00..c698359 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1394,6 +1394,17 @@ func (f *formatter) ExprShellExec(n *ast.ExprShellExec) { func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) { n.Class.Accept(f) n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) + + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + switch n.Call.(type) { + case *ast.Identifier: + case *ast.ExprVariable: + default: + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) + } + n.Call.Accept(f) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index bc08e81..8180fdb 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -4692,6 +4692,36 @@ func TestFormatter_ExprStaticCall(t *testing.T) { } } +func TestFormatter_ExprStaticCall_Expr(t *testing.T) { + o := bytes.NewBufferString("") + + n := &ast.ExprStaticCall{ + Class: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("foo"), + }, + }, + }, + Call: &ast.ScalarString{ + Value: []byte("'bar'"), + }, + } + + f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + n.Accept(f) + + p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + n.Accept(p) + + expected := `foo::{'bar'}()` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + func TestFormatter_ExprStaticCall_Arguments(t *testing.T) { o := bytes.NewBufferString("") diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index d4ac78a..23b23f1 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -840,7 +840,9 @@ func (p *printer) ExprShellExec(n *ast.ExprShellExec) { func (p *printer) ExprStaticCall(n *ast.ExprStaticCall) { p.printNode(n.Class) p.printToken(n.DoubleColonTkn, []byte("::")) + p.printToken(n.OpenCurlyBracketTkn, nil) p.printNode(n.Call) + p.printToken(n.CloseCurlyBracketTkn, nil) p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) From e4321b5e9023da7605a8aaf819af47f053c866b8 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 28 Dec 2020 00:02:14 +0200 Subject: [PATCH 131/140] refactoring: create "ExprBrackets" node --- internal/php5/parser_test.go | 54 +++++++++---------- internal/php5/php5.go | Bin 265640 -> 265714 bytes internal/php5/php5.y | 86 +++++++++++++++--------------- internal/php7/parser_test.go | 40 +++++++------- internal/php7/php7.go | Bin 220446 -> 220503 bytes internal/php7/php7.y | 38 ++++++------- pkg/ast/ast.go | 1 + pkg/ast/node.go | 15 ++++++ pkg/ast/traverser/dfs.go | 12 +++++ pkg/ast/visitor/dumper.go | 13 +++++ pkg/ast/visitor/formatter.go | 6 +++ pkg/ast/visitor/formatter_test.go | 25 +++++++++ pkg/ast/visitor/null.go | 4 ++ pkg/ast/visitor/printer.go | 6 +++ pkg/ast/visitor/printer_test.go | 19 +++++++ 15 files changed, 210 insertions(+), 109 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 889fb3c..928496a 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -11513,14 +11513,14 @@ func TestStmtContinue(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 23, EndPos: 26, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -11530,7 +11530,7 @@ func TestStmtContinue(t *testing.T) { EndPos: 24, }, }, - Child: &ast.ScalarLnumber{ + Expr: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11549,7 +11549,7 @@ func TestStmtContinue(t *testing.T) { }, Value: []byte("3"), }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -12598,14 +12598,14 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, }, Exprs: []ast.Vertex{ - &ast.ParserBrackets{ + &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 11, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -12615,7 +12615,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndPos: 8, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12642,7 +12642,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -12694,14 +12694,14 @@ func TestStmtExpression(t *testing.T) { StartPos: 3, EndPos: 9, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 8, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -12733,14 +12733,14 @@ func TestStmtExpression(t *testing.T) { }, }, }, - Child: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 4, EndPos: 7, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -12750,7 +12750,7 @@ func TestStmtExpression(t *testing.T) { EndPos: 5, }, }, - Child: &ast.ScalarLnumber{ + Expr: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12769,7 +12769,7 @@ func TestStmtExpression(t *testing.T) { }, Value: []byte("1"), }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -12780,7 +12780,7 @@ func TestStmtExpression(t *testing.T) { }, }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -29993,14 +29993,14 @@ func TestStmtBreak(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 20, EndPos: 23, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -30010,7 +30010,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 21, }, }, - Child: &ast.ScalarLnumber{ + Expr: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30029,7 +30029,7 @@ func TestStmtBreak(t *testing.T) { }, Value: []byte("3"), }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -31402,14 +31402,14 @@ func TestExprClone_Brackets(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -31419,7 +31419,7 @@ func TestExprClone_Brackets(t *testing.T) { EndPos: 9, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31446,7 +31446,7 @@ func TestExprClone_Brackets(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -38335,14 +38335,14 @@ func TestExprPrint(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -38352,7 +38352,7 @@ func TestExprPrint(t *testing.T) { EndPos: 9, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38379,7 +38379,7 @@ func TestExprPrint(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 4e5baf8f419e80c834553b73dc282d4902ff0ba6..ce0b005c6530a61e131770ea1a267e42ecea3cf3 100644 GIT binary patch delta 1118 zcmZ26Tj0}dfrc%N?m0ZJ6$M33MTyDTsU^kJ8(Em8rvEBol$)M#j*)$OgB>Hg5V8VI zJrHmDMO8+X=@)Vs`A~H`Rxn9VSJh&Yn||RLBky*-T*irvs4A#nK1T*K@Ai&-Mtvq! zqaCXmMW%o3W0ar1zX<5`--V2F*qn|~5mLmci)KUxlPK7T?LZ^M(aeWAT?d<~-~fp) z#TpY(X{xq3QK z0mpRaD#noM@(N5G)Aw-$qr&{Ecn((_lVdU{cBcblS8)2eOlH3A7d|rT9GO1Bo0)Yw^EP0*YIqAuc<-6i zrafckpT3TRNo4wk4~$&X8w{EFrYp2C@=eeA%`7nOF3^yKT%e}D-^`NJ92t41J7h7j zZU3~5={`T2cR)e^{uq-6wjj_s&SZ|J92nM9MVQ66&pgg_D;$f%Os5wZF|$mcvyfSK zy2E}Z?&n`ECMmpRxD))%YMB3v{aP}oIranP*Dm~A9+P)az+Nys&%j|6N2g1JZx$a@|jDwxtb5Y?{ zBMU?!T{1%+(4VB*OM*fdBYdV^M`p-uL*D}ujD8xbL*dggZw zdJ!asEBX8k90cjaj9CI!Y5fdJzQWhmi-1+~1X#Wt%TV$aaBPAp-1Yz|kVrj$@q_+& z;4@$n0T)qfNH~3e0e!UaDAc~*3A&~=P`LLQVyEQxG9#Tl;yq19&`PONtmn(C7-l?q z#4L(*PtOb!%prT4ba#T)$tnemsPer8yX^TnjRVv>UTEqeQ^A~6d9 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index a9d05ee..245e18a 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -787,9 +787,9 @@ unticked_statement: $$ = &ast.StmtIf{ Position: pos, IfTkn: $1, - OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, - Cond: $2.(*ast.ParserBrackets).Child, - CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, + OpenParenthesisTkn: $2.(*ast.ExprBrackets).OpenParenthesisTkn, + Cond: $2.(*ast.ExprBrackets).Expr, + CloseParenthesisTkn: $2.(*ast.ExprBrackets).CloseParenthesisTkn, Stmt: $3, ElseIf: $4, Else: $5, @@ -800,9 +800,9 @@ unticked_statement: $$ = &ast.StmtIf{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), IfTkn: $1, - OpenParenthesisTkn: $2.(*ast.ParserBrackets).OpenBracketTkn, - Cond: $2.(*ast.ParserBrackets).Child, - CloseParenthesisTkn: $2.(*ast.ParserBrackets).CloseBracketTkn, + OpenParenthesisTkn: $2.(*ast.ExprBrackets).OpenParenthesisTkn, + Cond: $2.(*ast.ExprBrackets).Expr, + CloseParenthesisTkn: $2.(*ast.ExprBrackets).CloseParenthesisTkn, ColonTkn: $3, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($4), @@ -817,9 +817,9 @@ unticked_statement: | T_WHILE parenthesis_expr while_statement { $3.(*ast.StmtWhile).WhileTkn = $1 - $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn - $3.(*ast.StmtWhile).Cond = $2.(*ast.ParserBrackets).Child - $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn + $3.(*ast.StmtWhile).OpenParenthesisTkn = $2.(*ast.ExprBrackets).OpenParenthesisTkn + $3.(*ast.StmtWhile).Cond = $2.(*ast.ExprBrackets).Expr + $3.(*ast.StmtWhile).CloseParenthesisTkn = $2.(*ast.ExprBrackets).CloseParenthesisTkn $3.(*ast.StmtWhile).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $3) $$ = $3 @@ -831,9 +831,9 @@ unticked_statement: DoTkn: $1, Stmt: $2, WhileTkn: $3, - OpenParenthesisTkn: $4.(*ast.ParserBrackets).OpenBracketTkn, - Cond: $4.(*ast.ParserBrackets).Child, - CloseParenthesisTkn: $4.(*ast.ParserBrackets).CloseBracketTkn, + OpenParenthesisTkn: $4.(*ast.ExprBrackets).OpenParenthesisTkn, + Cond: $4.(*ast.ExprBrackets).Expr, + CloseParenthesisTkn: $4.(*ast.ExprBrackets).CloseParenthesisTkn, SemiColonTkn: $5, } } @@ -857,9 +857,9 @@ unticked_statement: | T_SWITCH parenthesis_expr switch_case_list { $3.(*ast.StmtSwitch).SwitchTkn = $1 - $3.(*ast.StmtSwitch).OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn - $3.(*ast.StmtSwitch).Cond = $2.(*ast.ParserBrackets).Child - $3.(*ast.StmtSwitch).CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn + $3.(*ast.StmtSwitch).OpenParenthesisTkn = $2.(*ast.ExprBrackets).OpenParenthesisTkn + $3.(*ast.StmtSwitch).Cond = $2.(*ast.ExprBrackets).Expr + $3.(*ast.StmtSwitch).CloseParenthesisTkn = $2.(*ast.ExprBrackets).CloseParenthesisTkn $3.(*ast.StmtSwitch).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $3) $$ = $3 @@ -1717,9 +1717,9 @@ elseif_list: $$ = append($1, &ast.StmtElseIf{ Position: yylex.(*Parser).builder.NewTokenNodePosition($2, $4), ElseIfTkn: $2, - OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, - Cond: $3.(*ast.ParserBrackets).Child, - CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, + OpenParenthesisTkn: $3.(*ast.ExprBrackets).OpenParenthesisTkn, + Cond: $3.(*ast.ExprBrackets).Expr, + CloseParenthesisTkn: $3.(*ast.ExprBrackets).CloseParenthesisTkn, Stmt: $4, }) } @@ -1736,9 +1736,9 @@ new_elseif_list: $$ = append($1, &ast.StmtElseIf{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($2, $5), ElseIfTkn: $2, - OpenParenthesisTkn: $3.(*ast.ParserBrackets).OpenBracketTkn, - Cond: $3.(*ast.ParserBrackets).Child, - CloseParenthesisTkn: $3.(*ast.ParserBrackets).CloseBracketTkn, + OpenParenthesisTkn: $3.(*ast.ExprBrackets).OpenParenthesisTkn, + Cond: $3.(*ast.ExprBrackets).Expr, + CloseParenthesisTkn: $3.(*ast.ExprBrackets).CloseParenthesisTkn, ColonTkn: $4, Stmt: &ast.StmtStmtList{ Position: yylex.(*Parser).builder.NewNodeListPosition($5), @@ -3214,11 +3214,11 @@ expr_without_variable: } | '(' new_expr ')' instance_call { - $$ = &ast.ParserBrackets{ + $$ = &ast.ExprBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + OpenParenthesisTkn: $1, + Expr: $2, + CloseParenthesisTkn: $3, } for _, n := range($4) { @@ -3336,9 +3336,9 @@ expr_without_variable: exit.Position = yylex.(*Parser).builder.NewTokenPosition($1) } else { exit.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) - exit.OpenParenthesisTkn = $2.(*ast.ParserBrackets).OpenBracketTkn - exit.Expr = $2.(*ast.ParserBrackets).Child - exit.CloseParenthesisTkn = $2.(*ast.ParserBrackets).CloseBracketTkn + exit.OpenParenthesisTkn = $2.(*ast.ExprBrackets).OpenParenthesisTkn + exit.Expr = $2.(*ast.ExprBrackets).Expr + exit.CloseParenthesisTkn = $2.(*ast.ExprBrackets).CloseParenthesisTkn } $$ = exit @@ -3916,10 +3916,10 @@ exit_expr: } | '(' ')' { - $$ = &ast.ParserBrackets{ + $$ = &ast.ExprBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), - OpenBracketTkn: $1, - CloseBracketTkn: $2, + OpenParenthesisTkn: $1, + CloseParenthesisTkn: $2, } } | parenthesis_expr @@ -4464,11 +4464,11 @@ static_operation: } | '(' static_scalar_value ')' { - $$ = &ast.ParserBrackets{ + $$ = &ast.ExprBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + OpenParenthesisTkn: $1, + Expr: $2, + CloseParenthesisTkn: $3, } } ; @@ -4662,20 +4662,20 @@ expr: parenthesis_expr: '(' expr ')' { - $$ = &ast.ParserBrackets{ + $$ = &ast.ExprBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + OpenParenthesisTkn: $1, + Expr: $2, + CloseParenthesisTkn: $3, } } | '(' yield_expr ')' { - $$ = &ast.ParserBrackets{ + $$ = &ast.ExprBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + OpenParenthesisTkn: $1, + Expr: $2, + CloseParenthesisTkn: $3, } } ; diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index b2bf948..4957b16 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -13048,14 +13048,14 @@ func TestStmtContinue(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 23, EndPos: 26, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -13065,7 +13065,7 @@ func TestStmtContinue(t *testing.T) { EndPos: 24, }, }, - Child: &ast.ScalarLnumber{ + Expr: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13084,7 +13084,7 @@ func TestStmtContinue(t *testing.T) { }, Value: []byte("3"), }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -14133,14 +14133,14 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, }, Exprs: []ast.Vertex{ - &ast.ParserBrackets{ + &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 11, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -14150,7 +14150,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndPos: 8, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14177,7 +14177,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -33925,14 +33925,14 @@ func TestStmtBreak(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 20, EndPos: 23, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -33942,7 +33942,7 @@ func TestStmtBreak(t *testing.T) { EndPos: 21, }, }, - Child: &ast.ScalarLnumber{ + Expr: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33961,7 +33961,7 @@ func TestStmtBreak(t *testing.T) { }, Value: []byte("3"), }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -35900,14 +35900,14 @@ func TestExprClone_Brackets(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -35917,7 +35917,7 @@ func TestExprClone_Brackets(t *testing.T) { EndPos: 9, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35944,7 +35944,7 @@ func TestExprClone_Brackets(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ @@ -43295,14 +43295,14 @@ func TestExprPrint(t *testing.T) { }, }, }, - Expr: &ast.ParserBrackets{ + Expr: &ast.ExprBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - OpenBracketTkn: &token.Token{ + OpenParenthesisTkn: &token.Token{ ID: token.ID(40), Value: []byte("("), Position: &position.Position{ @@ -43312,7 +43312,7 @@ func TestExprPrint(t *testing.T) { EndPos: 9, }, }, - Child: &ast.ExprVariable{ + Expr: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43339,7 +43339,7 @@ func TestExprPrint(t *testing.T) { Value: []byte("$a"), }, }, - CloseBracketTkn: &token.Token{ + CloseParenthesisTkn: &token.Token{ ID: token.ID(41), Value: []byte(")"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 72e8ddc19ce3bc761f1a6662688f62ada9d60d6c..5e50fcea36c20a722094407fb3ee0e93ff883c89 100644 GIT binary patch delta 335 zcmbQYi}(62-i8*&Ell6%Oq;^QIz7>jS$6vQCyc7oKNvDuPLKS@s4+cY8x!C3x^QNJ z=>`9pgr+YDXO^6<|DH*5`{%h#*ZE{!D+-F7iV~BvQ%j09_52G`^8yl!Qu9hOQj0T- zr$1f8q%DoA1jOUw1cKCx%#!H`IvEwF`>kc-<3Uz6y|I{4bo%B?Oyb)ot!4VJMY`j9 aZ!%q0B2}Bz_SnBn;f$nf+xVX;Hx>XcZGR#F delta 248 zcmcb{8^Sf}eBVN{-ODbF0WopB!1 zb-w8n_As(>Iu#`*XQ!4FYffKyj!9(t-!)9iU Date: Mon, 28 Dec 2020 00:38:39 +0200 Subject: [PATCH 132/140] refactoring: create "ScalarEncapsedStringVar" node --- internal/php5/parser_test.go | 120 ++++++++++++------------------ internal/php5/php5.go | Bin 265714 -> 265368 bytes internal/php5/php5.y | 58 ++++++--------- internal/php7/parser_test.go | 120 ++++++++++++------------------ internal/php7/php7.go | Bin 220503 -> 220157 bytes internal/php7/php7.y | 58 ++++++--------- pkg/ast/ast.go | 1 + pkg/ast/node.go | 19 +++++ pkg/ast/traverser/dfs.go | 17 +++++ pkg/ast/visitor/dumper.go | 16 ++++ pkg/ast/visitor/formatter.go | 15 ++++ pkg/ast/visitor/formatter_test.go | 49 ++++++++++++ pkg/ast/visitor/null.go | 4 + pkg/ast/visitor/printer.go | 9 +++ 14 files changed, 272 insertions(+), 214 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 928496a..c875222 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -4335,14 +4335,14 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringVar{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 15, }, - OpenBracketTkn: &token.Token{ + DollarOpenCurlyBracketTkn: &token.Token{ ID: token.T_DOLLAR_OPEN_CURLY_BRACES, Value: []byte("${"), Position: &position.Position{ @@ -4352,34 +4352,26 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndPos: 11, }, }, - Child: &ast.ExprVariable{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING_VARNAME, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING_VARNAME, - Value: []byte("foo"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - }, - Value: []byte("foo"), }, + Value: []byte("foo"), }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ @@ -4501,14 +4493,14 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringVar{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, - EndPos: 18, + EndPos: 15, }, - OpenBracketTkn: &token.Token{ + DollarOpenCurlyBracketTkn: &token.Token{ ID: token.T_DOLLAR_OPEN_CURLY_BRACES, Value: []byte("${"), Position: &position.Position{ @@ -4518,81 +4510,65 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndPos: 11, }, }, - Child: &ast.ExprArrayDimFetch{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, - EndPos: 17, + EndPos: 14, }, - Var: &ast.ExprVariable{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING_VARNAME, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - VarName: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING_VARNAME, - Value: []byte("foo"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - }, - Value: []byte("foo"), - }, }, - OpenBracketTkn: &token.Token{ - ID: token.ID(91), - Value: []byte("["), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 14, - EndPos: 15, - }, + Value: []byte("foo"), + }, + OpenSquareBracketTkn: &token.Token{ + ID: token.ID(91), + Value: []byte("["), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, }, - Dim: &ast.ScalarLnumber{ + }, + Dim: &ast.ScalarLnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("0"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 16, }, - NumberTkn: &token.Token{ - ID: token.T_LNUMBER, - Value: []byte("0"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 16, - }, - }, - Value: []byte("0"), }, - CloseBracketTkn: &token.Token{ - ID: token.ID(93), - Value: []byte("]"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, + Value: []byte("0"), + }, + CloseSquareBracketTkn: &token.Token{ + ID: token.ID(93), + Value: []byte("]"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index ce0b005c6530a61e131770ea1a267e42ecea3cf3..b1468ec88a55742ff94f10ef7b3f7fce9a72bb3a 100644 GIT binary patch delta 751 zcmcIi-%FEW6y}`sZBF;YIoGE{VP8-)D#kXQuA5SfZ9!yGR5vBN7?oL@3%iU(7v6<; zPtp$-w646Eh<#8&O5Jo3%^(Q6Xhueq)G{g(i(XxSLD0nu=RBN;^E}UaSFX9QPP$8R zA9qJDCw=2dAF0P?(kC;|Fc%anPFBRlM^b2Vh>pq`vf|Vx-j7N@H(K{*Mn+OO4DRG+ z9M{_~a!%t#E{*APv>=hTXCIwNBD6Jhu@}m-FA6_g=k~%SMC>s-7#s2@6HVkCb=MIgI zrE+OZZ>KGIFeObmvBZrijIqOB-#?N$pWYb2<^|GW>>wusMQTC*G&P`iR<%#Fv9#B`IcxqO^}t z)U*UgcOf;XBFNuUEWf3OD8gT4(xM2V+R+Lbt~VVvtw^|2r^P8;v#5}dq~y|+a;KWx ag!^_afozZZUHQjsF`YK;24T*rMg9QPc<=E5 delta 725 zcmaiwT}YE*7>0SC=T*Pu+!id`()oQwNYD>1r*o2(RJw=^5$q(Yfks8;vi}3Y$nY#W zyNf_p*^vcS#7Bgd(9cQW&Vqs(9e6OzW)wkA>UCeCXC1uoJ~z+Lecd;1`o7)rjkW|i z8od$^4#tC|AKUSuJf6hiud)``Gh(6N;21_H#EqtV^&I zVz1Ge=xs}!>~2JOfCAKq_7Odt33CwZva%ZwEh$I8Nu_9*kgET$?nL^F_;9L&6VC5b zhhCNTiwB$LX%);F@#A@bJxC2xF%FE#3g_D1X^F$iOXU)V+z?fx`x$w0?KArpL5dbY z8j;x{A-wL&BY?d3{X>#2-ge`6^dqagA#+URgjDs3J1PD0qL+g{{kjvFHO z*sL69uB*Z6C{@7nv+nvX2Z_R<`)t}Df5uW$+9b%2B5Z;K|r4LMWX|Dz0POYX-8fv44xm>N6_rK&K pd)!cW^?0#r)fffpC32^s<;cR)#qR8aZ5q^Jj2UW(aKx=P{{erO^Hcx; diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 245e18a..5c2a399 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5412,52 +5412,40 @@ encaps_var: } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { - $$ = &ast.ParserBrackets{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: &ast.ExprVariable{ - Position: yylex.(*Parser).builder.NewNodePosition($2), - VarName: $2, - }, - CloseBracketTkn: $3, + $$ = &ast.ScalarEncapsedStringVar{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + DollarOpenCurlyBracketTkn: $1, + VarName: $2, + CloseCurlyBracketTkn: $3, } } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { - $$ = &ast.ParserBrackets{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: &ast.ExprVariable{ + $$ = &ast.ScalarEncapsedStringVar{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + DollarOpenCurlyBracketTkn: $1, + VarName: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), - VarName: &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), - IdentifierTkn: $2, - Value: $2.Value, - }, + IdentifierTkn: $2, + Value: $2.Value, }, - CloseBracketTkn: $3, + CloseCurlyBracketTkn: $3, } } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { - $$ = &ast.ParserBrackets{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), - OpenBracketTkn: $1, - Child: &ast.ExprArrayDimFetch{ - Position: yylex.(*Parser).builder.NewTokensPosition($2, $5), - Var: &ast.ExprVariable{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), - VarName: &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), - IdentifierTkn: $2, - Value: $2.Value, - }, - }, - OpenBracketTkn: $3, - Dim: $4, - CloseBracketTkn: $5, + $$ = &ast.ScalarEncapsedStringVar{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + DollarOpenCurlyBracketTkn: $1, + VarName: &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($2), + IdentifierTkn: $2, + Value: $2.Value, }, - CloseBracketTkn: $6, + OpenSquareBracketTkn: $3, + Dim: $4, + CloseSquareBracketTkn: $5, + CloseCurlyBracketTkn: $6, } } | T_CURLY_OPEN variable '}' diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 4957b16..ca22168 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -4692,14 +4692,14 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringVar{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 15, }, - OpenBracketTkn: &token.Token{ + DollarOpenCurlyBracketTkn: &token.Token{ ID: token.T_DOLLAR_OPEN_CURLY_BRACES, Value: []byte("${"), Position: &position.Position{ @@ -4709,34 +4709,26 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndPos: 11, }, }, - Child: &ast.ExprVariable{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - VarName: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING_VARNAME, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING_VARNAME, - Value: []byte("foo"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - }, - Value: []byte("foo"), }, + Value: []byte("foo"), }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ @@ -4858,14 +4850,14 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringVar{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, - EndPos: 18, + EndPos: 15, }, - OpenBracketTkn: &token.Token{ + DollarOpenCurlyBracketTkn: &token.Token{ ID: token.T_DOLLAR_OPEN_CURLY_BRACES, Value: []byte("${"), Position: &position.Position{ @@ -4875,81 +4867,65 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndPos: 11, }, }, - Child: &ast.ExprArrayDimFetch{ + VarName: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, - EndPos: 17, + EndPos: 14, }, - Var: &ast.ExprVariable{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING_VARNAME, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 11, EndPos: 14, }, - VarName: &ast.Identifier{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING_VARNAME, - Value: []byte("foo"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 11, - EndPos: 14, - }, - }, - Value: []byte("foo"), - }, }, - OpenBracketTkn: &token.Token{ - ID: token.ID(91), - Value: []byte("["), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 14, - EndPos: 15, - }, + Value: []byte("foo"), + }, + OpenSquareBracketTkn: &token.Token{ + ID: token.ID(91), + Value: []byte("["), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, }, - Dim: &ast.ScalarLnumber{ + }, + Dim: &ast.ScalarLnumber{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, + EndPos: 16, + }, + NumberTkn: &token.Token{ + ID: token.T_LNUMBER, + Value: []byte("0"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 16, }, - NumberTkn: &token.Token{ - ID: token.T_LNUMBER, - Value: []byte("0"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 16, - }, - }, - Value: []byte("0"), }, - CloseBracketTkn: &token.Token{ - ID: token.ID(93), - Value: []byte("]"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, + Value: []byte("0"), + }, + CloseSquareBracketTkn: &token.Token{ + ID: token.ID(93), + Value: []byte("]"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 17, }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 5e50fcea36c20a722094407fb3ee0e93ff883c89..f4271bafb5606a421be4c99726e3416aa24091e6 100644 GIT binary patch delta 632 zcmbV}Pe_w-7{_^@$7Y4EYf;m&t#|zq>E!00y~_o@Gi{^9_hs3vRB{Ksw6ZDLDGEAx z6GiAtbde5?AlSO}gCMAg@HkIFAQ*&nOX(04V!za5mpuF~58vna{eHgBr`N`&GAh9U zTZxC^z)Uzm`mqWJWV#89YwW@4cB$uF9{D8uA8qNu(g5|L8Yi!(XQEKZPonsoj>3-c z0hBxW5Po>&2!1E29&R@oa5s4$&N}47`x5yvx5|g{vr96FedXi-|9i>iFzgbg;4W!1 z^D$k6<&cT;vNl`2Pj$H2Eoq8jW0pgEMEI9UrIBkqmx_1tlVd3MYm)M3jrgWheE5|l zFK%VoIC!owF*UX=!d$PM`kPE6XSo3@TWsKa?{>0OGY3%}CJ#n!IfnHv${||OHMM-8 zlQ?6_5S+B65kD`x1fdI3hlVfw6yq65b6ZrEGjfBu-BO{8(kEo$U6q1}j&qH2ENLMq zM+*}juUz@a6vf6Mn`$j9cM0o*98vcMWIySaQqOkRpeMEJ#bxmkwIX&~%U5zTO?b%? zQBzm69E%AG?RY%7Dvd-PNG<4fw^>}6L)tGM!~8dW47;CCs0TeW+$E>Z?Ee* InntAc4+AyFx&QzG delta 603 zcma)&O=wd=6ot9>_9v;$kAgqXGCwj5vfQC zDiylWMFipCvJ1O3x^cjbF0>T7(Us`Nf(jyvxaiXAyee2+IWRDH;GFN=^Fw)FKk+;a z7@UaA1&#TjLHe=^8Zxs7FOO0K)@=#l=~pho-zLq-jguR-Bzx;qr_Y=}fk!WR2-OnT z;p#GN!-X6*qNl(vSD}0xA^ej9sB=AZrF&N#KH~vHFen!c344$JZ!?n{TKS z;W25){b3GcV2MW@t{>Yi-i>NXJKFcCdyCs$>1uL2rvkIct*E^vFD~!Y;lj3f@II+u zIa|C``Mvr2V={2pmMr$ArDbDjrHkE9)aTUD0`oK1<5*hOxId~UGIEZaVhN3ybug%A zqys7?UiEWSd_sfRI?JXSk4q1sl-DIB;%YH3OU%7dSS1dr+Xv+earDpBen?yn>-(gZ zjUAR<&R{L-{v)TjPR&io3{n54A7j!H#L# Date: Mon, 28 Dec 2020 00:53:48 +0200 Subject: [PATCH 133/140] refactoring: create "ScalarEncapsedStringBrackets" node --- internal/php5/parser_test.go | 16 ++++++++-------- internal/php5/php5.go | Bin 265368 -> 265402 bytes internal/php5/php5.y | 10 +++++----- internal/php7/parser_test.go | 16 ++++++++-------- internal/php7/php7.go | Bin 220157 -> 220191 bytes internal/php7/php7.y | 10 +++++----- pkg/ast/ast.go | 3 +-- pkg/ast/node.go | 18 +++++++++++++++++- pkg/ast/traverser/dfs.go | 24 ++++++++++++------------ pkg/ast/visitor/dumper.go | 26 +++++++++++++------------- pkg/ast/visitor/formatter.go | 10 ++++++---- pkg/ast/visitor/formatter_test.go | 25 +++++++++++++++++++++++++ pkg/ast/visitor/null.go | 8 ++++---- pkg/ast/visitor/printer.go | 12 ++++++------ 14 files changed, 110 insertions(+), 68 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index c875222..bff1735 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -3975,14 +3975,14 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { Value: []byte("$a"), }, }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 11, }, - OpenBracketTkn: &token.Token{ + OpenCurlyBracketTkn: &token.Token{ ID: token.T_CURLY_OPEN, Value: []byte("{"), Position: &position.Position{ @@ -3992,7 +3992,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 8, }, }, - Child: &ast.ExprVariable{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4019,7 +4019,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { Value: []byte("$b"), }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ @@ -4690,14 +4690,14 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 22, }, - OpenBracketTkn: &token.Token{ + OpenCurlyBracketTkn: &token.Token{ ID: token.T_CURLY_OPEN, Value: []byte("{"), Position: &position.Position{ @@ -4707,7 +4707,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndPos: 10, }, }, - Child: &ast.ExprMethodCall{ + Var: &ast.ExprMethodCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4791,7 +4791,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index b1468ec88a55742ff94f10ef7b3f7fce9a72bb3a..3c7d0974e0dd6ab5bf2d5840217aa0ae8c51e558 100644 GIT binary patch delta 86 zcmV-c0IC0&nGm{}5P*aMgaWh!VDFc}E&~RaXW#=4myI6-BbRLz0!NqNLjpXPK=1+u sm%M2L441#^0|%F|X#onCfNcX0m+ZfBZF}7ZW*Zp*%7_es diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 5c2a399..65e6ed1 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5450,11 +5450,11 @@ encaps_var: } | T_CURLY_OPEN variable '}' { - $$ = &ast.ParserBrackets{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + $$ = &ast.ScalarEncapsedStringBrackets{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + OpenCurlyBracketTkn: $1, + Var: $2, + CloseCurlyBracketTkn: $3, } } ; diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index ca22168..d6ddeac 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -4332,14 +4332,14 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { Value: []byte("$a"), }, }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 11, }, - OpenBracketTkn: &token.Token{ + OpenCurlyBracketTkn: &token.Token{ ID: token.T_CURLY_OPEN, Value: []byte("{"), Position: &position.Position{ @@ -4349,7 +4349,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndPos: 8, }, }, - Child: &ast.ExprVariable{ + Var: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4376,7 +4376,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { Value: []byte("$b"), }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ @@ -5047,14 +5047,14 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, Value: []byte("test "), }, - &ast.ParserBrackets{ + &ast.ScalarEncapsedStringBrackets{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 22, }, - OpenBracketTkn: &token.Token{ + OpenCurlyBracketTkn: &token.Token{ ID: token.T_CURLY_OPEN, Value: []byte("{"), Position: &position.Position{ @@ -5064,7 +5064,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndPos: 10, }, }, - Child: &ast.ExprMethodCall{ + Var: &ast.ExprMethodCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -5148,7 +5148,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, }, }, - CloseBracketTkn: &token.Token{ + CloseCurlyBracketTkn: &token.Token{ ID: token.ID(125), Value: []byte("}"), Position: &position.Position{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index f4271bafb5606a421be4c99726e3416aa24091e6..97c37c1f2d46f0ffbaf13624df69264f1b7da407 100644 GIT binary patch delta 81 zcmV-X0IvW2w+)}T4S<9JgaWh!_(YeW<^l$nPeKC@mx25OBbU!H0)v+@!2u4JZw3Pg nm;XBf3YSnq0S%W>{Q?D-JWl}{m#@(Q4VU150SveFMFR;I27MiQ delta 31 ncmbQggZJ-t-i8*&7N#xCKU}6?h+$-#K39(U`*v|RW)3j`*zpVR diff --git a/internal/php7/php7.y b/internal/php7/php7.y index e695902..ec98771 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -4208,11 +4208,11 @@ encaps_var: } | T_CURLY_OPEN variable '}' { - $$ = &ast.ParserBrackets{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - OpenBracketTkn: $1, - Child: $2, - CloseBracketTkn: $3, + $$ = &ast.ScalarEncapsedStringBrackets{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + OpenCurlyBracketTkn: $1, + Var: $2, + CloseCurlyBracketTkn: $3, } } ; diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 214c67d..508cca0 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -176,6 +176,7 @@ type NodeVisitor interface { ScalarEncapsed(n *ScalarEncapsed) ScalarEncapsedStringPart(n *ScalarEncapsedStringPart) ScalarEncapsedStringVar(n *ScalarEncapsedStringVar) + ScalarEncapsedStringBrackets(n *ScalarEncapsedStringBrackets) ScalarHeredoc(n *ScalarHeredoc) ScalarLnumber(n *ScalarLnumber) ScalarMagicConstant(n *ScalarMagicConstant) @@ -185,6 +186,4 @@ type NodeVisitor interface { NameFullyQualified(n *NameFullyQualified) NameRelative(n *NameRelative) NameNamePart(n *NameNamePart) - - ParserBrackets(n *ParserBrackets) } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index edfa296..d523b27 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -150,6 +150,22 @@ func (n *ScalarEncapsedStringVar) GetPosition() *position.Position { return n.Position } +// ScalarEncapsedStringVar node +type ScalarEncapsedStringBrackets struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Var Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *ScalarEncapsedStringBrackets) Accept(v NodeVisitor) { + v.ScalarEncapsedStringBrackets(n) +} + +func (n *ScalarEncapsedStringBrackets) GetPosition() *position.Position { + return n.Position +} + // ScalarHeredoc node type ScalarHeredoc struct { Position *position.Position @@ -2695,7 +2711,7 @@ type ParserBrackets struct { } func (n *ParserBrackets) Accept(v NodeVisitor) { - v.ParserBrackets(n) + // do nothing } func (n *ParserBrackets) GetPosition() *position.Position { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index f5683de..93333c9 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -2472,6 +2472,18 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Dim) t.visitor.Leave("Dim", true) } + case *ast.ScalarEncapsedStringBrackets: + if nn == nil { + return + } + if !t.visitor.EnterNode(nn) { + return + } + if nn.Var != nil { + t.visitor.Enter("Var", true) + t.Traverse(nn.Var) + t.visitor.Leave("Var", true) + } case *ast.ScalarHeredoc: if nn == nil { return @@ -2556,18 +2568,6 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - case *ast.ParserBrackets: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Child != nil { - t.visitor.Enter("Child", true) - t.Traverse(nn.Child) - t.visitor.Leave("Child", true) - } default: panic("unexpected type of node") } diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 6b01b99..0e1bf41 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -2274,6 +2274,19 @@ func (v *Dumper) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { v.print(v.indent, "},\n") } +func (v *Dumper) ScalarEncapsedStringBrackets(n *ast.ScalarEncapsedStringBrackets) { + v.print(0, "&ast.ScalarEncapsedStringBrackets{\n") + v.indent++ + + v.dumpPosition(n.Position) + v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) + v.dumpVertex("Var", n.Var) + v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) + + v.indent-- + v.print(v.indent, "},\n") +} + func (v *Dumper) ScalarHeredoc(n *ast.ScalarHeredoc) { v.print(0, "&ast.ScalarHeredoc{\n") v.indent++ @@ -2374,16 +2387,3 @@ func (v *Dumper) NameNamePart(n *ast.NameNamePart) { v.indent-- v.print(v.indent, "},\n") } - -func (v *Dumper) ParserBrackets(n *ast.ParserBrackets) { - v.print(0, "&ast.ParserBrackets{\n") - v.indent++ - - v.dumpPosition(n.Position) - v.dumpToken("OpenBracketTkn", n.OpenBracketTkn) - v.dumpVertex("Child", n.Child) - v.dumpToken("CloseBracketTkn", n.CloseBracketTkn) - - v.indent-- - v.print(v.indent, "},\n") -} diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index 8c42228..b81a13c 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -1985,6 +1985,12 @@ func (f *formatter) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) } +func (f *formatter) ScalarEncapsedStringBrackets(n *ast.ScalarEncapsedStringBrackets) { + n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) + n.Var.Accept(f) + n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) +} + func (f *formatter) ScalarHeredoc(n *ast.ScalarHeredoc) { n.OpenHeredocTkn = f.newToken(token.T_START_HEREDOC, []byte("<< Date: Mon, 28 Dec 2020 10:10:15 +0200 Subject: [PATCH 134/140] refactoring: update ast structure of "Class", "Interface" and "Trait" nodes --- internal/php5/parser_test.go | 616 +++++++-------- internal/php5/php5.go | Bin 265402 -> 266451 bytes internal/php5/php5.y | 86 +- internal/php7/parser_test.go | 878 ++++++++++----------- internal/php7/php7.go | Bin 220191 -> 221592 bytes internal/php7/php7.y | 90 ++- pkg/ast/ast.go | 3 - pkg/ast/node.go | 82 +- pkg/ast/traverser/dfs.go | 56 +- pkg/ast/visitor/dumper.go | 49 +- pkg/ast/visitor/formatter.go | 41 +- pkg/ast/visitor/formatter_test.go | 209 +---- pkg/ast/visitor/namespace_resolver.go | 6 +- pkg/ast/visitor/namespace_resolver_test.go | 18 +- pkg/ast/visitor/null.go | 12 - pkg/ast/visitor/printer.go | 24 +- pkg/ast/visitor/printer_test.go | 40 +- 17 files changed, 903 insertions(+), 1307 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index bff1735..b2d3144 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -9945,74 +9945,66 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, Value: []byte("foo"), }, - Extends: &ast.StmtClassExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 30, + EndPos: 26, }, - ExtendTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 26, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 19, }, }, }, - ClassName: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 30, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + Extends: &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 30, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 30, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 27, EndPos: 30, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 30, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 27, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, }, @@ -10187,75 +10179,67 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, Value: []byte("foo"), }, - Implements: &ast.StmtClassImplements{ + ImplementsTkn: &token.Token{ + ID: token.T_IMPLEMENTS, + Value: []byte("implements"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 33, + EndPos: 29, }, - ImplementsTkn: &token.Token{ - ID: token.T_IMPLEMENTS, - Value: []byte("implements"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 30, - EndPos: 33, + StartPos: 18, + EndPos: 19, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Implements: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, }, @@ -10431,129 +10415,121 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, Value: []byte("foo"), }, - Implements: &ast.StmtClassImplements{ + ImplementsTkn: &token.Token{ + ID: token.T_IMPLEMENTS, + Value: []byte("implements"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 38, + EndPos: 29, }, - ImplementsTkn: &token.Token{ - ID: token.T_IMPLEMENTS, - Value: []byte("implements"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 30, - EndPos: 33, + StartPos: 18, + EndPos: 19, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Implements: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 34, - EndPos: 35, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 35, }, }, }, - Value: []byte("baz"), }, + Value: []byte("baz"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 34, - }, + }, + ImplementsSeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, }, }, }, @@ -19076,75 +19052,67 @@ func TestStmtInterface_Extend(t *testing.T) { }, Value: []byte("Foo"), }, - Extends: &ast.StmtInterfaceExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, - EndPos: 28, + EndPos: 24, }, - ExtendsTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 24, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 25, - EndPos: 28, + StartPos: 16, + EndPos: 17, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Extends: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 28, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 25, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, }, @@ -19275,129 +19243,121 @@ func TestStmtInterface_Extends(t *testing.T) { }, Value: []byte("Foo"), }, - Extends: &ast.StmtInterfaceExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, - EndPos: 33, + EndPos: 24, }, - ExtendsTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 24, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 25, - EndPos: 28, + StartPos: 16, + EndPos: 17, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Extends: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 28, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 25, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, + }, + ExtendsSeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 3c7d0974e0dd6ab5bf2d5840217aa0ae8c51e558..6b818aa38179998d09246d888e2afa779678cb79 100644 GIT binary patch delta 9000 zcmbVRdt8-O*8c6a4_*KPZ=eElKv8oP&*5CLOdJ)kDepOzF^GzZ$VH*dG^CrBT|S)3 zRpzKoIXaUXHsx0Hf;wmyN6|F3EYYk+M@O{jHk0-}d%y1iZ2EoQ_xt+8c-On%z1Los zXFY43tuMxW@N!H|R#(b!Ka$f`<#ZK&e-|-jW`243$o%30=RiKaN$lX_P2#>bAt_(j zA}T4oEoT%{&vtD~(uUt(QBX3qe0)&}U!E^Ia^nLcqT^7##|9tk@2h}Rkg9lur*1dmrkvXX4uI0SsMbVX)AEc;0Kl{bFg0lSC`4y$Jv46RxF6V6) zi4hgE^9w6}VyYRP#y3d^IYTS1GaDcNt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$Rq**6#?%Btc1kDVOf196@4ne}_vK zqGL2|8h?LT>2xfSDL(Bs-z;YaI~$dN_6i_n6Z&(zNZIapFIwE9x8V~wC$ k!H!I8y5a9rFR)zZdIXNukRcRXm|?A-V;TCNFh}D50Di1;T>t<8 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 65e6ed1..b422f9f 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -1280,36 +1280,55 @@ unticked_class_declaration_statement: { switch n := $1.(type) { case *ast.StmtClass : - n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) - n.ClassName = &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), + className := &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } - n.Extends = $3 - n.Implements = $4 - n.OpenCurlyBracketTkn = $5 - n.Stmts = $6 + + n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) + n.ClassName = className + n.OpenCurlyBracketTkn = $5 + n.Stmts = $6 n.CloseCurlyBracketTkn = $7 + + if $3 != nil { + n.ExtendsTkn = $3.(*ast.StmtClass).ExtendsTkn + n.Extends = $3.(*ast.StmtClass).Extends + } + + if $4 != nil { + n.ImplementsTkn = $4.(*ast.StmtClass).ImplementsTkn + n.Implements = $4.(*ast.StmtClass).Implements + n.ImplementsSeparatorTkns = $4.(*ast.StmtClass).ImplementsSeparatorTkns + } case *ast.StmtTrait : - n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) - n.TraitName = &ast.Identifier{ - Position: yylex.(*Parser).builder.NewTokenPosition($2), + traitName := &ast.Identifier{ + Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, } - n.Extends = $3 - n.Implements = $4 - n.OpenCurlyBracketTkn = $5 - n.Stmts = $6 + + n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) + n.TraitName = traitName + n.OpenCurlyBracketTkn = $5 + n.Stmts = $6 n.CloseCurlyBracketTkn = $7 + + if $3 != nil { + yylex.(*Parser).errHandlerFunc(errors.NewError("A trait cannot extend a class. Traits can only be composed from other traits with the 'use' keyword", $3.(*ast.StmtClass).Position)) + } + + if $4 != nil { + yylex.(*Parser).errHandlerFunc(errors.NewError("A trait cannot implement an interface", $4.(*ast.StmtClass).Position)) + } } $$ = $1 } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { - $$ = &ast.StmtInterface{ + iface := &ast.StmtInterface{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), InterfaceTkn: $1, InterfaceName: &ast.Identifier{ @@ -1317,11 +1336,18 @@ unticked_class_declaration_statement: IdentifierTkn: $2, Value: $2.Value, }, - Extends: $3, OpenCurlyBracketTkn: $4, Stmts: $5, CloseCurlyBracketTkn: $6, } + + if $3 != nil { + iface.ExtendsTkn = $3.(*ast.StmtInterface).ExtendsTkn + iface.Extends = $3.(*ast.StmtInterface).Extends + iface.ExtendsSeparatorTkns = $3.(*ast.StmtInterface).ExtendsSeparatorTkns + } + + $$ = iface } ; @@ -1378,10 +1404,10 @@ extends_from: } | T_EXTENDS fully_qualified_class_name { - $$ = &ast.StmtClassExtends{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - ExtendTkn: $1, - ClassName: $2, + $$ = &ast.StmtClass{ + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + ExtendsTkn: $1, + Extends: $2, } } ; @@ -1400,11 +1426,11 @@ interface_extends_list: } | T_EXTENDS interface_list { - $$ = &ast.StmtInterfaceExtends{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - ExtendsTkn: $1, - InterfaceNames: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + $$ = &ast.StmtInterface{ + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + ExtendsTkn: $1, + Extends: $2.(*ast.ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }; } ; @@ -1416,11 +1442,11 @@ implements_list: } | T_IMPLEMENTS interface_list { - $$ = &ast.StmtClassImplements{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - ImplementsTkn: $1, - InterfaceNames: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + $$ = &ast.StmtClass{ + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + ImplementsTkn: $1, + Implements: $2.(*ast.ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }; } ; diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index d6ddeac..5b63320 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -11108,74 +11108,66 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, Value: []byte("foo"), }, - Extends: &ast.StmtClassExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 30, + EndPos: 26, }, - ExtendTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 26, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 19, }, }, }, - ClassName: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 30, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + Extends: &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 30, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 30, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 27, EndPos: 30, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 30, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 27, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, }, @@ -11350,75 +11342,67 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, Value: []byte("foo"), }, - Implements: &ast.StmtClassImplements{ + ImplementsTkn: &token.Token{ + ID: token.T_IMPLEMENTS, + Value: []byte("implements"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 33, + EndPos: 29, }, - ImplementsTkn: &token.Token{ - ID: token.T_IMPLEMENTS, - Value: []byte("implements"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 30, - EndPos: 33, + StartPos: 18, + EndPos: 19, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Implements: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, }, @@ -11594,129 +11578,121 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, Value: []byte("foo"), }, - Implements: &ast.StmtClassImplements{ + ImplementsTkn: &token.Token{ + ID: token.T_IMPLEMENTS, + Value: []byte("implements"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, - EndPos: 38, + EndPos: 29, }, - ImplementsTkn: &token.Token{ - ID: token.T_IMPLEMENTS, - Value: []byte("implements"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 29, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 19, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 30, - EndPos: 33, + StartPos: 18, + EndPos: 19, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Implements: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("bar"), }, + Value: []byte("bar"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 34, - EndPos: 35, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 34, + EndPos: 35, }, }, }, - Value: []byte("baz"), }, + Value: []byte("baz"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 34, - }, + }, + ImplementsSeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 34, }, }, }, @@ -11883,58 +11859,115 @@ func TestStmtClass_AnonimousClass(t *testing.T) { EndPos: 14, }, }, - Extends: &ast.StmtClassExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, - EndPos: 26, + EndPos: 22, }, - ExtendTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 22, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 14, - EndPos: 15, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 14, + EndPos: 15, }, }, }, - ClassName: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + Extends: &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("foo"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 23, EndPos: 26, }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 23, + }, + }, + }, + }, + Value: []byte("foo"), + }, + }, + }, + ImplementsTkn: &token.Token{ + ID: token.T_IMPLEMENTS, + Value: []byte("implements"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 27, + EndPos: 37, + }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 27, + }, + }, + }, + }, + Implements: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 38, + EndPos: 41, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 38, + EndPos: 41, + }, StringTkn: &token.Token{ ID: token.T_STRING, - Value: []byte("foo"), + Value: []byte("bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 23, - EndPos: 26, + StartPos: 38, + EndPos: 41, }, FreeFloating: []*token.Token{ { @@ -11943,140 +11976,67 @@ func TestStmtClass_AnonimousClass(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 22, - EndPos: 23, + StartPos: 37, + EndPos: 38, }, }, }, }, - Value: []byte("foo"), + Value: []byte("bar"), }, }, }, - }, - Implements: &ast.StmtClassImplements{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 27, - EndPos: 46, - }, - ImplementsTkn: &token.Token{ - ID: token.T_IMPLEMENTS, - Value: []byte("implements"), + &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 27, - EndPos: 37, + StartPos: 43, + EndPos: 46, }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), + Parts: []ast.Vertex{ + &ast.NameNamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 26, - EndPos: 27, + StartPos: 43, + EndPos: 46, }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 38, - EndPos: 41, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 38, - EndPos: 41, - }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 38, - EndPos: 41, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 37, - EndPos: 38, - }, - }, - }, - }, - Value: []byte("bar"), - }, - }, - }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 43, - EndPos: 46, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 43, EndPos: 46, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 43, - EndPos: 46, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 42, - EndPos: 43, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 42, + EndPos: 43, }, }, }, - Value: []byte("baz"), }, + Value: []byte("baz"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 41, - EndPos: 42, - }, + }, + ImplementsSeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 41, + EndPos: 42, }, }, }, @@ -20762,75 +20722,67 @@ func TestStmtInterface_Extend(t *testing.T) { }, Value: []byte("Foo"), }, - Extends: &ast.StmtInterfaceExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, - EndPos: 28, + EndPos: 24, }, - ExtendsTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 24, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 25, - EndPos: 28, + StartPos: 16, + EndPos: 17, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Extends: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 28, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 25, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, }, @@ -20961,129 +20913,121 @@ func TestStmtInterface_Extends(t *testing.T) { }, Value: []byte("Foo"), }, - Extends: &ast.StmtInterfaceExtends{ + ExtendsTkn: &token.Token{ + ID: token.T_EXTENDS, + Value: []byte("extends"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, - EndPos: 33, + EndPos: 24, }, - ExtendsTkn: &token.Token{ - ID: token.T_EXTENDS, - Value: []byte("extends"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 17, - EndPos: 24, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 17, - }, - }, - }, - }, - InterfaceNames: []ast.Vertex{ - &ast.NameName{ + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 25, - EndPos: 28, + StartPos: 16, + EndPos: 17, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + }, + }, + Extends: []ast.Vertex{ + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 28, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 28, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 28, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 24, - EndPos: 25, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 24, + EndPos: 25, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + }, + &ast.NameName{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, }, - SeparatorTkns: []*token.Token{ - { - ID: token.ID(44), - Value: []byte(","), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 29, - }, + }, + ExtendsSeparatorTkns: []*token.Token{ + { + ID: token.ID(44), + Value: []byte(","), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 29, }, }, }, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 97c37c1f2d46f0ffbaf13624df69264f1b7da407..2c353f75d3b926764fe4fb288d77a2b9fa2c96b8 100644 GIT binary patch delta 7152 zcmeHMX?T@ImVW9~LP&s+00|+vNp2Phi-fx-Hy{!aLPQ`5VG}x-0KtVVKt{lbfOfk( zLbDv5Q4BUMs0hJ@5)ln84~nz~TLw_DLFi@?)X=S>tn*fV-_0VipPBhR|L%9HPMuR{ zeNWxz-)i^t`|WDtyO7WQprea&bPWwdmy{o#-pcoHcuDxih7|bJkrmoK<=~+?a>y?0T>FLm($x(>I@te8P5T!i$nwP?27M3F{%BTu*Mcv@!Iyj*nQCl`oFBPr=RuHy2FvbklIv*$vi zdAz({bPk=OZNghOiQ;Il52qR{8ltnWfjiCKj=)0_4IW;$2??~yf%QW zFoX}^00Dbfz!w!=DOCC16g{bf*X<2@^R8)SQ_A7ZN+sqt^=7XL@aBMRVuIy9v+a8K z_13q!WmaYRTz$-S+0%^6_IUS}S&Z45?bkNTNNag_3-&U+{PZ?aEWBLQPsDQOAzUHq zZIREehfzCnH-c7DEXTL93INaPEfa&kmyV+h?z>&&3%@p>&Ac82&V3QgiMupe>ND6@T1xS&$BGo*=MrHNjg^H{(kYHh8HsTEEwJVe7MWr8GM9Fu0-n7? zjN&rFU zq3pP7AaUd;Vn6v^JW${9*gllmpc993^$ViCdb>`93i7+n4uu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_declaration_statement: class_modifiers T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - $$ = &ast.StmtClass{ + class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $9), Modifiers: $1, ClassTkn: $2, @@ -1212,16 +1212,27 @@ class_declaration_statement: IdentifierTkn: $3, Value: $3.Value, }, - Extends: $4, - Implements: $5, OpenCurlyBracketTkn: $7, Stmts: $8, CloseCurlyBracketTkn: $9, } + + if $4 != nil { + class.ExtendsTkn = $4.(*ast.StmtClass).ExtendsTkn + class.Extends = $4.(*ast.StmtClass).Extends + } + + if $5 != nil { + class.ImplementsTkn = $5.(*ast.StmtClass).ImplementsTkn + class.Implements = $5.(*ast.StmtClass).Implements + class.ImplementsSeparatorTkns = $5.(*ast.StmtClass).ImplementsSeparatorTkns + } + + $$ = class } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - $$ = &ast.StmtClass{ + class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, ClassName: &ast.Identifier{ @@ -1229,12 +1240,23 @@ class_declaration_statement: IdentifierTkn: $2, Value: $2.Value, }, - Extends: $3, - Implements: $4, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, } + + if $3 != nil { + class.ExtendsTkn = $3.(*ast.StmtClass).ExtendsTkn + class.Extends = $3.(*ast.StmtClass).Extends + } + + if $4 != nil { + class.ImplementsTkn = $4.(*ast.StmtClass).ImplementsTkn + class.Implements = $4.(*ast.StmtClass).Implements + class.ImplementsSeparatorTkns = $4.(*ast.StmtClass).ImplementsSeparatorTkns + } + + $$ = class } ; @@ -1289,7 +1311,7 @@ trait_declaration_statement: interface_declaration_statement: T_INTERFACE T_STRING interface_extends_list backup_doc_comment '{' class_statement_list '}' { - $$ = &ast.StmtInterface{ + iface := &ast.StmtInterface{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), InterfaceTkn: $1, InterfaceName: &ast.Identifier{ @@ -1297,11 +1319,18 @@ interface_declaration_statement: IdentifierTkn: $2, Value: $2.Value, }, - Extends: $3, OpenCurlyBracketTkn: $5, Stmts: $6, CloseCurlyBracketTkn: $7, } + + if $3 != nil { + iface.ExtendsTkn = $3.(*ast.StmtInterface).ExtendsTkn + iface.Extends = $3.(*ast.StmtInterface).Extends + iface.ExtendsSeparatorTkns = $3.(*ast.StmtInterface).ExtendsSeparatorTkns + } + + $$ = iface } ; @@ -1312,10 +1341,10 @@ extends_from: } | T_EXTENDS name { - $$ = &ast.StmtClassExtends{ - Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), - ExtendTkn: $1, - ClassName: $2, + $$ = &ast.StmtClass{ + Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), + ExtendsTkn: $1, + Extends: $2, } } ; @@ -1327,11 +1356,11 @@ interface_extends_list: } | T_EXTENDS name_list { - $$ = &ast.StmtInterfaceExtends{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - ExtendsTkn: $1, - InterfaceNames: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + $$ = &ast.StmtInterface{ + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + ExtendsTkn: $1, + Extends: $2.(*ast.ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }; } ; @@ -1343,11 +1372,11 @@ implements_list: } | T_IMPLEMENTS name_list { - $$ = &ast.StmtClassImplements{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), - ImplementsTkn: $1, - InterfaceNames: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + $$ = &ast.StmtClass{ + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + ImplementsTkn: $1, + Implements: $2.(*ast.ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, }; } ; @@ -2458,19 +2487,30 @@ non_empty_for_exprs: anonymous_class: T_CLASS ctor_arguments extends_from implements_list backup_doc_comment '{' class_statement_list '}' { - $$ = &ast.StmtClass{ + class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, - Extends: $3, - Implements: $4, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, } + + if $3 != nil { + class.ExtendsTkn = $3.(*ast.StmtClass).ExtendsTkn + class.Extends = $3.(*ast.StmtClass).Extends + } + + if $4 != nil { + class.ImplementsTkn = $4.(*ast.StmtClass).ImplementsTkn + class.Implements = $4.(*ast.StmtClass).Implements + class.ImplementsSeparatorTkns = $4.(*ast.StmtClass).ImplementsSeparatorTkns + } + + $$ = class } ; diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 508cca0..d8fb966 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -31,8 +31,6 @@ type NodeVisitor interface { StmtCatch(n *StmtCatch) StmtClass(n *StmtClass) StmtClassConstList(n *StmtClassConstList) - StmtClassExtends(n *StmtClassExtends) - StmtClassImplements(n *StmtClassImplements) StmtClassMethod(n *StmtClassMethod) StmtConstList(n *StmtConstList) StmtConstant(n *StmtConstant) @@ -54,7 +52,6 @@ type NodeVisitor interface { StmtIf(n *StmtIf) StmtInlineHtml(n *StmtInlineHtml) StmtInterface(n *StmtInterface) - StmtInterfaceExtends(n *StmtInterfaceExtends) StmtLabel(n *StmtLabel) StmtNamespace(n *StmtNamespace) StmtNop(n *StmtNop) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d523b27..98889da 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -285,19 +285,22 @@ func (n *StmtCatch) GetPosition() *position.Position { // StmtClass node type StmtClass struct { - Position *position.Position - Modifiers []Vertex - ClassTkn *token.Token - ClassName Vertex - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token - Extends Vertex - Implements Vertex - OpenCurlyBracketTkn *token.Token - Stmts []Vertex - CloseCurlyBracketTkn *token.Token + Position *position.Position + Modifiers []Vertex + ClassTkn *token.Token + ClassName Vertex + OpenParenthesisTkn *token.Token + Arguments []Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token + ExtendsTkn *token.Token + Extends Vertex + ImplementsTkn *token.Token + Implements []Vertex + ImplementsSeparatorTkns []*token.Token + OpenCurlyBracketTkn *token.Token + Stmts []Vertex + CloseCurlyBracketTkn *token.Token } func (n *StmtClass) Accept(v NodeVisitor) { @@ -326,37 +329,6 @@ func (n *StmtClassConstList) GetPosition() *position.Position { return n.Position } -// StmtClassExtends node -type StmtClassExtends struct { - Position *position.Position - ExtendTkn *token.Token - ClassName Vertex -} - -func (n *StmtClassExtends) Accept(v NodeVisitor) { - v.StmtClassExtends(n) -} - -func (n *StmtClassExtends) GetPosition() *position.Position { - return n.Position -} - -// StmtClassImplements node -type StmtClassImplements struct { - Position *position.Position - ImplementsTkn *token.Token - InterfaceNames []Vertex - SeparatorTkns []*token.Token -} - -func (n *StmtClassImplements) Accept(v NodeVisitor) { - v.StmtClassImplements(n) -} - -func (n *StmtClassImplements) GetPosition() *position.Position { - return n.Position -} - // StmtClassMethod node type StmtClassMethod struct { Position *position.Position @@ -744,7 +716,9 @@ type StmtInterface struct { Position *position.Position InterfaceTkn *token.Token InterfaceName Vertex - Extends Vertex + ExtendsTkn *token.Token + Extends []Vertex + ExtendsSeparatorTkns []*token.Token OpenCurlyBracketTkn *token.Token Stmts []Vertex CloseCurlyBracketTkn *token.Token @@ -758,22 +732,6 @@ func (n *StmtInterface) GetPosition() *position.Position { return n.Position } -// StmtInterfaceExtends node -type StmtInterfaceExtends struct { - Position *position.Position - ExtendsTkn *token.Token - InterfaceNames []Vertex - SeparatorTkns []*token.Token -} - -func (n *StmtInterfaceExtends) Accept(v NodeVisitor) { - v.StmtInterfaceExtends(n) -} - -func (n *StmtInterfaceExtends) GetPosition() *position.Position { - return n.Position -} - // StmtLabel node type StmtLabel struct { Position *position.Position @@ -966,8 +924,6 @@ type StmtTrait struct { Position *position.Position TraitTkn *token.Token TraitName Vertex - Extends Vertex - Implements Vertex OpenCurlyBracketTkn *token.Token Stmts []Vertex CloseCurlyBracketTkn *token.Token diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 93333c9..9e58ba5 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -170,9 +170,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.visitor.Leave("Extends", true) } if nn.Implements != nil { - t.visitor.Enter("Implements", true) - t.Traverse(nn.Implements) - t.visitor.Leave("Implements", true) + t.visitor.Enter("Implements", false) + for _, c := range nn.Implements { + t.Traverse(c) + } + t.visitor.Leave("Implements", false) } if nn.Stmts != nil { t.visitor.Enter("Stmts", false) @@ -202,32 +204,6 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Consts", false) } - case *ast.StmtClassExtends: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.ClassName != nil { - t.visitor.Enter("ClassName", true) - t.Traverse(nn.ClassName) - t.visitor.Leave("ClassName", true) - } - case *ast.StmtClassImplements: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.InterfaceNames != nil { - t.visitor.Enter("InterfaceNames", false) - for _, c := range nn.InterfaceNames { - t.Traverse(c) - } - t.visitor.Leave("InterfaceNames", false) - } case *ast.StmtClassMethod: if nn == nil { return @@ -599,9 +575,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.visitor.Leave("InterfaceName", true) } if nn.Extends != nil { - t.visitor.Enter("Extends", true) - t.Traverse(nn.Extends) - t.visitor.Leave("Extends", true) + t.visitor.Enter("Extends", false) + for _, c := range nn.Extends { + t.Traverse(c) + } + t.visitor.Leave("Extends", false) } if nn.Stmts != nil { t.visitor.Enter("Stmts", false) @@ -610,20 +588,6 @@ func (t *DFS) Traverse(n ast.Vertex) { } t.visitor.Leave("Stmts", false) } - case *ast.StmtInterfaceExtends: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.InterfaceNames != nil { - t.visitor.Enter("InterfaceNames", false) - for _, c := range nn.InterfaceNames { - t.Traverse(c) - } - t.visitor.Leave("InterfaceNames", false) - } case *ast.StmtLabel: if nn == nil { return diff --git a/pkg/ast/visitor/dumper.go b/pkg/ast/visitor/dumper.go index 0e1bf41..2783faa 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/ast/visitor/dumper.go @@ -286,8 +286,11 @@ func (v *Dumper) StmtClass(n *ast.StmtClass) { v.dumpVertexList("Arguments", n.Arguments) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) + v.dumpToken("ExtendsTkn", n.ExtendsTkn) v.dumpVertex("Extends", n.Extends) - v.dumpVertex("Implements", n.Implements) + v.dumpToken("ImplementsTkn", n.ImplementsTkn) + v.dumpVertexList("Implements", n.Implements) + v.dumpTokenList("ImplementsSeparatorTkns", n.ImplementsSeparatorTkns) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) @@ -311,31 +314,6 @@ func (v *Dumper) StmtClassConstList(n *ast.StmtClassConstList) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtClassExtends(n *ast.StmtClassExtends) { - v.print(0, "&ast.StmtClassExtends{\n") - v.indent++ - - v.dumpPosition(n.Position) - v.dumpToken("ExtendTkn", n.ExtendTkn) - v.dumpVertex("ClassName", n.ClassName) - - v.indent-- - v.print(v.indent, "},\n") -} - -func (v *Dumper) StmtClassImplements(n *ast.StmtClassImplements) { - v.print(0, "&ast.StmtClassImplements{\n") - v.indent++ - - v.dumpPosition(n.Position) - v.dumpToken("ImplementsTkn", n.ImplementsTkn) - v.dumpVertexList("InterfaceNames", n.InterfaceNames) - v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) - - v.indent-- - v.print(v.indent, "},\n") -} - func (v *Dumper) StmtClassMethod(n *ast.StmtClassMethod) { v.print(0, "&ast.StmtClassMethod{\n") v.indent++ @@ -666,7 +644,9 @@ func (v *Dumper) StmtInterface(n *ast.StmtInterface) { v.dumpPosition(n.Position) v.dumpToken("InterfaceTkn", n.InterfaceTkn) v.dumpVertex("InterfaceName", n.InterfaceName) - v.dumpVertex("Extends", n.Extends) + v.dumpToken("ExtendsTkn", n.ExtendsTkn) + v.dumpVertexList("Extends", n.Extends) + v.dumpTokenList("ExtendsSeparatorTkns", n.ExtendsSeparatorTkns) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) @@ -675,19 +655,6 @@ func (v *Dumper) StmtInterface(n *ast.StmtInterface) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { - v.print(0, "&ast.StmtInterfaceExtends{\n") - v.indent++ - - v.dumpPosition(n.Position) - v.dumpToken("ExtendsTkn", n.ExtendsTkn) - v.dumpVertexList("InterfaceNames", n.InterfaceNames) - v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) - - v.indent-- - v.print(v.indent, "},\n") -} - func (v *Dumper) StmtLabel(n *ast.StmtLabel) { v.print(0, "&ast.StmtLabel{\n") v.indent++ @@ -849,8 +816,6 @@ func (v *Dumper) StmtTrait(n *ast.StmtTrait) { v.dumpPosition(n.Position) v.dumpToken("TraitTkn", n.TraitTkn) v.dumpVertex("TraitName", n.TraitName) - v.dumpVertex("Extends", n.Extends) - v.dumpVertex("Implements", n.Implements) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) diff --git a/pkg/ast/visitor/formatter.go b/pkg/ast/visitor/formatter.go index b81a13c..c6e1a50 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/ast/visitor/formatter.go @@ -281,12 +281,14 @@ func (f *formatter) StmtClass(n *ast.StmtClass) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) if n.Extends != nil { + n.ExtendsTkn = f.newToken(token.T_EXTENDS, []byte("extends")) n.Extends.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } if n.Implements != nil { - n.Implements.Accept(f) + n.ImplementsTkn = f.newToken(token.T_IMPLEMENTS, []byte("implements")) + n.ImplementsSeparatorTkns = f.formatList(n.Implements, ',') f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } @@ -318,20 +320,6 @@ func (f *formatter) StmtClassConstList(n *ast.StmtClassConstList) { n.SemiColonTkn = f.newSemicolonTkn() } -func (f *formatter) StmtClassExtends(n *ast.StmtClassExtends) { - n.ExtendTkn = f.newToken(token.T_EXTENDS, []byte("extends")) - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - - n.ClassName.Accept(f) -} - -func (f *formatter) StmtClassImplements(n *ast.StmtClassImplements) { - n.ImplementsTkn = f.newToken(token.T_IMPLEMENTS, []byte("implements")) - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - - n.SeparatorTkns = f.formatList(n.InterfaceNames, ',') -} - func (f *formatter) StmtClassMethod(n *ast.StmtClassMethod) { for _, m := range n.Modifiers { m.Accept(f) @@ -677,7 +665,8 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) if n.Extends != nil { - n.Extends.Accept(f) + n.ExtendsTkn = f.newToken(token.T_EXTENDS, []byte("extends")) + n.ExtendsSeparatorTkns = f.formatList(n.Extends, ',') f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } @@ -695,16 +684,6 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) { n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) } -func (f *formatter) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { - n.ExtendsTkn = f.newToken(token.T_EXTENDS, []byte("extends")) - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - - n.SeparatorTkns = nil - if len(n.InterfaceNames) > 0 { - n.SeparatorTkns = f.formatList(n.InterfaceNames, ',') - } -} - func (f *formatter) StmtLabel(n *ast.StmtLabel) { n.LabelName.Accept(f) n.ColonTkn = f.newToken(':', []byte(":")) @@ -865,16 +844,6 @@ func (f *formatter) StmtTrait(n *ast.StmtTrait) { n.TraitName.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - if n.Extends != nil { - n.Extends.Accept(f) - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - } - - if n.Implements != nil { - n.Implements.Accept(f) - f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - } - n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) if len(n.Stmts) > 0 { diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/ast/visitor/formatter_test.go index 9e59126..7c708bc 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/ast/visitor/formatter_test.go @@ -519,12 +519,10 @@ func TestFormatter_Class_Extends(t *testing.T) { ClassName: &ast.Identifier{ Value: []byte("foo"), }, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, + Extends: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("bar"), }, }, }, @@ -556,13 +554,11 @@ func TestFormatter_Class_Implements(t *testing.T) { ClassName: &ast.Identifier{ Value: []byte("foo"), }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, + Implements: []ast.Vertex{ + &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("bar"), }, }, }, @@ -669,69 +665,6 @@ func TestFormatter_StmtClassConstList_Modifier(t *testing.T) { } } -func TestFormatter_ClassExtends(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtClassExtends{ - ClassName: &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("foo"), - }, - }, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `extends foo` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestFormatter_ClassImplements(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("foo"), - }, - }, - }, - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, - }, - }, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `implements foo, bar` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestFormatter_ClassMethod(t *testing.T) { o := bytes.NewBufferString("") @@ -1881,13 +1814,11 @@ func TestFormatter_StmtInterface_Extends(t *testing.T) { InterfaceName: &ast.Identifier{ Value: []byte("foo"), }, - Extends: &ast.StmtInterfaceExtends{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, + Extends: []ast.Vertex{ + &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Value: []byte("bar"), }, }, }, @@ -1913,42 +1844,6 @@ func TestFormatter_StmtInterface_Extends(t *testing.T) { } } -func TestFormatter_StmtInterfaceExtends(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtInterfaceExtends{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("foo"), - }, - }, - }, - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, - }, - }, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `extends foo, bar` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestFormatter_StmtLabel(t *testing.T) { o := bytes.NewBufferString("") @@ -2465,82 +2360,6 @@ func TestFormatter_StmtTrait(t *testing.T) { } } -func TestFormatter_StmtTrait_Extends(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtTrait{ - TraitName: &ast.Identifier{ - Value: []byte("foo"), - }, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, - }, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `trait foo extends bar { - ; - }` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestFormatter_StmtTrait_Implements(t *testing.T) { - o := bytes.NewBufferString("") - - n := &ast.StmtTrait{ - TraitName: &ast.Identifier{ - Value: []byte("foo"), - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Value: []byte("bar"), - }, - }, - }, - }, - }, - Stmts: []ast.Vertex{ - &ast.StmtNop{}, - }, - } - - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) - n.Accept(f) - - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) - n.Accept(p) - - expected := `trait foo implements bar { - ; - }` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - func TestFormatter_StmtTraitMethodRef(t *testing.T) { o := bytes.NewBufferString("") diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 9e4e6a2..7de7f68 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -73,11 +73,11 @@ func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { if n.Extends != nil { - nsr.ResolveName(n.Extends.(*ast.StmtClassExtends).ClassName, "") + nsr.ResolveName(n.Extends, "") } if n.Implements != nil { - for _, interfaceName := range n.Implements.(*ast.StmtClassImplements).InterfaceNames { + for _, interfaceName := range n.Implements { nsr.ResolveName(interfaceName, "") } } @@ -89,7 +89,7 @@ func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface) { if n.Extends != nil { - for _, interfaceName := range n.Extends.(*ast.StmtInterfaceExtends).InterfaceNames { + for _, interfaceName := range n.Extends { nsr.ResolveName(interfaceName, "") } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 8a8bb14..8d7d5cb 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -401,13 +401,9 @@ func TestResolveClassName(t *testing.T) { class := &ast.StmtClass{ ClassName: &ast.Identifier{Value: []byte("A")}, - Extends: &ast.StmtClassExtends{ - ClassName: nameAB, - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - nameBC, - }, + Extends: nameAB, + Implements: []ast.Vertex{ + nameBC, }, } @@ -436,11 +432,9 @@ func TestResolveInterfaceName(t *testing.T) { interfaceNode := &ast.StmtInterface{ InterfaceName: &ast.Identifier{Value: []byte("A")}, - Extends: &ast.StmtInterfaceExtends{ - InterfaceNames: []ast.Vertex{ - nameAB, - nameBC, - }, + Extends: []ast.Vertex{ + nameAB, + nameBC, }, } diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index f412369..a8ca90d 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -62,14 +62,6 @@ func (v *Null) StmtClassConstList(_ *ast.StmtClassConstList) { // do nothing } -func (v *Null) StmtClassExtends(_ *ast.StmtClassExtends) { - // do nothing -} - -func (v *Null) StmtClassImplements(_ *ast.StmtClassImplements) { - // do nothing -} - func (v *Null) StmtClassMethod(_ *ast.StmtClassMethod) { // do nothing } @@ -154,10 +146,6 @@ func (v *Null) StmtInterface(_ *ast.StmtInterface) { // do nothing } -func (v *Null) StmtInterfaceExtends(_ *ast.StmtInterfaceExtends) { - // do nothing -} - func (v *Null) StmtLabel(_ *ast.StmtLabel) { // do nothing } diff --git a/pkg/ast/visitor/printer.go b/pkg/ast/visitor/printer.go index ff82f60..88fffed 100644 --- a/pkg/ast/visitor/printer.go +++ b/pkg/ast/visitor/printer.go @@ -194,8 +194,10 @@ func (p *printer) StmtClass(n *ast.StmtClass) { p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) + p.printToken(n.ExtendsTkn, p.ifNode(n.Extends, []byte("extends"))) p.printNode(n.Extends) - p.printNode(n.Implements) + p.printToken(n.ImplementsTkn, p.ifNodeList(n.Implements, []byte("implements"))) + p.printSeparatedList(n.Implements, n.ImplementsSeparatorTkns, []byte(",")) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) p.printToken(n.CloseCurlyBracketTkn, []byte("}")) @@ -208,16 +210,6 @@ func (p *printer) StmtClassConstList(n *ast.StmtClassConstList) { p.printToken(n.SemiColonTkn, []byte(";")) } -func (p *printer) StmtClassExtends(n *ast.StmtClassExtends) { - p.printToken(n.ExtendTkn, []byte("extends")) - p.printNode(n.ClassName) -} - -func (p *printer) StmtClassImplements(n *ast.StmtClassImplements) { - p.printToken(n.ImplementsTkn, []byte("implements")) - p.printSeparatedList(n.InterfaceNames, n.SeparatorTkns, []byte(",")) -} - func (p *printer) StmtClassMethod(n *ast.StmtClassMethod) { p.printList(n.Modifiers) p.printToken(n.FunctionTkn, []byte("function")) @@ -436,17 +428,13 @@ func (p *printer) StmtInlineHtml(n *ast.StmtInlineHtml) { func (p *printer) StmtInterface(n *ast.StmtInterface) { p.printToken(n.InterfaceTkn, []byte("interface")) p.printNode(n.InterfaceName) - p.printNode(n.Extends) + p.printToken(n.ExtendsTkn, p.ifNodeList(n.Extends, []byte("extends"))) + p.printSeparatedList(n.Extends, n.ExtendsSeparatorTkns, []byte(",")) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) p.printToken(n.CloseCurlyBracketTkn, []byte("}")) } -func (p *printer) StmtInterfaceExtends(n *ast.StmtInterfaceExtends) { - p.printToken(n.ExtendsTkn, []byte("extends")) - p.printSeparatedList(n.InterfaceNames, n.SeparatorTkns, []byte(",")) -} - func (p *printer) StmtLabel(n *ast.StmtLabel) { p.printNode(n.LabelName) p.printToken(n.ColonTkn, []byte(":")) @@ -525,8 +513,6 @@ func (p *printer) StmtThrow(n *ast.StmtThrow) { func (p *printer) StmtTrait(n *ast.StmtTrait) { p.printToken(n.TraitTkn, []byte("trait")) p.printNode(n.TraitName) - p.printNode(n.Extends) - p.printNode(n.Implements) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) p.printToken(n.CloseCurlyBracketTkn, []byte("}")) diff --git a/pkg/ast/visitor/printer_test.go b/pkg/ast/visitor/printer_test.go index 1d4bcb1..7735a52 100644 --- a/pkg/ast/visitor/printer_test.go +++ b/pkg/ast/visitor/printer_test.go @@ -29,11 +29,9 @@ func TestPrinterPrintFile(t *testing.T) { &ast.NameNamePart{Value: []byte("Bar")}, }, }, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{ - Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Baz")}, - }, + Extends: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{Value: []byte("Baz")}, }, }, Stmts: []ast.Vertex{ @@ -3255,14 +3253,10 @@ func TestPrinterPrintStmtClass(t *testing.T) { n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, ClassName: &ast.Identifier{Value: []byte("Foo")}, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, + Extends: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Implements: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassConstList{ @@ -3307,14 +3301,10 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { }, }, }, - Extends: &ast.StmtClassExtends{ - ClassName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - }, - Implements: &ast.StmtClassImplements{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, - }, + Extends: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Implements: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassConstList{ @@ -4122,11 +4112,9 @@ func TestPrinterPrintInterface(t *testing.T) { p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) n := &ast.StmtInterface{ InterfaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Extends: &ast.StmtInterfaceExtends{ - InterfaceNames: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - }, + Extends: []ast.Vertex{ + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassMethod{ From c0465f96051dfa7ad857a1c54de6a4363a4a6399 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 28 Dec 2020 10:47:09 +0200 Subject: [PATCH 135/140] refactoring: remove "StmtTraitMethodRef" node --- internal/php5/parser_test.go | 264 +++++++++------------ internal/php5/php5.go | Bin 266451 -> 267006 bytes internal/php5/php5.y | 34 +-- internal/php7/parser_test.go | 264 +++++++++------------ internal/php7/php7.go | Bin 221592 -> 222523 bytes internal/php7/php7.y | 52 ++-- pkg/ast/ast.go | 1 - pkg/ast/node.go | 60 ++--- pkg/ast/traverser/dfs.go | 43 ++-- pkg/ast/visitor/dumper.go | 21 +- pkg/ast/visitor/formatter.go | 23 +- pkg/ast/visitor/formatter_test.go | 158 ++++++------ pkg/ast/visitor/namespace_resolver.go | 4 +- pkg/ast/visitor/namespace_resolver_test.go | 14 +- pkg/ast/visitor/null.go | 4 - pkg/ast/visitor/printer.go | 14 +- pkg/ast/visitor/printer_test.go | 55 +---- 17 files changed, 456 insertions(+), 555 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index b2d3144..ad51d2f 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -24032,44 +24032,36 @@ func TestStmtTraitUse_Modifier(t *testing.T) { StartPos: 30, EndPos: 43, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, @@ -24453,44 +24445,36 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { StartPos: 30, EndPos: 47, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, @@ -24905,83 +24889,75 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 30, EndPos: 58, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 38, + EndPos: 33, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 35, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 35, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, InsteadofTkn: &token.Token{ ID: token.T_INSTEADOF, @@ -25119,83 +25095,75 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 60, EndPos: 75, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 68, + EndPos: 63, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 63, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, EndPos: 63, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 59, - EndPos: 60, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 59, + EndPos: 60, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 63, - EndPos: 65, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 63, + EndPos: 65, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 65, + EndPos: 68, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 65, EndPos: 68, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 65, - EndPos: 68, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 6b818aa38179998d09246d888e2afa779678cb79..a65a4c86b8b6110e0454d39af0d3a8041ac5b829 100644 GIT binary patch delta 6243 zcmd5=d34l8wmx-lhd>A+VI&Yb&>bKwVX?cjbb>;FXciGkKu{EvAUl#pzzu~UGaw=Z z$dKy{$f9t9$`U}R5k-~}7#)^m5Fg{oARs!pfMGyKQ1pFOzwTu8y)*y4b6)<)>07^A zZr$a(->nntVt?EaTb-Ang7fkd7UU-=ou5Egys|XNUb(Li-7j_h$t$rrDzf$6j}%Xy zF?jrpNu}e4j-SxIx0NM(GkfIAJ}M^Vm)~zIojLa5@j0armzLZ;wWMcMGyFNr<#I=g zm$m<*=E=WY$2wjM~djeJEC%B=8He<`&AA@_8yz3g71;GW1p| zP#M~vt_qZV+85u7o*}ms_ooixeHH3g-$zOM^?uY|N%1DeV zWyrQ#<&h!pstB1fklKnjjgw?;f9fTr`P}mV*bp85lOYC7m#w{28!3H)Vx(OTMTxq> ziMme?B`W8xv3)37rVXUlj@Gd&DER+QVYgH)gqDT3!|v6!xQ?$A$H*Qd7P(w)9Is^N zQZA+Wq&x^;tjVQXncGEq^pZRps#HMcPJ#QpUD++aDxiD}EIq`%^uhv)RVpZR2f+Ya z@1PNs=63`;H8_Y0WZjnvAy>uSW$z%YOqX?IF>oeG=`!q2d@oPI&J`Xwf7DQVM`jL& zS_l@mBUau;c{rfBNQDOU5Da9>fT8p^IaP??Sw`j1$7@Ace4qlMg}ova`F&D3f{LWx zO-WKSjUx0GH)Sck_iKt&(ryIJQdt@^o@MBTD0G{+?j;|8$j#-mQPfW(fIm?UD)!YF zoI;cpkc3gnFTOXGOD}kkJ|&YBUYWCBMd)Q?X*E%5K>NqjcqRW#C6DZ!KnojoNswt1 z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>NXG*B*;?^*Q5C zrHQ}VyIx)p*Ed8$_=gSH=NXJ zTP-iR`QxqF4qK&i{x;yZGhHh+P4Exfjpg7;eSSR8Qc%r6%XR1fm9Opi*#`y1kSE@x zh-a}2O90)8-UM3yE>8CoaYk05E0#_pEh>64hTiA2_hFz+o$o!_Fr3xagl>aDpDF0u zbZK8K-wlCnU&*8{&8?6|`MKYv#e3lymvJc^d|{u-5tZ|SY&S3XII9uWV?V^0J0iYA z)YJQAuAq!Giy!$2k)6+eBtN$Z5vW=Wd%i*OzVb0xV5;stqTkc&6UdqO1=^DN@X`T2 z!ZWKM=N^?eT%TjTIQF=V;@y$x3vT;VM-S-vVbNi|CCqx$wA612_0S=C?z(3LS2fA8 znw2_r2P%|rI1FFrCZK2PLy5ZuA3g$0y8oYeuo3q)*zvz(!CGLLLf`d1!HyF+)A-Vt z@8^DYngWpIk$$cLWhRq0%^W{AC39ma_{h_(x&UZK?eE>)s=>v^o|OVPzYO%Xgh` zckegG`^~<*lt$=YX~gn6nq+>kL!hU;`0sKUKfXgg%O89LOZfXm%!R9?h}DL_Io+cD62rCUn5+{)Cp{l zQak=3??Ed{mleZ~eZ={!Ov}zvNtfkAcuaNa1mLD~bmSQ5%5Rr{_co_WJLKbrRDtq! zNSEMfVe?{gm9Ta5(e}V%Kr5hG+J58jEj((s1p>zA0VXQ!wh*-@04up% zlXnEgYXCYcFB*bu#kzar;{L%l9h4efI3m~<&+CJ6uyGCQZ-{b6+Fm!bIDi|v+X`Vj fQ&P~3>q40W_}ws@H~4<~Wq$;Ad7I3>Zyxb4sM%1k diff --git a/internal/php5/php5.y b/internal/php5/php5.y index b422f9f..581d612 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2295,10 +2295,12 @@ trait_precedence: { $$ = &ast.StmtTraitUsePrecedence{ Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - Ref: $1, - InsteadofTkn: $2, - Insteadof: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Trait: $1.(*ast.TraitMethodRef).Trait, + DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, + Method: $1.(*ast.TraitMethodRef).Method, + InsteadofTkn: $2, + Insteadof: $3.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, } } ; @@ -2322,7 +2324,7 @@ trait_reference_list: trait_method_reference: T_STRING { - $$ = &ast.StmtTraitMethodRef{ + $$ = &ast.TraitMethodRef{ Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2340,7 +2342,7 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - $$ = &ast.StmtTraitMethodRef{ + $$ = &ast.TraitMethodRef{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, @@ -2357,10 +2359,12 @@ trait_alias: trait_method_reference T_AS trait_modifiers T_STRING { $$ = &ast.StmtTraitUseAlias{ - Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), - Ref: $1, - AsTkn: $2, - Modifier: $3, + Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), + Trait: $1.(*ast.TraitMethodRef).Trait, + DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, + Method: $1.(*ast.TraitMethodRef).Method, + AsTkn: $2, + Modifier: $3, Alias: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, @@ -2371,10 +2375,12 @@ trait_alias: | trait_method_reference T_AS member_modifier { $$ = &ast.StmtTraitUseAlias{ - Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), - Ref: $1, - AsTkn: $2, - Modifier: $3, + Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), + Trait: $1.(*ast.TraitMethodRef).Trait, + DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, + Method: $1.(*ast.TraitMethodRef).Method, + AsTkn: $2, + Modifier: $3, } } ; diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 5b63320..aa1b77d 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -26000,44 +26000,36 @@ func TestStmtTraitUse_Modifier(t *testing.T) { StartPos: 30, EndPos: 43, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, @@ -26421,44 +26413,36 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { StartPos: 30, EndPos: 47, }, - Ref: &ast.StmtTraitMethodRef{ + Method: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - Method: &ast.Identifier{ + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, @@ -26873,83 +26857,75 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 30, EndPos: 58, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, - EndPos: 38, + EndPos: 33, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 30, + EndPos: 33, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Bar"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 30, EndPos: 33, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Bar"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 30, - EndPos: 33, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 30, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 30, }, }, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 35, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 35, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 35, + EndPos: 38, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 35, EndPos: 38, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 35, - EndPos: 38, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, InsteadofTkn: &token.Token{ ID: token.T_INSTEADOF, @@ -27087,83 +27063,75 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 60, EndPos: 75, }, - Ref: &ast.StmtTraitMethodRef{ + Trait: &ast.NameName{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, - EndPos: 68, + EndPos: 63, }, - Trait: &ast.NameName{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 60, + EndPos: 63, + }, + StringTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("Baz"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 60, EndPos: 63, }, - StringTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("Baz"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 60, - EndPos: 63, - }, - FreeFloating: []*token.Token{ - { - ID: token.T_WHITESPACE, - Value: []byte(" "), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 59, - EndPos: 60, - }, + FreeFloating: []*token.Token{ + { + ID: token.T_WHITESPACE, + Value: []byte(" "), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 59, + EndPos: 60, }, }, }, - Value: []byte("Baz"), }, + Value: []byte("Baz"), }, }, - DoubleColonTkn: &token.Token{ - ID: token.T_PAAMAYIM_NEKUDOTAYIM, - Value: []byte("::"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 63, - EndPos: 65, - }, + }, + DoubleColonTkn: &token.Token{ + ID: token.T_PAAMAYIM_NEKUDOTAYIM, + Value: []byte("::"), + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 63, + EndPos: 65, }, - Method: &ast.Identifier{ + }, + Method: &ast.Identifier{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 65, + EndPos: 68, + }, + IdentifierTkn: &token.Token{ + ID: token.T_STRING, + Value: []byte("one"), Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 65, EndPos: 68, }, - IdentifierTkn: &token.Token{ - ID: token.T_STRING, - Value: []byte("one"), - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 65, - EndPos: 68, - }, - }, - Value: []byte("one"), }, + Value: []byte("one"), }, AsTkn: &token.Token{ ID: token.T_AS, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 2c353f75d3b926764fe4fb288d77a2b9fa2c96b8..8c4c775da8b45637d7cae76a854812cd6a982fd1 100644 GIT binary patch delta 4831 zcmdT|dvKN25udY%ydQ)C0wFia4T2`&k(-;F$0dNd0(tO|L?aIqln9AMP!f!_sMS!6 zQA-pGWYt;>RE@P#Q&A5BQnXXBh&4Vsb*exB$D%_eXt7bz_P6Kz0@P`p{?)Pk0r%|L zvuF3Wzq7j^5BxT6=l-~^3zy6ZaxO$w5&-&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rnS<(aZ zml

vvj`LLq}!`KU1CVDYFGH?z+$OaKoPj#x zD(SrUItg`*Nc-4Peeejx@z_V!3!jSVE1PV=YUw8z3+{kA@a*w2)r>(FLtjdj-30ef zl@TudN~@}trSkr=8DeGByEa{Z#}^&4gpWQXoZK-$UgAkk90eYjqnv!mX)x8o$weU< ztBNw@451tuI{s5G{Cbr?3&9}E>S%wND)_*SzzB1*ZuB_eA`cq~mo0h@tt=63TrmiE zg*1ze=5$l94U(9EpzB%!&Gm=m$P&z>Mz|c7)y+d>saXifwv4rKBMVP=j>dZ z3*F3>ciL^=gdERZH_2*UZ8n(q=9wJ6l_yv031FOC?$B)?GM&lydo_YXFhaCWCm+8O zl2u&cmwma@A=9{z7nb%+05H<5Pof9k#Ye|Muf(TQBP!rWF0#4l5GCIYyGotlPK{9&i z&VpncVcEk6#>)xZQXrGL$wR4}`~h^nZMz7ob3X%r!KA1L^-+T{;%f!eZjE$Ch4xDk zQjb^4*#xu8Rq|F{O?oy|xZWb1tv;I|_kg2ja?ViuCdqpRzc5L Date: Mon, 28 Dec 2020 21:13:08 +0200 Subject: [PATCH 136/140] refactoring: update traverser --- cmd/php-parser/main.go | 15 +- pkg/ast/ast.go | 14 +- pkg/ast/node.go | 322 +-- pkg/ast/traverser/dfs.go | 2533 ----------------- pkg/{ast/visitor => visitor/dumper}/dumper.go | 2 +- .../visitor => visitor/dumper}/dumper_test.go | 6 +- .../formatter}/formatter.go | 2 +- .../formatter}/formatter_test.go | 913 +++--- .../nsresolver}/namespace_resolver.go | 5 +- .../nsresolver}/namespace_resolver_test.go | 121 +- pkg/{ast => }/visitor/null.go | 0 .../visitor => visitor/printer}/printer.go | 2 +- .../printer}/printer_php5_test.go | 6 +- .../printer}/printer_php7_test.go | 8 +- .../printer}/printer_test.go | 388 +-- pkg/visitor/traverser/traverser.go | 1164 ++++++++ 16 files changed, 2050 insertions(+), 3451 deletions(-) delete mode 100644 pkg/ast/traverser/dfs.go rename pkg/{ast/visitor => visitor/dumper}/dumper.go (99%) rename pkg/{ast/visitor => visitor/dumper}/dumper_test.go (90%) rename pkg/{ast/visitor => visitor/formatter}/formatter.go (99%) rename pkg/{ast/visitor => visitor/formatter}/formatter_test.go (75%) rename pkg/{ast/visitor => visitor/nsresolver}/namespace_resolver.go (99%) rename pkg/{ast/visitor => visitor/nsresolver}/namespace_resolver_test.go (88%) rename pkg/{ast => }/visitor/null.go (100%) rename pkg/{ast/visitor => visitor/printer}/printer.go (99%) rename pkg/{ast/visitor => visitor/printer}/printer_php5_test.go (99%) rename pkg/{ast/visitor => visitor/printer}/printer_php7_test.go (99%) rename pkg/{ast/visitor => visitor/printer}/printer_test.go (88%) create mode 100644 pkg/visitor/traverser/traverser.go diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index 13d8734..a94d348 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -3,6 +3,10 @@ package main import ( "bytes" "flag" + "github.com/z7zmey/php-parser/pkg/visitor/dumper" + "github.com/z7zmey/php-parser/pkg/visitor/nsresolver" + "github.com/z7zmey/php-parser/pkg/visitor/printer" + "github.com/z7zmey/php-parser/pkg/visitor/traverser" "io" "io/ioutil" "log" @@ -17,8 +21,6 @@ import ( "github.com/yookoala/realpath" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/traverser" - "github.com/z7zmey/php-parser/pkg/ast/visitor" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/parser" ) @@ -165,7 +167,7 @@ func printerWorker(r <-chan result) { if *printBack { o := bytes.NewBuffer([]byte{}) - p := visitor.NewPrinter(o) + p := printer.NewPrinter(o) res.rootNode.Accept(p) err := ioutil.WriteFile(res.path, o.Bytes(), 0644) @@ -173,16 +175,15 @@ func printerWorker(r <-chan result) { } if *showResolvedNs { - v := visitor.NewNamespaceResolver() - t := traverser.NewDFS(v) - t.Traverse(res.rootNode) + v := nsresolver.NewNamespaceResolver() + traverser.NewTraverser(v).Traverse(res.rootNode) for _, n := range v.ResolvedNames { _, _ = io.WriteString(os.Stderr, "===> "+n+"\n") } } if *dump == true { - visitor.NewDumper(os.Stdout).WithPositions().WithTokens().Dump(res.rootNode) + dumper.NewDumper(os.Stdout).WithPositions().WithTokens().Dump(res.rootNode) } wg.Done() diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index fb5b351..261001f 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -3,23 +3,11 @@ package ast import "github.com/z7zmey/php-parser/pkg/position" type Vertex interface { - Accept(v NodeVisitor) + Accept(v Visitor) GetPosition() *position.Position } -type Traverser interface { - Traverse(n Vertex) -} - type Visitor interface { - Enter(key string, singleNode bool) - Leave(key string, singleNode bool) - - EnterNode(n Vertex) bool - LeaveNode(n Vertex) -} - -type NodeVisitor interface { Root(n *Root) Nullable(n *Nullable) Parameter(n *Parameter) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index e97fc87..043c404 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -12,7 +12,7 @@ type Root struct { EndTkn *token.Token } -func (n *Root) Accept(v NodeVisitor) { +func (n *Root) Accept(v Visitor) { v.Root(n) } @@ -27,7 +27,7 @@ type Nullable struct { Expr Vertex } -func (n *Nullable) Accept(v NodeVisitor) { +func (n *Nullable) Accept(v Visitor) { v.Nullable(n) } @@ -46,7 +46,7 @@ type Parameter struct { DefaultValue Vertex } -func (n *Parameter) Accept(v NodeVisitor) { +func (n *Parameter) Accept(v Visitor) { v.Parameter(n) } @@ -61,7 +61,7 @@ type Identifier struct { Value []byte } -func (n *Identifier) Accept(v NodeVisitor) { +func (n *Identifier) Accept(v Visitor) { v.Identifier(n) } @@ -77,7 +77,7 @@ type Argument struct { Expr Vertex } -func (n *Argument) Accept(v NodeVisitor) { +func (n *Argument) Accept(v Visitor) { v.Argument(n) } @@ -92,7 +92,7 @@ type ScalarDnumber struct { Value []byte } -func (n *ScalarDnumber) Accept(v NodeVisitor) { +func (n *ScalarDnumber) Accept(v Visitor) { v.ScalarDnumber(n) } @@ -108,7 +108,7 @@ type ScalarEncapsed struct { CloseQuoteTkn *token.Token } -func (n *ScalarEncapsed) Accept(v NodeVisitor) { +func (n *ScalarEncapsed) Accept(v Visitor) { v.ScalarEncapsed(n) } @@ -123,7 +123,7 @@ type ScalarEncapsedStringPart struct { Value []byte } -func (n *ScalarEncapsedStringPart) Accept(v NodeVisitor) { +func (n *ScalarEncapsedStringPart) Accept(v Visitor) { v.ScalarEncapsedStringPart(n) } @@ -142,7 +142,7 @@ type ScalarEncapsedStringVar struct { CloseCurlyBracketTkn *token.Token } -func (n *ScalarEncapsedStringVar) Accept(v NodeVisitor) { +func (n *ScalarEncapsedStringVar) Accept(v Visitor) { v.ScalarEncapsedStringVar(n) } @@ -158,7 +158,7 @@ type ScalarEncapsedStringBrackets struct { CloseCurlyBracketTkn *token.Token } -func (n *ScalarEncapsedStringBrackets) Accept(v NodeVisitor) { +func (n *ScalarEncapsedStringBrackets) Accept(v Visitor) { v.ScalarEncapsedStringBrackets(n) } @@ -174,7 +174,7 @@ type ScalarHeredoc struct { CloseHeredocTkn *token.Token } -func (n *ScalarHeredoc) Accept(v NodeVisitor) { +func (n *ScalarHeredoc) Accept(v Visitor) { v.ScalarHeredoc(n) } @@ -189,7 +189,7 @@ type ScalarLnumber struct { Value []byte } -func (n *ScalarLnumber) Accept(v NodeVisitor) { +func (n *ScalarLnumber) Accept(v Visitor) { v.ScalarLnumber(n) } @@ -204,7 +204,7 @@ type ScalarMagicConstant struct { Value []byte } -func (n *ScalarMagicConstant) Accept(v NodeVisitor) { +func (n *ScalarMagicConstant) Accept(v Visitor) { v.ScalarMagicConstant(n) } @@ -220,7 +220,7 @@ type ScalarString struct { Value []byte } -func (n *ScalarString) Accept(v NodeVisitor) { +func (n *ScalarString) Accept(v Visitor) { v.ScalarString(n) } @@ -236,7 +236,7 @@ type StmtBreak struct { SemiColonTkn *token.Token } -func (n *StmtBreak) Accept(v NodeVisitor) { +func (n *StmtBreak) Accept(v Visitor) { v.StmtBreak(n) } @@ -253,7 +253,7 @@ type StmtCase struct { Stmts []Vertex } -func (n *StmtCase) Accept(v NodeVisitor) { +func (n *StmtCase) Accept(v Visitor) { v.StmtCase(n) } @@ -275,7 +275,7 @@ type StmtCatch struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtCatch) Accept(v NodeVisitor) { +func (n *StmtCatch) Accept(v Visitor) { v.StmtCatch(n) } @@ -303,7 +303,7 @@ type StmtClass struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtClass) Accept(v NodeVisitor) { +func (n *StmtClass) Accept(v Visitor) { v.StmtClass(n) } @@ -321,7 +321,7 @@ type StmtClassConstList struct { SemiColonTkn *token.Token } -func (n *StmtClassConstList) Accept(v NodeVisitor) { +func (n *StmtClassConstList) Accept(v Visitor) { v.StmtClassConstList(n) } @@ -345,7 +345,7 @@ type StmtClassMethod struct { Stmt Vertex } -func (n *StmtClassMethod) Accept(v NodeVisitor) { +func (n *StmtClassMethod) Accept(v Visitor) { v.StmtClassMethod(n) } @@ -362,7 +362,7 @@ type StmtConstList struct { SemiColonTkn *token.Token } -func (n *StmtConstList) Accept(v NodeVisitor) { +func (n *StmtConstList) Accept(v Visitor) { v.StmtConstList(n) } @@ -378,7 +378,7 @@ type StmtConstant struct { Expr Vertex } -func (n *StmtConstant) Accept(v NodeVisitor) { +func (n *StmtConstant) Accept(v Visitor) { v.StmtConstant(n) } @@ -394,7 +394,7 @@ type StmtContinue struct { SemiColonTkn *token.Token } -func (n *StmtContinue) Accept(v NodeVisitor) { +func (n *StmtContinue) Accept(v Visitor) { v.StmtContinue(n) } @@ -416,7 +416,7 @@ type StmtDeclare struct { SemiColonTkn *token.Token } -func (n *StmtDeclare) Accept(v NodeVisitor) { +func (n *StmtDeclare) Accept(v Visitor) { v.StmtDeclare(n) } @@ -432,7 +432,7 @@ type StmtDefault struct { Stmts []Vertex } -func (n *StmtDefault) Accept(v NodeVisitor) { +func (n *StmtDefault) Accept(v Visitor) { v.StmtDefault(n) } @@ -452,7 +452,7 @@ type StmtDo struct { SemiColonTkn *token.Token } -func (n *StmtDo) Accept(v NodeVisitor) { +func (n *StmtDo) Accept(v Visitor) { v.StmtDo(n) } @@ -469,7 +469,7 @@ type StmtEcho struct { SemiColonTkn *token.Token } -func (n *StmtEcho) Accept(v NodeVisitor) { +func (n *StmtEcho) Accept(v Visitor) { v.StmtEcho(n) } @@ -485,7 +485,7 @@ type StmtElse struct { Stmt Vertex } -func (n *StmtElse) Accept(v NodeVisitor) { +func (n *StmtElse) Accept(v Visitor) { v.StmtElse(n) } @@ -504,7 +504,7 @@ type StmtElseIf struct { Stmt Vertex } -func (n *StmtElseIf) Accept(v NodeVisitor) { +func (n *StmtElseIf) Accept(v Visitor) { v.StmtElseIf(n) } @@ -519,7 +519,7 @@ type StmtExpression struct { SemiColonTkn *token.Token } -func (n *StmtExpression) Accept(v NodeVisitor) { +func (n *StmtExpression) Accept(v Visitor) { v.StmtExpression(n) } @@ -536,7 +536,7 @@ type StmtFinally struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtFinally) Accept(v NodeVisitor) { +func (n *StmtFinally) Accept(v Visitor) { v.StmtFinally(n) } @@ -564,7 +564,7 @@ type StmtFor struct { SemiColonTkn *token.Token } -func (n *StmtFor) Accept(v NodeVisitor) { +func (n *StmtFor) Accept(v Visitor) { v.StmtFor(n) } @@ -590,7 +590,7 @@ type StmtForeach struct { SemiColonTkn *token.Token } -func (n *StmtForeach) Accept(v NodeVisitor) { +func (n *StmtForeach) Accept(v Visitor) { v.StmtForeach(n) } @@ -615,7 +615,7 @@ type StmtFunction struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtFunction) Accept(v NodeVisitor) { +func (n *StmtFunction) Accept(v Visitor) { v.StmtFunction(n) } @@ -632,7 +632,7 @@ type StmtGlobal struct { SemiColonTkn *token.Token } -func (n *StmtGlobal) Accept(v NodeVisitor) { +func (n *StmtGlobal) Accept(v Visitor) { v.StmtGlobal(n) } @@ -648,7 +648,7 @@ type StmtGoto struct { SemiColonTkn *token.Token } -func (n *StmtGoto) Accept(v NodeVisitor) { +func (n *StmtGoto) Accept(v Visitor) { v.StmtGoto(n) } @@ -665,7 +665,7 @@ type StmtHaltCompiler struct { SemiColonTkn *token.Token } -func (n *StmtHaltCompiler) Accept(v NodeVisitor) { +func (n *StmtHaltCompiler) Accept(v Visitor) { v.StmtHaltCompiler(n) } @@ -688,7 +688,7 @@ type StmtIf struct { SemiColonTkn *token.Token } -func (n *StmtIf) Accept(v NodeVisitor) { +func (n *StmtIf) Accept(v Visitor) { v.StmtIf(n) } @@ -703,7 +703,7 @@ type StmtInlineHtml struct { Value []byte } -func (n *StmtInlineHtml) Accept(v NodeVisitor) { +func (n *StmtInlineHtml) Accept(v Visitor) { v.StmtInlineHtml(n) } @@ -724,7 +724,7 @@ type StmtInterface struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtInterface) Accept(v NodeVisitor) { +func (n *StmtInterface) Accept(v Visitor) { v.StmtInterface(n) } @@ -739,7 +739,7 @@ type StmtLabel struct { ColonTkn *token.Token } -func (n *StmtLabel) Accept(v NodeVisitor) { +func (n *StmtLabel) Accept(v Visitor) { v.StmtLabel(n) } @@ -758,7 +758,7 @@ type StmtNamespace struct { SemiColonTkn *token.Token } -func (n *StmtNamespace) Accept(v NodeVisitor) { +func (n *StmtNamespace) Accept(v Visitor) { v.StmtNamespace(n) } @@ -772,7 +772,7 @@ type StmtNop struct { SemiColonTkn *token.Token } -func (n *StmtNop) Accept(v NodeVisitor) { +func (n *StmtNop) Accept(v Visitor) { v.StmtNop(n) } @@ -788,7 +788,7 @@ type StmtProperty struct { Expr Vertex } -func (n *StmtProperty) Accept(v NodeVisitor) { +func (n *StmtProperty) Accept(v Visitor) { v.StmtProperty(n) } @@ -806,7 +806,7 @@ type StmtPropertyList struct { SemiColonTkn *token.Token } -func (n *StmtPropertyList) Accept(v NodeVisitor) { +func (n *StmtPropertyList) Accept(v Visitor) { v.StmtPropertyList(n) } @@ -822,7 +822,7 @@ type StmtReturn struct { SemiColonTkn *token.Token } -func (n *StmtReturn) Accept(v NodeVisitor) { +func (n *StmtReturn) Accept(v Visitor) { v.StmtReturn(n) } @@ -839,7 +839,7 @@ type StmtStatic struct { SemiColonTkn *token.Token } -func (n *StmtStatic) Accept(v NodeVisitor) { +func (n *StmtStatic) Accept(v Visitor) { v.StmtStatic(n) } @@ -855,7 +855,7 @@ type StmtStaticVar struct { Expr Vertex } -func (n *StmtStaticVar) Accept(v NodeVisitor) { +func (n *StmtStaticVar) Accept(v Visitor) { v.StmtStaticVar(n) } @@ -871,7 +871,7 @@ type StmtStmtList struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtStmtList) Accept(v NodeVisitor) { +func (n *StmtStmtList) Accept(v Visitor) { v.StmtStmtList(n) } @@ -895,7 +895,7 @@ type StmtSwitch struct { SemiColonTkn *token.Token } -func (n *StmtSwitch) Accept(v NodeVisitor) { +func (n *StmtSwitch) Accept(v Visitor) { v.StmtSwitch(n) } @@ -911,7 +911,7 @@ type StmtThrow struct { SemiColonTkn *token.Token } -func (n *StmtThrow) Accept(v NodeVisitor) { +func (n *StmtThrow) Accept(v Visitor) { v.StmtThrow(n) } @@ -929,7 +929,7 @@ type StmtTrait struct { CloseCurlyBracketTkn *token.Token } -func (n *StmtTrait) Accept(v NodeVisitor) { +func (n *StmtTrait) Accept(v Visitor) { v.StmtTrait(n) } @@ -949,7 +949,7 @@ type StmtTraitUse struct { SemiColonTkn *token.Token } -func (n *StmtTraitUse) Accept(v NodeVisitor) { +func (n *StmtTraitUse) Accept(v Visitor) { v.StmtTraitUse(n) } @@ -969,7 +969,7 @@ type StmtTraitUseAlias struct { SemiColonTkn *token.Token } -func (n *StmtTraitUseAlias) Accept(v NodeVisitor) { +func (n *StmtTraitUseAlias) Accept(v Visitor) { v.StmtTraitUseAlias(n) } @@ -989,7 +989,7 @@ type StmtTraitUsePrecedence struct { SemiColonTkn *token.Token } -func (n *StmtTraitUsePrecedence) Accept(v NodeVisitor) { +func (n *StmtTraitUsePrecedence) Accept(v Visitor) { v.StmtTraitUsePrecedence(n) } @@ -1008,7 +1008,7 @@ type StmtTry struct { Finally Vertex } -func (n *StmtTry) Accept(v NodeVisitor) { +func (n *StmtTry) Accept(v Visitor) { v.StmtTry(n) } @@ -1027,7 +1027,7 @@ type StmtUnset struct { SemiColonTkn *token.Token } -func (n *StmtUnset) Accept(v NodeVisitor) { +func (n *StmtUnset) Accept(v Visitor) { v.StmtUnset(n) } @@ -1045,7 +1045,7 @@ type StmtUse struct { SemiColonTkn *token.Token } -func (n *StmtUse) Accept(v NodeVisitor) { +func (n *StmtUse) Accept(v Visitor) { v.StmtUse(n) } @@ -1068,7 +1068,7 @@ type StmtGroupUse struct { SemiColonTkn *token.Token } -func (n *StmtGroupUse) Accept(v NodeVisitor) { +func (n *StmtGroupUse) Accept(v Visitor) { v.StmtGroupUse(n) } @@ -1086,7 +1086,7 @@ type StmtUseDeclaration struct { Alias Vertex } -func (n *StmtUseDeclaration) Accept(v NodeVisitor) { +func (n *StmtUseDeclaration) Accept(v Visitor) { v.StmtUseDeclaration(n) } @@ -1107,7 +1107,7 @@ type StmtWhile struct { SemiColonTkn *token.Token } -func (n *StmtWhile) Accept(v NodeVisitor) { +func (n *StmtWhile) Accept(v Visitor) { v.StmtWhile(n) } @@ -1125,7 +1125,7 @@ type ExprArray struct { CloseBracketTkn *token.Token } -func (n *ExprArray) Accept(v NodeVisitor) { +func (n *ExprArray) Accept(v Visitor) { v.ExprArray(n) } @@ -1142,7 +1142,7 @@ type ExprArrayDimFetch struct { CloseBracketTkn *token.Token } -func (n *ExprArrayDimFetch) Accept(v NodeVisitor) { +func (n *ExprArrayDimFetch) Accept(v Visitor) { v.ExprArrayDimFetch(n) } @@ -1160,7 +1160,7 @@ type ExprArrayItem struct { Val Vertex } -func (n *ExprArrayItem) Accept(v NodeVisitor) { +func (n *ExprArrayItem) Accept(v Visitor) { v.ExprArrayItem(n) } @@ -1184,7 +1184,7 @@ type ExprArrowFunction struct { Expr Vertex } -func (n *ExprArrowFunction) Accept(v NodeVisitor) { +func (n *ExprArrowFunction) Accept(v Visitor) { v.ExprArrowFunction(n) } @@ -1199,7 +1199,7 @@ type ExprBitwiseNot struct { Expr Vertex } -func (n *ExprBitwiseNot) Accept(v NodeVisitor) { +func (n *ExprBitwiseNot) Accept(v Visitor) { v.ExprBitwiseNot(n) } @@ -1214,7 +1214,7 @@ type ExprBooleanNot struct { Expr Vertex } -func (n *ExprBooleanNot) Accept(v NodeVisitor) { +func (n *ExprBooleanNot) Accept(v Visitor) { v.ExprBooleanNot(n) } @@ -1229,7 +1229,7 @@ type ExprBrackets struct { CloseParenthesisTkn *token.Token } -func (n *ExprBrackets) Accept(v NodeVisitor) { +func (n *ExprBrackets) Accept(v Visitor) { v.ExprBrackets(n) } @@ -1245,7 +1245,7 @@ type ExprClassConstFetch struct { ConstantName Vertex } -func (n *ExprClassConstFetch) Accept(v NodeVisitor) { +func (n *ExprClassConstFetch) Accept(v Visitor) { v.ExprClassConstFetch(n) } @@ -1260,7 +1260,7 @@ type ExprClone struct { Expr Vertex } -func (n *ExprClone) Accept(v NodeVisitor) { +func (n *ExprClone) Accept(v Visitor) { v.ExprClone(n) } @@ -1290,7 +1290,7 @@ type ExprClosure struct { CloseCurlyBracketTkn *token.Token } -func (n *ExprClosure) Accept(v NodeVisitor) { +func (n *ExprClosure) Accept(v Visitor) { v.ExprClosure(n) } @@ -1305,7 +1305,7 @@ type ExprClosureUse struct { Var Vertex } -func (n *ExprClosureUse) Accept(v NodeVisitor) { +func (n *ExprClosureUse) Accept(v Visitor) { v.ExprClosureUse(n) } @@ -1319,7 +1319,7 @@ type ExprConstFetch struct { Const Vertex } -func (n *ExprConstFetch) Accept(v NodeVisitor) { +func (n *ExprConstFetch) Accept(v Visitor) { v.ExprConstFetch(n) } @@ -1336,7 +1336,7 @@ type ExprEmpty struct { CloseParenthesisTkn *token.Token } -func (n *ExprEmpty) Accept(v NodeVisitor) { +func (n *ExprEmpty) Accept(v Visitor) { v.ExprEmpty(n) } @@ -1351,7 +1351,7 @@ type ExprErrorSuppress struct { Expr Vertex } -func (n *ExprErrorSuppress) Accept(v NodeVisitor) { +func (n *ExprErrorSuppress) Accept(v Visitor) { v.ExprErrorSuppress(n) } @@ -1368,7 +1368,7 @@ type ExprEval struct { CloseParenthesisTkn *token.Token } -func (n *ExprEval) Accept(v NodeVisitor) { +func (n *ExprEval) Accept(v Visitor) { v.ExprEval(n) } @@ -1385,7 +1385,7 @@ type ExprExit struct { CloseParenthesisTkn *token.Token } -func (n *ExprExit) Accept(v NodeVisitor) { +func (n *ExprExit) Accept(v Visitor) { v.ExprExit(n) } @@ -1403,7 +1403,7 @@ type ExprFunctionCall struct { CloseParenthesisTkn *token.Token } -func (n *ExprFunctionCall) Accept(v NodeVisitor) { +func (n *ExprFunctionCall) Accept(v Visitor) { v.ExprFunctionCall(n) } @@ -1418,7 +1418,7 @@ type ExprInclude struct { Expr Vertex } -func (n *ExprInclude) Accept(v NodeVisitor) { +func (n *ExprInclude) Accept(v Visitor) { v.ExprInclude(n) } @@ -1433,7 +1433,7 @@ type ExprIncludeOnce struct { Expr Vertex } -func (n *ExprIncludeOnce) Accept(v NodeVisitor) { +func (n *ExprIncludeOnce) Accept(v Visitor) { v.ExprIncludeOnce(n) } @@ -1449,7 +1449,7 @@ type ExprInstanceOf struct { Class Vertex } -func (n *ExprInstanceOf) Accept(v NodeVisitor) { +func (n *ExprInstanceOf) Accept(v Visitor) { v.ExprInstanceOf(n) } @@ -1467,7 +1467,7 @@ type ExprIsset struct { CloseParenthesisTkn *token.Token } -func (n *ExprIsset) Accept(v NodeVisitor) { +func (n *ExprIsset) Accept(v Visitor) { v.ExprIsset(n) } @@ -1485,7 +1485,7 @@ type ExprList struct { CloseBracketTkn *token.Token } -func (n *ExprList) Accept(v NodeVisitor) { +func (n *ExprList) Accept(v Visitor) { v.ExprList(n) } @@ -1507,7 +1507,7 @@ type ExprMethodCall struct { CloseParenthesisTkn *token.Token } -func (n *ExprMethodCall) Accept(v NodeVisitor) { +func (n *ExprMethodCall) Accept(v Visitor) { v.ExprMethodCall(n) } @@ -1526,7 +1526,7 @@ type ExprNew struct { CloseParenthesisTkn *token.Token } -func (n *ExprNew) Accept(v NodeVisitor) { +func (n *ExprNew) Accept(v Visitor) { v.ExprNew(n) } @@ -1541,7 +1541,7 @@ type ExprPostDec struct { DecTkn *token.Token } -func (n *ExprPostDec) Accept(v NodeVisitor) { +func (n *ExprPostDec) Accept(v Visitor) { v.ExprPostDec(n) } @@ -1556,7 +1556,7 @@ type ExprPostInc struct { IncTkn *token.Token } -func (n *ExprPostInc) Accept(v NodeVisitor) { +func (n *ExprPostInc) Accept(v Visitor) { v.ExprPostInc(n) } @@ -1571,7 +1571,7 @@ type ExprPreDec struct { Var Vertex } -func (n *ExprPreDec) Accept(v NodeVisitor) { +func (n *ExprPreDec) Accept(v Visitor) { v.ExprPreDec(n) } @@ -1586,7 +1586,7 @@ type ExprPreInc struct { Var Vertex } -func (n *ExprPreInc) Accept(v NodeVisitor) { +func (n *ExprPreInc) Accept(v Visitor) { v.ExprPreInc(n) } @@ -1601,7 +1601,7 @@ type ExprPrint struct { Expr Vertex } -func (n *ExprPrint) Accept(v NodeVisitor) { +func (n *ExprPrint) Accept(v Visitor) { v.ExprPrint(n) } @@ -1619,7 +1619,7 @@ type ExprPropertyFetch struct { CloseCurlyBracketTkn *token.Token } -func (n *ExprPropertyFetch) Accept(v NodeVisitor) { +func (n *ExprPropertyFetch) Accept(v Visitor) { v.ExprPropertyFetch(n) } @@ -1634,7 +1634,7 @@ type ExprRequire struct { Expr Vertex } -func (n *ExprRequire) Accept(v NodeVisitor) { +func (n *ExprRequire) Accept(v Visitor) { v.ExprRequire(n) } @@ -1649,7 +1649,7 @@ type ExprRequireOnce struct { Expr Vertex } -func (n *ExprRequireOnce) Accept(v NodeVisitor) { +func (n *ExprRequireOnce) Accept(v Visitor) { v.ExprRequireOnce(n) } @@ -1665,7 +1665,7 @@ type ExprShellExec struct { CloseBacktickTkn *token.Token } -func (n *ExprShellExec) Accept(v NodeVisitor) { +func (n *ExprShellExec) Accept(v Visitor) { v.ExprShellExec(n) } @@ -1687,7 +1687,7 @@ type ExprStaticCall struct { CloseParenthesisTkn *token.Token } -func (n *ExprStaticCall) Accept(v NodeVisitor) { +func (n *ExprStaticCall) Accept(v Visitor) { v.ExprStaticCall(n) } @@ -1703,7 +1703,7 @@ type ExprStaticPropertyFetch struct { Property Vertex } -func (n *ExprStaticPropertyFetch) Accept(v NodeVisitor) { +func (n *ExprStaticPropertyFetch) Accept(v Visitor) { v.ExprStaticPropertyFetch(n) } @@ -1721,7 +1721,7 @@ type ExprTernary struct { IfFalse Vertex } -func (n *ExprTernary) Accept(v NodeVisitor) { +func (n *ExprTernary) Accept(v Visitor) { v.ExprTernary(n) } @@ -1736,7 +1736,7 @@ type ExprUnaryMinus struct { Expr Vertex } -func (n *ExprUnaryMinus) Accept(v NodeVisitor) { +func (n *ExprUnaryMinus) Accept(v Visitor) { v.ExprUnaryMinus(n) } @@ -1751,7 +1751,7 @@ type ExprUnaryPlus struct { Expr Vertex } -func (n *ExprUnaryPlus) Accept(v NodeVisitor) { +func (n *ExprUnaryPlus) Accept(v Visitor) { v.ExprUnaryPlus(n) } @@ -1768,7 +1768,7 @@ type ExprVariable struct { CloseCurlyBracketTkn *token.Token } -func (n *ExprVariable) Accept(v NodeVisitor) { +func (n *ExprVariable) Accept(v Visitor) { v.ExprVariable(n) } @@ -1785,7 +1785,7 @@ type ExprYield struct { Value Vertex } -func (n *ExprYield) Accept(v NodeVisitor) { +func (n *ExprYield) Accept(v Visitor) { v.ExprYield(n) } @@ -1800,7 +1800,7 @@ type ExprYieldFrom struct { Expr Vertex } -func (n *ExprYieldFrom) Accept(v NodeVisitor) { +func (n *ExprYieldFrom) Accept(v Visitor) { v.ExprYieldFrom(n) } @@ -1815,7 +1815,7 @@ type ExprCastArray struct { Expr Vertex } -func (n *ExprCastArray) Accept(v NodeVisitor) { +func (n *ExprCastArray) Accept(v Visitor) { v.ExprCastArray(n) } @@ -1830,7 +1830,7 @@ type ExprCastBool struct { Expr Vertex } -func (n *ExprCastBool) Accept(v NodeVisitor) { +func (n *ExprCastBool) Accept(v Visitor) { v.ExprCastBool(n) } @@ -1845,7 +1845,7 @@ type ExprCastDouble struct { Expr Vertex } -func (n *ExprCastDouble) Accept(v NodeVisitor) { +func (n *ExprCastDouble) Accept(v Visitor) { v.ExprCastDouble(n) } @@ -1860,7 +1860,7 @@ type ExprCastInt struct { Expr Vertex } -func (n *ExprCastInt) Accept(v NodeVisitor) { +func (n *ExprCastInt) Accept(v Visitor) { v.ExprCastInt(n) } @@ -1875,7 +1875,7 @@ type ExprCastObject struct { Expr Vertex } -func (n *ExprCastObject) Accept(v NodeVisitor) { +func (n *ExprCastObject) Accept(v Visitor) { v.ExprCastObject(n) } @@ -1890,7 +1890,7 @@ type ExprCastString struct { Expr Vertex } -func (n *ExprCastString) Accept(v NodeVisitor) { +func (n *ExprCastString) Accept(v Visitor) { v.ExprCastString(n) } @@ -1905,7 +1905,7 @@ type ExprCastUnset struct { Expr Vertex } -func (n *ExprCastUnset) Accept(v NodeVisitor) { +func (n *ExprCastUnset) Accept(v Visitor) { v.ExprCastUnset(n) } @@ -1921,7 +1921,7 @@ type ExprAssign struct { Expr Vertex } -func (n *ExprAssign) Accept(v NodeVisitor) { +func (n *ExprAssign) Accept(v Visitor) { v.ExprAssign(n) } @@ -1938,7 +1938,7 @@ type ExprAssignReference struct { Expr Vertex } -func (n *ExprAssignReference) Accept(v NodeVisitor) { +func (n *ExprAssignReference) Accept(v Visitor) { v.ExprAssignReference(n) } @@ -1954,7 +1954,7 @@ type ExprAssignBitwiseAnd struct { Expr Vertex } -func (n *ExprAssignBitwiseAnd) Accept(v NodeVisitor) { +func (n *ExprAssignBitwiseAnd) Accept(v Visitor) { v.ExprAssignBitwiseAnd(n) } @@ -1970,7 +1970,7 @@ type ExprAssignBitwiseOr struct { Expr Vertex } -func (n *ExprAssignBitwiseOr) Accept(v NodeVisitor) { +func (n *ExprAssignBitwiseOr) Accept(v Visitor) { v.ExprAssignBitwiseOr(n) } @@ -1986,7 +1986,7 @@ type ExprAssignBitwiseXor struct { Expr Vertex } -func (n *ExprAssignBitwiseXor) Accept(v NodeVisitor) { +func (n *ExprAssignBitwiseXor) Accept(v Visitor) { v.ExprAssignBitwiseXor(n) } @@ -2002,7 +2002,7 @@ type ExprAssignCoalesce struct { Expr Vertex } -func (n *ExprAssignCoalesce) Accept(v NodeVisitor) { +func (n *ExprAssignCoalesce) Accept(v Visitor) { v.ExprAssignCoalesce(n) } @@ -2018,7 +2018,7 @@ type ExprAssignConcat struct { Expr Vertex } -func (n *ExprAssignConcat) Accept(v NodeVisitor) { +func (n *ExprAssignConcat) Accept(v Visitor) { v.ExprAssignConcat(n) } @@ -2034,7 +2034,7 @@ type ExprAssignDiv struct { Expr Vertex } -func (n *ExprAssignDiv) Accept(v NodeVisitor) { +func (n *ExprAssignDiv) Accept(v Visitor) { v.ExprAssignDiv(n) } @@ -2050,7 +2050,7 @@ type ExprAssignMinus struct { Expr Vertex } -func (n *ExprAssignMinus) Accept(v NodeVisitor) { +func (n *ExprAssignMinus) Accept(v Visitor) { v.ExprAssignMinus(n) } @@ -2066,7 +2066,7 @@ type ExprAssignMod struct { Expr Vertex } -func (n *ExprAssignMod) Accept(v NodeVisitor) { +func (n *ExprAssignMod) Accept(v Visitor) { v.ExprAssignMod(n) } @@ -2082,7 +2082,7 @@ type ExprAssignMul struct { Expr Vertex } -func (n *ExprAssignMul) Accept(v NodeVisitor) { +func (n *ExprAssignMul) Accept(v Visitor) { v.ExprAssignMul(n) } @@ -2098,7 +2098,7 @@ type ExprAssignPlus struct { Expr Vertex } -func (n *ExprAssignPlus) Accept(v NodeVisitor) { +func (n *ExprAssignPlus) Accept(v Visitor) { v.ExprAssignPlus(n) } @@ -2114,7 +2114,7 @@ type ExprAssignPow struct { Expr Vertex } -func (n *ExprAssignPow) Accept(v NodeVisitor) { +func (n *ExprAssignPow) Accept(v Visitor) { v.ExprAssignPow(n) } @@ -2130,7 +2130,7 @@ type ExprAssignShiftLeft struct { Expr Vertex } -func (n *ExprAssignShiftLeft) Accept(v NodeVisitor) { +func (n *ExprAssignShiftLeft) Accept(v Visitor) { v.ExprAssignShiftLeft(n) } @@ -2146,7 +2146,7 @@ type ExprAssignShiftRight struct { Expr Vertex } -func (n *ExprAssignShiftRight) Accept(v NodeVisitor) { +func (n *ExprAssignShiftRight) Accept(v Visitor) { v.ExprAssignShiftRight(n) } @@ -2162,7 +2162,7 @@ type ExprBinaryBitwiseAnd struct { Right Vertex } -func (n *ExprBinaryBitwiseAnd) Accept(v NodeVisitor) { +func (n *ExprBinaryBitwiseAnd) Accept(v Visitor) { v.ExprBinaryBitwiseAnd(n) } @@ -2178,7 +2178,7 @@ type ExprBinaryBitwiseOr struct { Right Vertex } -func (n *ExprBinaryBitwiseOr) Accept(v NodeVisitor) { +func (n *ExprBinaryBitwiseOr) Accept(v Visitor) { v.ExprBinaryBitwiseOr(n) } @@ -2194,7 +2194,7 @@ type ExprBinaryBitwiseXor struct { Right Vertex } -func (n *ExprBinaryBitwiseXor) Accept(v NodeVisitor) { +func (n *ExprBinaryBitwiseXor) Accept(v Visitor) { v.ExprBinaryBitwiseXor(n) } @@ -2210,7 +2210,7 @@ type ExprBinaryBooleanAnd struct { Right Vertex } -func (n *ExprBinaryBooleanAnd) Accept(v NodeVisitor) { +func (n *ExprBinaryBooleanAnd) Accept(v Visitor) { v.ExprBinaryBooleanAnd(n) } @@ -2226,7 +2226,7 @@ type ExprBinaryBooleanOr struct { Right Vertex } -func (n *ExprBinaryBooleanOr) Accept(v NodeVisitor) { +func (n *ExprBinaryBooleanOr) Accept(v Visitor) { v.ExprBinaryBooleanOr(n) } @@ -2242,7 +2242,7 @@ type ExprBinaryCoalesce struct { Right Vertex } -func (n *ExprBinaryCoalesce) Accept(v NodeVisitor) { +func (n *ExprBinaryCoalesce) Accept(v Visitor) { v.ExprBinaryCoalesce(n) } @@ -2258,7 +2258,7 @@ type ExprBinaryConcat struct { Right Vertex } -func (n *ExprBinaryConcat) Accept(v NodeVisitor) { +func (n *ExprBinaryConcat) Accept(v Visitor) { v.ExprBinaryConcat(n) } @@ -2274,7 +2274,7 @@ type ExprBinaryDiv struct { Right Vertex } -func (n *ExprBinaryDiv) Accept(v NodeVisitor) { +func (n *ExprBinaryDiv) Accept(v Visitor) { v.ExprBinaryDiv(n) } @@ -2290,7 +2290,7 @@ type ExprBinaryEqual struct { Right Vertex } -func (n *ExprBinaryEqual) Accept(v NodeVisitor) { +func (n *ExprBinaryEqual) Accept(v Visitor) { v.ExprBinaryEqual(n) } @@ -2306,7 +2306,7 @@ type ExprBinaryGreater struct { Right Vertex } -func (n *ExprBinaryGreater) Accept(v NodeVisitor) { +func (n *ExprBinaryGreater) Accept(v Visitor) { v.ExprBinaryGreater(n) } @@ -2322,7 +2322,7 @@ type ExprBinaryGreaterOrEqual struct { Right Vertex } -func (n *ExprBinaryGreaterOrEqual) Accept(v NodeVisitor) { +func (n *ExprBinaryGreaterOrEqual) Accept(v Visitor) { v.ExprBinaryGreaterOrEqual(n) } @@ -2338,7 +2338,7 @@ type ExprBinaryIdentical struct { Right Vertex } -func (n *ExprBinaryIdentical) Accept(v NodeVisitor) { +func (n *ExprBinaryIdentical) Accept(v Visitor) { v.ExprBinaryIdentical(n) } @@ -2354,7 +2354,7 @@ type ExprBinaryLogicalAnd struct { Right Vertex } -func (n *ExprBinaryLogicalAnd) Accept(v NodeVisitor) { +func (n *ExprBinaryLogicalAnd) Accept(v Visitor) { v.ExprBinaryLogicalAnd(n) } @@ -2370,7 +2370,7 @@ type ExprBinaryLogicalOr struct { Right Vertex } -func (n *ExprBinaryLogicalOr) Accept(v NodeVisitor) { +func (n *ExprBinaryLogicalOr) Accept(v Visitor) { v.ExprBinaryLogicalOr(n) } @@ -2386,7 +2386,7 @@ type ExprBinaryLogicalXor struct { Right Vertex } -func (n *ExprBinaryLogicalXor) Accept(v NodeVisitor) { +func (n *ExprBinaryLogicalXor) Accept(v Visitor) { v.ExprBinaryLogicalXor(n) } @@ -2402,7 +2402,7 @@ type ExprBinaryMinus struct { Right Vertex } -func (n *ExprBinaryMinus) Accept(v NodeVisitor) { +func (n *ExprBinaryMinus) Accept(v Visitor) { v.ExprBinaryMinus(n) } @@ -2418,7 +2418,7 @@ type ExprBinaryMod struct { Right Vertex } -func (n *ExprBinaryMod) Accept(v NodeVisitor) { +func (n *ExprBinaryMod) Accept(v Visitor) { v.ExprBinaryMod(n) } @@ -2434,7 +2434,7 @@ type ExprBinaryMul struct { Right Vertex } -func (n *ExprBinaryMul) Accept(v NodeVisitor) { +func (n *ExprBinaryMul) Accept(v Visitor) { v.ExprBinaryMul(n) } @@ -2450,7 +2450,7 @@ type ExprBinaryNotEqual struct { Right Vertex } -func (n *ExprBinaryNotEqual) Accept(v NodeVisitor) { +func (n *ExprBinaryNotEqual) Accept(v Visitor) { v.ExprBinaryNotEqual(n) } @@ -2466,7 +2466,7 @@ type ExprBinaryNotIdentical struct { Right Vertex } -func (n *ExprBinaryNotIdentical) Accept(v NodeVisitor) { +func (n *ExprBinaryNotIdentical) Accept(v Visitor) { v.ExprBinaryNotIdentical(n) } @@ -2482,7 +2482,7 @@ type ExprBinaryPlus struct { Right Vertex } -func (n *ExprBinaryPlus) Accept(v NodeVisitor) { +func (n *ExprBinaryPlus) Accept(v Visitor) { v.ExprBinaryPlus(n) } @@ -2498,7 +2498,7 @@ type ExprBinaryPow struct { Right Vertex } -func (n *ExprBinaryPow) Accept(v NodeVisitor) { +func (n *ExprBinaryPow) Accept(v Visitor) { v.ExprBinaryPow(n) } @@ -2514,7 +2514,7 @@ type ExprBinaryShiftLeft struct { Right Vertex } -func (n *ExprBinaryShiftLeft) Accept(v NodeVisitor) { +func (n *ExprBinaryShiftLeft) Accept(v Visitor) { v.ExprBinaryShiftLeft(n) } @@ -2530,7 +2530,7 @@ type ExprBinaryShiftRight struct { Right Vertex } -func (n *ExprBinaryShiftRight) Accept(v NodeVisitor) { +func (n *ExprBinaryShiftRight) Accept(v Visitor) { v.ExprBinaryShiftRight(n) } @@ -2546,7 +2546,7 @@ type ExprBinarySmaller struct { Right Vertex } -func (n *ExprBinarySmaller) Accept(v NodeVisitor) { +func (n *ExprBinarySmaller) Accept(v Visitor) { v.ExprBinarySmaller(n) } @@ -2562,7 +2562,7 @@ type ExprBinarySmallerOrEqual struct { Right Vertex } -func (n *ExprBinarySmallerOrEqual) Accept(v NodeVisitor) { +func (n *ExprBinarySmallerOrEqual) Accept(v Visitor) { v.ExprBinarySmallerOrEqual(n) } @@ -2578,7 +2578,7 @@ type ExprBinarySpaceship struct { Right Vertex } -func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { +func (n *ExprBinarySpaceship) Accept(v Visitor) { v.ExprBinarySpaceship(n) } @@ -2592,7 +2592,7 @@ type NameName struct { SeparatorTkns []*token.Token } -func (n *NameName) Accept(v NodeVisitor) { +func (n *NameName) Accept(v Visitor) { v.NameName(n) } @@ -2607,7 +2607,7 @@ type NameFullyQualified struct { SeparatorTkns []*token.Token } -func (n *NameFullyQualified) Accept(v NodeVisitor) { +func (n *NameFullyQualified) Accept(v Visitor) { v.NameFullyQualified(n) } @@ -2623,7 +2623,7 @@ type NameRelative struct { SeparatorTkns []*token.Token } -func (n *NameRelative) Accept(v NodeVisitor) { +func (n *NameRelative) Accept(v Visitor) { v.NameRelative(n) } @@ -2637,7 +2637,7 @@ type NameNamePart struct { Value []byte } -func (n *NameNamePart) Accept(v NodeVisitor) { +func (n *NameNamePart) Accept(v Visitor) { v.NameNamePart(n) } @@ -2654,7 +2654,7 @@ type ParserBrackets struct { CloseBracketTkn *token.Token } -func (n *ParserBrackets) Accept(v NodeVisitor) { +func (n *ParserBrackets) Accept(v Visitor) { // do nothing } @@ -2668,7 +2668,7 @@ type ParserSeparatedList struct { SeparatorTkns []*token.Token } -func (n *ParserSeparatedList) Accept(v NodeVisitor) { +func (n *ParserSeparatedList) Accept(v Visitor) { // do nothing } @@ -2684,7 +2684,7 @@ type TraitAdaptationList struct { CloseCurlyBracketTkn *token.Token } -func (n *TraitAdaptationList) Accept(v NodeVisitor) { +func (n *TraitAdaptationList) Accept(v Visitor) { // do nothing } @@ -2701,7 +2701,7 @@ type ArgumentList struct { CloseParenthesisTkn *token.Token } -func (n *ArgumentList) Accept(v NodeVisitor) { +func (n *ArgumentList) Accept(v Visitor) { // do nothing } @@ -2715,7 +2715,7 @@ type ReturnType struct { Type Vertex } -func (n *ReturnType) Accept(v NodeVisitor) { +func (n *ReturnType) Accept(v Visitor) { // do nothing } @@ -2731,7 +2731,7 @@ type TraitMethodRef struct { Method Vertex } -func (n *TraitMethodRef) Accept(v NodeVisitor) { +func (n *TraitMethodRef) Accept(v Visitor) { // do nothing } diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go deleted file mode 100644 index 716bb30..0000000 --- a/pkg/ast/traverser/dfs.go +++ /dev/null @@ -1,2533 +0,0 @@ -package traverser - -import "github.com/z7zmey/php-parser/pkg/ast" - -type DFS struct { - visitor ast.Visitor -} - -func NewDFS(visitor ast.Visitor) *DFS { - return &DFS{ - visitor: visitor, - } -} - -func (t *DFS) Traverse(n ast.Vertex) { - switch nn := n.(type) { - case *ast.Root: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.Nullable: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.Parameter: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Type != nil { - t.visitor.Enter("Type", true) - t.Traverse(nn.Type) - t.visitor.Leave("Type", true) - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.DefaultValue != nil { - t.visitor.Enter("DefaultValue", true) - t.Traverse(nn.DefaultValue) - t.visitor.Leave("DefaultValue", true) - } - case *ast.Identifier: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.Argument: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtBreak: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtCase: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtCatch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Types != nil { - t.visitor.Enter("Types", false) - for _, c := range nn.Types { - t.Traverse(c) - } - t.visitor.Leave("Types", false) - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtClass: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.ClassName != nil { - t.visitor.Enter("ClassName", true) - t.Traverse(nn.ClassName) - t.visitor.Leave("ClassName", true) - } - if nn.Modifiers != nil { - t.visitor.Enter("Modifiers", false) - for _, c := range nn.Modifiers { - t.Traverse(c) - } - t.visitor.Leave("Modifiers", false) - } - if nn.Arguments != nil { - t.visitor.Enter("Arguments", false) - for _, c := range nn.Arguments { - t.Traverse(c) - } - t.visitor.Leave("Arguments", false) - } - if nn.Extends != nil { - t.visitor.Enter("Extends", true) - t.Traverse(nn.Extends) - t.visitor.Leave("Extends", true) - } - if nn.Implements != nil { - t.visitor.Enter("Implements", false) - for _, c := range nn.Implements { - t.Traverse(c) - } - t.visitor.Leave("Implements", false) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtClassConstList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Modifiers != nil { - t.visitor.Enter("Modifiers", false) - for _, c := range nn.Modifiers { - t.Traverse(c) - } - t.visitor.Leave("Modifiers", false) - } - if nn.Consts != nil { - t.visitor.Enter("Consts", false) - for _, c := range nn.Consts { - t.Traverse(c) - } - t.visitor.Leave("Consts", false) - } - case *ast.StmtClassMethod: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.MethodName != nil { - t.visitor.Enter("MethodName", true) - t.Traverse(nn.MethodName) - t.visitor.Leave("MethodName", true) - } - if nn.Modifiers != nil { - t.visitor.Enter("Modifiers", false) - for _, c := range nn.Modifiers { - t.Traverse(c) - } - t.visitor.Leave("Modifiers", false) - } - if nn.Params != nil { - t.visitor.Enter("Params", false) - for _, c := range nn.Params { - t.Traverse(c) - } - t.visitor.Leave("Params", false) - } - if nn.ReturnType != nil { - t.visitor.Enter("ReturnType", true) - t.Traverse(nn.ReturnType) - t.visitor.Leave("ReturnType", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtConstList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Consts != nil { - t.visitor.Enter("Consts", false) - for _, c := range nn.Consts { - t.Traverse(c) - } - t.visitor.Leave("Consts", false) - } - case *ast.StmtConstant: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Name != nil { - t.visitor.Enter("Name", true) - t.Traverse(nn.Name) - t.visitor.Leave("Name", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtContinue: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtDeclare: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Consts != nil { - t.visitor.Enter("Consts", false) - for _, c := range nn.Consts { - t.Traverse(c) - } - t.visitor.Leave("Consts", false) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtDefault: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtDo: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - case *ast.StmtEcho: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Exprs != nil { - t.visitor.Enter("Exprs", false) - for _, c := range nn.Exprs { - t.Traverse(c) - } - t.visitor.Leave("Exprs", false) - } - case *ast.StmtElse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtElseIf: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtExpression: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtFinally: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtFor: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Init != nil { - t.visitor.Enter("Init", false) - for _, c := range nn.Init { - t.Traverse(c) - } - t.visitor.Leave("Init", false) - } - if nn.Cond != nil { - t.visitor.Enter("Cond", false) - for _, c := range nn.Cond { - t.Traverse(c) - } - t.visitor.Leave("Cond", false) - } - if nn.Loop != nil { - t.visitor.Enter("Loop", false) - for _, c := range nn.Loop { - t.Traverse(c) - } - t.visitor.Leave("Loop", false) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtForeach: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - if nn.Key != nil { - t.visitor.Enter("Key", true) - t.Traverse(nn.Key) - t.visitor.Leave("Key", true) - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.StmtFunction: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.FunctionName != nil { - t.visitor.Enter("FunctionName", true) - t.Traverse(nn.FunctionName) - t.visitor.Leave("FunctionName", true) - } - if nn.Params != nil { - t.visitor.Enter("Params", false) - for _, c := range nn.Params { - t.Traverse(c) - } - t.visitor.Leave("Params", false) - } - if nn.ReturnType != nil { - t.visitor.Enter("ReturnType", true) - t.Traverse(nn.ReturnType) - t.visitor.Leave("ReturnType", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtGlobal: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Vars != nil { - t.visitor.Enter("Vars", false) - for _, c := range nn.Vars { - t.Traverse(c) - } - t.visitor.Leave("Vars", false) - } - case *ast.StmtGoto: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Label != nil { - t.visitor.Enter("Label", true) - t.Traverse(nn.Label) - t.visitor.Leave("Label", true) - } - case *ast.StmtHaltCompiler: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.StmtIf: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - if nn.ElseIf != nil { - t.visitor.Enter("ElseIf", false) - for _, c := range nn.ElseIf { - t.Traverse(c) - } - t.visitor.Leave("ElseIf", false) - } - if nn.Else != nil { - t.visitor.Enter("Else", true) - t.Traverse(nn.Else) - t.visitor.Leave("Else", true) - } - case *ast.StmtInlineHtml: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.StmtInterface: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.InterfaceName != nil { - t.visitor.Enter("InterfaceName", true) - t.Traverse(nn.InterfaceName) - t.visitor.Leave("InterfaceName", true) - } - if nn.Extends != nil { - t.visitor.Enter("Extends", false) - for _, c := range nn.Extends { - t.Traverse(c) - } - t.visitor.Leave("Extends", false) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtLabel: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.LabelName != nil { - t.visitor.Enter("LabelName", true) - t.Traverse(nn.LabelName) - t.visitor.Leave("LabelName", true) - } - case *ast.StmtNamespace: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Name != nil { - t.visitor.Enter("Name", true) - t.Traverse(nn.Name) - t.visitor.Leave("Name", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtNop: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.StmtProperty: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtPropertyList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Modifiers != nil { - t.visitor.Enter("Modifiers", false) - for _, c := range nn.Modifiers { - t.Traverse(c) - } - t.visitor.Leave("Modifiers", false) - } - if nn.Type != nil { - t.visitor.Enter("Type", true) - t.Traverse(nn.Type) - t.visitor.Leave("Type", true) - } - if nn.Properties != nil { - t.visitor.Enter("Properties", false) - for _, c := range nn.Properties { - t.Traverse(c) - } - t.visitor.Leave("Properties", false) - } - case *ast.StmtReturn: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtStatic: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Vars != nil { - t.visitor.Enter("Vars", false) - for _, c := range nn.Vars { - t.Traverse(c) - } - t.visitor.Leave("Vars", false) - } - case *ast.StmtStaticVar: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtStmtList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtSwitch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.CaseList != nil { - t.visitor.Enter("CaseList", false) - for _, c := range nn.CaseList { - t.Traverse(c) - } - t.visitor.Leave("CaseList", false) - } - case *ast.StmtThrow: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.StmtTrait: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.TraitName != nil { - t.visitor.Enter("TraitName", true) - t.Traverse(nn.TraitName) - t.visitor.Leave("TraitName", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.StmtTraitUse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Traits != nil { - t.visitor.Enter("Traits", false) - for _, c := range nn.Traits { - t.Traverse(c) - } - t.visitor.Leave("Traits", false) - } - if nn.Adaptations != nil { - t.visitor.Enter("Adaptations", false) - for _, c := range nn.Adaptations { - t.Traverse(c) - } - t.visitor.Leave("Adaptations", false) - } - case *ast.StmtTraitUseAlias: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Trait != nil { - t.visitor.Enter("Trait", true) - t.Traverse(nn.Trait) - t.visitor.Leave("Trait", true) - } - if nn.Method != nil { - t.visitor.Enter("Method", true) - t.Traverse(nn.Method) - t.visitor.Leave("Method", true) - } - if nn.Modifier != nil { - t.visitor.Enter("Modifier", true) - t.Traverse(nn.Modifier) - t.visitor.Leave("Modifier", true) - } - if nn.Alias != nil { - t.visitor.Enter("Alias", true) - t.Traverse(nn.Alias) - t.visitor.Leave("Alias", true) - } - case *ast.StmtTraitUsePrecedence: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Trait != nil { - t.visitor.Enter("Trait", true) - t.Traverse(nn.Trait) - t.visitor.Leave("Trait", true) - } - if nn.Method != nil { - t.visitor.Enter("Method", true) - t.Traverse(nn.Method) - t.visitor.Leave("Method", true) - } - if nn.Insteadof != nil { - t.visitor.Enter("Insteadof", false) - for _, c := range nn.Insteadof { - t.Traverse(c) - } - t.visitor.Leave("Insteadof", false) - } - case *ast.StmtTry: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - if nn.Catches != nil { - t.visitor.Enter("Catches", false) - for _, c := range nn.Catches { - t.Traverse(c) - } - t.visitor.Leave("Catches", false) - } - if nn.Finally != nil { - t.visitor.Enter("Finally", true) - t.Traverse(nn.Finally) - t.visitor.Leave("Finally", true) - } - case *ast.StmtUnset: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Vars != nil { - t.visitor.Enter("Vars", false) - for _, c := range nn.Vars { - t.Traverse(c) - } - t.visitor.Leave("Vars", false) - } - case *ast.StmtUse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Type != nil { - t.visitor.Enter("Type", true) - t.Traverse(nn.Type) - t.visitor.Leave("Type", true) - } - if nn.UseDeclarations != nil { - t.visitor.Enter("UseDeclarations", false) - for _, c := range nn.UseDeclarations { - t.Traverse(c) - } - t.visitor.Leave("UseDeclarations", false) - } - case *ast.StmtGroupUse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Type != nil { - t.visitor.Enter("Type", true) - t.Traverse(nn.Type) - t.visitor.Leave("Type", true) - } - if nn.Prefix != nil { - t.visitor.Enter("Prefix", true) - t.Traverse(nn.Prefix) - t.visitor.Leave("Prefix", true) - } - if nn.UseDeclarations != nil { - t.visitor.Enter("UseDeclarations", false) - for _, c := range nn.UseDeclarations { - t.Traverse(c) - } - t.visitor.Leave("UseDeclarations", false) - } - case *ast.StmtUseDeclaration: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Type != nil { - t.visitor.Enter("Type", true) - t.Traverse(nn.Type) - t.visitor.Leave("Type", true) - } - if nn.Use != nil { - t.visitor.Enter("Use", true) - t.Traverse(nn.Use) - t.visitor.Leave("Use", true) - } - if nn.Alias != nil { - t.visitor.Enter("Alias", true) - t.Traverse(nn.Alias) - t.visitor.Leave("Alias", true) - } - case *ast.StmtWhile: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Cond != nil { - t.visitor.Enter("Cond", true) - t.Traverse(nn.Cond) - t.visitor.Leave("Cond", true) - } - if nn.Stmt != nil { - t.visitor.Enter("Stmt", true) - t.Traverse(nn.Stmt) - t.visitor.Leave("Stmt", true) - } - case *ast.ExprArray: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Items != nil { - t.visitor.Enter("Items", false) - for _, c := range nn.Items { - t.Traverse(c) - } - t.visitor.Leave("Items", false) - } - case *ast.ExprArrayDimFetch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Dim != nil { - t.visitor.Enter("Dim", true) - t.Traverse(nn.Dim) - t.visitor.Leave("Dim", true) - } - case *ast.ExprArrayItem: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Key != nil { - t.visitor.Enter("Key", true) - t.Traverse(nn.Key) - t.visitor.Leave("Key", true) - } - if nn.Val != nil { - t.visitor.Enter("Val", true) - t.Traverse(nn.Val) - t.visitor.Leave("Val", true) - } - case *ast.ExprArrowFunction: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Params != nil { - t.visitor.Enter("Params", false) - for _, c := range nn.Params { - t.Traverse(c) - } - t.visitor.Leave("Params", false) - } - if nn.ReturnType != nil { - t.visitor.Enter("ReturnType", true) - t.Traverse(nn.ReturnType) - t.visitor.Leave("ReturnType", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprBitwiseNot: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprBooleanNot: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprBrackets: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprClassConstFetch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Class != nil { - t.visitor.Enter("Class", true) - t.Traverse(nn.Class) - t.visitor.Leave("Class", true) - } - if nn.ConstantName != nil { - t.visitor.Enter("Name", true) - t.Traverse(nn.ConstantName) - t.visitor.Leave("Name", true) - } - case *ast.ExprClone: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprClosure: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Params != nil { - t.visitor.Enter("Params", false) - for _, c := range nn.Params { - t.Traverse(c) - } - t.visitor.Leave("Params", false) - } - if nn.Use != nil { - t.visitor.Enter("Use", false) - for _, c := range nn.Use { - t.Traverse(c) - } - t.visitor.Leave("Use", false) - } - if nn.ReturnType != nil { - t.visitor.Enter("ReturnType", true) - t.Traverse(nn.ReturnType) - t.visitor.Leave("ReturnType", true) - } - if nn.Stmts != nil { - t.visitor.Enter("Stmts", false) - for _, c := range nn.Stmts { - t.Traverse(c) - } - t.visitor.Leave("Stmts", false) - } - case *ast.ExprClosureUse: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ExprConstFetch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Const != nil { - t.visitor.Enter("Const", true) - t.Traverse(nn.Const) - t.visitor.Leave("Const", true) - } - case *ast.ExprEmpty: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprErrorSuppress: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprEval: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprExit: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprFunctionCall: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Function != nil { - t.visitor.Enter("Function", true) - t.Traverse(nn.Function) - t.visitor.Leave("Function", true) - } - if nn.Arguments != nil { - t.visitor.Enter("Arguments", false) - for _, c := range nn.Arguments { - t.Traverse(c) - } - t.visitor.Leave("Arguments", false) - } - case *ast.ExprInclude: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprIncludeOnce: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprInstanceOf: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - if nn.Class != nil { - t.visitor.Enter("Class", true) - t.Traverse(nn.Class) - t.visitor.Leave("Class", true) - } - case *ast.ExprIsset: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Vars != nil { - t.visitor.Enter("Vars", false) - for _, c := range nn.Vars { - t.Traverse(c) - } - t.visitor.Leave("Vars", false) - } - case *ast.ExprList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Items != nil { - t.visitor.Enter("Items", false) - for _, c := range nn.Items { - t.Traverse(c) - } - t.visitor.Leave("Items", false) - } - case *ast.ExprMethodCall: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Method != nil { - t.visitor.Enter("Method", true) - t.Traverse(nn.Method) - t.visitor.Leave("Method", true) - } - if nn.Arguments != nil { - t.visitor.Enter("Arguments", false) - for _, c := range nn.Arguments { - t.Traverse(c) - } - t.visitor.Leave("Arguments", false) - } - case *ast.ExprNew: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Class != nil { - t.visitor.Enter("Class", true) - t.Traverse(nn.Class) - t.visitor.Leave("Class", true) - } - if nn.Arguments != nil { - t.visitor.Enter("Arguments", false) - for _, c := range nn.Arguments { - t.Traverse(c) - } - t.visitor.Leave("Arguments", false) - } - case *ast.ExprPostDec: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ExprPostInc: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ExprPreDec: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ExprPreInc: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ExprPrint: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprPropertyFetch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Property != nil { - t.visitor.Enter("Property", true) - t.Traverse(nn.Property) - t.visitor.Leave("Property", true) - } - case *ast.ExprRequire: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprRequireOnce: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprShellExec: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.ExprStaticCall: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Class != nil { - t.visitor.Enter("Class", true) - t.Traverse(nn.Class) - t.visitor.Leave("Class", true) - } - if nn.Call != nil { - t.visitor.Enter("Call", true) - t.Traverse(nn.Call) - t.visitor.Leave("Call", true) - } - if nn.Arguments != nil { - t.visitor.Enter("Arguments", false) - for _, c := range nn.Arguments { - t.Traverse(c) - } - t.visitor.Leave("Arguments", false) - } - case *ast.ExprStaticPropertyFetch: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Class != nil { - t.visitor.Enter("Class", true) - t.Traverse(nn.Class) - t.visitor.Leave("Class", true) - } - if nn.Property != nil { - t.visitor.Enter("Property", true) - t.Traverse(nn.Property) - t.visitor.Leave("Property", true) - } - case *ast.ExprTernary: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Condition != nil { - t.visitor.Enter("Condition", true) - t.Traverse(nn.Condition) - t.visitor.Leave("Condition", true) - } - if nn.IfTrue != nil { - t.visitor.Enter("IfTrue", true) - t.Traverse(nn.IfTrue) - t.visitor.Leave("IfTrue", true) - } - if nn.IfFalse != nil { - t.visitor.Enter("IfFalse", true) - t.Traverse(nn.IfFalse) - t.visitor.Leave("IfFalse", true) - } - case *ast.ExprUnaryMinus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprUnaryPlus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprVariable: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.VarName != nil { - t.visitor.Enter("VarName", true) - t.Traverse(nn.VarName) - t.visitor.Leave("VarName", true) - } - case *ast.ExprYield: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Key != nil { - t.visitor.Enter("Key", true) - t.Traverse(nn.Key) - t.visitor.Leave("Key", true) - } - if nn.Value != nil { - t.visitor.Enter("Value", true) - t.Traverse(nn.Value) - t.visitor.Leave("Value", true) - } - case *ast.ExprYieldFrom: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssign: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignReference: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignBitwiseAnd: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignBitwiseOr: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignBitwiseXor: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignCoalesce: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignConcat: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignDiv: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignMinus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignMod: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignMul: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignPlus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignPow: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignShiftLeft: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprAssignShiftRight: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprBinaryBitwiseAnd: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryBitwiseOr: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryBitwiseXor: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryBooleanAnd: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryBooleanOr: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryCoalesce: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryConcat: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryDiv: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryEqual: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryGreater: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryGreaterOrEqual: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryIdentical: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryLogicalAnd: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryLogicalOr: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryLogicalXor: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryMinus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryMod: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryMul: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryNotEqual: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryNotIdentical: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryPlus: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryPow: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryShiftLeft: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinaryShiftRight: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinarySmaller: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinarySmallerOrEqual: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprBinarySpaceship: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Left != nil { - t.visitor.Enter("Left", true) - t.Traverse(nn.Left) - t.visitor.Leave("Left", true) - } - if nn.Right != nil { - t.visitor.Enter("Right", true) - t.Traverse(nn.Right) - t.visitor.Leave("Right", true) - } - case *ast.ExprCastArray: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastBool: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastDouble: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastInt: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastObject: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastString: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ExprCastUnset: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Expr != nil { - t.visitor.Enter("Expr", true) - t.Traverse(nn.Expr) - t.visitor.Leave("Expr", true) - } - case *ast.ScalarDnumber: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.ScalarEncapsed: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.ScalarEncapsedStringPart: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.ScalarEncapsedStringVar: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.VarName != nil { - t.visitor.Enter("VarName", true) - t.Traverse(nn.VarName) - t.visitor.Leave("VarName", true) - } - if nn.Dim != nil { - t.visitor.Enter("Dim", true) - t.Traverse(nn.Dim) - t.visitor.Leave("Dim", true) - } - case *ast.ScalarEncapsedStringBrackets: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.ScalarHeredoc: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.ScalarLnumber: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.ScalarMagicConstant: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.ScalarString: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - case *ast.NameName: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.NameFullyQualified: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.NameRelative: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Parts != nil { - t.visitor.Enter("Parts", false) - for _, c := range nn.Parts { - t.Traverse(c) - } - t.visitor.Leave("Parts", false) - } - case *ast.NameNamePart: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - default: - panic("unexpected type of node") - } - - t.visitor.LeaveNode(n) -} diff --git a/pkg/ast/visitor/dumper.go b/pkg/visitor/dumper/dumper.go similarity index 99% rename from pkg/ast/visitor/dumper.go rename to pkg/visitor/dumper/dumper.go index 9a7f501..2aa6d0e 100644 --- a/pkg/ast/visitor/dumper.go +++ b/pkg/visitor/dumper/dumper.go @@ -1,4 +1,4 @@ -package visitor +package dumper import ( "github.com/z7zmey/php-parser/pkg/position" diff --git a/pkg/ast/visitor/dumper_test.go b/pkg/visitor/dumper/dumper_test.go similarity index 90% rename from pkg/ast/visitor/dumper_test.go rename to pkg/visitor/dumper/dumper_test.go index c9f3e8c..8c94ac2 100644 --- a/pkg/ast/visitor/dumper_test.go +++ b/pkg/visitor/dumper/dumper_test.go @@ -1,19 +1,19 @@ -package visitor_test +package dumper_test import ( "bytes" "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/visitor/dumper" "testing" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/visitor" ) func TestDumper_root(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewDumper(o).WithTokens().WithPositions() + p := dumper.NewDumper(o).WithTokens().WithPositions() n := &ast.Root{ Position: &position.Position{ StartLine: 1, diff --git a/pkg/ast/visitor/formatter.go b/pkg/visitor/formatter/formatter.go similarity index 99% rename from pkg/ast/visitor/formatter.go rename to pkg/visitor/formatter/formatter.go index 757cd49..e6cb6f6 100644 --- a/pkg/ast/visitor/formatter.go +++ b/pkg/visitor/formatter/formatter.go @@ -1,4 +1,4 @@ -package visitor +package formatter import ( "bytes" diff --git a/pkg/ast/visitor/formatter_test.go b/pkg/visitor/formatter/formatter_test.go similarity index 75% rename from pkg/ast/visitor/formatter_test.go rename to pkg/visitor/formatter/formatter_test.go index fc0ede9..a170d89 100644 --- a/pkg/ast/visitor/formatter_test.go +++ b/pkg/visitor/formatter/formatter_test.go @@ -1,12 +1,13 @@ -package visitor_test +package formatter_test import ( "bytes" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/visitor/formatter" + "github.com/z7zmey/php-parser/pkg/visitor/printer" "testing" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/ast/visitor" ) func TestFormatter_Root(t *testing.T) { @@ -18,10 +19,10 @@ func TestFormatter_Root(t *testing.T) { }, } - f := visitor.NewFormatter() + f := formatter.NewFormatter() n.Accept(f) - p := visitor.NewPrinter(o) + p := printer.NewPrinter(o) n.Accept(p) expected := ` $val) { @@ -1397,10 +1398,10 @@ func TestFormatter_StmtFunction(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function foo() { @@ -1426,10 +1427,10 @@ func TestFormatter_StmtFunction_Ref(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function &foo() { @@ -1470,10 +1471,10 @@ func TestFormatter_StmtFunction_Params(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function foo($a, $b) { @@ -1505,10 +1506,10 @@ func TestFormatter_StmtFunction_ReturnType(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function foo(): bar { @@ -1539,10 +1540,10 @@ func TestFormatter_StmtGlobal(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `global $a, $b;` @@ -1562,10 +1563,10 @@ func TestFormatter_StmtGoto(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `goto FOO;` @@ -1581,10 +1582,10 @@ func TestFormatter_StmtHaltCompiler(t *testing.T) { n := &ast.StmtHaltCompiler{} - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `__halt_compiler();` @@ -1611,10 +1612,10 @@ func TestFormatter_StmtIf(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `if ($foo) { @@ -1669,10 +1670,10 @@ func TestFormatter_StmtIf_ElseIf(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `if ($foo) { @@ -1712,10 +1713,10 @@ func TestFormatter_StmtIf_Else(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `if ($foo) { @@ -1759,10 +1760,10 @@ func TestFormatter_StmtInlineHtml(t *testing.T) { }, } - f := visitor.NewFormatter() + f := formatter.NewFormatter() n.Accept(f) - p := visitor.NewPrinter(o) + p := printer.NewPrinter(o) n.Accept(p) expected := ` $bar` @@ -3214,10 +3215,10 @@ func TestFormatter_ExprArrayItem_Variadic(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `...$foo` @@ -3239,10 +3240,10 @@ func TestFormatter_ExprArrowFunction(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `fn() => $foo` @@ -3265,10 +3266,10 @@ func TestFormatter_ExprArrowFunction_Ref(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `fn&() => $foo` @@ -3306,10 +3307,10 @@ func TestFormatter_ExprArrowFunction_Params(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `fn($a, $b) => $foo` @@ -3338,10 +3339,10 @@ func TestFormatter_ExprArrowFunction_ReturnType(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `fn(): foo => $bar` @@ -3363,10 +3364,10 @@ func TestFormatter_ExprBitwiseNot(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `~$foo` @@ -3388,10 +3389,10 @@ func TestFormatter_ExprBooleanNot(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `!$foo` @@ -3413,10 +3414,10 @@ func TestFormatter_ExprBrackets(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `($foo)` @@ -3441,10 +3442,10 @@ func TestFormatter_ExprClassConstFetch(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo::bar` @@ -3466,10 +3467,10 @@ func TestFormatter_ExprClone(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `clone $foo` @@ -3489,10 +3490,10 @@ func TestFormatter_ExprClosure(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function() { @@ -3515,10 +3516,10 @@ func TestFormatter_ExprClosure_Ref(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function&() { @@ -3556,10 +3557,10 @@ func TestFormatter_ExprClosure_Params(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function($a, $b) { @@ -3588,10 +3589,10 @@ func TestFormatter_ExprClosure_ReturnType(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function(): foo { @@ -3622,10 +3623,10 @@ func TestFormatter_ExprClosure_Use(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `function() use($foo) { @@ -3649,10 +3650,10 @@ func TestFormatter_ExprClosureUse(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$a` @@ -3675,10 +3676,10 @@ func TestFormatter_ExprClosureUse_Reference(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `&$a` @@ -3702,10 +3703,10 @@ func TestFormatter_ExprConstFetch(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `FOO` @@ -3727,10 +3728,10 @@ func TestFormatter_ExprEmpty(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `empty($foo)` @@ -3752,10 +3753,10 @@ func TestFormatter_ExprErrorSuppress(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `@$foo` @@ -3777,10 +3778,10 @@ func TestFormatter_ExprEval(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `eval($foo)` @@ -3796,10 +3797,10 @@ func TestFormatter_ExprExit(t *testing.T) { n := &ast.ExprExit{} - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `exit` @@ -3821,10 +3822,10 @@ func TestFormatter_ExprExit_Expr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `exit($foo)` @@ -3848,10 +3849,10 @@ func TestFormatter_ExprFunctionCall(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo()` @@ -3884,10 +3885,10 @@ func TestFormatter_ExprFunctionCall_Arguments(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo($bar)` @@ -3907,10 +3908,10 @@ func TestFormatter_ExprInclude(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `include 'foo.php'` @@ -3930,10 +3931,10 @@ func TestFormatter_ExprIncludeOnce(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `include_once 'foo.php'` @@ -3962,10 +3963,10 @@ func TestFormatter_ExprInstanceOf(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo instanceof bar` @@ -3994,10 +3995,10 @@ func TestFormatter_ExprIsset(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `isset($a, $b)` @@ -4030,10 +4031,10 @@ func TestFormatter_ExprList(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `list($a, $b)` @@ -4058,10 +4059,10 @@ func TestFormatter_ExprMethodCall(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo->bar()` @@ -4086,10 +4087,10 @@ func TestFormatter_ExprMethodCall_Expr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo->{'bar'}()` @@ -4130,10 +4131,10 @@ func TestFormatter_ExprMethodCall_Arguments(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo->bar($a, $b)` @@ -4157,10 +4158,10 @@ func TestFormatter_ExprNew(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `new foo` @@ -4200,10 +4201,10 @@ func TestFormatter_ExprNew_Arguments(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `new foo($a, $b)` @@ -4225,10 +4226,10 @@ func TestFormatter_ExprPreDec(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `--$foo` @@ -4250,10 +4251,10 @@ func TestFormatter_ExprPreInc(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `++$foo` @@ -4275,10 +4276,10 @@ func TestFormatter_ExprPostDec(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo--` @@ -4300,10 +4301,10 @@ func TestFormatter_ExprPostInc(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo++` @@ -4325,10 +4326,10 @@ func TestFormatter_ExprPrint(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `print $foo` @@ -4353,10 +4354,10 @@ func TestFormatter_ExprPropertyFetch(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo->bar` @@ -4381,10 +4382,10 @@ func TestFormatter_ExprPropertyFetch_Expr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo->{'bar'}` @@ -4404,10 +4405,10 @@ func TestFormatter_ExprRequire(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `require 'foo.php'` @@ -4427,10 +4428,10 @@ func TestFormatter_ExprRequireOnce(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `require_once 'foo.php'` @@ -4446,10 +4447,10 @@ func TestFormatter_ExprShellExec(t *testing.T) { n := &ast.ExprShellExec{} - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := "``" @@ -4471,10 +4472,10 @@ func TestFormatter_ExprShellExec_Part(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := "`foo`" @@ -4504,10 +4505,10 @@ func TestFormatter_ExprShellExec_Parts(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := "`foo $bar baz`" @@ -4534,10 +4535,10 @@ func TestFormatter_ExprStaticCall(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo::bar()` @@ -4564,10 +4565,10 @@ func TestFormatter_ExprStaticCall_Expr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo::{'bar'}()` @@ -4610,10 +4611,10 @@ func TestFormatter_ExprStaticCall_Arguments(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo::bar($a, $b)` @@ -4642,10 +4643,10 @@ func TestFormatter_ExprStaticPropertyFetch(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo::$bar` @@ -4677,10 +4678,10 @@ func TestFormatter_ExprTernary(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ? $bar : $baz` @@ -4707,10 +4708,10 @@ func TestFormatter_ExprTernary_short(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ?: $bar` @@ -4732,10 +4733,10 @@ func TestFormatter_ExprUnaryMinus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `-$foo` @@ -4757,10 +4758,10 @@ func TestFormatter_ExprUnaryPlus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `+$foo` @@ -4780,10 +4781,10 @@ func TestFormatter_ExprVariable(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo` @@ -4805,10 +4806,10 @@ func TestFormatter_ExprVariable_Variable(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$$foo` @@ -4828,10 +4829,10 @@ func TestFormatter_ExprVariable_Expression(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `${'foo'}` @@ -4853,10 +4854,10 @@ func TestFormatter_ExprYield(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `yield $foo` @@ -4883,10 +4884,10 @@ func TestFormatter_ExprYield_Key(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `yield $foo => $bar` @@ -4908,10 +4909,10 @@ func TestFormatter_ExprYieldFrom(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `yield from $foo` @@ -4938,10 +4939,10 @@ func TestFormatter_ExprAssign(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo = $bar` @@ -4968,10 +4969,10 @@ func TestFormatter_ExprAssignReference(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo =& $bar` @@ -4998,10 +4999,10 @@ func TestFormatter_ExprAssignBitwiseAnd(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo &= $bar` @@ -5028,10 +5029,10 @@ func TestFormatter_ExprAssignBitwiseOr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo |= $bar` @@ -5058,10 +5059,10 @@ func TestFormatter_ExprAssignBitwiseXor(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ^= $bar` @@ -5088,10 +5089,10 @@ func TestFormatter_ExprAssignCoalesce(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ??= $bar` @@ -5118,10 +5119,10 @@ func TestFormatter_ExprAssignConcat(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo .= $bar` @@ -5148,10 +5149,10 @@ func TestFormatter_ExprAssignDiv(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo /= $bar` @@ -5178,10 +5179,10 @@ func TestFormatter_ExprAssignMinus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo -= $bar` @@ -5208,10 +5209,10 @@ func TestFormatter_ExprAssignMod(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo %= $bar` @@ -5238,10 +5239,10 @@ func TestFormatter_ExprAssignMul(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo *= $bar` @@ -5268,10 +5269,10 @@ func TestFormatter_ExprAssignPlus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo += $bar` @@ -5298,10 +5299,10 @@ func TestFormatter_ExprAssignPow(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo **= $bar` @@ -5328,10 +5329,10 @@ func TestFormatter_ExprAssignShiftLeft(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo <<= $bar` @@ -5358,10 +5359,10 @@ func TestFormatter_ExprAssignShiftRight(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo >>= $bar` @@ -5388,10 +5389,10 @@ func TestFormatter_ExprBinaryBitwiseAnd(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo & $bar` @@ -5418,10 +5419,10 @@ func TestFormatter_ExprBinaryBitwiseOr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo | $bar` @@ -5448,10 +5449,10 @@ func TestFormatter_ExprBinaryBitwiseXor(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ^ $bar` @@ -5478,10 +5479,10 @@ func TestFormatter_ExprBinaryBooleanAnd(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo && $bar` @@ -5508,10 +5509,10 @@ func TestFormatter_ExprBinaryBooleanOr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo || $bar` @@ -5538,10 +5539,10 @@ func TestFormatter_ExprBinaryCoalesce(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ?? $bar` @@ -5568,10 +5569,10 @@ func TestFormatter_ExprBinaryConcat(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo . $bar` @@ -5598,10 +5599,10 @@ func TestFormatter_ExprBinaryDiv(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo / $bar` @@ -5628,10 +5629,10 @@ func TestFormatter_ExprBinaryEqual(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo == $bar` @@ -5658,10 +5659,10 @@ func TestFormatter_ExprBinaryGreater(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo > $bar` @@ -5688,10 +5689,10 @@ func TestFormatter_ExprBinaryGreaterOrEqual(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo >= $bar` @@ -5718,10 +5719,10 @@ func TestFormatter_ExprBinaryIdentical(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo === $bar` @@ -5748,10 +5749,10 @@ func TestFormatter_ExprBinaryLogicalAnd(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo and $bar` @@ -5778,10 +5779,10 @@ func TestFormatter_ExprBinaryLogicalOr(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo or $bar` @@ -5808,10 +5809,10 @@ func TestFormatter_ExprBinaryLogicalXor(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo xor $bar` @@ -5838,10 +5839,10 @@ func TestFormatter_ExprBinaryMinus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo - $bar` @@ -5868,10 +5869,10 @@ func TestFormatter_ExprBinaryMod(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo % $bar` @@ -5898,10 +5899,10 @@ func TestFormatter_ExprBinaryMul(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo * $bar` @@ -5928,10 +5929,10 @@ func TestFormatter_ExprBinaryNotEqual(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo != $bar` @@ -5958,10 +5959,10 @@ func TestFormatter_ExprBinaryNotIdentical(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo !== $bar` @@ -5988,10 +5989,10 @@ func TestFormatter_ExprBinaryPlus(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo + $bar` @@ -6018,10 +6019,10 @@ func TestFormatter_ExprBinaryPow(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo ** $bar` @@ -6048,10 +6049,10 @@ func TestFormatter_ExprBinaryShiftLeft(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo << $bar` @@ -6078,10 +6079,10 @@ func TestFormatter_ExprBinaryShiftRight(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo >> $bar` @@ -6108,10 +6109,10 @@ func TestFormatter_ExprBinarySmaller(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo < $bar` @@ -6138,10 +6139,10 @@ func TestFormatter_ExprBinarySmallerOrEqual(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo <= $bar` @@ -6168,10 +6169,10 @@ func TestFormatter_ExprBinarySpaceship(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `$foo <=> $bar` @@ -6193,10 +6194,10 @@ func TestFormatter_ExprCastArray(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(array)$foo` @@ -6218,10 +6219,10 @@ func TestFormatter_ExprCastBool(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(bool)$foo` @@ -6243,10 +6244,10 @@ func TestFormatter_ExprCastDouble(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(float)$foo` @@ -6268,10 +6269,10 @@ func TestFormatter_ExprCastInt(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(int)$foo` @@ -6293,10 +6294,10 @@ func TestFormatter_ExprCastObject(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(object)$foo` @@ -6318,10 +6319,10 @@ func TestFormatter_ExprCastString(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(string)$foo` @@ -6343,10 +6344,10 @@ func TestFormatter_ExprCastUnset(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `(unset)$foo` @@ -6364,10 +6365,10 @@ func TestFormatter_ScalarDnumber(t *testing.T) { Value: []byte("1234"), } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `1234` @@ -6383,10 +6384,10 @@ func TestFormatter_ScalarEncapsed(t *testing.T) { n := &ast.ScalarEncapsed{} - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `""` @@ -6408,10 +6409,10 @@ func TestFormatter_ScalarEncapsed_Part(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `"foo"` @@ -6441,10 +6442,10 @@ func TestFormatter_ScalarEncapsed_Parts(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `"foo $bar baz"` @@ -6462,10 +6463,10 @@ func TestFormatter_ScalarEncapsedStringPart(t *testing.T) { Value: []byte("foo"), } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `foo` @@ -6485,10 +6486,10 @@ func TestFormatter_ScalarEncapsedStringVar(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `${foo}` @@ -6511,10 +6512,10 @@ func TestFormatter_ScalarEncapsedStringVar_Dim(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `${foo['bar']}` @@ -6536,10 +6537,10 @@ func TestFormatter_ScalarEncapsedStringBrackets(t *testing.T) { }, } - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `{$foo}` @@ -6555,10 +6556,10 @@ func TestFormatter_ScalarHeredoc(t *testing.T) { n := &ast.ScalarHeredoc{} - f := visitor.NewFormatter().WithState(visitor.FormatterStatePHP).WithIndent(1) + f := formatter.NewFormatter().WithState(formatter.FormatterStatePHP).WithIndent(1) n.Accept(f) - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n.Accept(p) expected := `<<HTML")}, @@ -101,7 +101,7 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { func TestPrinterPrintIdentifier(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Identifier{ Value: []byte("test"), } @@ -118,7 +118,7 @@ func TestPrinterPrintIdentifier(t *testing.T) { func TestPrinterPrintParameter(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Parameter{ Type: &ast.NameFullyQualified{ Parts: []ast.Vertex{ @@ -150,7 +150,7 @@ func TestPrinterPrintParameter(t *testing.T) { func TestPrinterPrintNullable(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Nullable{ Expr: &ast.Parameter{ Type: &ast.NameFullyQualified{ @@ -184,7 +184,7 @@ func TestPrinterPrintNullable(t *testing.T) { func TestPrinterPrintArgument(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Argument{ VariadicTkn: &token.Token{ Value: []byte("..."), @@ -205,7 +205,7 @@ func TestPrinterPrintArgument(t *testing.T) { func TestPrinterPrintArgumentByRef(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Argument{ AmpersandTkn: &token.Token{ Value: []byte("&"), @@ -229,7 +229,7 @@ func TestPrinterPrintArgumentByRef(t *testing.T) { func TestPrinterPrintNameNamePart(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameNamePart{ Value: []byte("foo"), } @@ -246,7 +246,7 @@ func TestPrinterPrintNameNamePart(t *testing.T) { func TestPrinterPrintNameName(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{ @@ -270,7 +270,7 @@ func TestPrinterPrintNameName(t *testing.T) { func TestPrinterPrintNameFullyQualified(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameFullyQualified{ Parts: []ast.Vertex{ &ast.NameNamePart{ @@ -294,7 +294,7 @@ func TestPrinterPrintNameFullyQualified(t *testing.T) { func TestPrinterPrintNameRelative(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameRelative{ Parts: []ast.Vertex{ &ast.NameNamePart{ @@ -320,7 +320,7 @@ func TestPrinterPrintNameRelative(t *testing.T) { func TestPrinterPrintScalarLNumber(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarLnumber{ Value: []byte("1"), } @@ -337,7 +337,7 @@ func TestPrinterPrintScalarLNumber(t *testing.T) { func TestPrinterPrintScalarDNumber(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarDnumber{ Value: []byte(".1"), } @@ -354,7 +354,7 @@ func TestPrinterPrintScalarDNumber(t *testing.T) { func TestPrinterPrintScalarString(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarString{ Value: []byte("'hello world'"), } @@ -371,7 +371,7 @@ func TestPrinterPrintScalarString(t *testing.T) { func TestPrinterPrintScalarEncapsedStringPart(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarEncapsedStringPart{ Value: []byte("hello world"), } @@ -388,7 +388,7 @@ func TestPrinterPrintScalarEncapsedStringPart(t *testing.T) { func TestPrinterPrintScalarEncapsed(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarEncapsed{ Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, @@ -411,7 +411,7 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) { func TestPrinterPrintScalarHeredoc(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarHeredoc{ Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, @@ -436,7 +436,7 @@ EOT` func TestPrinterPrintScalarMagicConstant(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ScalarMagicConstant{ Value: []byte("__DIR__"), } @@ -452,7 +452,7 @@ func TestPrinterPrintScalarMagicConstant(t *testing.T) { func TestPrinterPrintAssign(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssign{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -474,7 +474,7 @@ func TestPrinterPrintAssign(t *testing.T) { func TestPrinterPrintReference(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignReference{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -496,7 +496,7 @@ func TestPrinterPrintReference(t *testing.T) { func TestPrinterPrintAssignBitwiseAnd(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseAnd{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -518,7 +518,7 @@ func TestPrinterPrintAssignBitwiseAnd(t *testing.T) { func TestPrinterPrintAssignBitwiseOr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseOr{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -540,7 +540,7 @@ func TestPrinterPrintAssignBitwiseOr(t *testing.T) { func TestPrinterPrintAssignBitwiseXor(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseXor{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -562,7 +562,7 @@ func TestPrinterPrintAssignBitwiseXor(t *testing.T) { func TestPrinterPrintAssignCoalesce(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignCoalesce{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -584,7 +584,7 @@ func TestPrinterPrintAssignCoalesce(t *testing.T) { func TestPrinterPrintAssignConcat(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignConcat{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -606,7 +606,7 @@ func TestPrinterPrintAssignConcat(t *testing.T) { func TestPrinterPrintAssignDiv(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignDiv{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -628,7 +628,7 @@ func TestPrinterPrintAssignDiv(t *testing.T) { func TestPrinterPrintAssignMinus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMinus{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -650,7 +650,7 @@ func TestPrinterPrintAssignMinus(t *testing.T) { func TestPrinterPrintAssignMod(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMod{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -672,7 +672,7 @@ func TestPrinterPrintAssignMod(t *testing.T) { func TestPrinterPrintAssignMul(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMul{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -694,7 +694,7 @@ func TestPrinterPrintAssignMul(t *testing.T) { func TestPrinterPrintAssignPlus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignPlus{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -716,7 +716,7 @@ func TestPrinterPrintAssignPlus(t *testing.T) { func TestPrinterPrintAssignPow(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignPow{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -738,7 +738,7 @@ func TestPrinterPrintAssignPow(t *testing.T) { func TestPrinterPrintAssignShiftLeft(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignShiftLeft{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -760,7 +760,7 @@ func TestPrinterPrintAssignShiftLeft(t *testing.T) { func TestPrinterPrintAssignShiftRight(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignShiftRight{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -784,7 +784,7 @@ func TestPrinterPrintAssignShiftRight(t *testing.T) { func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -806,7 +806,7 @@ func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -828,7 +828,7 @@ func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseXor{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -850,7 +850,7 @@ func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBooleanAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -872,7 +872,7 @@ func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { func TestPrinterPrintBinaryBooleanOr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBooleanOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -894,7 +894,7 @@ func TestPrinterPrintBinaryBooleanOr(t *testing.T) { func TestPrinterPrintBinaryCoalesce(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryCoalesce{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -916,7 +916,7 @@ func TestPrinterPrintBinaryCoalesce(t *testing.T) { func TestPrinterPrintBinaryConcat(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryConcat{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -938,7 +938,7 @@ func TestPrinterPrintBinaryConcat(t *testing.T) { func TestPrinterPrintBinaryDiv(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryDiv{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -960,7 +960,7 @@ func TestPrinterPrintBinaryDiv(t *testing.T) { func TestPrinterPrintBinaryEqual(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -982,7 +982,7 @@ func TestPrinterPrintBinaryEqual(t *testing.T) { func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryGreaterOrEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1004,7 +1004,7 @@ func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { func TestPrinterPrintBinaryGreater(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryGreater{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1026,7 +1026,7 @@ func TestPrinterPrintBinaryGreater(t *testing.T) { func TestPrinterPrintBinaryIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryIdentical{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1048,7 +1048,7 @@ func TestPrinterPrintBinaryIdentical(t *testing.T) { func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalAnd{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1070,7 +1070,7 @@ func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { func TestPrinterPrintBinaryLogicalOr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalOr{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1092,7 +1092,7 @@ func TestPrinterPrintBinaryLogicalOr(t *testing.T) { func TestPrinterPrintBinaryLogicalXor(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalXor{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1114,7 +1114,7 @@ func TestPrinterPrintBinaryLogicalXor(t *testing.T) { func TestPrinterPrintBinaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMinus{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1136,7 +1136,7 @@ func TestPrinterPrintBinaryMinus(t *testing.T) { func TestPrinterPrintBinaryMod(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMod{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1158,7 +1158,7 @@ func TestPrinterPrintBinaryMod(t *testing.T) { func TestPrinterPrintBinaryMul(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMul{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1180,7 +1180,7 @@ func TestPrinterPrintBinaryMul(t *testing.T) { func TestPrinterPrintBinaryNotEqual(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryNotEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1202,7 +1202,7 @@ func TestPrinterPrintBinaryNotEqual(t *testing.T) { func TestPrinterPrintBinaryNotIdentical(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryNotIdentical{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1224,7 +1224,7 @@ func TestPrinterPrintBinaryNotIdentical(t *testing.T) { func TestPrinterPrintBinaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryPlus{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1246,7 +1246,7 @@ func TestPrinterPrintBinaryPlus(t *testing.T) { func TestPrinterPrintBinaryPow(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryPow{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1268,7 +1268,7 @@ func TestPrinterPrintBinaryPow(t *testing.T) { func TestPrinterPrintBinaryShiftLeft(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryShiftLeft{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1290,7 +1290,7 @@ func TestPrinterPrintBinaryShiftLeft(t *testing.T) { func TestPrinterPrintBinaryShiftRight(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryShiftRight{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1312,7 +1312,7 @@ func TestPrinterPrintBinaryShiftRight(t *testing.T) { func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySmallerOrEqual{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1334,7 +1334,7 @@ func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { func TestPrinterPrintBinarySmaller(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySmaller{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1356,7 +1356,7 @@ func TestPrinterPrintBinarySmaller(t *testing.T) { func TestPrinterPrintBinarySpaceship(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySpaceship{ Left: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -1380,7 +1380,7 @@ func TestPrinterPrintBinarySpaceship(t *testing.T) { func TestPrinterPrintArray(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastArray{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1399,7 +1399,7 @@ func TestPrinterPrintArray(t *testing.T) { func TestPrinterPrintBool(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastBool{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1418,7 +1418,7 @@ func TestPrinterPrintBool(t *testing.T) { func TestPrinterPrintDouble(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastDouble{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1437,7 +1437,7 @@ func TestPrinterPrintDouble(t *testing.T) { func TestPrinterPrintInt(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastInt{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1456,7 +1456,7 @@ func TestPrinterPrintInt(t *testing.T) { func TestPrinterPrintObject(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastObject{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1475,7 +1475,7 @@ func TestPrinterPrintObject(t *testing.T) { func TestPrinterPrintString(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastString{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1494,7 +1494,7 @@ func TestPrinterPrintString(t *testing.T) { func TestPrinterPrintUnset(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastUnset{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1515,7 +1515,7 @@ func TestPrinterPrintUnset(t *testing.T) { func TestPrinterPrintExprArrayDimFetch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayDimFetch{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1535,7 +1535,7 @@ func TestPrinterPrintExprArrayDimFetch(t *testing.T) { func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, Val: &ast.ExprVariable{ @@ -1555,7 +1555,7 @@ func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { func TestPrinterPrintExprArrayItem(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayItem{ Val: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$world")}, @@ -1574,7 +1574,7 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { func TestPrinterPrintExprArrayItem_Reference(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayItem{ AmpersandTkn: &token.Token{ Value: []byte("&"), @@ -1596,7 +1596,7 @@ func TestPrinterPrintExprArrayItem_Reference(t *testing.T) { func TestPrinterPrintExprArrayItemUnpack(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayItem{ EllipsisTkn: &token.Token{ Value: []byte("..."), @@ -1618,7 +1618,7 @@ func TestPrinterPrintExprArrayItemUnpack(t *testing.T) { func TestPrinterPrintExprArray(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArray{ ArrayTkn: &token.Token{ Value: []byte("array"), @@ -1659,7 +1659,7 @@ func TestPrinterPrintExprArray(t *testing.T) { func TestPrinterPrintExprBitwiseNot(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBitwiseNot{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1678,7 +1678,7 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { func TestPrinterPrintExprBooleanNot(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1697,7 +1697,7 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { func TestPrinterPrintExprBracket(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1716,7 +1716,7 @@ func TestPrinterPrintExprBracket(t *testing.T) { func TestPrinterPrintExprClassConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClassConstFetch{ Class: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1738,7 +1738,7 @@ func TestPrinterPrintExprClassConstFetch(t *testing.T) { func TestPrinterPrintExprClone(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClone{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1757,7 +1757,7 @@ func TestPrinterPrintExprClone(t *testing.T) { func TestPrinterPrintExprClosureUse(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClosureUse{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, @@ -1776,7 +1776,7 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { func TestPrinterPrintExprClosureUse_Reference(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClosureUse{ AmpersandTkn: &token.Token{ Value: []byte("&"), @@ -1798,7 +1798,7 @@ func TestPrinterPrintExprClosureUse_Reference(t *testing.T) { func TestPrinterPrintExprClosure(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClosure{ StaticTkn: &token.Token{ Value: []byte("static"), @@ -1850,7 +1850,7 @@ func TestPrinterPrintExprClosure(t *testing.T) { func TestPrinterPrintExprArrowFunction(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtExpression{ Expr: &ast.ExprArrowFunction{ StaticTkn: &token.Token{ @@ -1890,7 +1890,7 @@ func TestPrinterPrintExprArrowFunction(t *testing.T) { func TestPrinterPrintExprConstFetch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprConstFetch{ Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}, } @@ -1907,7 +1907,7 @@ func TestPrinterPrintExprConstFetch(t *testing.T) { func TestPrinterPrintEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprEmpty{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1926,7 +1926,7 @@ func TestPrinterPrintEmpty(t *testing.T) { func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprErrorSuppress{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1945,7 +1945,7 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { func TestPrinterPrintEval(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprEval{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1964,7 +1964,7 @@ func TestPrinterPrintEval(t *testing.T) { func TestPrinterPrintExit(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprExit{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -1983,7 +1983,7 @@ func TestPrinterPrintExit(t *testing.T) { func TestPrinterPrintDie(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprExit{ ExitTkn: &token.Token{ Value: []byte("die"), @@ -2005,7 +2005,7 @@ func TestPrinterPrintDie(t *testing.T) { func TestPrinterPrintFunctionCall(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprFunctionCall{ Function: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2047,7 +2047,7 @@ func TestPrinterPrintFunctionCall(t *testing.T) { func TestPrinterPrintInclude(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprInclude{ Expr: &ast.ScalarString{Value: []byte("'path'")}, } @@ -2064,7 +2064,7 @@ func TestPrinterPrintInclude(t *testing.T) { func TestPrinterPrintIncludeOnce(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprIncludeOnce{ Expr: &ast.ScalarString{Value: []byte("'path'")}, } @@ -2081,7 +2081,7 @@ func TestPrinterPrintIncludeOnce(t *testing.T) { func TestPrinterPrintInstanceOf(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprInstanceOf{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2101,7 +2101,7 @@ func TestPrinterPrintInstanceOf(t *testing.T) { func TestPrinterPrintIsset(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprIsset{ Vars: []ast.Vertex{ &ast.ExprVariable{ @@ -2125,7 +2125,7 @@ func TestPrinterPrintIsset(t *testing.T) { func TestPrinterPrintList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ @@ -2164,7 +2164,7 @@ func TestPrinterPrintList(t *testing.T) { func TestPrinterPrintMethodCall(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, @@ -2196,7 +2196,7 @@ func TestPrinterPrintMethodCall(t *testing.T) { func TestPrinterPrintNew(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprNew{ Class: &ast.NameName{ Parts: []ast.Vertex{ @@ -2231,7 +2231,7 @@ func TestPrinterPrintNew(t *testing.T) { func TestPrinterPrintPostDec(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPostDec{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2250,7 +2250,7 @@ func TestPrinterPrintPostDec(t *testing.T) { func TestPrinterPrintPostInc(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPostInc{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2269,7 +2269,7 @@ func TestPrinterPrintPostInc(t *testing.T) { func TestPrinterPrintPreDec(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPreDec{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2288,7 +2288,7 @@ func TestPrinterPrintPreDec(t *testing.T) { func TestPrinterPrintPreInc(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPreInc{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2307,7 +2307,7 @@ func TestPrinterPrintPreInc(t *testing.T) { func TestPrinterPrintPrint(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPrint{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2326,7 +2326,7 @@ func TestPrinterPrintPrint(t *testing.T) { func TestPrinterPrintPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPropertyFetch{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$foo")}, @@ -2346,7 +2346,7 @@ func TestPrinterPrintPropertyFetch(t *testing.T) { func TestPrinterPrintRequire(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprRequire{ Expr: &ast.ScalarString{Value: []byte("'path'")}, } @@ -2363,7 +2363,7 @@ func TestPrinterPrintRequire(t *testing.T) { func TestPrinterPrintRequireOnce(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprRequireOnce{ Expr: &ast.ScalarString{Value: []byte("'path'")}, } @@ -2380,7 +2380,7 @@ func TestPrinterPrintRequireOnce(t *testing.T) { func TestPrinterPrintShellExec(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprShellExec{ Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, @@ -2403,7 +2403,7 @@ func TestPrinterPrintShellExec(t *testing.T) { func TestPrinterPrintExprShortArray(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArray{ Items: []ast.Vertex{ &ast.ExprArrayItem{ @@ -2441,7 +2441,7 @@ func TestPrinterPrintExprShortArray(t *testing.T) { func TestPrinterPrintShortList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprList{ OpenBracketTkn: &token.Token{ Value: []byte("["), @@ -2486,7 +2486,7 @@ func TestPrinterPrintShortList(t *testing.T) { func TestPrinterPrintStaticCall(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprStaticCall{ Class: &ast.Identifier{Value: []byte("Foo")}, Call: &ast.Identifier{Value: []byte("bar")}, @@ -2516,7 +2516,7 @@ func TestPrinterPrintStaticCall(t *testing.T) { func TestPrinterPrintStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprStaticPropertyFetch{ Class: &ast.Identifier{Value: []byte("Foo")}, Property: &ast.ExprVariable{ @@ -2536,7 +2536,7 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { func TestPrinterPrintTernary(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprTernary{ Condition: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2558,7 +2558,7 @@ func TestPrinterPrintTernary(t *testing.T) { func TestPrinterPrintTernaryFull(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprTernary{ Condition: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2583,7 +2583,7 @@ func TestPrinterPrintTernaryFull(t *testing.T) { func TestPrinterPrintUnaryMinus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprUnaryMinus{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2602,7 +2602,7 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { func TestPrinterPrintUnaryPlus(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprUnaryPlus{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2621,7 +2621,7 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { func TestPrinterPrintVariable(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprVariable{ DollarTkn: &token.Token{ Value: []byte("$"), @@ -2649,7 +2649,7 @@ func TestPrinterPrintVariable(t *testing.T) { func TestPrinterPrintYieldFrom(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYieldFrom{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2668,7 +2668,7 @@ func TestPrinterPrintYieldFrom(t *testing.T) { func TestPrinterPrintYield(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYield{ Value: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2687,7 +2687,7 @@ func TestPrinterPrintYield(t *testing.T) { func TestPrinterPrintYieldFull(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYield{ Key: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$k")}, @@ -2711,7 +2711,7 @@ func TestPrinterPrintYieldFull(t *testing.T) { func TestPrinterPrintAltElseIf(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2740,7 +2740,7 @@ func TestPrinterPrintAltElseIf(t *testing.T) { func TestPrinterPrintAltElseIfEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2763,7 +2763,7 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { func TestPrinterPrintAltElse(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElse{ ColonTkn: &token.Token{ Value: []byte(":"), @@ -2789,7 +2789,7 @@ func TestPrinterPrintAltElse(t *testing.T) { func TestPrinterPrintAltElseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElse{ ColonTkn: &token.Token{ Value: []byte(":"), @@ -2809,7 +2809,7 @@ func TestPrinterPrintAltElseEmpty(t *testing.T) { func TestPrinterPrintAltFor(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ @@ -2850,7 +2850,7 @@ func TestPrinterPrintAltFor(t *testing.T) { func TestPrinterPrintAltForeach(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2885,7 +2885,7 @@ func TestPrinterPrintAltForeach(t *testing.T) { func TestPrinterPrintAltForeach_Reference(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -2923,7 +2923,7 @@ func TestPrinterPrintAltForeach_Reference(t *testing.T) { func TestPrinterPrintAltIf(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -2990,7 +2990,7 @@ func TestPrinterPrintAltIf(t *testing.T) { func TestPrinterPrintStmtAltSwitch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -3030,7 +3030,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { func TestPrinterPrintAltWhile(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3059,7 +3059,7 @@ func TestPrinterPrintAltWhile(t *testing.T) { func TestPrinterPrintStmtBreak(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtBreak{ Expr: &ast.ScalarLnumber{ Value: []byte("1"), @@ -3078,7 +3078,7 @@ func TestPrinterPrintStmtBreak(t *testing.T) { func TestPrinterPrintStmtCase(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCase{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3102,7 +3102,7 @@ func TestPrinterPrintStmtCase(t *testing.T) { func TestPrinterPrintStmtCaseEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCase{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3122,7 +3122,7 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { func TestPrinterPrintStmtCatch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCatch{ Types: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, @@ -3150,7 +3150,7 @@ func TestPrinterPrintStmtCatch(t *testing.T) { func TestPrinterPrintStmtClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClassMethod{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, AmpersandTkn: &token.Token{ @@ -3201,7 +3201,7 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClassMethod{ Modifiers: []ast.Vertex{ &ast.Identifier{Value: []byte("public")}, @@ -3249,7 +3249,7 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { func TestPrinterPrintStmtClass(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, ClassName: &ast.Identifier{Value: []byte("Foo")}, @@ -3286,7 +3286,7 @@ func TestPrinterPrintStmtClass(t *testing.T) { func TestPrinterPrintStmtAnonymousClass(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, Arguments: []ast.Vertex{ @@ -3331,7 +3331,7 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { func TestPrinterPrintStmtClassConstList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClassConstList{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, Consts: []ast.Vertex{ @@ -3358,7 +3358,7 @@ func TestPrinterPrintStmtClassConstList(t *testing.T) { func TestPrinterPrintStmtConstList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtConstList{ Consts: []ast.Vertex{ &ast.StmtConstant{ @@ -3384,7 +3384,7 @@ func TestPrinterPrintStmtConstList(t *testing.T) { func TestPrinterPrintStmtConstant(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("FOO")}, Expr: &ast.ScalarString{Value: []byte("'BAR'")}, @@ -3402,7 +3402,7 @@ func TestPrinterPrintStmtConstant(t *testing.T) { func TestPrinterPrintStmtContinue(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtContinue{ Expr: &ast.ScalarLnumber{ Value: []byte("1"), @@ -3421,7 +3421,7 @@ func TestPrinterPrintStmtContinue(t *testing.T) { func TestPrinterPrintStmtDeclareStmts(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ @@ -3448,7 +3448,7 @@ func TestPrinterPrintStmtDeclareStmts(t *testing.T) { func TestPrinterPrintStmtDeclareExpr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ @@ -3471,7 +3471,7 @@ func TestPrinterPrintStmtDeclareExpr(t *testing.T) { func TestPrinterPrintStmtDeclareNop(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ @@ -3494,7 +3494,7 @@ func TestPrinterPrintStmtDeclareNop(t *testing.T) { func TestPrinterPrintStmtDefalut(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDefault{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -3515,7 +3515,7 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDefault{ Stmts: []ast.Vertex{}, } @@ -3532,7 +3532,7 @@ func TestPrinterPrintStmtDefalutEmpty(t *testing.T) { func TestPrinterPrintStmtDo_Expression(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDo{ Cond: &ast.ScalarLnumber{Value: []byte("1")}, Stmt: &ast.StmtExpression{ @@ -3554,7 +3554,7 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { func TestPrinterPrintStmtDo_StmtList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtDo{ Cond: &ast.ScalarLnumber{Value: []byte("1")}, Stmt: &ast.StmtStmtList{ @@ -3578,7 +3578,7 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o) + p := printer.NewPrinter(o) n := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtEcho{ @@ -3606,7 +3606,7 @@ func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { func TestPrinterPrintStmtEchoPhpState(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtEcho{ Exprs: []ast.Vertex{ &ast.ExprVariable{ @@ -3630,7 +3630,7 @@ func TestPrinterPrintStmtEchoPhpState(t *testing.T) { func TestPrinterPrintStmtElseIfStmts(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3654,7 +3654,7 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { func TestPrinterPrintStmtElseIfExpr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3674,7 +3674,7 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { func TestPrinterPrintStmtElseIfNop(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3694,7 +3694,7 @@ func TestPrinterPrintStmtElseIfNop(t *testing.T) { func TestPrinterPrintStmtElseStmts(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElse{ Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -3715,7 +3715,7 @@ func TestPrinterPrintStmtElseStmts(t *testing.T) { func TestPrinterPrintStmtElseExpr(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElse{ Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, } @@ -3732,7 +3732,7 @@ func TestPrinterPrintStmtElseExpr(t *testing.T) { func TestPrinterPrintStmtElseNop(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElse{ Stmt: &ast.StmtNop{}, } @@ -3749,7 +3749,7 @@ func TestPrinterPrintStmtElseNop(t *testing.T) { func TestPrinterPrintExpression(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtExpression{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3768,7 +3768,7 @@ func TestPrinterPrintExpression(t *testing.T) { func TestPrinterPrintStmtFinally(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtFinally{ Stmts: []ast.Vertex{ &ast.StmtNop{}, @@ -3787,7 +3787,7 @@ func TestPrinterPrintStmtFinally(t *testing.T) { func TestPrinterPrintStmtFor(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ @@ -3832,7 +3832,7 @@ func TestPrinterPrintStmtFor(t *testing.T) { func TestPrinterPrintStmtForeach(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3862,7 +3862,7 @@ func TestPrinterPrintStmtForeach(t *testing.T) { func TestPrinterPrintStmtForeach_Reference(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -3895,7 +3895,7 @@ func TestPrinterPrintStmtForeach_Reference(t *testing.T) { func TestPrinterPrintStmtFunction(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtFunction{ AmpersandTkn: &token.Token{ Value: []byte("&"), @@ -3931,7 +3931,7 @@ func TestPrinterPrintStmtFunction(t *testing.T) { func TestPrinterPrintStmtGlobal(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtGlobal{ Vars: []ast.Vertex{ &ast.ExprVariable{ @@ -3955,7 +3955,7 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { func TestPrinterPrintStmtGoto(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtGoto{ Label: &ast.Identifier{Value: []byte("FOO")}, } @@ -3972,7 +3972,7 @@ func TestPrinterPrintStmtGoto(t *testing.T) { func TestPrinterPrintHaltCompiler(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtHaltCompiler{} n.Accept(p) @@ -3987,7 +3987,7 @@ func TestPrinterPrintHaltCompiler(t *testing.T) { func TestPrinterPrintIfExpression(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4040,7 +4040,7 @@ func TestPrinterPrintIfExpression(t *testing.T) { func TestPrinterPrintIfStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4068,7 +4068,7 @@ func TestPrinterPrintIfStmtList(t *testing.T) { func TestPrinterPrintIfNop(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4088,7 +4088,7 @@ func TestPrinterPrintIfNop(t *testing.T) { func TestPrinterPrintInlineHtml(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtInlineHtml{ @@ -4109,7 +4109,7 @@ func TestPrinterPrintInlineHtml(t *testing.T) { func TestPrinterPrintInterface(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtInterface{ InterfaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Extends: []ast.Vertex{ @@ -4144,7 +4144,7 @@ func TestPrinterPrintInterface(t *testing.T) { func TestPrinterPrintLabel(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtLabel{ LabelName: &ast.Identifier{Value: []byte("FOO")}, } @@ -4161,7 +4161,7 @@ func TestPrinterPrintLabel(t *testing.T) { func TestPrinterPrintNamespace(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtNamespace{ Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, } @@ -4178,7 +4178,7 @@ func TestPrinterPrintNamespace(t *testing.T) { func TestPrinterPrintNamespaceWithStmts(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtNamespace{ Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ @@ -4200,7 +4200,7 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { func TestPrinterPrintNop(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtNop{} n.Accept(p) @@ -4215,7 +4215,7 @@ func TestPrinterPrintNop(t *testing.T) { func TestPrinterPrintPropertyList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtPropertyList{ Modifiers: []ast.Vertex{ &ast.Identifier{Value: []byte("public")}, @@ -4255,7 +4255,7 @@ func TestPrinterPrintPropertyList(t *testing.T) { func TestPrinterPrintProperty(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtProperty{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4275,7 +4275,7 @@ func TestPrinterPrintProperty(t *testing.T) { func TestPrinterPrintReturn(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtReturn{ Expr: &ast.ScalarLnumber{Value: []byte("1")}, } @@ -4292,7 +4292,7 @@ func TestPrinterPrintReturn(t *testing.T) { func TestPrinterPrintStaticVar(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtStaticVar{ Var: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, @@ -4312,7 +4312,7 @@ func TestPrinterPrintStaticVar(t *testing.T) { func TestPrinterPrintStatic(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtStatic{ Vars: []ast.Vertex{ &ast.StmtStaticVar{ @@ -4340,7 +4340,7 @@ func TestPrinterPrintStatic(t *testing.T) { func TestPrinterPrintStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -4364,7 +4364,7 @@ func TestPrinterPrintStmtList(t *testing.T) { func TestPrinterPrintStmtListNested(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -4399,7 +4399,7 @@ func TestPrinterPrintStmtListNested(t *testing.T) { func TestPrinterPrintStmtSwitch(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -4436,7 +4436,7 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { func TestPrinterPrintStmtThrow(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtThrow{ Expr: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$var")}, @@ -4455,7 +4455,7 @@ func TestPrinterPrintStmtThrow(t *testing.T) { func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUseAlias{ Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, @@ -4475,7 +4475,7 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUsePrecedence{ Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, @@ -4497,7 +4497,7 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { func TestPrinterPrintStmtTraitUse(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, @@ -4517,7 +4517,7 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, @@ -4544,7 +4544,7 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { func TestPrinterPrintTrait(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTrait{ TraitName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ @@ -4575,7 +4575,7 @@ func TestPrinterPrintTrait(t *testing.T) { func TestPrinterPrintStmtTry(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTry{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ @@ -4617,7 +4617,7 @@ func TestPrinterPrintStmtTry(t *testing.T) { func TestPrinterPrintStmtUnset(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtUnset{ Vars: []ast.Vertex{ &ast.ExprVariable{ @@ -4641,7 +4641,7 @@ func TestPrinterPrintStmtUnset(t *testing.T) { func TestPrinterPrintUse(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtUse{ Type: &ast.Identifier{Value: []byte("function")}, UseDeclarations: []ast.Vertex{ @@ -4667,7 +4667,7 @@ func TestPrinterPrintUse(t *testing.T) { func TestPrinterPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtGroupUse{ Type: &ast.Identifier{Value: []byte("function")}, Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, @@ -4694,7 +4694,7 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { func TestPrinterPrintUseDeclaration(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtUseDeclaration{ Type: &ast.Identifier{Value: []byte("function")}, Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, @@ -4713,7 +4713,7 @@ func TestPrinterPrintUseDeclaration(t *testing.T) { func TestPrinterPrintWhileStmtList(t *testing.T) { o := bytes.NewBufferString("") - p := visitor.NewPrinter(o).WithState(visitor.PrinterStatePHP) + p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ VarName: &ast.Identifier{Value: []byte("$a")}, diff --git a/pkg/visitor/traverser/traverser.go b/pkg/visitor/traverser/traverser.go new file mode 100644 index 0000000..128f7ea --- /dev/null +++ b/pkg/visitor/traverser/traverser.go @@ -0,0 +1,1164 @@ +package traverser + +import ( + "github.com/z7zmey/php-parser/pkg/ast" +) + +type Traverser struct { + v ast.Visitor +} + +func NewTraverser(v ast.Visitor) *Traverser { + return &Traverser{ + v: v, + } +} + +func (t *Traverser) Traverse(n ast.Vertex) { + if n != nil { + n.Accept(t) + } +} + +func (t *Traverser) Root(n *ast.Root) { + n.Accept(t.v) + + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) Nullable(n *ast.Nullable) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) Parameter(n *ast.Parameter) { + n.Accept(t.v) + + t.Traverse(n.Type) + t.Traverse(n.Var) + t.Traverse(n.DefaultValue) +} + +func (t *Traverser) Identifier(n *ast.Identifier) { + n.Accept(t.v) +} + +func (t *Traverser) Argument(n *ast.Argument) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtBreak(n *ast.StmtBreak) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtCase(n *ast.StmtCase) { + n.Accept(t.v) + + t.Traverse(n.Cond) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtCatch(n *ast.StmtCatch) { + n.Accept(t.v) + + for _, nn := range n.Types { + nn.Accept(t) + } + t.Traverse(n.Var) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtClass(n *ast.StmtClass) { + n.Accept(t.v) + + for _, nn := range n.Modifiers { + nn.Accept(t) + } + t.Traverse(n.ClassName) + for _, nn := range n.Arguments { + nn.Accept(t) + } + t.Traverse(n.Extends) + for _, nn := range n.Implements { + nn.Accept(t) + } + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtClassConstList(n *ast.StmtClassConstList) { + n.Accept(t.v) + + for _, nn := range n.Modifiers { + nn.Accept(t) + } + for _, nn := range n.Consts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtClassMethod(n *ast.StmtClassMethod) { + n.Accept(t.v) + + for _, nn := range n.Modifiers { + nn.Accept(t) + } + t.Traverse(n.MethodName) + for _, nn := range n.Params { + nn.Accept(t) + } + t.Traverse(n.ReturnType) + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtConstList(n *ast.StmtConstList) { + n.Accept(t.v) + + for _, nn := range n.Consts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtConstant(n *ast.StmtConstant) { + n.Accept(t.v) + + t.Traverse(n.Name) + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtContinue(n *ast.StmtContinue) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtDeclare(n *ast.StmtDeclare) { + n.Accept(t.v) + + for _, nn := range n.Consts { + nn.Accept(t) + } + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtDefault(n *ast.StmtDefault) { + n.Accept(t.v) + + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtDo(n *ast.StmtDo) { + n.Accept(t.v) + + t.Traverse(n.Stmt) + t.Traverse(n.Cond) +} + +func (t *Traverser) StmtEcho(n *ast.StmtEcho) { + n.Accept(t.v) + + for _, nn := range n.Exprs { + nn.Accept(t) + } +} + +func (t *Traverser) StmtElse(n *ast.StmtElse) { + n.Accept(t.v) + + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtElseIf(n *ast.StmtElseIf) { + n.Accept(t.v) + + t.Traverse(n.Cond) + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtExpression(n *ast.StmtExpression) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtFinally(n *ast.StmtFinally) { + n.Accept(t.v) + + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtFor(n *ast.StmtFor) { + n.Accept(t.v) + + for _, nn := range n.Init { + nn.Accept(t) + } + for _, nn := range n.Cond { + nn.Accept(t) + } + for _, nn := range n.Loop { + nn.Accept(t) + } + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtForeach(n *ast.StmtForeach) { + n.Accept(t.v) + + t.Traverse(n.Expr) + t.Traverse(n.Key) + t.Traverse(n.Var) + t.Traverse(n.Stmt) +} + +func (t *Traverser) StmtFunction(n *ast.StmtFunction) { + n.Accept(t.v) + + t.Traverse(n.FunctionName) + for _, nn := range n.Params { + nn.Accept(t) + } + t.Traverse(n.ReturnType) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtGlobal(n *ast.StmtGlobal) { + n.Accept(t.v) + + for _, nn := range n.Vars { + nn.Accept(t) + } +} + +func (t *Traverser) StmtGoto(n *ast.StmtGoto) { + n.Accept(t.v) + + t.Traverse(n.Label) +} + +func (t *Traverser) StmtHaltCompiler(n *ast.StmtHaltCompiler) { + n.Accept(t.v) +} + +func (t *Traverser) StmtIf(n *ast.StmtIf) { + n.Accept(t.v) + + t.Traverse(n.Cond) + t.Traverse(n.Stmt) + for _, nn := range n.ElseIf { + nn.Accept(t) + } + t.Traverse(n.Else) +} + +func (t *Traverser) StmtInlineHtml(n *ast.StmtInlineHtml) { + n.Accept(t.v) +} + +func (t *Traverser) StmtInterface(n *ast.StmtInterface) { + n.Accept(t.v) + + t.Traverse(n.InterfaceName) + for _, nn := range n.Extends { + nn.Accept(t) + } + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtLabel(n *ast.StmtLabel) { + n.Accept(t.v) + + t.Traverse(n.LabelName) +} + +func (t *Traverser) StmtNamespace(n *ast.StmtNamespace) { + n.Accept(t.v) + + t.Traverse(n.Name) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtNop(n *ast.StmtNop) { + n.Accept(t.v) +} + +func (t *Traverser) StmtProperty(n *ast.StmtProperty) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtPropertyList(n *ast.StmtPropertyList) { + n.Accept(t.v) + + for _, nn := range n.Modifiers { + nn.Accept(t) + } + t.Traverse(n.Type) + for _, nn := range n.Properties { + nn.Accept(t) + } +} + +func (t *Traverser) StmtReturn(n *ast.StmtReturn) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtStatic(n *ast.StmtStatic) { + n.Accept(t.v) + + for _, nn := range n.Vars { + nn.Accept(t) + } +} + +func (t *Traverser) StmtStaticVar(n *ast.StmtStaticVar) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtStmtList(n *ast.StmtStmtList) { + n.Accept(t.v) + + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtSwitch(n *ast.StmtSwitch) { + n.Accept(t.v) + + t.Traverse(n.Cond) + for _, nn := range n.CaseList { + nn.Accept(t) + } +} + +func (t *Traverser) StmtThrow(n *ast.StmtThrow) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) StmtTrait(n *ast.StmtTrait) { + n.Accept(t.v) + + t.Traverse(n.TraitName) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) StmtTraitUse(n *ast.StmtTraitUse) { + n.Accept(t.v) + + for _, nn := range n.Traits { + nn.Accept(t) + } + for _, nn := range n.Adaptations { + nn.Accept(t) + } +} + +func (t *Traverser) StmtTraitUseAlias(n *ast.StmtTraitUseAlias) { + n.Accept(t.v) + + t.Traverse(n.Trait) + t.Traverse(n.Method) + t.Traverse(n.Modifier) + t.Traverse(n.Alias) +} + +func (t *Traverser) StmtTraitUsePrecedence(n *ast.StmtTraitUsePrecedence) { + n.Accept(t.v) + + t.Traverse(n.Trait) + t.Traverse(n.Method) + for _, nn := range n.Insteadof { + nn.Accept(t) + } +} + +func (t *Traverser) StmtTry(n *ast.StmtTry) { + n.Accept(t.v) + + for _, nn := range n.Stmts { + nn.Accept(t) + } + for _, nn := range n.Catches { + nn.Accept(t) + } + t.Traverse(n.Finally) +} + +func (t *Traverser) StmtUnset(n *ast.StmtUnset) { + n.Accept(t.v) + + for _, nn := range n.Vars { + nn.Accept(t) + } +} + +func (t *Traverser) StmtUse(n *ast.StmtUse) { + n.Accept(t.v) + + t.Traverse(n.Type) + for _, nn := range n.UseDeclarations { + nn.Accept(t) + } +} + +func (t *Traverser) StmtGroupUse(n *ast.StmtGroupUse) { + n.Accept(t.v) + + t.Traverse(n.Type) + t.Traverse(n.Prefix) + for _, nn := range n.UseDeclarations { + nn.Accept(t) + } +} + +func (t *Traverser) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + n.Accept(t.v) + + t.Traverse(n.Type) + t.Traverse(n.Use) + t.Traverse(n.Alias) +} + +func (t *Traverser) StmtWhile(n *ast.StmtWhile) { + n.Accept(t.v) + + t.Traverse(n.Cond) + t.Traverse(n.Stmt) +} + +func (t *Traverser) ExprArray(n *ast.ExprArray) { + n.Accept(t.v) + + for _, nn := range n.Items { + nn.Accept(t) + } +} + +func (t *Traverser) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Dim) +} + +func (t *Traverser) ExprArrayItem(n *ast.ExprArrayItem) { + n.Accept(t.v) + + t.Traverse(n.Key) + t.Traverse(n.Val) +} + +func (t *Traverser) ExprArrowFunction(n *ast.ExprArrowFunction) { + n.Accept(t.v) + + for _, nn := range n.Params { + nn.Accept(t) + } + t.Traverse(n.ReturnType) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprBitwiseNot(n *ast.ExprBitwiseNot) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprBooleanNot(n *ast.ExprBooleanNot) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprBrackets(n *ast.ExprBrackets) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprClassConstFetch(n *ast.ExprClassConstFetch) { + n.Accept(t.v) + + t.Traverse(n.Class) + t.Traverse(n.ConstantName) +} + +func (t *Traverser) ExprClone(n *ast.ExprClone) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprClosure(n *ast.ExprClosure) { + n.Accept(t.v) + + for _, nn := range n.Params { + nn.Accept(t) + } + for _, nn := range n.Use { + nn.Accept(t) + } + t.Traverse(n.ReturnType) + for _, nn := range n.Stmts { + nn.Accept(t) + } +} + +func (t *Traverser) ExprClosureUse(n *ast.ExprClosureUse) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ExprConstFetch(n *ast.ExprConstFetch) { + n.Accept(t.v) + + t.Traverse(n.Const) +} + +func (t *Traverser) ExprEmpty(n *ast.ExprEmpty) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprErrorSuppress(n *ast.ExprErrorSuppress) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprEval(n *ast.ExprEval) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprExit(n *ast.ExprExit) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprFunctionCall(n *ast.ExprFunctionCall) { + n.Accept(t.v) + + t.Traverse(n.Function) + for _, nn := range n.Arguments { + nn.Accept(t) + } +} + +func (t *Traverser) ExprInclude(n *ast.ExprInclude) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprIncludeOnce(n *ast.ExprIncludeOnce) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprInstanceOf(n *ast.ExprInstanceOf) { + n.Accept(t.v) + + t.Traverse(n.Expr) + t.Traverse(n.Class) +} + +func (t *Traverser) ExprIsset(n *ast.ExprIsset) { + n.Accept(t.v) + + for _, nn := range n.Vars { + nn.Accept(t) + } +} + +func (t *Traverser) ExprList(n *ast.ExprList) { + n.Accept(t.v) + + for _, nn := range n.Items { + nn.Accept(t) + } +} + +func (t *Traverser) ExprMethodCall(n *ast.ExprMethodCall) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Method) + for _, nn := range n.Arguments { + nn.Accept(t) + } +} + +func (t *Traverser) ExprNew(n *ast.ExprNew) { + n.Accept(t.v) + + t.Traverse(n.Class) + for _, nn := range n.Arguments { + nn.Accept(t) + } +} + +func (t *Traverser) ExprPostDec(n *ast.ExprPostDec) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ExprPostInc(n *ast.ExprPostInc) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ExprPreDec(n *ast.ExprPreDec) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ExprPreInc(n *ast.ExprPreInc) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ExprPrint(n *ast.ExprPrint) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprPropertyFetch(n *ast.ExprPropertyFetch) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Property) +} + +func (t *Traverser) ExprRequire(n *ast.ExprRequire) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprRequireOnce(n *ast.ExprRequireOnce) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprShellExec(n *ast.ExprShellExec) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) ExprStaticCall(n *ast.ExprStaticCall) { + n.Accept(t.v) + + t.Traverse(n.Class) + t.Traverse(n.Call) + for _, nn := range n.Arguments { + nn.Accept(t) + } +} + +func (t *Traverser) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { + n.Accept(t.v) + + t.Traverse(n.Class) + t.Traverse(n.Property) +} + +func (t *Traverser) ExprTernary(n *ast.ExprTernary) { + n.Accept(t.v) + + t.Traverse(n.Condition) + t.Traverse(n.IfTrue) + t.Traverse(n.IfFalse) +} + +func (t *Traverser) ExprUnaryMinus(n *ast.ExprUnaryMinus) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprUnaryPlus(n *ast.ExprUnaryPlus) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprVariable(n *ast.ExprVariable) { + n.Accept(t.v) + + t.Traverse(n.VarName) +} + +func (t *Traverser) ExprYield(n *ast.ExprYield) { + n.Accept(t.v) + + t.Traverse(n.Key) + t.Traverse(n.Value) +} + +func (t *Traverser) ExprYieldFrom(n *ast.ExprYieldFrom) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssign(n *ast.ExprAssign) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignReference(n *ast.ExprAssignReference) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignConcat(n *ast.ExprAssignConcat) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignDiv(n *ast.ExprAssignDiv) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignMinus(n *ast.ExprAssignMinus) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignMod(n *ast.ExprAssignMod) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignMul(n *ast.ExprAssignMul) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignPlus(n *ast.ExprAssignPlus) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignPow(n *ast.ExprAssignPow) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { + n.Accept(t.v) + + t.Traverse(n.Var) + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryConcat(n *ast.ExprBinaryConcat) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryDiv(n *ast.ExprBinaryDiv) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryEqual(n *ast.ExprBinaryEqual) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryGreater(n *ast.ExprBinaryGreater) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryMinus(n *ast.ExprBinaryMinus) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryMod(n *ast.ExprBinaryMod) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryMul(n *ast.ExprBinaryMul) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryPlus(n *ast.ExprBinaryPlus) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryPow(n *ast.ExprBinaryPow) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinarySmaller(n *ast.ExprBinarySmaller) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { + n.Accept(t.v) + + t.Traverse(n.Left) + t.Traverse(n.Right) +} + +func (t *Traverser) ExprCastArray(n *ast.ExprCastArray) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastBool(n *ast.ExprCastBool) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastDouble(n *ast.ExprCastDouble) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastInt(n *ast.ExprCastInt) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastObject(n *ast.ExprCastObject) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastString(n *ast.ExprCastString) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ExprCastUnset(n *ast.ExprCastUnset) { + n.Accept(t.v) + + t.Traverse(n.Expr) +} + +func (t *Traverser) ScalarDnumber(n *ast.ScalarDnumber) { + n.Accept(t.v) +} + +func (t *Traverser) ScalarEncapsed(n *ast.ScalarEncapsed) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { + n.Accept(t.v) +} + +func (t *Traverser) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { + n.Accept(t.v) + + t.Traverse(n.VarName) + t.Traverse(n.Dim) +} + +func (t *Traverser) ScalarEncapsedStringBrackets(n *ast.ScalarEncapsedStringBrackets) { + n.Accept(t.v) + + t.Traverse(n.Var) +} + +func (t *Traverser) ScalarHeredoc(n *ast.ScalarHeredoc) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) ScalarLnumber(n *ast.ScalarLnumber) { + n.Accept(t.v) +} + +func (t *Traverser) ScalarMagicConstant(n *ast.ScalarMagicConstant) { + n.Accept(t.v) +} + +func (t *Traverser) ScalarString(n *ast.ScalarString) { + n.Accept(t.v) +} + +func (t *Traverser) NameName(n *ast.NameName) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) NameFullyQualified(n *ast.NameFullyQualified) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) NameRelative(n *ast.NameRelative) { + n.Accept(t.v) + + for _, nn := range n.Parts { + nn.Accept(t) + } +} + +func (t *Traverser) NameNamePart(n *ast.NameNamePart) { + n.Accept(t.v) +} From 07f49a4d21a99e69621f2d84560bc3d618344649 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 28 Dec 2020 21:31:24 +0200 Subject: [PATCH 137/140] refactoring: move internal nodes --- internal/php5/node.go | 85 ++++++ internal/php5/php5.go | Bin 267006 -> 265606 bytes internal/php5/php5.y | 602 +++++++++++++++++++++--------------------- internal/php7/node.go | 99 +++++++ internal/php7/php7.go | Bin 222523 -> 221511 bytes internal/php7/php7.y | 440 +++++++++++++++--------------- pkg/ast/node.go | 94 ------- 7 files changed, 705 insertions(+), 615 deletions(-) create mode 100644 internal/php5/node.go create mode 100644 internal/php7/node.go diff --git a/internal/php5/node.go b/internal/php5/node.go new file mode 100644 index 0000000..6a612ac --- /dev/null +++ b/internal/php5/node.go @@ -0,0 +1,85 @@ +package php5 + +import ( + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" +) + +type ParserBrackets struct { + Position *position.Position + OpenBracketTkn *token.Token + Child ast.Vertex + CloseBracketTkn *token.Token +} + +func (n *ParserBrackets) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserBrackets) GetPosition() *position.Position { + return n.Position +} + +type ParserSeparatedList struct { + Position *position.Position + Items []ast.Vertex + SeparatorTkns []*token.Token +} + +func (n *ParserSeparatedList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserSeparatedList) GetPosition() *position.Position { + return n.Position +} + +// TraitAdaptationList node +type TraitAdaptationList struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []ast.Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *TraitAdaptationList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + +// ArgumentList node +type ArgumentList struct { + Position *position.Position + OpenParenthesisTkn *token.Token + Arguments []ast.Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token +} + +func (n *ArgumentList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ArgumentList) GetPosition() *position.Position { + return n.Position +} + +// TraitMethodRef node +type TraitMethodRef struct { + Position *position.Position + Trait ast.Vertex + DoubleColonTkn *token.Token + Method ast.Vertex +} + +func (n *TraitMethodRef) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitMethodRef) GetPosition() *position.Position { + return n.Position +} diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a65a4c86b8b6110e0454d39af0d3a8041ac5b829..f93f178b08a189954f823aaf5bf7b5d3b0aa0eb0 100644 GIT binary patch delta 3974 zcmb7Hdr*|u6`yks6j&CP$XXFF3xojD0LrR_*8&A0K9H@}MjINTsr7+UOkx#d433%9 z$@rRx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1|1qC?ozLO-2Sr*MA4=J;zuR7GFIH_uVJP-8#TsFaiUq{_HNLj zfqgQlDL#0E@{LukLS`&o897D<+h=bQzByMl_F7VeGB5u zxv5}u;4Y8)Y|zswa?35HqC&Hxo5Jat+>+!IWn!>bCa`>ZM!Z~k^*BK}mbVV-)%jv_ zEfil{b~>m}&KJ|(#eus7h{`%42=&T5PDeRJC~8P^*iQORUJmt{?+27^1)o-)_#g7 z+KoJR?T^NIdF?}DRI)-dYUArQ+%=3l8>19^UmaV-B(=aNe}vq)MLebSBv(3fIC*}j zs1ZTi&eO7acyG^QLB`ijR)gEv1<((x|>vloyg;v|ih>0gOQLbFuv{zepqq_V+F7RfAHr+*Sm zt21crb{>C@|G_tROTOn)w00R!47q6#D^re$rbKmExlH)}ns~b{kAxFwO_xZL51bJ{ XMtW0EJU-qUbVxlztaOEiRYd*+iej$p diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 581d612..54e00b5 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -291,7 +291,7 @@ top_statement_list: namespace_name: T_STRING { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -309,8 +309,8 @@ namespace_name: Value: $3.Value, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, part) $$ = $1 } @@ -350,9 +350,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -363,9 +363,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracketTkn: $3, Stmts: $4, @@ -387,8 +387,8 @@ top_statement: $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, - UseDeclarations: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -402,8 +402,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -417,8 +417,8 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -433,14 +433,14 @@ top_statement: use_declarations: use_declarations ',' use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -450,22 +450,22 @@ use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -478,12 +478,12 @@ use_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -493,9 +493,9 @@ use_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -510,14 +510,14 @@ use_declaration: use_function_declarations: use_function_declarations ',' use_function_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_function_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -527,22 +527,22 @@ use_function_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -555,12 +555,12 @@ use_function_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -570,9 +570,9 @@ use_function_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -587,14 +587,14 @@ use_function_declaration: use_const_declarations: use_const_declarations ',' use_const_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_const_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -604,22 +604,22 @@ use_const_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -632,12 +632,12 @@ use_const_declaration: | T_NS_SEPARATOR namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -647,9 +647,9 @@ use_const_declaration: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $3, Alias: &ast.Identifier{ @@ -841,14 +841,14 @@ unticked_statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Init = $3.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Cond = $5.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Loop = $7.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) @@ -1046,8 +1046,8 @@ unticked_statement: { $5.(*ast.StmtDeclare).DeclareTkn = $1 $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 - $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items - $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).Consts = $3.(*ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) @@ -1265,8 +1265,8 @@ unticked_function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $4, - Params: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $6, OpenCurlyBracketTkn: $7, Stmts: $8, @@ -1427,10 +1427,10 @@ interface_extends_list: | T_EXTENDS interface_list { $$ = &ast.StmtInterface{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ExtendsTkn: $1, - Extends: $2.(*ast.ParserSeparatedList).Items, - ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Extends: $2.(*ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1443,10 +1443,10 @@ implements_list: | T_IMPLEMENTS interface_list { $$ = &ast.StmtClass{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ImplementsTkn: $1, - Implements: $2.(*ast.ParserSeparatedList).Items, - ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Implements: $2.(*ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1454,14 +1454,14 @@ implements_list: interface_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | interface_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1496,7 +1496,7 @@ foreach_variable: } | T_LIST '(' assignment_list ')' { - pairList := $3.(*ast.ParserSeparatedList) + pairList := $3.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -1507,8 +1507,8 @@ foreach_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -1588,7 +1588,7 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtConstant{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), @@ -1605,9 +1605,9 @@ declare_list: } | declare_list ',' T_STRING '=' static_scalar { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append( - $1.(*ast.ParserSeparatedList).Items, + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append( + $1.(*ParserSeparatedList).Items, &ast.StmtConstant{ Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Name: &ast.Identifier{ @@ -1818,21 +1818,21 @@ parameter_list: } | /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | non_empty_parameter_list ',' parameter { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1927,7 +1927,7 @@ optional_class_type: function_call_parameter_list: '(' ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, @@ -1935,7 +1935,7 @@ function_call_parameter_list: } | '(' non_empty_function_call_parameter_list ')' { - argumentList := $2.(*ast.ArgumentList) + argumentList := $2.(*ArgumentList) argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) argumentList.OpenParenthesisTkn = $1 argumentList.CloseParenthesisTkn = $3 @@ -1944,7 +1944,7 @@ function_call_parameter_list: } | '(' yield_expr ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenParenthesisTkn: $1, Arguments: []ast.Vertex{ @@ -1962,14 +1962,14 @@ function_call_parameter_list: non_empty_function_call_parameter_list: function_call_parameter { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Arguments: []ast.Vertex{$1}, } } | non_empty_function_call_parameter_list ',' function_call_parameter { - $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) - $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) + $1.(*ArgumentList).SeparatorTkns = append($1.(*ArgumentList).SeparatorTkns, $2) + $1.(*ArgumentList).Arguments = append($1.(*ArgumentList).Arguments, $3) $$ = $1 } @@ -2154,8 +2154,8 @@ class_statement: $$ = &ast.StmtPropertyList{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $3), Modifiers: $1, - Properties: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Properties: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -2187,8 +2187,8 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $5, - Params: $6.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $6.(*ParserSeparatedList).Items, + SeparatorTkns: $6.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, Stmt: $8, } @@ -2201,12 +2201,12 @@ trait_use_statement: traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, - Traits: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Traits: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } switch n := $3.(type) { - case *ast.TraitAdaptationList : + case *TraitAdaptationList : traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn traitUse.Adaptations = n.Adaptations traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn @@ -2221,14 +2221,14 @@ trait_use_statement: trait_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | trait_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2244,7 +2244,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, @@ -2294,13 +2294,13 @@ trait_precedence: trait_method_reference_fully_qualified T_INSTEADOF trait_reference_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ParserSeparatedList).Items), + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, InsteadofTkn: $2, - Insteadof: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Insteadof: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -2308,14 +2308,14 @@ trait_precedence: trait_reference_list: fully_qualified_class_name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | trait_reference_list ',' fully_qualified_class_name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2324,7 +2324,7 @@ trait_reference_list: trait_method_reference: T_STRING { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2342,7 +2342,7 @@ trait_method_reference: trait_method_reference_fully_qualified: fully_qualified_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, @@ -2360,9 +2360,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ @@ -2376,9 +2376,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, } @@ -2520,8 +2520,8 @@ class_variable_declaration: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, item) $$ = $1 } @@ -2541,14 +2541,14 @@ class_variable_declaration: Expr: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, item) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, item) $$ = $1 } | T_VARIABLE { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2567,7 +2567,7 @@ class_variable_declaration: } | T_VARIABLE '=' static_scalar { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.StmtProperty{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), @@ -2647,7 +2647,7 @@ echo_expr_list: for_expr: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_for_expr { @@ -2658,14 +2658,14 @@ for_expr: non_empty_for_expr: non_empty_for_expr ',' expr { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2743,10 +2743,10 @@ new_expr: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -2766,8 +2766,8 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, EqualTkn: $5, @@ -2801,10 +2801,10 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokenNodePosition($4, $6), NewTkn: $4, Class: $5, - OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $6.(*ast.ArgumentList).Arguments, - SeparatorTkns: $6.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $6.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $6.(*ArgumentList).OpenParenthesisTkn, + Arguments: $6.(*ArgumentList).Arguments, + SeparatorTkns: $6.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $6.(*ArgumentList).CloseParenthesisTkn, } } else { _new = &ast.ExprNew{ @@ -3427,8 +3427,8 @@ expr_without_variable: closure.FunctionTkn = $1 closure.AmpersandTkn = $2 closure.OpenParenthesisTkn = $3 - closure.Params = $4.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $4.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $4.(*ParserSeparatedList).Items + closure.SeparatorTkns = $4.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $5 closure.OpenCurlyBracketTkn = $7 closure.Stmts = $8 @@ -3445,8 +3445,8 @@ expr_without_variable: closure.FunctionTkn = $2 closure.AmpersandTkn = $3 closure.OpenParenthesisTkn = $4 - closure.Params = $5.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $5.(*ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $6 closure.OpenCurlyBracketTkn = $8 closure.Stmts = $9 @@ -3549,8 +3549,8 @@ combined_scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -3559,8 +3559,8 @@ combined_scalar: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -3583,8 +3583,8 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ast.ParserSeparatedList).Items, - UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Use: $3.(*ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } } @@ -3605,8 +3605,8 @@ lexical_var_list: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, variable) $$ = $1 } @@ -3625,8 +3625,8 @@ lexical_var_list: }, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, variable) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, variable) $$ = $1 } @@ -3644,7 +3644,7 @@ lexical_var_list: }, } - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ variable }, } } @@ -3663,7 +3663,7 @@ lexical_var_list: }, } - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ variable }, } } @@ -3673,16 +3673,16 @@ function_call: namespace_name function_call_parameter_list { $$ = &ast.ExprFunctionCall{ - Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ast.ParserSeparatedList).Items, $2), + Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ParserSeparatedList).Items, $2), Function: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3690,16 +3690,16 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $4), Function: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | T_NS_SEPARATOR namespace_name function_call_parameter_list @@ -3707,15 +3707,15 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Function: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3725,13 +3725,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3746,10 +3746,10 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list @@ -3759,13 +3759,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3780,10 +3780,10 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } } | variable_without_objects function_call_parameter_list @@ -3791,10 +3791,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -3811,28 +3811,28 @@ class_name: | namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -3841,28 +3841,28 @@ fully_qualified_class_name: namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -3984,7 +3984,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = &ast.ArgumentList{} + $$ = &ArgumentList{} } | function_call_parameter_list { @@ -4133,36 +4133,36 @@ static_scalar_value: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Const: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -4172,8 +4172,8 @@ static_scalar_value: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -4182,8 +4182,8 @@ static_scalar_value: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -4513,36 +4513,36 @@ general_constant: | namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Const: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), Const: &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.ExprConstFetch{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), Const: &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, } } @@ -4603,13 +4603,13 @@ scalar: static_array_pair_list: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_static_array_pair_list possible_comma { if $2 != nil { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, &ast.ExprArrayItem{}) } $$ = $1 @@ -4637,8 +4637,8 @@ non_empty_static_array_pair_list: Val: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -4649,14 +4649,14 @@ non_empty_static_array_pair_list: Val: $3, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), @@ -4669,7 +4669,7 @@ non_empty_static_array_pair_list: } | static_scalar_value { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodePosition($1), @@ -4895,10 +4895,10 @@ method: { $$ = &ast.ExprMethodCall{ Position: yylex.(*Parser).builder.NewNodePosition($1), - OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $1.(*ast.ArgumentList).Arguments, - SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $1.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $1.(*ArgumentList).OpenParenthesisTkn, + Arguments: $1.(*ArgumentList).Arguments, + SeparatorTkns: $1.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $1.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -5135,7 +5135,7 @@ object_dim_list: Property: $1, } - if brackets, ok := $1.(*ast.ParserBrackets); ok { + if brackets, ok := $1.(*ParserBrackets); ok { property.OpenCurlyBracketTkn = brackets.OpenBracketTkn property.Property = brackets.Child property.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -5156,7 +5156,7 @@ variable_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -5187,14 +5187,14 @@ simple_indirect_reference: assignment_list: assignment_list ',' assignment_list_element { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | assignment_list_element { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -5211,7 +5211,7 @@ assignment_list_element: } | T_LIST '(' assignment_list ')' { - pairList := $3.(*ast.ParserSeparatedList) + pairList := $3.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -5224,8 +5224,8 @@ assignment_list_element: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, } @@ -5240,13 +5240,13 @@ assignment_list_element: array_pair_list: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_array_pair_list possible_comma { if $2 != nil { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, &ast.ExprArrayItem{}) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, &ast.ExprArrayItem{}) } $$ = $1 @@ -5263,8 +5263,8 @@ non_empty_array_pair_list: Val: $5, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -5275,14 +5275,14 @@ non_empty_array_pair_list: Val: $3, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | expr T_DOUBLE_ARROW expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), @@ -5295,7 +5295,7 @@ non_empty_array_pair_list: } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodePosition($1), @@ -5314,8 +5314,8 @@ non_empty_array_pair_list: Val: $6, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } @@ -5327,14 +5327,14 @@ non_empty_array_pair_list: Val: $4, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, arrayItem) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, arrayItem) $$ = $1 } | expr T_DOUBLE_ARROW '&' w_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), @@ -5348,7 +5348,7 @@ non_empty_array_pair_list: } | '&' w_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.ExprArrayItem{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), @@ -5537,8 +5537,8 @@ internal_functions_in_yacc: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), IssetTkn: $1, OpenParenthesisTkn: $2, - Vars: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Vars: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $4, } } @@ -5609,14 +5609,14 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | isset_variables ',' isset_variable { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } diff --git a/internal/php7/node.go b/internal/php7/node.go new file mode 100644 index 0000000..dfb0236 --- /dev/null +++ b/internal/php7/node.go @@ -0,0 +1,99 @@ +package php7 + +import ( + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" +) + +type ParserBrackets struct { + Position *position.Position + OpenBracketTkn *token.Token + Child ast.Vertex + CloseBracketTkn *token.Token +} + +func (n *ParserBrackets) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserBrackets) GetPosition() *position.Position { + return n.Position +} + +type ParserSeparatedList struct { + Position *position.Position + Items []ast.Vertex + SeparatorTkns []*token.Token +} + +func (n *ParserSeparatedList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ParserSeparatedList) GetPosition() *position.Position { + return n.Position +} + +// TraitAdaptationList node +type TraitAdaptationList struct { + Position *position.Position + OpenCurlyBracketTkn *token.Token + Adaptations []ast.Vertex + CloseCurlyBracketTkn *token.Token +} + +func (n *TraitAdaptationList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitAdaptationList) GetPosition() *position.Position { + return n.Position +} + +// ArgumentList node +type ArgumentList struct { + Position *position.Position + OpenParenthesisTkn *token.Token + Arguments []ast.Vertex + SeparatorTkns []*token.Token + CloseParenthesisTkn *token.Token +} + +func (n *ArgumentList) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ArgumentList) GetPosition() *position.Position { + return n.Position +} + +type ReturnType struct { + Position *position.Position + ColonTkn *token.Token + Type ast.Vertex +} + +func (n *ReturnType) Accept(v ast.Visitor) { + // do nothing +} + +func (n *ReturnType) GetPosition() *position.Position { + return n.Position +} + +// TraitMethodRef node +type TraitMethodRef struct { + Position *position.Position + Trait ast.Vertex + DoubleColonTkn *token.Token + Method ast.Vertex +} + +func (n *TraitMethodRef) Accept(v ast.Visitor) { + // do nothing +} + +func (n *TraitMethodRef) GetPosition() *position.Position { + return n.Position +} diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 8c4c775da8b45637d7cae76a854812cd6a982fd1..9810e30bd7d4cfe13636d6e9b9ddf654e0d8054f 100644 GIT binary patch delta 3012 zcmcgueN5DK7~k{!ju(kLVc>zDyc`G|3fz&Nim4pp)F3@jLNS3vS?SVjt@$#SE^CuE z2082Lj{<6K<`!?Q?ODTo!-hsV++1e946WvxZ&exD2J2U6LB03H$V(sc@%P}yB}idYCc?0!TVH5X^`WL6Rs#nCY^V| z66GzTy29XGZZCvW5k{rq$0bl=(kZ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5*OOA#EsBu!+QX)bHv2csdm@pxy`4LrQb{unP<`UK!)>J;Nk4*^SEzVnN98V z&g`vDd|&<#aAIb7WRVk->9OR*XtR>jktkMN#$9?r6iO#q;x$Pzb2hE`!3A?HQ7jKG zoA`fj_EjvFF=CU?Crd2bDGp!9blvzf`%LU}ka*aQ{(iDuoWn=--Nx%0p1UTc=MRr- zq}oOOT^wwr2HwLx@#-a?=Td?Lazm?TH8$r*Dx$bi%}rK3fJ^WzV73lNa62tueh6t|E$d7yA0)~ z7R&+M1AZa7@9fk(O)-ntrzn3%$l{n^qImodisll<>ds6CSsaQ-D+z9;Mt=|7V^611 Q)KXt<8 diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 0b15329..6a3f21d 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -336,7 +336,7 @@ top_statement_list: namespace_name: T_STRING { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{ &ast.NameNamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -354,8 +354,8 @@ namespace_name: Value: $3.Value, } - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, part) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, part) $$ = $1 } @@ -365,28 +365,28 @@ name: namespace_name { $$ = &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, } } | T_NAMESPACE T_NS_SEPARATOR namespace_name { $$ = &ast.NameRelative{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $3.(*ParserSeparatedList).Items), NsTkn: $1, NsSeparatorTkn: $2, - Parts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } | T_NS_SEPARATOR namespace_name { $$ = &ast.NameFullyQualified{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -433,9 +433,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, SemiColonTkn: $3, } @@ -446,9 +446,9 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, Name: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, OpenCurlyBracketTkn: $3, Stmts: $4, @@ -491,8 +491,8 @@ top_statement: $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, - UseDeclarations: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -502,8 +502,8 @@ top_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, Type: $2, - UseDeclarations: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -512,8 +512,8 @@ top_statement: $$ = &ast.StmtConstList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), ConstTkn: $1, - Consts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Consts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } @@ -542,41 +542,41 @@ group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { if $5 != nil { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } $$ = &ast.StmtGroupUse{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { if $6 != nil { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -586,41 +586,41 @@ mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { if $5 != nil { - $4.(*ast.ParserSeparatedList).SeparatorTkns = append($4.(*ast.ParserSeparatedList).SeparatorTkns, $5) + $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } $$ = &ast.StmtGroupUse{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $6), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { if $6 != nil { - $5.(*ast.ParserSeparatedList).SeparatorTkns = append($5.(*ast.ParserSeparatedList).SeparatorTkns, $6) + $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } $$ = &ast.StmtGroupUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, Prefix: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ast.ParserSeparatedList).Items), - Parts: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), + Parts: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + UseDeclarations: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } } @@ -640,14 +640,14 @@ possible_comma: inline_use_declarations: inline_use_declarations ',' inline_use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | inline_use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -656,14 +656,14 @@ inline_use_declarations: unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | unprefixed_use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -672,14 +672,14 @@ unprefixed_use_declarations: use_declarations: use_declarations ',' use_declaration { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | use_declaration { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -704,22 +704,22 @@ unprefixed_use_declaration: namespace_name { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, } } | namespace_name T_AS T_STRING { $$ = &ast.StmtUseDeclaration{ - Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ast.ParserSeparatedList).Items, $3), + Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), Use: &ast.NameName{ - Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ast.ParserSeparatedList).Items), - Parts: $1.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $1.(*ast.ParserSeparatedList).SeparatorTkns, + Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), + Parts: $1.(*ParserSeparatedList).Items, + SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, AsTkn: $2, Alias: &ast.Identifier{ @@ -749,14 +749,14 @@ use_declaration: const_list: const_list ',' const_decl { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | const_decl { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -857,14 +857,14 @@ statement: { $9.(*ast.StmtFor).ForTkn = $1 $9.(*ast.StmtFor).OpenParenthesisTkn = $2 - $9.(*ast.StmtFor).Init = $3.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Init = $3.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).InitSeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).InitSemiColonTkn = $4 - $9.(*ast.StmtFor).Cond = $5.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Cond = $5.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).CondSeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CondSemiColonTkn = $6 - $9.(*ast.StmtFor).Loop = $7.(*ast.ParserSeparatedList).Items - $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ast.ParserSeparatedList).SeparatorTkns + $9.(*ast.StmtFor).Loop = $7.(*ParserSeparatedList).Items + $9.(*ast.StmtFor).LoopSeparatorTkns = $7.(*ParserSeparatedList).SeparatorTkns $9.(*ast.StmtFor).CloseParenthesisTkn = $8 $9.(*ast.StmtFor).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $9) @@ -1004,8 +1004,8 @@ statement: { $5.(*ast.StmtDeclare).DeclareTkn = $1 $5.(*ast.StmtDeclare).OpenParenthesisTkn = $2 - $5.(*ast.StmtDeclare).Consts = $3.(*ast.ParserSeparatedList).Items - $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ast.ParserSeparatedList).SeparatorTkns + $5.(*ast.StmtDeclare).Consts = $3.(*ParserSeparatedList).Items + $5.(*ast.StmtDeclare).SeparatorTkns = $3.(*ParserSeparatedList).SeparatorTkns $5.(*ast.StmtDeclare).CloseParenthesisTkn = $4 $5.(*ast.StmtDeclare).Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $5) @@ -1166,11 +1166,11 @@ function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $5, - Params: $6.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $6.(*ParserSeparatedList).Items, + SeparatorTkns: $6.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, - ColonTkn: $8.(*ast.ReturnType).ColonTkn, - ReturnType: $8.(*ast.ReturnType).Type, + ColonTkn: $8.(*ReturnType).ColonTkn, + ReturnType: $8.(*ReturnType).Type, OpenCurlyBracketTkn: $9, Stmts: $10, CloseCurlyBracketTkn: $11, @@ -1357,10 +1357,10 @@ interface_extends_list: | T_EXTENDS name_list { $$ = &ast.StmtInterface{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ExtendsTkn: $1, - Extends: $2.(*ast.ParserSeparatedList).Items, - ExtendsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Extends: $2.(*ParserSeparatedList).Items, + ExtendsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1373,10 +1373,10 @@ implements_list: | T_IMPLEMENTS name_list { $$ = &ast.StmtClass{ - Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ast.ParserSeparatedList).Items), + Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), ImplementsTkn: $1, - Implements: $2.(*ast.ParserSeparatedList).Items, - ImplementsSeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Implements: $2.(*ParserSeparatedList).Items, + ImplementsSeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }; } ; @@ -1400,8 +1400,8 @@ foreach_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -1410,8 +1410,8 @@ foreach_variable: $$ = &ast.ExprList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -1707,21 +1707,21 @@ parameter_list: } | /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | non_empty_parameter_list ',' parameter { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -1836,11 +1836,11 @@ type: return_type: /* empty */ { - $$ = &ast.ReturnType{} + $$ = &ReturnType{} } | ':' type_expr { - $$ = &ast.ReturnType{ + $$ = &ReturnType{ ColonTkn: $1, Type: $2, } @@ -1850,7 +1850,7 @@ return_type: argument_list: '(' ')' { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenParenthesisTkn: $1, CloseParenthesisTkn: $2, @@ -1858,7 +1858,7 @@ argument_list: } | '(' non_empty_argument_list possible_comma ')' { - argumentList := $2.(*ast.ArgumentList) + argumentList := $2.(*ArgumentList) argumentList.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) argumentList.OpenParenthesisTkn = $1 if $3 != nil { @@ -1873,14 +1873,14 @@ argument_list: non_empty_argument_list: argument { - $$ = &ast.ArgumentList{ + $$ = &ArgumentList{ Arguments: []ast.Vertex{$1}, } } | non_empty_argument_list ',' argument { - $1.(*ast.ArgumentList).SeparatorTkns = append($1.(*ast.ArgumentList).SeparatorTkns, $2) - $1.(*ast.ArgumentList).Arguments = append($1.(*ast.ArgumentList).Arguments, $3) + $1.(*ArgumentList).SeparatorTkns = append($1.(*ArgumentList).SeparatorTkns, $2) + $1.(*ArgumentList).Arguments = append($1.(*ArgumentList).Arguments, $3) $$ = $1 } @@ -1995,8 +1995,8 @@ class_statement: Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $4), Modifiers: $1, Type: $2, - Properties: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Properties: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -2006,8 +2006,8 @@ class_statement: Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $4), Modifiers: $1, ConstTkn: $2, - Consts: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Consts: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } @@ -2016,12 +2016,12 @@ class_statement: traitUse := &ast.StmtTraitUse{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), UseTkn: $1, - Traits: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Traits: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, } switch n := $3.(type) { - case *ast.TraitAdaptationList : + case *TraitAdaptationList : traitUse.OpenCurlyBracketTkn = n.OpenCurlyBracketTkn traitUse.Adaptations = n.Adaptations traitUse.CloseCurlyBracketTkn = n.CloseCurlyBracketTkn @@ -2049,11 +2049,11 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $6, - Params: $7.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $7.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $7.(*ParserSeparatedList).Items, + SeparatorTkns: $7.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $8, - ColonTkn: $9.(*ast.ReturnType).ColonTkn, - ReturnType: $9.(*ast.ReturnType).Type, + ColonTkn: $9.(*ReturnType).ColonTkn, + ReturnType: $9.(*ReturnType).Type, Stmt: $10, } } @@ -2062,14 +2062,14 @@ class_statement: name_list: name { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | name_list ',' name { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } @@ -2085,7 +2085,7 @@ trait_adaptations: } | '{' '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), OpenCurlyBracketTkn: $1, CloseCurlyBracketTkn: $2, @@ -2093,7 +2093,7 @@ trait_adaptations: } | '{' trait_adaptation_list '}' { - $$ = &ast.TraitAdaptationList{ + $$ = &TraitAdaptationList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, Adaptations: $2, @@ -2132,13 +2132,13 @@ trait_precedence: absolute_trait_method_reference T_INSTEADOF name_list { $$ = &ast.StmtTraitUsePrecedence{ - Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ast.ParserSeparatedList).Items), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Position: yylex.(*Parser).builder.NewNodeNodeListPosition($1, $3.(*ParserSeparatedList).Items), + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, InsteadofTkn: $2, - Insteadof: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Insteadof: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, } } ; @@ -2148,9 +2148,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Alias: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), @@ -2163,9 +2163,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Alias: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), @@ -2178,9 +2178,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $4), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, Alias: &ast.Identifier{ @@ -2194,9 +2194,9 @@ trait_alias: { $$ = &ast.StmtTraitUseAlias{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), - Trait: $1.(*ast.TraitMethodRef).Trait, - DoubleColonTkn: $1.(*ast.TraitMethodRef).DoubleColonTkn, - Method: $1.(*ast.TraitMethodRef).Method, + Trait: $1.(*TraitMethodRef).Trait, + DoubleColonTkn: $1.(*TraitMethodRef).DoubleColonTkn, + Method: $1.(*TraitMethodRef).Method, AsTkn: $2, Modifier: $3, } @@ -2206,7 +2206,7 @@ trait_alias: trait_method_reference: identifier { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewTokenPosition($1), Method: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), @@ -2224,7 +2224,7 @@ trait_method_reference: absolute_trait_method_reference: name T_PAAMAYIM_NEKUDOTAYIM identifier { - $$ = &ast.TraitMethodRef{ + $$ = &TraitMethodRef{ Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Trait: $1, DoubleColonTkn: $2, @@ -2349,14 +2349,14 @@ member_modifier: property_list: property_list ',' property { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | property { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2399,14 +2399,14 @@ property: class_const_list: class_const_list ',' class_const_decl { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | class_const_decl { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2470,7 +2470,7 @@ echo_expr: for_exprs: /* empty */ { - $$ = &ast.ParserSeparatedList{} + $$ = &ParserSeparatedList{} } | non_empty_for_exprs { @@ -2481,14 +2481,14 @@ for_exprs: non_empty_for_exprs: non_empty_for_exprs ',' expr { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | expr { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -2500,10 +2500,10 @@ anonymous_class: class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, OpenCurlyBracketTkn: $6, Stmts: $7, CloseCurlyBracketTkn: $8, @@ -2532,10 +2532,10 @@ new_expr: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), NewTkn: $1, Class: $2, - OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ast.ArgumentList).Arguments, - SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $3.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, + Arguments: $3.(*ArgumentList).Arguments, + SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } } else { $$ = &ast.ExprNew{ @@ -2564,8 +2564,8 @@ expr_without_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, EqualTkn: $5, @@ -2579,8 +2579,8 @@ expr_without_variable: Var: &ast.ExprList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, }, EqualTkn: $4, @@ -3248,11 +3248,11 @@ inline_function: closure.FunctionTkn = $1 closure.AmpersandTkn = $2 closure.OpenParenthesisTkn = $4 - closure.Params = $5.(*ast.ParserSeparatedList).Items - closure.SeparatorTkns = $5.(*ast.ParserSeparatedList).SeparatorTkns + closure.Params = $5.(*ParserSeparatedList).Items + closure.SeparatorTkns = $5.(*ParserSeparatedList).SeparatorTkns closure.CloseParenthesisTkn = $6 - closure.ColonTkn = $8.(*ast.ReturnType).ColonTkn - closure.ReturnType = $8.(*ast.ReturnType).Type + closure.ColonTkn = $8.(*ReturnType).ColonTkn + closure.ReturnType = $8.(*ReturnType).Type closure.OpenCurlyBracketTkn = $9 closure.Stmts = $10 closure.CloseCurlyBracketTkn = $11 @@ -3266,11 +3266,11 @@ inline_function: FnTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, - Params: $4.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, + Params: $4.(*ParserSeparatedList).Items, + SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, - ColonTkn: $6.(*ast.ReturnType).ColonTkn, - ReturnType: $6.(*ast.ReturnType).Type, + ColonTkn: $6.(*ReturnType).ColonTkn, + ReturnType: $6.(*ReturnType).Type, DoubleArrowTkn: $8, Expr: $9, } @@ -3302,8 +3302,8 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ast.ParserSeparatedList).Items, - UseSeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Use: $3.(*ParserSeparatedList).Items, + UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } } @@ -3312,14 +3312,14 @@ lexical_vars: lexical_var_list: lexical_var_list ',' lexical_var { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | lexical_var { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -3363,10 +3363,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list @@ -3376,13 +3376,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3397,13 +3397,13 @@ function_call: Class: $1, DoubleColonTkn: $2, Call: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { staticCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn staticCall.Call = brackets.Child staticCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3416,10 +3416,10 @@ function_call: $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, - OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ast.ArgumentList).Arguments, - SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $2.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, + Arguments: $2.(*ArgumentList).Arguments, + SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } } ; @@ -3490,7 +3490,7 @@ backticks_expr: ctor_arguments: /* empty */ { - $$ = &ast.ArgumentList{} + $$ = &ArgumentList{} } | argument_list { @@ -3505,8 +3505,8 @@ dereferencable_scalar: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ArrayTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, } } @@ -3515,8 +3515,8 @@ dereferencable_scalar: $$ = &ast.ExprArray{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, - Items: $2.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $2.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $3, } } @@ -3809,13 +3809,13 @@ callable_variable: Var: $1, ObjectOperatorTkn: $2, Method: $3, - OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ast.ArgumentList).Arguments, - SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, - CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, + OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, + Arguments: $4.(*ArgumentList).Arguments, + SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, + CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { methodCall.OpenCurlyBracketTkn = brackets.OpenBracketTkn methodCall.Method = brackets.Child methodCall.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3847,7 +3847,7 @@ variable: Property: $3, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn propertyFetch.Property = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3944,7 +3944,7 @@ new_variable: Property: $3, } - if brackets, ok := $3.(*ast.ParserBrackets); ok { + if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn propertyFetch.Property = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn @@ -3983,7 +3983,7 @@ member_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -4007,7 +4007,7 @@ property_name: } | '{' expr '}' { - $$ = &ast.ParserBrackets{ + $$ = &ParserBrackets{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenBracketTkn: $1, Child: $2, @@ -4023,7 +4023,7 @@ property_name: array_pair_list: non_empty_array_pair_list { - pairList := $1.(*ast.ParserSeparatedList) + pairList := $1.(*ParserSeparatedList) fistPair := pairList.Items[0].(*ast.ExprArrayItem) if fistPair.Key == nil && fistPair.Val == nil && len(pairList.Items) == 1 { @@ -4048,14 +4048,14 @@ possible_array_pair: non_empty_array_pair_list: non_empty_array_pair_list ',' possible_array_pair { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } | possible_array_pair { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } @@ -4114,8 +4114,8 @@ array_pair: Position: yylex.(*Parser).builder.NewTokensPosition($3, $6), ListTkn: $3, OpenBracketTkn: $4, - Items: $5.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $5.(*ParserSeparatedList).Items, + SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $6, }, } @@ -4128,8 +4128,8 @@ array_pair: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ListTkn: $1, OpenBracketTkn: $2, - Items: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Items: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseBracketTkn: $4, }, } @@ -4334,15 +4334,15 @@ internal_functions_in_yacc: T_ISSET '(' isset_variables possible_comma ')' { if $4 != nil { - $3.(*ast.ParserSeparatedList).SeparatorTkns = append($3.(*ast.ParserSeparatedList).SeparatorTkns, $4) + $3.(*ParserSeparatedList).SeparatorTkns = append($3.(*ParserSeparatedList).SeparatorTkns, $4) } $$ = &ast.ExprIsset{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), IssetTkn: $1, OpenParenthesisTkn: $2, - Vars: $3.(*ast.ParserSeparatedList).Items, - SeparatorTkns: $3.(*ast.ParserSeparatedList).SeparatorTkns, + Vars: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, } } @@ -4403,14 +4403,14 @@ internal_functions_in_yacc: isset_variables: isset_variable { - $$ = &ast.ParserSeparatedList{ + $$ = &ParserSeparatedList{ Items: []ast.Vertex{$1}, } } | isset_variables ',' isset_variable { - $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) - $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) + $1.(*ParserSeparatedList).SeparatorTkns = append($1.(*ParserSeparatedList).SeparatorTkns, $2) + $1.(*ParserSeparatedList).Items = append($1.(*ParserSeparatedList).Items, $3) $$ = $1 } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 043c404..40e1093 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -2644,97 +2644,3 @@ func (n *NameNamePart) Accept(v Visitor) { func (n *NameNamePart) GetPosition() *position.Position { return n.Position } - -// TODO: move to private section - -type ParserBrackets struct { - Position *position.Position - OpenBracketTkn *token.Token - Child Vertex - CloseBracketTkn *token.Token -} - -func (n *ParserBrackets) Accept(v Visitor) { - // do nothing -} - -func (n *ParserBrackets) GetPosition() *position.Position { - return n.Position -} - -type ParserSeparatedList struct { - Position *position.Position - Items []Vertex - SeparatorTkns []*token.Token -} - -func (n *ParserSeparatedList) Accept(v Visitor) { - // do nothing -} - -func (n *ParserSeparatedList) GetPosition() *position.Position { - return n.Position -} - -// TraitAdaptationList node -type TraitAdaptationList struct { - Position *position.Position - OpenCurlyBracketTkn *token.Token - Adaptations []Vertex - CloseCurlyBracketTkn *token.Token -} - -func (n *TraitAdaptationList) Accept(v Visitor) { - // do nothing -} - -func (n *TraitAdaptationList) GetPosition() *position.Position { - return n.Position -} - -// ArgumentList node -type ArgumentList struct { - Position *position.Position - OpenParenthesisTkn *token.Token - Arguments []Vertex - SeparatorTkns []*token.Token - CloseParenthesisTkn *token.Token -} - -func (n *ArgumentList) Accept(v Visitor) { - // do nothing -} - -func (n *ArgumentList) GetPosition() *position.Position { - return n.Position -} - -type ReturnType struct { - Position *position.Position - ColonTkn *token.Token - Type Vertex -} - -func (n *ReturnType) Accept(v Visitor) { - // do nothing -} - -func (n *ReturnType) GetPosition() *position.Position { - return n.Position -} - -// TraitMethodRef node -type TraitMethodRef struct { - Position *position.Position - Trait Vertex - DoubleColonTkn *token.Token - Method Vertex -} - -func (n *TraitMethodRef) Accept(v Visitor) { - // do nothing -} - -func (n *TraitMethodRef) GetPosition() *position.Position { - return n.Position -} From 0701b3552e78b0ad1112e2fe2460467ddaabcc5a Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 28 Dec 2020 21:43:55 +0200 Subject: [PATCH 138/140] refactoring: fix scanning double dollar in template string --- internal/scanner/scanner.go | Bin 410134 -> 410157 bytes internal/scanner/scanner.rl | 11 ++++---- internal/scanner/scanner_test.go | 42 +++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index 49e8150e909af3178d6c5ad83cbd6dcc40a33cd0..7fd94d176e2d989db815d6262845a74f30270ca9 100644 GIT binary patch delta 4790 zcma)Ad0f?17XO^zyO%{-9*kNlrD!O|Lqw2Gl+eoMLFk~^l$K7WkRW6(qp}HVYAV=O z&PC(RlJvIs527DN1RIvw2(|RT!&RQU@B-y&gbAm zQis*J7glEQzGCy5&-7W*_EQg$u(qN5V1qEO8%=6jxA1ULy5=#Fziuv!#MVGQQOsKZ zRR=4_$~eYIQ&Pc+4cnN@E$}^i4~R@$lWBQtky5=$ zcvkNc`R7gT!pZ_Gtn2|{Vr7j<^BZANdABCn;>E!W>DVxVZx<2GHsZ=flbEySDbZ4A z!o!oekC;;9Ar9Aiid$7?5m2{P{Pv^D#5ZDE{Z!F>DMl>6s>Wl)NA+{?7b`H~z&MJG zQnjWb>JOBc8ci@#I3*7ipEvHKWqM^^uFvV`u*5z+iVyoVjf0`o0m;kq)|5W z4G<)vf7}ZGsuE1tu!^}UXVDDYSp+61I&1EG#{qB zGVo_l@#Rgk`1{XknC%RaBJNruRycuK_+C#FfBwZRpgB!6Ka3RTniECEZL`?^OB((M zh~bSJiDKm~v+%x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T4(08eHrk6iCA|PoMwbw-$ErP^59E<} zI+%Oo!~uE}IS`)-;jxNC<%IjMiOxPDl-T!&^LQ*7zoa#rxu` zW4WHW)CKH-eMj-hILNNsJAis0Kir_!1&pSjnlPsud82u{S~tFVjSrr-lPqT`tU4%N zg)8QT5lr&NVaX^u78&6rCu0ncq+Y1EAv$&p#oTCi2P;ccRqBnDO?+Q)w)eN-a|h64EJSp4pz73J!Sl4J{2gD>O~-*$``6KNgsUl0$;3Ye!=<(cTeVS z*n6zj9cQkhQhvybl$ISY@vo_7RN=z#B<_QkqIf86e#@(@x2$G-Cz`LqUeP=dUr6Fz zaZU^mRl`5+XCJi0^8K0*6`%Cz$s4hJk17C5XYeq2cRDYiWJ;=@#H7`{4-TBghoN;g zof%54zF0ns1lG)U#(COop5Sca=xu6VV8N+#_=LZia6#YKX+4R%&!D5P^Y1Bk`YZF@ z8@#0X5u!n7>6pidIV)d(IesB`HEDq@tIqTU{+4=2nnG_yLZ~8M#QlwL5xQlWDRiQ) zEaD;fZBmmvi;~EkDJf2OS|#&@=B~SG&6K|&W~@r#1C*5eyqJ?pUN~RRxTR!x>SF$- z-tAE5v6N3XsVdrE-hP|6`g84GwSrsah<7=)JogR|rOy?7gnmo(z3|1gE6MnmR~g3p zV6RnVg^Th1XCQsU@WjKbcwF;$8Rw2HyC3kurEAD*l5?N=T?GH$sPiAnXqb!nPk7_XLL?-`f3tMGPw%P+{|DiV|gji+9dUB!VcO)FOfp^2MuXA@Czmfa> zpDAq final ), double_qoute_nonvarname: ( - (any - [\\{"\r\n] - varname_first) -> double_qoute - | "\r" @new_line -> double_qoute - | "\n" @new_line -> double_qoute - | "\\" -> double_qoute_any - | '"' -> final + (any - [\\${"\r\n] - varname_first) -> double_qoute + | "\r" @new_line -> double_qoute + | "\n" @new_line -> double_qoute + | "\\" -> double_qoute_any + | '$' -> double_qoute_nonvarname + | '"' -> final ); main := |* diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 04888c4..a51e6ea 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -1628,3 +1628,45 @@ func TestIgnoreControllCharactersAtStringVarOffset(t *testing.T) { actual = string(tkn.Value) assert.DeepEqual(t, expected, actual) } + +func TestDoubleDollar(t *testing.T) { + src := ` Date: Mon, 28 Dec 2020 23:01:02 +0200 Subject: [PATCH 139/140] refactoring: fix naming --- internal/php5/parser_test.go | 1096 +++++++------- internal/php5/php5.go | Bin 265606 -> 265200 bytes internal/php5/php5.y | 232 +-- internal/php7/parser_test.go | 1304 ++++++++--------- internal/php7/php7.go | Bin 221511 -> 221316 bytes internal/php7/php7.y | 184 +-- pkg/ast/ast.go | 10 +- pkg/ast/node.go | 96 +- pkg/visitor/dumper/dumper.go | 86 +- pkg/visitor/dumper/dumper_test.go | 2 +- pkg/visitor/formatter/formatter.go | 76 +- pkg/visitor/formatter/formatter_test.go | 728 ++++----- pkg/visitor/nsresolver/namespace_resolver.go | 44 +- .../nsresolver/namespace_resolver_test.go | 296 ++-- pkg/visitor/null.go | 10 +- pkg/visitor/printer/printer.go | 74 +- pkg/visitor/printer/printer_php7_test.go | 4 +- pkg/visitor/printer/printer_test.go | 736 +++++----- pkg/visitor/traverser/traverser.go | 56 +- 19 files changed, 2517 insertions(+), 2517 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index ad51d2f..6c1dfde 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -38,7 +38,7 @@ func TestIdentifier(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -133,7 +133,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 5, EndPos: 19, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -141,7 +141,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 8, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -194,7 +194,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 9, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 2, @@ -209,7 +209,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -266,7 +266,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -343,7 +343,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 23, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -385,7 +385,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 28, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 3, @@ -400,7 +400,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -457,7 +457,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 35, EndPos: 37, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -534,7 +534,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 42, EndPos: 46, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -605,7 +605,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 52, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 4, @@ -620,7 +620,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 52, EndPos: 54, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -677,7 +677,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -747,7 +747,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 66, EndPos: 85, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -755,7 +755,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 69, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -827,7 +827,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 75, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 5, @@ -842,7 +842,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 75, EndPos: 77, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -899,7 +899,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 82, EndPos: 84, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -976,7 +976,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 89, EndPos: 93, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1047,7 +1047,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 99, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 6, @@ -1062,7 +1062,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 99, EndPos: 101, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1119,7 +1119,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 106, EndPos: 108, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1211,7 +1211,7 @@ func TestPhp5ArgumentNode(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1219,7 +1219,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 120, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1262,7 +1262,7 @@ func TestPhp5ArgumentNode(t *testing.T) { EndPos: 121, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 7, @@ -1277,7 +1277,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 121, EndPos: 123, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1334,7 +1334,7 @@ func TestPhp5ArgumentNode(t *testing.T) { StartPos: 128, EndPos: 130, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1455,7 +1455,7 @@ func TestPhp5ParameterNode(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1504,7 +1504,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 18, EndPos: 31, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1512,7 +1512,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 21, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1540,7 +1540,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 22, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1589,7 +1589,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 27, EndPos: 31, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1597,7 +1597,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 31, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1627,7 +1627,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 33, EndPos: 45, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1635,7 +1635,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 36, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1707,7 +1707,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 41, EndPos: 45, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1814,7 +1814,7 @@ func TestPhp5ParameterNode(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -1918,7 +1918,7 @@ func TestPhp5ParameterNode(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -1967,7 +1967,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 83, EndPos: 96, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -1975,7 +1975,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 86, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2003,7 +2003,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 87, EndPos: 91, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2052,7 +2052,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 92, EndPos: 96, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2060,7 +2060,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 96, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2090,7 +2090,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 98, EndPos: 110, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2098,7 +2098,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 101, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2170,7 +2170,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 106, EndPos: 110, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2322,7 +2322,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 127, EndPos: 140, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2330,7 +2330,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 130, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2358,7 +2358,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 131, EndPos: 135, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2407,7 +2407,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 136, EndPos: 140, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2415,7 +2415,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 140, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2445,7 +2445,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 142, EndPos: 154, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2453,7 +2453,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 145, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2525,7 +2525,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 150, EndPos: 154, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2690,7 +2690,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 178, EndPos: 191, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2698,7 +2698,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 181, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2726,7 +2726,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 182, EndPos: 186, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2775,7 +2775,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 187, EndPos: 191, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2783,7 +2783,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 191, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2813,7 +2813,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 193, EndPos: 205, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2821,7 +2821,7 @@ func TestPhp5ParameterNode(t *testing.T) { EndPos: 196, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -2893,7 +2893,7 @@ func TestPhp5ParameterNode(t *testing.T) { StartPos: 201, EndPos: 205, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3074,7 +3074,7 @@ func TestName(t *testing.T) { StartPos: 3, EndPos: 8, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3082,7 +3082,7 @@ func TestName(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3233,7 +3233,7 @@ func TestFullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3372,7 +3372,7 @@ func TestRelative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3522,7 +3522,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3660,7 +3660,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3798,7 +3798,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3955,7 +3955,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3999,7 +3999,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4155,7 +4155,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4185,7 +4185,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndPos: 15, }, }, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4352,7 +4352,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndPos: 11, }, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4510,7 +4510,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndPos: 11, }, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4721,7 +4721,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { StartPos: 10, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4923,7 +4923,7 @@ LBL; StartPos: 15, EndPos: 19, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -5096,7 +5096,7 @@ LBL; StartPos: 17, EndPos: 21, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -6682,7 +6682,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -6870,7 +6870,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -6990,7 +6990,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -7181,7 +7181,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7433,7 +7433,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7553,7 +7553,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -7661,7 +7661,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 40, EndPos: 42, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -7868,7 +7868,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8233,7 +8233,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8304,7 +8304,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8482,7 +8482,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8617,7 +8617,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8772,7 +8772,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8950,7 +8950,7 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9107,7 +9107,7 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9306,7 +9306,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9441,7 +9441,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9596,7 +9596,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9755,7 +9755,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9914,7 +9914,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9967,7 +9967,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, }, }, - Extends: &ast.NameName{ + Extends: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9975,7 +9975,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { EndPos: 30, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10148,7 +10148,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10202,7 +10202,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10210,7 +10210,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10384,7 +10384,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10438,7 +10438,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10446,7 +10446,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10479,7 +10479,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10487,7 +10487,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndPos: 38, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12401,7 +12401,7 @@ func TestStmtEcho(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12574,7 +12574,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12840,7 +12840,7 @@ func TestStmtFor(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -12940,7 +12940,7 @@ func TestStmtFor(t *testing.T) { StartPos: 15, EndPos: 17, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13052,7 +13052,7 @@ func TestStmtFor(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13109,7 +13109,7 @@ func TestStmtFor(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13313,7 +13313,7 @@ func TestStmtFor_Alt(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13425,7 +13425,7 @@ func TestStmtFor_Alt(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13633,7 +13633,7 @@ func TestStmtForeach(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13682,7 +13682,7 @@ func TestStmtForeach(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13906,7 +13906,7 @@ func TestStmtForeach_Expr(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14080,7 +14080,7 @@ func TestStmtForeach_Alt(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14129,7 +14129,7 @@ func TestStmtForeach_Alt(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14325,7 +14325,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14374,7 +14374,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14435,7 +14435,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14659,7 +14659,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14720,7 +14720,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14894,7 +14894,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14943,7 +14943,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15026,7 +15026,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15188,7 +15188,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15237,7 +15237,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15345,7 +15345,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15491,7 +15491,7 @@ func TestStmtFunction(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15637,7 +15637,7 @@ func TestStmtFunction_Return(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15812,7 +15812,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15887,7 +15887,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15965,7 +15965,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 35, EndPos: 37, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16068,7 +16068,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 47, EndPos: 49, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16206,7 +16206,7 @@ func TestStmtFunction_Ref(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16408,7 +16408,7 @@ func TestStmtGlobal(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16521,7 +16521,7 @@ func TestStmtGlobal_Vars(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16560,7 +16560,7 @@ func TestStmtGlobal_Vars(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16621,14 +16621,14 @@ func TestStmtGlobal_Vars(t *testing.T) { }, }, }, - VarName: &ast.ExprVariable{ + Name: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, EndPos: 21, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16688,14 +16688,14 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 25, }, }, - VarName: &ast.ExprFunctionCall{ + Name: &ast.ExprFunctionCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 30, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16703,7 +16703,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16829,7 +16829,7 @@ func TestStmtGotoLabel(t *testing.T) { StartPos: 3, EndPos: 5, }, - LabelName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17134,7 +17134,7 @@ func TestStmtIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17296,7 +17296,7 @@ func TestStmtIf_ElseIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17426,7 +17426,7 @@ func TestStmtIf_ElseIf(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17590,7 +17590,7 @@ func TestStmtIf_Else(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17823,7 +17823,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17953,7 +17953,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18083,7 +18083,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 37, EndPos: 39, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18318,7 +18318,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18448,7 +18448,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18608,7 +18608,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 38, EndPos: 40, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18895,7 +18895,7 @@ func TestStmtInterface(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19021,7 +19021,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19075,7 +19075,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, }, Extends: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19083,7 +19083,7 @@ func TestStmtInterface_Extend(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19212,7 +19212,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19266,7 +19266,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, Extends: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19274,7 +19274,7 @@ func TestStmtInterface_Extends(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19307,7 +19307,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19315,7 +19315,7 @@ func TestStmtInterface_Extends(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19456,7 +19456,7 @@ func TestStmtNamespace(t *testing.T) { }, }, }, - Name: &ast.NameName{ + Name: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19464,7 +19464,7 @@ func TestStmtNamespace(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19569,7 +19569,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, }, }, - Name: &ast.NameName{ + Name: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19577,7 +19577,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19800,7 +19800,7 @@ func TestStmtProperty(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19882,7 +19882,7 @@ func TestStmtProperty(t *testing.T) { Value: []byte("var"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -19897,7 +19897,7 @@ func TestStmtProperty(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20015,7 +20015,7 @@ func TestStmtProperty_Properties(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20128,7 +20128,7 @@ func TestStmtProperty_Properties(t *testing.T) { Value: []byte("static"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -20143,7 +20143,7 @@ func TestStmtProperty_Properties(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20190,7 +20190,7 @@ func TestStmtProperty_Properties(t *testing.T) { StartPos: 32, EndPos: 34, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20373,7 +20373,7 @@ func TestStmtProperty_Properties2(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20486,7 +20486,7 @@ func TestStmtProperty_Properties2(t *testing.T) { Value: []byte("static"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -20501,7 +20501,7 @@ func TestStmtProperty_Properties2(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20601,7 +20601,7 @@ func TestStmtProperty_Properties2(t *testing.T) { StartPos: 36, EndPos: 38, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20746,7 +20746,7 @@ func TestStmtStaticVar(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20867,7 +20867,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20914,7 +20914,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21100,7 +21100,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21200,7 +21200,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21395,7 +21395,7 @@ func TestStmtSwitch(t *testing.T) { }, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -21794,7 +21794,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { EndPos: 18, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -22184,7 +22184,7 @@ func TestStmtSwitch_Alt(t *testing.T) { }, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -22552,7 +22552,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { EndPos: 18, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -22799,7 +22799,7 @@ func TestStmtThrow(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22903,7 +22903,7 @@ func TestStmtTrait(t *testing.T) { }, }, }, - TraitName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23029,7 +23029,7 @@ func TestStmtTraitUse(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23113,7 +23113,7 @@ func TestStmtTraitUse(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23121,7 +23121,7 @@ func TestStmtTraitUse(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23251,7 +23251,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23335,7 +23335,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23343,7 +23343,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23376,7 +23376,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23384,7 +23384,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23526,7 +23526,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23610,7 +23610,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23618,7 +23618,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23651,7 +23651,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23659,7 +23659,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23823,7 +23823,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23907,7 +23907,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23915,7 +23915,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23948,7 +23948,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23956,7 +23956,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24236,7 +24236,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24320,7 +24320,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24328,7 +24328,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24361,7 +24361,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24369,7 +24369,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24680,7 +24680,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24764,7 +24764,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24772,7 +24772,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24805,7 +24805,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24813,7 +24813,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24889,7 +24889,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 30, EndPos: 58, }, - Trait: &ast.NameName{ + Trait: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24897,7 +24897,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24982,7 +24982,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, Insteadof: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24990,7 +24990,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 52, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25023,7 +25023,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25031,7 +25031,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 58, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25095,7 +25095,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 60, EndPos: 75, }, - Trait: &ast.NameName{ + Trait: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25103,7 +25103,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 63, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25522,7 +25522,7 @@ func TestStmtTry_TryCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25530,7 +25530,7 @@ func TestStmtTry_TryCatch(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25559,7 +25559,7 @@ func TestStmtTry_TryCatch(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25785,7 +25785,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25793,7 +25793,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25822,7 +25822,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25950,7 +25950,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25958,7 +25958,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 59, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -25987,7 +25987,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { StartPos: 60, EndPos: 62, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -26213,7 +26213,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -26221,7 +26221,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -26250,7 +26250,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -26538,7 +26538,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26546,7 +26546,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 26, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26575,7 +26575,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26721,7 +26721,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26750,7 +26750,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26906,7 +26906,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26935,7 +26935,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 101, EndPos: 103, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27092,7 +27092,7 @@ func TestStmtUnset(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27213,7 +27213,7 @@ func TestStmtUnset_Vars(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27240,7 +27240,7 @@ func TestStmtUnset_Vars(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27328,7 +27328,7 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27367,15 +27367,15 @@ func TestStmtUse(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27383,7 +27383,7 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27451,7 +27451,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27490,8 +27490,8 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27520,7 +27520,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27528,7 +27528,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27584,7 +27584,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27623,8 +27623,8 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27653,7 +27653,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27661,7 +27661,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 11, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27770,7 +27770,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27809,15 +27809,15 @@ func TestStmtUse_List(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27825,7 +27825,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27859,14 +27859,14 @@ func TestStmtUse_List(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 15, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27874,7 +27874,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27954,7 +27954,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27993,15 +27993,15 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28009,7 +28009,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28043,14 +28043,14 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 22, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28058,7 +28058,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28191,7 +28191,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28261,15 +28261,15 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, Value: []byte("function"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 19, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28277,7 +28277,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28311,7 +28311,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28340,7 +28340,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28348,7 +28348,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28416,7 +28416,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28486,15 +28486,15 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, Value: []byte("function"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 26, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28502,7 +28502,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28589,7 +28589,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { Value: []byte("foo"), }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28618,7 +28618,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28626,7 +28626,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28747,7 +28747,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28817,15 +28817,15 @@ func TestStmtUse_ListConstType(t *testing.T) { }, Value: []byte("const"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, EndPos: 16, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28833,7 +28833,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28867,7 +28867,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28896,7 +28896,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28904,7 +28904,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28972,7 +28972,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29042,15 +29042,15 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, Value: []byte("const"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, EndPos: 23, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29058,7 +29058,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29145,7 +29145,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { Value: []byte("foo"), }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29174,7 +29174,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29182,7 +29182,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30035,7 +30035,7 @@ func TestExprArrayDimFetch(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30178,7 +30178,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30711,7 +30711,7 @@ func TestExprArray_Items(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30853,7 +30853,7 @@ func TestExprBitwiseNot(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30960,7 +30960,7 @@ func TestExprBooleanNot(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31028,7 +31028,7 @@ func TestExprClassConstFetch(t *testing.T) { StartPos: 3, EndPos: 11, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31036,7 +31036,7 @@ func TestExprClassConstFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31089,7 +31089,7 @@ func TestExprClassConstFetch(t *testing.T) { EndPos: 8, }, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31207,7 +31207,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { EndPos: 11, }, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31330,7 +31330,7 @@ func TestExprClone_Brackets(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31448,7 +31448,7 @@ func TestExprClone(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31706,7 +31706,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31741,7 +31741,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31841,7 +31841,7 @@ func TestExprClosure_Use(t *testing.T) { }, }, }, - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ Position: &position.Position{ StartLine: 1, @@ -31856,7 +31856,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31913,7 +31913,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32095,7 +32095,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32130,7 +32130,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32230,7 +32230,7 @@ func TestExprClosure_Use2(t *testing.T) { }, }, }, - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ Position: &position.Position{ StartLine: 1, @@ -32255,7 +32255,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 26, EndPos: 28, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32290,7 +32290,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32427,7 +32427,7 @@ func TestExprConstFetch(t *testing.T) { StartPos: 3, EndPos: 6, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32435,7 +32435,7 @@ func TestExprConstFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32576,7 +32576,7 @@ func TestExprConstFetch_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32685,7 +32685,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32803,7 +32803,7 @@ func TestExprEmpty(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32920,7 +32920,7 @@ func TestExprErrorSuppress(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33037,7 +33037,7 @@ func TestExprEval(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33344,7 +33344,7 @@ func TestExprExit_Expr(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33651,7 +33651,7 @@ func TestExprDie_Expr(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33729,7 +33729,7 @@ func TestExprFunctionCall(t *testing.T) { StartPos: 3, EndPos: 8, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33737,7 +33737,7 @@ func TestExprFunctionCall(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33898,7 +33898,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34027,7 +34027,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34058,7 +34058,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -34161,7 +34161,7 @@ func TestExprFunctionCall_Var(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34213,7 +34213,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -34238,14 +34238,14 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 13, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34338,7 +34338,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { StartPos: 3, EndPos: 15, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34346,7 +34346,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 7, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34399,7 +34399,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -34421,7 +34421,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34538,7 +34538,7 @@ func TestExprPostDec(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34645,7 +34645,7 @@ func TestExprPostInc(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34784,7 +34784,7 @@ func TestExprPreDec(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34891,7 +34891,7 @@ func TestExprPreInc(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34998,7 +34998,7 @@ func TestExprInclude(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35117,7 +35117,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35236,7 +35236,7 @@ func TestExprRequire(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35355,7 +35355,7 @@ func TestExprRequire_Once(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35442,7 +35442,7 @@ func TestExprInstanceOf(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35506,7 +35506,7 @@ func TestExprInstanceOf(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35514,7 +35514,7 @@ func TestExprInstanceOf(t *testing.T) { EndPos: 20, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35602,7 +35602,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35706,7 +35706,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35782,7 +35782,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35876,7 +35876,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35995,7 +35995,7 @@ func TestExprIsset(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36124,7 +36124,7 @@ func TestExprIsset_Variables(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36151,7 +36151,7 @@ func TestExprIsset_Variables(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36346,7 +36346,7 @@ func TestExprList_Empty(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36490,7 +36490,7 @@ func TestExprList(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36552,7 +36552,7 @@ func TestExprList(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36703,7 +36703,7 @@ func TestExprList_ArrayIndex(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36786,7 +36786,7 @@ func TestExprList_ArrayIndex(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36965,7 +36965,7 @@ func TestExprList_List(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37040,7 +37040,7 @@ func TestExprList_List(t *testing.T) { StartPos: 20, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37185,7 +37185,7 @@ func TestExprList_EmptyItem(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37271,7 +37271,7 @@ func TestExprList_EmptyItem(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37417,7 +37417,7 @@ func TestExprList_EmptyItems(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37548,7 +37548,7 @@ func TestExprList_EmptyItems(t *testing.T) { StartPos: 20, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37635,7 +37635,7 @@ func TestExprMethodCall(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37806,7 +37806,7 @@ func TestExprNew(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37814,7 +37814,7 @@ func TestExprNew(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37967,7 +37967,7 @@ func TestExprNew_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38118,7 +38118,7 @@ func TestExprNew_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38263,7 +38263,7 @@ func TestExprPrint(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38351,7 +38351,7 @@ func TestExprPropertyFetch(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38403,7 +38403,7 @@ func TestExprPropertyFetch(t *testing.T) { EndPos: 7, }, }, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38529,7 +38529,7 @@ func TestExprShellExec(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38942,7 +38942,7 @@ func TestExprShortArray_Items(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39045,7 +39045,7 @@ func TestExprStaticCall(t *testing.T) { StartPos: 3, EndPos: 13, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39053,7 +39053,7 @@ func TestExprStaticCall(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39243,7 +39243,7 @@ func TestExprStaticCall_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39401,7 +39401,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39519,7 +39519,7 @@ func TestExprStaticCall_Var(t *testing.T) { StartPos: 3, EndPos: 14, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39527,7 +39527,7 @@ func TestExprStaticCall_Var(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39587,7 +39587,7 @@ func TestExprStaticCall_Var(t *testing.T) { StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39682,7 +39682,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39741,7 +39741,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39829,7 +39829,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { StartPos: 3, EndPos: 12, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39837,7 +39837,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39890,14 +39890,14 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 8, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40015,7 +40015,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40046,14 +40046,14 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndPos: 18, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 18, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40161,7 +40161,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40192,14 +40192,14 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndPos: 9, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40267,14 +40267,14 @@ func TestExprTernary(t *testing.T) { StartPos: 3, EndPos: 15, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40345,7 +40345,7 @@ func TestExprTernary(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40406,7 +40406,7 @@ func TestExprTernary(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40486,14 +40486,14 @@ func TestExprTernary_Simple(t *testing.T) { StartPos: 3, EndPos: 12, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40586,7 +40586,7 @@ func TestExprTernary_Simple(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40666,14 +40666,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 3, EndPos: 25, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40744,14 +40744,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 8, EndPos: 20, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40812,7 +40812,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40873,7 +40873,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40935,7 +40935,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 23, EndPos: 25, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41015,21 +41015,21 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 3, EndPos: 25, }, - Condition: &ast.ExprTernary{ + Cond: &ast.ExprTernary{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 15, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41100,7 +41100,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41161,7 +41161,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41223,7 +41223,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41284,7 +41284,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 23, EndPos: 25, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41403,7 +41403,7 @@ func TestExprUnaryMinus(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41510,7 +41510,7 @@ func TestExprUnaryPlus(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41578,7 +41578,7 @@ func TestExprVariable(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41699,14 +41699,14 @@ func TestExprVariable_Variable(t *testing.T) { }, }, }, - VarName: &ast.ExprVariable{ + Name: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41886,14 +41886,14 @@ func TestExprYield_Val(t *testing.T) { }, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42012,7 +42012,7 @@ func TestExprYield_KeyVal(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42066,14 +42066,14 @@ func TestExprYield_KeyVal(t *testing.T) { }, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42185,7 +42185,7 @@ func TestExprYield_Expr(t *testing.T) { }, }, }, - Value: &ast.ScalarLnumber{ + Val: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42303,7 +42303,7 @@ func TestExprYield_KeyExpr(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42357,7 +42357,7 @@ func TestExprYield_KeyExpr(t *testing.T) { }, }, }, - Value: &ast.ScalarLnumber{ + Val: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42461,7 +42461,7 @@ func TestExprAssign(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -42532,7 +42532,7 @@ func TestExprAssign(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -42597,7 +42597,7 @@ func TestExprAssign(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -42668,7 +42668,7 @@ func TestExprAssign(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -42733,7 +42733,7 @@ func TestExprAssign(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -42826,7 +42826,7 @@ func TestExprAssign(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -42834,7 +42834,7 @@ func TestExprAssign(t *testing.T) { EndPos: 41, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -42901,7 +42901,7 @@ func TestExprAssign(t *testing.T) { StartPos: 45, EndPos: 47, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -42994,7 +42994,7 @@ func TestExprAssign(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -43002,7 +43002,7 @@ func TestExprAssign(t *testing.T) { EndPos: 58, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -43045,7 +43045,7 @@ func TestExprAssign(t *testing.T) { EndPos: 59, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 5, @@ -43060,7 +43060,7 @@ func TestExprAssign(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -43126,7 +43126,7 @@ func TestExprAssign(t *testing.T) { StartPos: 66, EndPos: 68, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -43187,7 +43187,7 @@ func TestExprAssign(t *testing.T) { StartPos: 72, EndPos: 74, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -43252,7 +43252,7 @@ func TestExprAssign(t *testing.T) { StartPos: 78, EndPos: 80, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -43313,7 +43313,7 @@ func TestExprAssign(t *testing.T) { StartPos: 84, EndPos: 86, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -43378,7 +43378,7 @@ func TestExprAssign(t *testing.T) { StartPos: 90, EndPos: 92, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -43439,7 +43439,7 @@ func TestExprAssign(t *testing.T) { StartPos: 96, EndPos: 98, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -43504,7 +43504,7 @@ func TestExprAssign(t *testing.T) { StartPos: 102, EndPos: 104, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -43565,7 +43565,7 @@ func TestExprAssign(t *testing.T) { StartPos: 108, EndPos: 110, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -43630,7 +43630,7 @@ func TestExprAssign(t *testing.T) { StartPos: 114, EndPos: 116, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -43691,7 +43691,7 @@ func TestExprAssign(t *testing.T) { StartPos: 120, EndPos: 122, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -43756,7 +43756,7 @@ func TestExprAssign(t *testing.T) { StartPos: 126, EndPos: 128, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -43817,7 +43817,7 @@ func TestExprAssign(t *testing.T) { StartPos: 132, EndPos: 134, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -43882,7 +43882,7 @@ func TestExprAssign(t *testing.T) { StartPos: 138, EndPos: 140, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -43943,7 +43943,7 @@ func TestExprAssign(t *testing.T) { StartPos: 144, EndPos: 146, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -44008,7 +44008,7 @@ func TestExprAssign(t *testing.T) { StartPos: 150, EndPos: 152, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -44069,7 +44069,7 @@ func TestExprAssign(t *testing.T) { StartPos: 156, EndPos: 158, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -44134,7 +44134,7 @@ func TestExprAssign(t *testing.T) { StartPos: 162, EndPos: 164, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -44195,7 +44195,7 @@ func TestExprAssign(t *testing.T) { StartPos: 168, EndPos: 170, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -44260,7 +44260,7 @@ func TestExprAssign(t *testing.T) { StartPos: 174, EndPos: 176, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -44321,7 +44321,7 @@ func TestExprAssign(t *testing.T) { StartPos: 181, EndPos: 183, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -44386,7 +44386,7 @@ func TestExprAssign(t *testing.T) { StartPos: 187, EndPos: 189, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -44447,7 +44447,7 @@ func TestExprAssign(t *testing.T) { StartPos: 194, EndPos: 196, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -44512,7 +44512,7 @@ func TestExprAssign(t *testing.T) { StartPos: 200, EndPos: 202, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -44573,7 +44573,7 @@ func TestExprAssign(t *testing.T) { StartPos: 207, EndPos: 209, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -44687,7 +44687,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -44758,7 +44758,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -44823,7 +44823,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -44884,7 +44884,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 21, EndPos: 23, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -44949,7 +44949,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -45010,7 +45010,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 32, EndPos: 34, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -45075,7 +45075,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 38, EndPos: 40, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -45136,7 +45136,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 44, EndPos: 46, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -45201,7 +45201,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 50, EndPos: 52, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -45262,7 +45262,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 56, EndPos: 58, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -45327,7 +45327,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 62, EndPos: 64, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -45388,7 +45388,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 67, EndPos: 69, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -45453,7 +45453,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 73, EndPos: 75, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -45514,7 +45514,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 78, EndPos: 80, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -45579,7 +45579,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 84, EndPos: 86, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -45640,7 +45640,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 90, EndPos: 92, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -45705,7 +45705,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 96, EndPos: 98, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -45766,7 +45766,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 102, EndPos: 104, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -45831,7 +45831,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 108, EndPos: 110, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -45892,7 +45892,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 113, EndPos: 115, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -45957,7 +45957,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 119, EndPos: 121, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -46018,7 +46018,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 126, EndPos: 128, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -46083,7 +46083,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 132, EndPos: 134, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -46144,7 +46144,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 139, EndPos: 141, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -46209,7 +46209,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 145, EndPos: 147, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -46270,7 +46270,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 151, EndPos: 153, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -46335,7 +46335,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 157, EndPos: 159, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -46396,7 +46396,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 164, EndPos: 166, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -46461,7 +46461,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 170, EndPos: 172, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -46522,7 +46522,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 175, EndPos: 177, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -46587,7 +46587,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 181, EndPos: 183, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -46648,7 +46648,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 186, EndPos: 188, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -46713,7 +46713,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 192, EndPos: 194, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -46774,7 +46774,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 197, EndPos: 199, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -46839,7 +46839,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 203, EndPos: 205, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 19, EndLine: 19, @@ -46900,7 +46900,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 209, EndPos: 211, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 19, EndLine: 19, @@ -46965,7 +46965,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 215, EndPos: 217, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 20, EndLine: 20, @@ -47026,7 +47026,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 222, EndPos: 224, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 20, EndLine: 20, @@ -47091,7 +47091,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 228, EndPos: 230, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 21, EndLine: 21, @@ -47152,7 +47152,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 233, EndPos: 235, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 21, EndLine: 21, @@ -47217,7 +47217,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 239, EndPos: 241, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 22, EndLine: 22, @@ -47278,7 +47278,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 245, EndPos: 247, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 22, EndLine: 22, @@ -47343,7 +47343,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 251, EndPos: 253, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 23, EndLine: 23, @@ -47404,7 +47404,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 257, EndPos: 259, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 23, EndLine: 23, @@ -47469,7 +47469,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 263, EndPos: 265, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 24, EndLine: 24, @@ -47530,7 +47530,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 269, EndPos: 271, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 24, EndLine: 24, @@ -47595,7 +47595,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 275, EndPos: 277, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 25, EndLine: 25, @@ -47656,7 +47656,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 281, EndPos: 283, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 25, EndLine: 25, @@ -47721,7 +47721,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 287, EndPos: 289, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 26, EndLine: 26, @@ -47782,7 +47782,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 292, EndPos: 294, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 26, EndLine: 26, @@ -47914,7 +47914,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -47989,7 +47989,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -48064,7 +48064,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 39, EndPos: 41, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -48139,7 +48139,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 53, EndPos: 55, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -48214,7 +48214,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 66, EndPos: 68, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -48289,7 +48289,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 81, EndPos: 83, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -48364,7 +48364,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 92, EndPos: 94, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -48439,7 +48439,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 106, EndPos: 108, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -48514,7 +48514,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 120, EndPos: 122, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -48589,7 +48589,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 134, EndPos: 136, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -48664,7 +48664,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 147, EndPos: 149, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -49322,7 +49322,7 @@ CAD; StartPos: 79, EndPos: 85, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f93f178b08a189954f823aaf5bf7b5d3b0aa0eb0..b213c534b1e0b358971a8c5125a8c1b77da0c2fb 100644 GIT binary patch delta 2563 zcmbtVYfzMB6rOX=vcN72i^*MJ(FPS-TtJko3Fci)O|2vebG(3J2!lFm+JfVzUT73&w0-Co^SJe z=1w-39)P3a(hv?7kV_Vrtmk*9z)W6~2FE0E6eNJlz9b4Nkl!|75SJ|n3s-eg0+(9B zho|R5fNnw2vLg0vr2wuU2_w15iqpBq24?;y5=Zdr7+6WOa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2f!C$o1G|*&;UN->-0(=_y5I}qI MfPh)t7NSf42hhRFtN;K2 diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 54e00b5..41ef5e4 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -293,7 +293,7 @@ namespace_name: { $$ = &ParserSeparatedList{ Items: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, @@ -303,7 +303,7 @@ namespace_name: } | namespace_name T_NS_SEPARATOR T_STRING { - part := &ast.NameNamePart{ + part := &ast.NamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($3), StringTkn: $3, Value: $3.Value, @@ -349,7 +349,7 @@ top_statement: $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, - Name: &ast.NameName{ + Name: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -362,7 +362,7 @@ top_statement: $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, - Name: &ast.NameName{ + Name: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -384,17 +384,17 @@ top_statement: } | T_USE use_declarations ';' { - $$ = &ast.StmtUse{ + $$ = &ast.StmtUseList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), UseTkn: $1, - UseDeclarations: $2.(*ParserSeparatedList).Items, + Uses: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } } | T_USE T_FUNCTION use_function_declarations ';' { - $$ = &ast.StmtUse{ + $$ = &ast.StmtUseList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, Type: &ast.Identifier{ @@ -402,14 +402,14 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ParserSeparatedList).Items, + Uses: $3.(*ParserSeparatedList).Items, SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } } | T_USE T_CONST use_const_declarations ';' { - $$ = &ast.StmtUse{ + $$ = &ast.StmtUseList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), UseTkn: $1, Type: &ast.Identifier{ @@ -417,7 +417,7 @@ top_statement: IdentifierTkn: $2, Value: $2.Value, }, - UseDeclarations: $3.(*ParserSeparatedList).Items, + Uses: $3.(*ParserSeparatedList).Items, SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } @@ -449,9 +449,9 @@ use_declarations: use_declaration: namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -460,9 +460,9 @@ use_declaration: } | namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -477,10 +477,10 @@ use_declaration: } | T_NS_SEPARATOR namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -489,10 +489,10 @@ use_declaration: } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -526,9 +526,9 @@ use_function_declarations: use_function_declaration: namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -537,9 +537,9 @@ use_function_declaration: } | namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -554,10 +554,10 @@ use_function_declaration: } | T_NS_SEPARATOR namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -566,10 +566,10 @@ use_function_declaration: } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -603,9 +603,9 @@ use_const_declarations: use_const_declaration: namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -614,9 +614,9 @@ use_const_declaration: } | namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -631,10 +631,10 @@ use_const_declaration: } | T_NS_SEPARATOR namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokenNodeListPosition($1, $2.(*ParserSeparatedList).Items), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -643,10 +643,10 @@ use_const_declaration: } | T_NS_SEPARATOR namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), NsSeparatorTkn: $1, - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -755,7 +755,7 @@ statement: { $$ = &ast.StmtLabel{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), - LabelName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -1115,7 +1115,7 @@ catch_statement: Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -1179,7 +1179,7 @@ additional_catch: Types: []ast.Vertex{$3}, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -1259,7 +1259,7 @@ unticked_function_declaration_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $9), FunctionTkn: $1, AmpersandTkn: $2, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -1287,7 +1287,7 @@ unticked_class_declaration_statement: } n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) - n.ClassName = className + n.Name = className n.OpenCurlyBracketTkn = $5 n.Stmts = $6 n.CloseCurlyBracketTkn = $7 @@ -1310,7 +1310,7 @@ unticked_class_declaration_statement: } n.Position = yylex.(*Parser).builder.NewNodeTokenPosition($1, $7) - n.TraitName = traitName + n.Name = traitName n.OpenCurlyBracketTkn = $5 n.Stmts = $6 n.CloseCurlyBracketTkn = $7 @@ -1331,7 +1331,7 @@ unticked_class_declaration_statement: iface := &ast.StmtInterface{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), InterfaceTkn: $1, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -1631,7 +1631,7 @@ switch_case_list: $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, - CaseList: $2, + Cases: $2, CloseCurlyBracketTkn: $3, } } @@ -1641,7 +1641,7 @@ switch_case_list: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), OpenCurlyBracketTkn: $1, CaseSeparatorTkn: $2, - CaseList: $3, + Cases: $3, CloseCurlyBracketTkn: $4, } } @@ -1650,7 +1650,7 @@ switch_case_list: $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ColonTkn: $1, - CaseList: $2, + Cases: $2, EndSwitchTkn: $3, SemiColonTkn: $4, } @@ -1661,7 +1661,7 @@ switch_case_list: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), ColonTkn: $1, CaseSeparatorTkn: $2, - CaseList: $3, + Cases: $3, EndSwitchTkn: $4, SemiColonTkn: $5, } @@ -1857,7 +1857,7 @@ parameter: VariadicTkn: $3, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -1883,7 +1883,7 @@ parameter: VariadicTkn: $3, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -2030,7 +2030,7 @@ global_var: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2042,7 +2042,7 @@ global_var: $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DollarTkn: $1, - VarName: $2, + Name: $2, } } | '$' '{' expr '}' @@ -2051,7 +2051,7 @@ global_var: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, OpenCurlyBracketTkn: $2, - VarName: $3, + Name: $3, CloseCurlyBracketTkn: $4, } } @@ -2065,7 +2065,7 @@ static_var_list: Position: yylex.(*Parser).builder.NewTokenPosition($3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -2082,7 +2082,7 @@ static_var_list: Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -2103,7 +2103,7 @@ static_var_list: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2121,7 +2121,7 @@ static_var_list: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2154,7 +2154,7 @@ class_statement: $$ = &ast.StmtPropertyList{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $3), Modifiers: $1, - Properties: $2.(*ParserSeparatedList).Items, + Props: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $3, } @@ -2181,7 +2181,7 @@ class_statement: Modifiers: $1, FunctionTkn: $2, AmpersandTkn: $3, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -2512,7 +2512,7 @@ class_variable_declaration: Position: yylex.(*Parser).builder.NewTokenPosition($3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -2531,7 +2531,7 @@ class_variable_declaration: Position: yylex.(*Parser).builder.NewTokenNodePosition($3, $5), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -2554,7 +2554,7 @@ class_variable_declaration: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2573,7 +2573,7 @@ class_variable_declaration: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2744,7 +2744,7 @@ new_expr: NewTkn: $1, Class: $2, OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ArgumentList).Arguments, + Args: $3.(*ArgumentList).Arguments, SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } @@ -2802,7 +2802,7 @@ expr_without_variable: NewTkn: $4, Class: $5, OpenParenthesisTkn: $6.(*ArgumentList).OpenParenthesisTkn, - Arguments: $6.(*ArgumentList).Arguments, + Args: $6.(*ArgumentList).Arguments, SeparatorTkns: $6.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $6.(*ArgumentList).CloseParenthesisTkn, } @@ -3281,7 +3281,7 @@ expr_without_variable: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), - Condition: $1, + Cond: $1, QuestionTkn: $2, IfTrue: $3, ColonTkn: $4, @@ -3292,7 +3292,7 @@ expr_without_variable: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), - Condition: $1, + Cond: $1, QuestionTkn: $2, ColonTkn: $3, IfFalse: $4, @@ -3462,7 +3462,7 @@ yield_expr: $$ = &ast.ExprYield{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, - Value: $2, + Val: $2, } } | T_YIELD variable @@ -3470,7 +3470,7 @@ yield_expr: $$ = &ast.ExprYield{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, - Value: $2, + Val: $2, } } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable @@ -3480,7 +3480,7 @@ yield_expr: YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, - Value: $4, + Val: $4, } } | T_YIELD expr T_DOUBLE_ARROW variable @@ -3490,7 +3490,7 @@ yield_expr: YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, - Value: $4, + Val: $4, } } ; @@ -3583,7 +3583,7 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ParserSeparatedList).Items, + Uses: $3.(*ParserSeparatedList).Items, UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } @@ -3597,7 +3597,7 @@ lexical_var_list: Position: yylex.(*Parser).builder.NewTokenPosition($3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($3), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -3617,7 +3617,7 @@ lexical_var_list: AmpersandTkn: $3, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -3636,7 +3636,7 @@ lexical_var_list: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -3655,7 +3655,7 @@ lexical_var_list: AmpersandTkn: $1, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($2), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -3674,13 +3674,13 @@ function_call: { $$ = &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodeListNodePosition($1.(*ParserSeparatedList).Items, $2), - Function: &ast.NameName{ + Function: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ArgumentList).Arguments, + Args: $2.(*ArgumentList).Arguments, SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } @@ -3697,7 +3697,7 @@ function_call: SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3713,7 +3713,7 @@ function_call: SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ArgumentList).Arguments, + Args: $3.(*ArgumentList).Arguments, SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } @@ -3726,7 +3726,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3747,7 +3747,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3760,7 +3760,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3781,7 +3781,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3792,7 +3792,7 @@ function_call: Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ArgumentList).Arguments, + Args: $2.(*ArgumentList).Arguments, SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } @@ -3810,7 +3810,7 @@ class_name: } | namespace_name { - $$ = &ast.NameName{ + $$ = &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -3840,7 +3840,7 @@ class_name: fully_qualified_class_name: namespace_name { - $$ = &ast.NameName{ + $$ = &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -4105,7 +4105,7 @@ static_class_constant: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -4134,7 +4134,7 @@ static_scalar_value: { $$ = &ast.ExprConstFetch{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Const: &ast.NameName{ + Const: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -4461,7 +4461,7 @@ static_operation: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), - Condition: $1, + Cond: $1, QuestionTkn: $2, ColonTkn: $3, IfFalse: $4, @@ -4471,7 +4471,7 @@ static_operation: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), - Condition: $1, + Cond: $1, QuestionTkn: $2, IfTrue: $3, ColonTkn: $4, @@ -4514,7 +4514,7 @@ general_constant: { $$ = &ast.ExprConstFetch{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Const: &ast.NameName{ + Const: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -4553,7 +4553,7 @@ scalar: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -4750,7 +4750,7 @@ variable: $3 = append($3, &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, - Arguments: mc.Arguments, + Args: mc.Args, SeparatorTkns: mc.SeparatorTkns, CloseParenthesisTkn: mc.CloseParenthesisTkn, }, @@ -4758,7 +4758,7 @@ variable: $3 = append($3, $4[1:len($4)]...) case *ast.ExprPropertyFetch: $4[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn - $4[0].(*ast.ExprMethodCall).Method = l.Property + $4[0].(*ast.ExprMethodCall).Method = l.Prop $4[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn $4[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn $3 = append($3[:len($3)-1], $4...) @@ -4844,7 +4844,7 @@ variable_property: $2 = append($2, &ast.ExprFunctionCall{ Position: yylex.(*Parser).builder.NewNodePosition(mc), OpenParenthesisTkn: mc.OpenParenthesisTkn, - Arguments: mc.Arguments, + Args: mc.Args, SeparatorTkns: mc.SeparatorTkns, CloseParenthesisTkn: mc.OpenParenthesisTkn, }, @@ -4852,7 +4852,7 @@ variable_property: $2 = append($2, $3[1:len($3)]...) case *ast.ExprPropertyFetch: $3[0].(*ast.ExprMethodCall).OpenCurlyBracketTkn = l.OpenCurlyBracketTkn - $3[0].(*ast.ExprMethodCall).Method = l.Property + $3[0].(*ast.ExprMethodCall).Method = l.Prop $3[0].(*ast.ExprMethodCall).CloseCurlyBracketTkn = l.CloseCurlyBracketTkn $3[0].(*ast.ExprMethodCall).ObjectOperatorTkn = l.ObjectOperatorTkn $2 = append($2[:len($2)-1], $3...) @@ -4896,7 +4896,7 @@ method: $$ = &ast.ExprMethodCall{ Position: yylex.(*Parser).builder.NewNodePosition($1), OpenParenthesisTkn: $1.(*ArgumentList).OpenParenthesisTkn, - Arguments: $1.(*ArgumentList).Arguments, + Args: $1.(*ArgumentList).Arguments, SeparatorTkns: $1.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $1.(*ArgumentList).CloseParenthesisTkn, } @@ -4926,7 +4926,7 @@ variable_without_objects: | simple_indirect_reference reference_variable { for i := len($1)-1; i>=0; i-- { - $1[i].(*ast.ExprVariable).VarName = $2 + $1[i].(*ast.ExprVariable).Name = $2 $1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -4942,7 +4942,7 @@ static_member: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects @@ -4951,7 +4951,7 @@ static_member: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } ; @@ -5010,7 +5010,7 @@ base_variable: | simple_indirect_reference reference_variable { for i := len($1)-1; i>=0; i-- { - $1[i].(*ast.ExprVariable).VarName = $2 + $1[i].(*ast.ExprVariable).Name = $2 $1[i].(*ast.ExprVariable).Position = yylex.(*Parser).builder.NewNodesPosition($1[i], $2) $2 = $1[i] } @@ -5056,7 +5056,7 @@ compound_variable: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -5069,7 +5069,7 @@ compound_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, OpenCurlyBracketTkn: $2, - VarName: $3, + Name: $3, CloseCurlyBracketTkn: $4, } } @@ -5097,7 +5097,7 @@ object_property: $$ = []ast.Vertex{ &ast.ExprPropertyFetch{ Position: yylex.(*Parser).builder.NewNodePosition($1), - Property: $1, + Prop: $1, }, } } @@ -5132,12 +5132,12 @@ object_dim_list: { property := &ast.ExprPropertyFetch{ Position: yylex.(*Parser).builder.NewNodePosition($1), - Property: $1, + Prop: $1, } if brackets, ok := $1.(*ParserBrackets); ok { property.OpenCurlyBracketTkn = brackets.OpenBracketTkn - property.Property = brackets.Child + property.Prop = brackets.Child property.CloseCurlyBracketTkn = brackets.CloseBracketTkn } @@ -5398,7 +5398,7 @@ encaps_var: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -5411,7 +5411,7 @@ encaps_var: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -5428,14 +5428,14 @@ encaps_var: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -5447,7 +5447,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: $2, + Name: $2, CloseCurlyBracketTkn: $3, } } @@ -5456,7 +5456,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -5469,7 +5469,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -5521,7 +5521,7 @@ encaps_var_offset: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -5640,7 +5640,7 @@ class_constant: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -5653,7 +5653,7 @@ class_constant: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -5669,7 +5669,7 @@ static_class_name_scalar: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -5685,7 +5685,7 @@ class_name_scalar: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index aa1b77d..b35eece 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -38,7 +38,7 @@ func TestIdentifier(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -135,7 +135,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 5, EndPos: 19, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -143,7 +143,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 8, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -196,7 +196,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 9, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 2, @@ -211,7 +211,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -268,7 +268,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -345,7 +345,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 23, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -387,7 +387,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 28, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 3, @@ -402,7 +402,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -459,7 +459,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 35, EndPos: 37, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -536,7 +536,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 42, EndPos: 46, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -607,7 +607,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 52, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 4, @@ -622,7 +622,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 52, EndPos: 54, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -679,7 +679,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -749,7 +749,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 66, EndPos: 85, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -757,7 +757,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 69, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -829,7 +829,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 75, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 5, @@ -844,7 +844,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 75, EndPos: 77, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -901,7 +901,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 82, EndPos: 84, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -978,7 +978,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 89, EndPos: 93, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1049,7 +1049,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 99, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 6, @@ -1064,7 +1064,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 99, EndPos: 101, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1121,7 +1121,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 106, EndPos: 108, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -1213,7 +1213,7 @@ func TestPhp7ArgumentNode(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1221,7 +1221,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 120, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1264,7 +1264,7 @@ func TestPhp7ArgumentNode(t *testing.T) { EndPos: 121, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 7, @@ -1279,7 +1279,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 121, EndPos: 123, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1336,7 +1336,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 128, EndPos: 130, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -1499,7 +1499,7 @@ func TestPhp7ArgumentNode(t *testing.T) { }, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 9, @@ -1514,7 +1514,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 171, EndPos: 173, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -1571,7 +1571,7 @@ func TestPhp7ArgumentNode(t *testing.T) { StartPos: 178, EndPos: 180, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -1727,7 +1727,7 @@ func TestPhp7ParameterNode(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1793,7 +1793,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 19, }, }, - Expr: &ast.NameName{ + Expr: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1801,7 +1801,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1830,7 +1830,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 23, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1879,7 +1879,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 28, EndPos: 32, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1887,7 +1887,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 32, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1917,7 +1917,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 34, EndPos: 46, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1925,7 +1925,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 37, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -1997,7 +1997,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 42, EndPos: 46, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -2104,7 +2104,7 @@ func TestPhp7ParameterNode(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2208,7 +2208,7 @@ func TestPhp7ParameterNode(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2274,7 +2274,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 85, }, }, - Expr: &ast.NameName{ + Expr: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2282,7 +2282,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 88, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2311,7 +2311,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 89, EndPos: 93, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2360,7 +2360,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 94, EndPos: 98, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2368,7 +2368,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 98, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2398,7 +2398,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 100, EndPos: 112, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2406,7 +2406,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 103, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2478,7 +2478,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 108, EndPos: 112, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -2647,7 +2647,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 130, }, }, - Expr: &ast.NameName{ + Expr: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2655,7 +2655,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 133, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2684,7 +2684,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 134, EndPos: 138, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2733,7 +2733,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 139, EndPos: 143, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2741,7 +2741,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 143, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2771,7 +2771,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 145, EndPos: 157, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2779,7 +2779,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 148, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -2851,7 +2851,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 153, EndPos: 157, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -3033,7 +3033,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 182, }, }, - Expr: &ast.NameName{ + Expr: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3041,7 +3041,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 185, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3070,7 +3070,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 186, EndPos: 190, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3119,7 +3119,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 191, EndPos: 195, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3127,7 +3127,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 195, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3157,7 +3157,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 197, EndPos: 209, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3165,7 +3165,7 @@ func TestPhp7ParameterNode(t *testing.T) { EndPos: 200, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3237,7 +3237,7 @@ func TestPhp7ParameterNode(t *testing.T) { StartPos: 205, EndPos: 209, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -3431,7 +3431,7 @@ func TestName(t *testing.T) { StartPos: 3, EndPos: 8, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3439,7 +3439,7 @@ func TestName(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3590,7 +3590,7 @@ func TestFullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3729,7 +3729,7 @@ func TestRelative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -3879,7 +3879,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4017,7 +4017,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4155,7 +4155,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4312,7 +4312,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4356,7 +4356,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4512,7 +4512,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4542,7 +4542,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndPos: 15, }, }, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4709,7 +4709,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndPos: 11, }, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -4867,7 +4867,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndPos: 11, }, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -5078,7 +5078,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { StartPos: 10, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -5280,7 +5280,7 @@ LBL; StartPos: 15, EndPos: 19, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -5453,7 +5453,7 @@ LBL; StartPos: 17, EndPos: 21, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7040,7 +7040,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7241,7 +7241,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7361,7 +7361,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -7552,7 +7552,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7804,7 +7804,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -7924,7 +7924,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -8032,7 +8032,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { StartPos: 40, EndPos: 42, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -8239,7 +8239,7 @@ func TestStmtClassConstList(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -8637,7 +8637,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9002,7 +9002,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9073,7 +9073,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9251,7 +9251,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9386,7 +9386,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9541,7 +9541,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9719,7 +9719,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9876,7 +9876,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9925,7 +9925,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { EndPos: 44, }, }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -9933,7 +9933,7 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { EndPos: 49, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10126,7 +10126,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10261,7 +10261,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10449,7 +10449,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10553,7 +10553,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { }, }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10614,7 +10614,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { EndPos: 45, }, }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10622,7 +10622,7 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { EndPos: 50, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10759,7 +10759,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -10918,7 +10918,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11077,7 +11077,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11130,7 +11130,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, }, }, - Extends: &ast.NameName{ + Extends: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11138,7 +11138,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { EndPos: 30, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11311,7 +11311,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11365,7 +11365,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11373,7 +11373,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11547,7 +11547,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11601,7 +11601,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11609,7 +11609,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11642,7 +11642,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11650,7 +11650,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndPos: 38, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11881,7 +11881,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, }, }, - Extends: &ast.NameName{ + Extends: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11889,7 +11889,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { EndPos: 26, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11945,7 +11945,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11953,7 +11953,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { EndPos: 41, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11986,7 +11986,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -11994,7 +11994,7 @@ func TestStmtClass_AnonimousClass(t *testing.T) { EndPos: 46, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -13920,7 +13920,7 @@ func TestStmtEcho(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14093,7 +14093,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14303,7 +14303,7 @@ func TestStmtFor(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14403,7 +14403,7 @@ func TestStmtFor(t *testing.T) { StartPos: 15, EndPos: 17, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14515,7 +14515,7 @@ func TestStmtFor(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14572,7 +14572,7 @@ func TestStmtFor(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14776,7 +14776,7 @@ func TestStmtFor_Alt(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -14888,7 +14888,7 @@ func TestStmtFor_Alt(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15096,7 +15096,7 @@ func TestStmtForeach(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15145,7 +15145,7 @@ func TestStmtForeach(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15369,7 +15369,7 @@ func TestStmtForeach_Expr(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15543,7 +15543,7 @@ func TestStmtForeach_Alt(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15592,7 +15592,7 @@ func TestStmtForeach_Alt(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15788,7 +15788,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15837,7 +15837,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -15898,7 +15898,7 @@ func TestStmtForeach_WithKey(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16122,7 +16122,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16183,7 +16183,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { StartPos: 24, EndPos: 26, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16357,7 +16357,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16406,7 +16406,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16489,7 +16489,7 @@ func TestStmtForeach_WithRef(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16651,7 +16651,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16700,7 +16700,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16808,7 +16808,7 @@ func TestStmtForeach_WithList(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -16954,7 +16954,7 @@ func TestStmtFunction(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17100,7 +17100,7 @@ func TestStmtFunction_Return(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17275,7 +17275,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17350,7 +17350,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17428,7 +17428,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 35, EndPos: 37, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17531,7 +17531,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { StartPos: 47, EndPos: 49, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17669,7 +17669,7 @@ func TestStmtFunction_Ref(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17885,7 +17885,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { }, }, }, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17934,7 +17934,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { EndPos: 19, }, }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -17942,7 +17942,7 @@ func TestStmtFunction_ReturnType(t *testing.T) { EndPos: 24, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18078,7 +18078,7 @@ func TestStmtGlobal(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18191,7 +18191,7 @@ func TestStmtGlobal_Vars(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18230,7 +18230,7 @@ func TestStmtGlobal_Vars(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18291,14 +18291,14 @@ func TestStmtGlobal_Vars(t *testing.T) { }, }, }, - VarName: &ast.ExprVariable{ + Name: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 19, EndPos: 21, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18358,14 +18358,14 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 25, }, }, - VarName: &ast.ExprFunctionCall{ + Name: &ast.ExprFunctionCall{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 25, EndPos: 30, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18373,7 +18373,7 @@ func TestStmtGlobal_Vars(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18499,7 +18499,7 @@ func TestStmtGotoLabel(t *testing.T) { StartPos: 3, EndPos: 5, }, - LabelName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18804,7 +18804,7 @@ func TestStmtIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -18966,7 +18966,7 @@ func TestStmtIf_ElseIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19096,7 +19096,7 @@ func TestStmtIf_ElseIf(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19260,7 +19260,7 @@ func TestStmtIf_Else(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19493,7 +19493,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19623,7 +19623,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19753,7 +19753,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { StartPos: 37, EndPos: 39, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -19988,7 +19988,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20118,7 +20118,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20278,7 +20278,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { StartPos: 38, EndPos: 40, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20565,7 +20565,7 @@ func TestStmtInterface(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20691,7 +20691,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20745,7 +20745,7 @@ func TestStmtInterface_Extend(t *testing.T) { }, }, Extends: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20753,7 +20753,7 @@ func TestStmtInterface_Extend(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20882,7 +20882,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, }, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20936,7 +20936,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, Extends: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20944,7 +20944,7 @@ func TestStmtInterface_Extends(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20977,7 +20977,7 @@ func TestStmtInterface_Extends(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -20985,7 +20985,7 @@ func TestStmtInterface_Extends(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21126,7 +21126,7 @@ func TestStmtNamespace(t *testing.T) { }, }, }, - Name: &ast.NameName{ + Name: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21134,7 +21134,7 @@ func TestStmtNamespace(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21239,7 +21239,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, }, }, - Name: &ast.NameName{ + Name: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21247,7 +21247,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21470,7 +21470,7 @@ func TestStmtProperty(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21552,7 +21552,7 @@ func TestStmtProperty(t *testing.T) { Value: []byte("var"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -21567,7 +21567,7 @@ func TestStmtProperty(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21685,7 +21685,7 @@ func TestStmtProperty_Properties(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21798,7 +21798,7 @@ func TestStmtProperty_Properties(t *testing.T) { Value: []byte("static"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -21813,7 +21813,7 @@ func TestStmtProperty_Properties(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -21860,7 +21860,7 @@ func TestStmtProperty_Properties(t *testing.T) { StartPos: 32, EndPos: 34, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22043,7 +22043,7 @@ func TestStmtProperty_Properties2(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22156,7 +22156,7 @@ func TestStmtProperty_Properties2(t *testing.T) { Value: []byte("static"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -22171,7 +22171,7 @@ func TestStmtProperty_Properties2(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22271,7 +22271,7 @@ func TestStmtProperty_Properties2(t *testing.T) { StartPos: 36, EndPos: 38, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22401,7 +22401,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22483,7 +22483,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { Value: []byte("var"), }, }, - Type: &ast.NameName{ + Type: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22491,7 +22491,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { EndPos: 21, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22524,7 +22524,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { }, }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Position: &position.Position{ StartLine: 1, @@ -22539,7 +22539,7 @@ func TestStmtProperty_PropertyType(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22672,7 +22672,7 @@ func TestStmtStaticVar(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22793,7 +22793,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -22840,7 +22840,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23026,7 +23026,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23126,7 +23126,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -23322,7 +23322,7 @@ func TestStmtSwitch(t *testing.T) { }, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -23735,7 +23735,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { EndPos: 18, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -24139,7 +24139,7 @@ func TestStmtSwitch_Alt(t *testing.T) { }, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -24520,7 +24520,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { EndPos: 18, }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Position: &position.Position{ StartLine: 3, @@ -24767,7 +24767,7 @@ func TestStmtThrow(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24871,7 +24871,7 @@ func TestStmtTrait(t *testing.T) { }, }, }, - TraitName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -24997,7 +24997,7 @@ func TestStmtTraitUse(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25081,7 +25081,7 @@ func TestStmtTraitUse(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25089,7 +25089,7 @@ func TestStmtTraitUse(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25219,7 +25219,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25303,7 +25303,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25311,7 +25311,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25344,7 +25344,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25352,7 +25352,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25494,7 +25494,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25578,7 +25578,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25586,7 +25586,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25619,7 +25619,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25627,7 +25627,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25791,7 +25791,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25875,7 +25875,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25883,7 +25883,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25916,7 +25916,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -25924,7 +25924,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26204,7 +26204,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26288,7 +26288,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26296,7 +26296,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26329,7 +26329,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26337,7 +26337,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26648,7 +26648,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26732,7 +26732,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26740,7 +26740,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26773,7 +26773,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26781,7 +26781,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 27, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26857,7 +26857,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 30, EndPos: 58, }, - Trait: &ast.NameName{ + Trait: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26865,7 +26865,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 33, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26950,7 +26950,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, Insteadof: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26958,7 +26958,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 52, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26991,7 +26991,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -26999,7 +26999,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 58, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27063,7 +27063,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { StartPos: 60, EndPos: 75, }, - Trait: &ast.NameName{ + Trait: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27071,7 +27071,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndPos: 63, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -27505,7 +27505,7 @@ func TestStmtTry_TryCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27513,7 +27513,7 @@ func TestStmtTry_TryCatch(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27542,7 +27542,7 @@ func TestStmtTry_TryCatch(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27782,7 +27782,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27790,7 +27790,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27811,7 +27811,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, }, }, - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27819,7 +27819,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { EndPos: 45, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -27860,7 +27860,7 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { StartPos: 46, EndPos: 48, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28100,7 +28100,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28108,7 +28108,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28137,7 +28137,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28265,7 +28265,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28273,7 +28273,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndPos: 59, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28302,7 +28302,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { StartPos: 60, EndPos: 62, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28542,7 +28542,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28550,7 +28550,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndPos: 28, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28579,7 +28579,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { StartPos: 29, EndPos: 31, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -28880,7 +28880,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28888,7 +28888,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndPos: 26, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -28917,7 +28917,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29063,7 +29063,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29092,7 +29092,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29248,7 +29248,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29277,7 +29277,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { StartPos: 101, EndPos: 103, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29434,7 +29434,7 @@ func TestStmtUnset(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29555,7 +29555,7 @@ func TestStmtUnset_Vars(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29582,7 +29582,7 @@ func TestStmtUnset_Vars(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29727,7 +29727,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29754,7 +29754,7 @@ func TestStmtUnset_TrailingComma(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29852,7 +29852,7 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29891,15 +29891,15 @@ func TestStmtUse(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29907,7 +29907,7 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -29975,7 +29975,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30014,8 +30014,8 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30044,7 +30044,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30052,7 +30052,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 11, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30108,7 +30108,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30147,8 +30147,8 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30177,7 +30177,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30185,7 +30185,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 11, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30294,7 +30294,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30333,15 +30333,15 @@ func TestStmtUse_List(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30349,7 +30349,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30383,14 +30383,14 @@ func TestStmtUse_List(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 15, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30398,7 +30398,7 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30478,7 +30478,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30517,15 +30517,15 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, EndPos: 10, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30533,7 +30533,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30567,14 +30567,14 @@ func TestStmtUse_ListAlias(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 22, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30582,7 +30582,7 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30715,7 +30715,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30785,15 +30785,15 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, Value: []byte("function"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 19, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30801,7 +30801,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30835,7 +30835,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30864,7 +30864,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30872,7 +30872,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -30940,7 +30940,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31010,15 +31010,15 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, Value: []byte("function"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, EndPos: 26, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31026,7 +31026,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31113,7 +31113,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { Value: []byte("foo"), }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31142,7 +31142,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31150,7 +31150,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31271,7 +31271,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31341,15 +31341,15 @@ func TestStmtUse_ListConstType(t *testing.T) { }, Value: []byte("const"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, EndPos: 16, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31357,7 +31357,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31391,7 +31391,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31420,7 +31420,7 @@ func TestStmtUse_ListConstType(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31428,7 +31428,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31496,7 +31496,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31566,15 +31566,15 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, Value: []byte("const"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, EndPos: 23, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31582,7 +31582,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31669,7 +31669,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { Value: []byte("foo"), }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31698,7 +31698,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, }, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31706,7 +31706,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31827,7 +31827,7 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 22, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31866,7 +31866,7 @@ func TestStmtUse_GroupUse(t *testing.T) { }, }, }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31874,7 +31874,7 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31927,15 +31927,15 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 12, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 15, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31943,7 +31943,7 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31965,14 +31965,14 @@ func TestStmtUse_GroupUse(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, EndPos: 20, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -31980,7 +31980,7 @@ func TestStmtUse_GroupUse(t *testing.T) { EndPos: 20, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32070,7 +32070,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 30, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32109,7 +32109,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, }, }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32117,7 +32117,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32170,15 +32170,15 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 12, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, EndPos: 15, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32186,7 +32186,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 15, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32208,14 +32208,14 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 17, EndPos: 28, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32223,7 +32223,7 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndPos: 20, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32366,7 +32366,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 31, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32436,7 +32436,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, Value: []byte("function"), }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32444,7 +32444,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32497,15 +32497,15 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 21, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 21, EndPos: 24, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32513,7 +32513,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 24, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32535,14 +32535,14 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 26, EndPos: 29, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32550,7 +32550,7 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndPos: 29, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32640,7 +32640,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 28, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32710,7 +32710,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, Value: []byte("const"), }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32718,7 +32718,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32771,15 +32771,15 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 18, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 18, EndPos: 21, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32787,7 +32787,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 21, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32809,14 +32809,14 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 23, EndPos: 26, }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32824,7 +32824,7 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndPos: 26, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32914,7 +32914,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 37, }, Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32953,7 +32953,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, }, }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -32961,7 +32961,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33014,8 +33014,8 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 12, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33041,7 +33041,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, Value: []byte("const"), }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33049,7 +33049,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 21, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33083,7 +33083,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, }, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33121,7 +33121,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, Value: []byte("function"), }, - Use: &ast.NameName{ + Use: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33129,7 +33129,7 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndPos: 35, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -33951,7 +33951,7 @@ func TestExprArrayDimFetch(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34094,7 +34094,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34627,7 +34627,7 @@ func TestExprArray_Items(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34797,7 +34797,7 @@ func TestExprArray_ItemUnpack(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -34958,7 +34958,7 @@ func TestExprArrowFunction(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35146,7 +35146,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { }, }, }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35154,7 +35154,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { EndPos: 16, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35216,7 +35216,7 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { StartPos: 20, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35335,7 +35335,7 @@ func TestExprBitwiseNot(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35442,7 +35442,7 @@ func TestExprBooleanNot(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35510,7 +35510,7 @@ func TestExprClassConstFetch(t *testing.T) { StartPos: 3, EndPos: 11, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35518,7 +35518,7 @@ func TestExprClassConstFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35571,7 +35571,7 @@ func TestExprClassConstFetch(t *testing.T) { EndPos: 8, }, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35689,7 +35689,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { EndPos: 11, }, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35812,7 +35812,7 @@ func TestExprClone_Brackets(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -35930,7 +35930,7 @@ func TestExprClone(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36188,7 +36188,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36223,7 +36223,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36323,7 +36323,7 @@ func TestExprClosure_Use(t *testing.T) { }, }, }, - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ Position: &position.Position{ StartLine: 1, @@ -36338,7 +36338,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 25, EndPos: 27, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36395,7 +36395,7 @@ func TestExprClosure_Use(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36577,7 +36577,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36612,7 +36612,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36712,7 +36712,7 @@ func TestExprClosure_Use2(t *testing.T) { }, }, }, - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ Position: &position.Position{ StartLine: 1, @@ -36737,7 +36737,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 26, EndPos: 28, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36772,7 +36772,7 @@ func TestExprClosure_Use2(t *testing.T) { StartPos: 30, EndPos: 32, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36971,7 +36971,7 @@ func TestExprClosure_ReturnType(t *testing.T) { EndPos: 14, }, }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -36979,7 +36979,7 @@ func TestExprClosure_ReturnType(t *testing.T) { EndPos: 19, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37093,7 +37093,7 @@ func TestExprConstFetch(t *testing.T) { StartPos: 3, EndPos: 6, }, - Const: &ast.NameName{ + Const: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37101,7 +37101,7 @@ func TestExprConstFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37242,7 +37242,7 @@ func TestExprConstFetch_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37351,7 +37351,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37469,7 +37469,7 @@ func TestExprEmpty(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37586,7 +37586,7 @@ func TestExprErrorSuppress(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -37703,7 +37703,7 @@ func TestExprEval(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38010,7 +38010,7 @@ func TestExprExit_Expr(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38317,7 +38317,7 @@ func TestExprDie_Expr(t *testing.T) { StartPos: 7, EndPos: 9, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38395,7 +38395,7 @@ func TestExprFunctionCall(t *testing.T) { StartPos: 3, EndPos: 8, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38403,7 +38403,7 @@ func TestExprFunctionCall(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38564,7 +38564,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38693,7 +38693,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38724,7 +38724,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -38827,7 +38827,7 @@ func TestExprFunctionCall_Var(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -38879,7 +38879,7 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -38904,14 +38904,14 @@ func TestExprFunctionCall_Var(t *testing.T) { EndPos: 13, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39004,7 +39004,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { StartPos: 3, EndPos: 15, }, - Function: &ast.NameName{ + Function: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39012,7 +39012,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 7, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39065,7 +39065,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndPos: 8, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -39087,7 +39087,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39204,7 +39204,7 @@ func TestExprPostDec(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39311,7 +39311,7 @@ func TestExprPostInc(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39450,7 +39450,7 @@ func TestExprPreDec(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39557,7 +39557,7 @@ func TestExprPreInc(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39664,7 +39664,7 @@ func TestExprInclude(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39783,7 +39783,7 @@ func TestExprInclude_Once(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -39902,7 +39902,7 @@ func TestExprRequire(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40021,7 +40021,7 @@ func TestExprRequire_Once(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40108,7 +40108,7 @@ func TestExprInstanceOf(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40172,7 +40172,7 @@ func TestExprInstanceOf(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40180,7 +40180,7 @@ func TestExprInstanceOf(t *testing.T) { EndPos: 20, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40268,7 +40268,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40372,7 +40372,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40448,7 +40448,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40542,7 +40542,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40661,7 +40661,7 @@ func TestExprIsset(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40790,7 +40790,7 @@ func TestExprIsset_Variables(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -40817,7 +40817,7 @@ func TestExprIsset_Variables(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41009,7 +41009,7 @@ func TestExprList_Empty(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41153,7 +41153,7 @@ func TestExprList(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41215,7 +41215,7 @@ func TestExprList(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41366,7 +41366,7 @@ func TestExprList_ArrayIndex(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41449,7 +41449,7 @@ func TestExprList_ArrayIndex(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41628,7 +41628,7 @@ func TestExprList_List(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41703,7 +41703,7 @@ func TestExprList_List(t *testing.T) { StartPos: 20, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41848,7 +41848,7 @@ func TestExprList_EmptyItem(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -41934,7 +41934,7 @@ func TestExprList_EmptyItem(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42080,7 +42080,7 @@ func TestExprList_EmptyItems(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42211,7 +42211,7 @@ func TestExprList_EmptyItems(t *testing.T) { StartPos: 20, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42298,7 +42298,7 @@ func TestExprMethodCall(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42469,7 +42469,7 @@ func TestExprNew(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42477,7 +42477,7 @@ func TestExprNew(t *testing.T) { EndPos: 10, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42630,7 +42630,7 @@ func TestExprNew_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42781,7 +42781,7 @@ func TestExprNew_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -42953,7 +42953,7 @@ func TestExprNew_Anonymous(t *testing.T) { }, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 1, @@ -42968,7 +42968,7 @@ func TestExprNew_Anonymous(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43025,7 +43025,7 @@ func TestExprNew_Anonymous(t *testing.T) { StartPos: 21, EndPos: 23, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43207,7 +43207,7 @@ func TestExprPrint(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43293,7 +43293,7 @@ func TestExprPropertyFetch(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43345,7 +43345,7 @@ func TestExprPropertyFetch(t *testing.T) { EndPos: 7, }, }, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43471,7 +43471,7 @@ func TestExprShellExec(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -43884,7 +43884,7 @@ func TestExprShortArray_Items(t *testing.T) { StartPos: 11, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44041,7 +44041,7 @@ func TestExprShortList(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44103,7 +44103,7 @@ func TestExprShortList(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44244,7 +44244,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44327,7 +44327,7 @@ func TestExprShortList_ArrayIndex(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44496,7 +44496,7 @@ func TestExprShortList_List(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44571,7 +44571,7 @@ func TestExprShortList_List(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44651,7 +44651,7 @@ func TestExprStaticCall(t *testing.T) { StartPos: 3, EndPos: 13, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44659,7 +44659,7 @@ func TestExprStaticCall(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -44849,7 +44849,7 @@ func TestExprStaticCall_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45007,7 +45007,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45125,7 +45125,7 @@ func TestExprStaticCall_Var(t *testing.T) { StartPos: 3, EndPos: 14, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45133,7 +45133,7 @@ func TestExprStaticCall_Var(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45193,7 +45193,7 @@ func TestExprStaticCall_Var(t *testing.T) { StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45288,7 +45288,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { StartPos: 3, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45347,7 +45347,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45435,7 +45435,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { StartPos: 3, EndPos: 12, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45443,7 +45443,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 6, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45496,14 +45496,14 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndPos: 8, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45621,7 +45621,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45652,14 +45652,14 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndPos: 18, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 18, EndPos: 22, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45767,7 +45767,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45798,14 +45798,14 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndPos: 9, }, }, - Property: &ast.ExprVariable{ + Prop: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 13, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45873,14 +45873,14 @@ func TestExprTernary(t *testing.T) { StartPos: 3, EndPos: 15, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -45951,7 +45951,7 @@ func TestExprTernary(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46012,7 +46012,7 @@ func TestExprTernary(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46092,14 +46092,14 @@ func TestExprTernary_Simple(t *testing.T) { StartPos: 3, EndPos: 12, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46192,7 +46192,7 @@ func TestExprTernary_Simple(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46272,14 +46272,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 3, EndPos: 25, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46350,14 +46350,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 8, EndPos: 20, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46418,7 +46418,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46479,7 +46479,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46541,7 +46541,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { StartPos: 23, EndPos: 25, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46621,21 +46621,21 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 3, EndPos: 25, }, - Condition: &ast.ExprTernary{ + Cond: &ast.ExprTernary{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 15, }, - Condition: &ast.ExprVariable{ + Cond: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46706,7 +46706,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 8, EndPos: 10, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46767,7 +46767,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 13, EndPos: 15, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46829,7 +46829,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 18, EndPos: 20, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -46890,7 +46890,7 @@ func TestExprTernary_NestedCond(t *testing.T) { StartPos: 23, EndPos: 25, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47009,7 +47009,7 @@ func TestExprUnaryMinus(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47116,7 +47116,7 @@ func TestExprUnaryPlus(t *testing.T) { StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47184,7 +47184,7 @@ func TestExprVariable(t *testing.T) { StartPos: 3, EndPos: 5, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47305,14 +47305,14 @@ func TestExprVariable_Variable(t *testing.T) { }, }, }, - VarName: &ast.ExprVariable{ + Name: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 4, EndPos: 6, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47492,14 +47492,14 @@ func TestExprYield_Val(t *testing.T) { }, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47618,7 +47618,7 @@ func TestExprYield_KeyVal(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47672,14 +47672,14 @@ func TestExprYield_KeyVal(t *testing.T) { }, }, }, - Value: &ast.ExprVariable{ + Val: &ast.ExprVariable{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 15, EndPos: 17, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47791,7 +47791,7 @@ func TestExprYield_Expr(t *testing.T) { }, }, }, - Value: &ast.ScalarLnumber{ + Val: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47909,7 +47909,7 @@ func TestExprYield_KeyExpr(t *testing.T) { StartPos: 9, EndPos: 11, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -47963,7 +47963,7 @@ func TestExprYield_KeyExpr(t *testing.T) { }, }, }, - Value: &ast.ScalarLnumber{ + Val: &ast.ScalarLnumber{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -48081,7 +48081,7 @@ func TestExprYieldFrom(t *testing.T) { StartPos: 14, EndPos: 16, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 1, EndLine: 1, @@ -48187,7 +48187,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -48258,7 +48258,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -48323,7 +48323,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -48394,7 +48394,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 22, EndPos: 24, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -48459,7 +48459,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 28, EndPos: 30, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -48552,7 +48552,7 @@ func TestExprAssign_Assign(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -48560,7 +48560,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 41, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -48627,7 +48627,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 45, EndPos: 47, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -48720,7 +48720,7 @@ func TestExprAssign_Assign(t *testing.T) { }, }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -48728,7 +48728,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 58, }, Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -48771,7 +48771,7 @@ func TestExprAssign_Assign(t *testing.T) { EndPos: 59, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Position: &position.Position{ StartLine: 5, @@ -48786,7 +48786,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 59, EndPos: 61, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -48852,7 +48852,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 66, EndPos: 68, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -48913,7 +48913,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 72, EndPos: 74, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -48978,7 +48978,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 78, EndPos: 80, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -49039,7 +49039,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 84, EndPos: 86, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -49104,7 +49104,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 90, EndPos: 92, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -49165,7 +49165,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 96, EndPos: 98, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -49230,7 +49230,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 102, EndPos: 104, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -49291,7 +49291,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 108, EndPos: 110, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -49356,7 +49356,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 114, EndPos: 116, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -49417,7 +49417,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 120, EndPos: 122, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -49482,7 +49482,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 126, EndPos: 128, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -49543,7 +49543,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 132, EndPos: 134, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -49608,7 +49608,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 138, EndPos: 140, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -49669,7 +49669,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 144, EndPos: 146, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -49734,7 +49734,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 150, EndPos: 152, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -49795,7 +49795,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 156, EndPos: 158, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -49860,7 +49860,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 162, EndPos: 164, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -49921,7 +49921,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 168, EndPos: 170, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -49986,7 +49986,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 174, EndPos: 176, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -50047,7 +50047,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 181, EndPos: 183, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -50112,7 +50112,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 187, EndPos: 189, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -50173,7 +50173,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 194, EndPos: 196, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -50238,7 +50238,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 200, EndPos: 202, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -50299,7 +50299,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 207, EndPos: 209, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -50364,7 +50364,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 213, EndPos: 215, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -50425,7 +50425,7 @@ func TestExprAssign_Assign(t *testing.T) { StartPos: 220, EndPos: 222, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -50541,7 +50541,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 5, EndPos: 7, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -50612,7 +50612,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 10, EndPos: 12, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -50677,7 +50677,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 16, EndPos: 18, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -50738,7 +50738,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 21, EndPos: 23, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -50803,7 +50803,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -50864,7 +50864,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 32, EndPos: 34, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -50929,7 +50929,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 38, EndPos: 40, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -50990,7 +50990,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 44, EndPos: 46, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -51055,7 +51055,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 50, EndPos: 52, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -51116,7 +51116,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 56, EndPos: 58, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -51181,7 +51181,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 62, EndPos: 64, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -51242,7 +51242,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 68, EndPos: 70, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -51307,7 +51307,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 74, EndPos: 76, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -51368,7 +51368,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 79, EndPos: 81, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -51433,7 +51433,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 85, EndPos: 87, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -51494,7 +51494,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 90, EndPos: 92, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -51559,7 +51559,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 96, EndPos: 98, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -51620,7 +51620,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 102, EndPos: 104, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -51685,7 +51685,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 108, EndPos: 110, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -51746,7 +51746,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 114, EndPos: 116, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -51811,7 +51811,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 120, EndPos: 122, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -51872,7 +51872,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 125, EndPos: 127, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -51937,7 +51937,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 131, EndPos: 133, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -51998,7 +51998,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 138, EndPos: 140, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 13, EndLine: 13, @@ -52063,7 +52063,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 144, EndPos: 146, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -52124,7 +52124,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 151, EndPos: 153, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 14, EndLine: 14, @@ -52189,7 +52189,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 157, EndPos: 159, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -52250,7 +52250,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 163, EndPos: 165, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 15, EndLine: 15, @@ -52315,7 +52315,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 169, EndPos: 171, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -52376,7 +52376,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 176, EndPos: 178, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 16, EndLine: 16, @@ -52441,7 +52441,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 182, EndPos: 184, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -52502,7 +52502,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 187, EndPos: 189, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 17, EndLine: 17, @@ -52567,7 +52567,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 193, EndPos: 195, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -52628,7 +52628,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 198, EndPos: 200, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 18, EndLine: 18, @@ -52693,7 +52693,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 204, EndPos: 206, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 19, EndLine: 19, @@ -52754,7 +52754,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 209, EndPos: 211, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 19, EndLine: 19, @@ -52819,7 +52819,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 215, EndPos: 217, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 20, EndLine: 20, @@ -52880,7 +52880,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 221, EndPos: 223, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 20, EndLine: 20, @@ -52945,7 +52945,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 227, EndPos: 229, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 21, EndLine: 21, @@ -53006,7 +53006,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 234, EndPos: 236, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 21, EndLine: 21, @@ -53071,7 +53071,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 240, EndPos: 242, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 22, EndLine: 22, @@ -53132,7 +53132,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 245, EndPos: 247, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 22, EndLine: 22, @@ -53197,7 +53197,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 251, EndPos: 253, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 23, EndLine: 23, @@ -53258,7 +53258,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 257, EndPos: 259, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 23, EndLine: 23, @@ -53323,7 +53323,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 263, EndPos: 265, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 24, EndLine: 24, @@ -53384,7 +53384,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 269, EndPos: 271, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 24, EndLine: 24, @@ -53449,7 +53449,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 275, EndPos: 277, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 25, EndLine: 25, @@ -53510,7 +53510,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 281, EndPos: 283, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 25, EndLine: 25, @@ -53575,7 +53575,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 287, EndPos: 289, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 26, EndLine: 26, @@ -53636,7 +53636,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 293, EndPos: 295, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 26, EndLine: 26, @@ -53701,7 +53701,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 299, EndPos: 301, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 27, EndLine: 27, @@ -53762,7 +53762,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 304, EndPos: 306, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 27, EndLine: 27, @@ -53827,7 +53827,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 310, EndPos: 312, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 28, EndLine: 28, @@ -53888,7 +53888,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { StartPos: 317, EndPos: 319, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 28, EndLine: 28, @@ -54020,7 +54020,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 12, EndPos: 14, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 2, EndLine: 2, @@ -54095,7 +54095,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 27, EndPos: 29, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 3, EndLine: 3, @@ -54170,7 +54170,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 39, EndPos: 41, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 4, EndLine: 4, @@ -54245,7 +54245,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 53, EndPos: 55, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 5, EndLine: 5, @@ -54320,7 +54320,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 66, EndPos: 68, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 6, EndLine: 6, @@ -54395,7 +54395,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 81, EndPos: 83, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 7, EndLine: 7, @@ -54470,7 +54470,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 92, EndPos: 94, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 8, EndLine: 8, @@ -54545,7 +54545,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 106, EndPos: 108, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 9, EndLine: 9, @@ -54620,7 +54620,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 120, EndPos: 122, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 10, EndLine: 10, @@ -54695,7 +54695,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 134, EndPos: 136, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, @@ -54770,7 +54770,7 @@ func TestExprCast_Array(t *testing.T) { StartPos: 147, EndPos: 149, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 12, EndLine: 12, @@ -55428,7 +55428,7 @@ CAD; StartPos: 79, EndPos: 85, }, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: &position.Position{ StartLine: 11, EndLine: 11, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 9810e30bd7d4cfe13636d6e9b9ddf654e0d8054f..eeb759574cf32c77b3edf87fadfc79894a42f52e 100644 GIT binary patch delta 1892 zcmbtUT}+#06wY~H5Wdns7$XI?{%pDlI$B`^DS;N4OM%KtRZKtzbuih5KTE-AmO19s zi@7*V3&AQMAA2+(~y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MA4yl@38BeO!mr=(`~qY|%L=nygiYqcOT>QBx?g8@zm>4@%*Q;NxZR(&yXy0aA=Y zx05n@z`<_~z`Mg$U@Sk+EYIDgzy_GnXAK!(8YJvnw!bc5hXr;j& zsB_yr_%myy?i!crSREIh1uqZySQ;)zbEq{I4vF<)lk!qzAy{}tCca>%6IPXy7+r`H z^0UaV%^v|AV6zurP695nYkQhQE%fM&=;80f94hR?*@l}ZQCAL5qLY2H27LhMQrA^{ zj_%yRT;5rSb}exZ?x9Flrp#1TFK>n%PUG|S==Pz;KBUez@MrOH2B94vgdoY}^ zW?XTxPzGJC9I=r8H#n%1Ae%frIGsQ3#VwHR-4UOerR@+VgHu@e-&SM4dx3L*9)HxB z_%zr5irM)p&@${yasD1IeSnMMshH;x{;rS3)qvONDylTu=wABkhV&_e+GsFc9gN31 ze!|IoAVV!o-oDFJ_&|JeAWONyEH^U#E4evC&8C@~W&68*%3*j)XL&_aMk_wN4A~uf zqdPejF2QznXLPgOr^&+Lt)w`O+csp9dNZO(}>Z|18eM|_9! zlnf8!Sguwkci7LaGIeS6lP;AjSE7mTx!B9yE7h#gx#A9K8%!A1OdeELLxT*SU!iJ9y0s3@|F diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 6a3f21d..fceb827 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -338,7 +338,7 @@ namespace_name: { $$ = &ParserSeparatedList{ Items: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($1), StringTkn: $1, Value: $1.Value, @@ -348,7 +348,7 @@ namespace_name: } | namespace_name T_NS_SEPARATOR T_STRING { - part := &ast.NameNamePart{ + part := &ast.NamePart{ Position: yylex.(*Parser).builder.NewTokenPosition($3), StringTkn: $3, Value: $3.Value, @@ -364,7 +364,7 @@ namespace_name: name: namespace_name { - $$ = &ast.NameName{ + $$ = &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -432,7 +432,7 @@ top_statement: $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), NsTkn: $1, - Name: &ast.NameName{ + Name: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -445,7 +445,7 @@ top_statement: $$ = &ast.StmtNamespace{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), NsTkn: $1, - Name: &ast.NameName{ + Name: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, @@ -467,7 +467,7 @@ top_statement: } | T_USE mixed_group_use_declaration ';' { - use := $2.(*ast.StmtGroupUse) + use := $2.(*ast.StmtGroupUseList) use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $3) use.UseTkn = $1 @@ -477,7 +477,7 @@ top_statement: } | T_USE use_type group_use_declaration ';' { - use := $3.(*ast.StmtGroupUse) + use := $3.(*ast.StmtGroupUseList) use.Position = yylex.(*Parser).builder.NewTokensPosition($1, $4) use.UseTkn = $1 @@ -488,23 +488,23 @@ top_statement: } | T_USE use_declarations ';' { - $$ = &ast.StmtUse{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), - UseTkn: $1, - UseDeclarations: $2.(*ParserSeparatedList).Items, - SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, - SemiColonTkn: $3, + $$ = &ast.StmtUseList{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), + UseTkn: $1, + Uses: $2.(*ParserSeparatedList).Items, + SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $3, } } | T_USE use_type use_declarations ';' { - $$ = &ast.StmtUse{ - Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), - UseTkn: $1, - Type: $2, - UseDeclarations: $3.(*ParserSeparatedList).Items, - SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, - SemiColonTkn: $4, + $$ = &ast.StmtUseList{ + Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), + UseTkn: $1, + Type: $2, + Uses: $3.(*ParserSeparatedList).Items, + SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, + SemiColonTkn: $4, } } | T_CONST const_list ';' @@ -545,16 +545,16 @@ group_use_declaration: $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } - $$ = &ast.StmtGroupUse{ + $$ = &ast.StmtGroupUseList{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ParserSeparatedList).Items, + Uses: $4.(*ParserSeparatedList).Items, SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } @@ -565,17 +565,17 @@ group_use_declaration: $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } - $$ = &ast.StmtGroupUse{ + $$ = &ast.StmtGroupUseList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ParserSeparatedList).Items, + Uses: $5.(*ParserSeparatedList).Items, SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } @@ -589,16 +589,16 @@ mixed_group_use_declaration: $4.(*ParserSeparatedList).SeparatorTkns = append($4.(*ParserSeparatedList).SeparatorTkns, $5) } - $$ = &ast.StmtGroupUse{ + $$ = &ast.StmtGroupUseList{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $6), - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $2, OpenCurlyBracketTkn: $3, - UseDeclarations: $4.(*ParserSeparatedList).Items, + Uses: $4.(*ParserSeparatedList).Items, SeparatorTkns: $4.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $6, } @@ -609,17 +609,17 @@ mixed_group_use_declaration: $5.(*ParserSeparatedList).SeparatorTkns = append($5.(*ParserSeparatedList).SeparatorTkns, $6) } - $$ = &ast.StmtGroupUse{ + $$ = &ast.StmtGroupUseList{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), LeadingNsSeparatorTkn: $1, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($2.(*ParserSeparatedList).Items), Parts: $2.(*ParserSeparatedList).Items, SeparatorTkns: $2.(*ParserSeparatedList).SeparatorTkns, }, NsSeparatorTkn: $3, OpenCurlyBracketTkn: $4, - UseDeclarations: $5.(*ParserSeparatedList).Items, + Uses: $5.(*ParserSeparatedList).Items, SeparatorTkns: $5.(*ParserSeparatedList).SeparatorTkns, CloseCurlyBracketTkn: $7, } @@ -692,7 +692,7 @@ inline_use_declaration: } | use_type unprefixed_use_declaration { - decl := $2.(*ast.StmtUseDeclaration) + decl := $2.(*ast.StmtUse) decl.Type = $1 decl.Position = yylex.(*Parser).builder.NewNodesPosition($1, $2) @@ -703,9 +703,9 @@ inline_use_declaration: unprefixed_use_declaration: namespace_name { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -714,9 +714,9 @@ unprefixed_use_declaration: } | namespace_name T_AS T_STRING { - $$ = &ast.StmtUseDeclaration{ + $$ = &ast.StmtUse{ Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1.(*ParserSeparatedList).Items, $3), - Use: &ast.NameName{ + Use: &ast.Name{ Position: yylex.(*Parser).builder.NewNodeListPosition($1.(*ParserSeparatedList).Items), Parts: $1.(*ParserSeparatedList).Items, SeparatorTkns: $1.(*ParserSeparatedList).SeparatorTkns, @@ -738,7 +738,7 @@ use_declaration: } | T_NS_SEPARATOR unprefixed_use_declaration { - decl := $2.(*ast.StmtUseDeclaration) + decl := $2.(*ast.StmtUse) decl.NsSeparatorTkn = $1 decl.Position = yylex.(*Parser).builder.NewTokenNodePosition($1, $2) @@ -1061,7 +1061,7 @@ statement: { $$ = &ast.StmtLabel{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $2), - LabelName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -1082,7 +1082,7 @@ catch_list: catch.OpenParenthesisTkn = $3 catch.Var = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($5), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($5), IdentifierTkn: $5, Value: $5.Value, @@ -1160,7 +1160,7 @@ function_declaration_statement: Position: yylex.(*Parser).builder.NewTokensPosition($1, $11), FunctionTkn: $1, AmpersandTkn: $2, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -1207,7 +1207,7 @@ class_declaration_statement: Position: yylex.(*Parser).builder.NewOptionalListTokensPosition($1, $2, $9), Modifiers: $1, ClassTkn: $2, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -1235,7 +1235,7 @@ class_declaration_statement: class := &ast.StmtClass{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -1296,7 +1296,7 @@ trait_declaration_statement: $$ = &ast.StmtTrait{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $6), TraitTkn: $1, - TraitName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -1314,7 +1314,7 @@ interface_declaration_statement: iface := &ast.StmtInterface{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $7), InterfaceTkn: $1, - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -1492,7 +1492,7 @@ switch_case_list: $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), OpenCurlyBracketTkn: $1, - CaseList: $2, + Cases: $2, CloseCurlyBracketTkn: $3, } } @@ -1502,7 +1502,7 @@ switch_case_list: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), OpenCurlyBracketTkn: $1, CaseSeparatorTkn: $2, - CaseList: $3, + Cases: $3, CloseCurlyBracketTkn: $4, } } @@ -1511,7 +1511,7 @@ switch_case_list: $$ = &ast.StmtSwitch{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), ColonTkn: $1, - CaseList: $2, + Cases: $2, EndSwitchTkn: $3, SemiColonTkn: $4, } @@ -1522,7 +1522,7 @@ switch_case_list: Position: yylex.(*Parser).builder.NewTokensPosition($1, $5), ColonTkn: $1, CaseSeparatorTkn: $2, - CaseList: $3, + Cases: $3, EndSwitchTkn: $4, SemiColonTkn: $5, } @@ -1746,7 +1746,7 @@ parameter: VariadicTkn: $3, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -1772,7 +1772,7 @@ parameter: VariadicTkn: $3, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($4), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -1951,7 +1951,7 @@ static_var: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -1965,7 +1965,7 @@ static_var: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -1995,7 +1995,7 @@ class_statement: Position: yylex.(*Parser).builder.NewNodeListTokenPosition($1, $4), Modifiers: $1, Type: $2, - Properties: $3.(*ParserSeparatedList).Items, + Props: $3.(*ParserSeparatedList).Items, SeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, SemiColonTkn: $4, } @@ -2043,7 +2043,7 @@ class_statement: Modifiers: $1, FunctionTkn: $2, AmpersandTkn: $3, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($4), IdentifierTkn: $4, Value: $4.Value, @@ -2369,7 +2369,7 @@ property: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2384,7 +2384,7 @@ property: Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -2501,7 +2501,7 @@ anonymous_class: Position: yylex.(*Parser).builder.NewTokensPosition($1, $8), ClassTkn: $1, OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ArgumentList).Arguments, + Args: $2.(*ArgumentList).Arguments, SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, OpenCurlyBracketTkn: $6, @@ -2533,7 +2533,7 @@ new_expr: NewTkn: $1, Class: $2, OpenParenthesisTkn: $3.(*ArgumentList).OpenParenthesisTkn, - Arguments: $3.(*ArgumentList).Arguments, + Args: $3.(*ArgumentList).Arguments, SeparatorTkns: $3.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ArgumentList).CloseParenthesisTkn, } @@ -3055,7 +3055,7 @@ expr_without_variable: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $5), - Condition: $1, + Cond: $1, QuestionTkn: $2, IfTrue: $3, ColonTkn: $4, @@ -3066,7 +3066,7 @@ expr_without_variable: { $$ = &ast.ExprTernary{ Position: yylex.(*Parser).builder.NewNodesPosition($1, $4), - Condition: $1, + Cond: $1, QuestionTkn: $2, ColonTkn: $3, IfFalse: $4, @@ -3199,7 +3199,7 @@ expr_without_variable: $$ = &ast.ExprYield{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), YieldTkn: $1, - Value: $2, + Val: $2, } } | T_YIELD expr T_DOUBLE_ARROW expr @@ -3209,7 +3209,7 @@ expr_without_variable: YieldTkn: $1, Key: $2, DoubleArrowTkn: $3, - Value: $4, + Val: $4, } } | T_YIELD_FROM expr @@ -3302,7 +3302,7 @@ lexical_vars: $$ = &ast.ExprClosure{ UseTkn: $1, UseOpenParenthesisTkn: $2, - Use: $3.(*ParserSeparatedList).Items, + Uses: $3.(*ParserSeparatedList).Items, UseSeparatorTkns: $3.(*ParserSeparatedList).SeparatorTkns, UseCloseParenthesisTkn: $4, } @@ -3332,7 +3332,7 @@ lexical_var: Position: yylex.(*Parser).builder.NewTokenPosition($1), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -3347,7 +3347,7 @@ lexical_var: AmpersandTkn: $1, Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($2), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -3364,7 +3364,7 @@ function_call: Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ArgumentList).Arguments, + Args: $2.(*ArgumentList).Arguments, SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } @@ -3377,7 +3377,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3398,7 +3398,7 @@ function_call: DoubleColonTkn: $2, Call: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3417,7 +3417,7 @@ function_call: Position: yylex.(*Parser).builder.NewNodesPosition($1, $2), Function: $1, OpenParenthesisTkn: $2.(*ArgumentList).OpenParenthesisTkn, - Arguments: $2.(*ArgumentList).Arguments, + Args: $2.(*ArgumentList).Arguments, SeparatorTkns: $2.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ArgumentList).CloseParenthesisTkn, } @@ -3676,7 +3676,7 @@ constant: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -3689,7 +3689,7 @@ constant: Position: yylex.(*Parser).builder.NewNodeTokenPosition($1, $3), Class: $1, DoubleColonTkn: $2, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -3810,7 +3810,7 @@ callable_variable: ObjectOperatorTkn: $2, Method: $3, OpenParenthesisTkn: $4.(*ArgumentList).OpenParenthesisTkn, - Arguments: $4.(*ArgumentList).Arguments, + Args: $4.(*ArgumentList).Arguments, SeparatorTkns: $4.(*ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ArgumentList).CloseParenthesisTkn, } @@ -3844,12 +3844,12 @@ variable: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, - Property: $3, + Prop: $3, } if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn - propertyFetch.Property = brackets.Child + propertyFetch.Prop = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn } @@ -3862,7 +3862,7 @@ simple_variable: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -3875,7 +3875,7 @@ simple_variable: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), DollarTkn: $1, OpenCurlyBracketTkn: $2, - VarName: $3, + Name: $3, CloseCurlyBracketTkn: $4, } } @@ -3884,7 +3884,7 @@ simple_variable: $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenNodePosition($1, $2), DollarTkn: $1, - VarName: $2, + Name: $2, } } ; @@ -3896,7 +3896,7 @@ static_member: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable @@ -3905,7 +3905,7 @@ static_member: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } ; @@ -3941,12 +3941,12 @@ new_variable: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Var: $1, ObjectOperatorTkn: $2, - Property: $3, + Prop: $3, } if brackets, ok := $3.(*ParserBrackets); ok { propertyFetch.OpenCurlyBracketTkn = brackets.OpenBracketTkn - propertyFetch.Property = brackets.Child + propertyFetch.Prop = brackets.Child propertyFetch.CloseCurlyBracketTkn = brackets.CloseBracketTkn } @@ -3958,7 +3958,7 @@ new_variable: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable @@ -3967,7 +3967,7 @@ new_variable: Position: yylex.(*Parser).builder.NewNodesPosition($1, $3), Class: $1, DoubleColonTkn: $2, - Property: $3, + Prop: $3, } } ; @@ -4174,7 +4174,7 @@ encaps_var: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -4187,7 +4187,7 @@ encaps_var: Position: yylex.(*Parser).builder.NewTokensPosition($1, $4), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, @@ -4204,14 +4204,14 @@ encaps_var: Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), Var: &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, }, }, ObjectOperatorTkn: $2, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($3), IdentifierTkn: $3, Value: $3.Value, @@ -4223,7 +4223,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: $2, + Name: $2, CloseCurlyBracketTkn: $3, } } @@ -4232,7 +4232,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -4245,7 +4245,7 @@ encaps_var: $$ = &ast.ScalarEncapsedStringVar{ Position: yylex.(*Parser).builder.NewTokensPosition($1, $3), DollarOpenCurlyBracketTkn: $1, - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($2), IdentifierTkn: $2, Value: $2.Value, @@ -4321,7 +4321,7 @@ encaps_var_offset: { $$ = &ast.ExprVariable{ Position: yylex.(*Parser).builder.NewTokenPosition($1), - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Position: yylex.(*Parser).builder.NewTokenPosition($1), IdentifierTkn: $1, Value: $1.Value, diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 261001f..7199459 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -57,9 +57,9 @@ type Visitor interface { StmtTraitUsePrecedence(n *StmtTraitUsePrecedence) StmtTry(n *StmtTry) StmtUnset(n *StmtUnset) - StmtUse(n *StmtUse) - StmtGroupUse(n *StmtGroupUse) - StmtUseDeclaration(n *StmtUseDeclaration) + StmtUse(n *StmtUseList) + StmtGroupUse(n *StmtGroupUseList) + StmtUseDeclaration(n *StmtUse) StmtWhile(n *StmtWhile) ExprArray(n *ExprArray) @@ -166,8 +166,8 @@ type Visitor interface { ScalarMagicConstant(n *ScalarMagicConstant) ScalarString(n *ScalarString) - NameName(n *NameName) + NameName(n *Name) NameFullyQualified(n *NameFullyQualified) NameRelative(n *NameRelative) - NameNamePart(n *NameNamePart) + NameNamePart(n *NamePart) } diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 40e1093..9a9dea7 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -135,7 +135,7 @@ func (n *ScalarEncapsedStringPart) GetPosition() *position.Position { type ScalarEncapsedStringVar struct { Position *position.Position DollarOpenCurlyBracketTkn *token.Token - VarName Vertex + Name Vertex OpenSquareBracketTkn *token.Token Dim Vertex CloseSquareBracketTkn *token.Token @@ -288,9 +288,9 @@ type StmtClass struct { Position *position.Position Modifiers []Vertex ClassTkn *token.Token - ClassName Vertex + Name Vertex OpenParenthesisTkn *token.Token - Arguments []Vertex + Args []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token ExtendsTkn *token.Token @@ -335,7 +335,7 @@ type StmtClassMethod struct { Modifiers []Vertex FunctionTkn *token.Token AmpersandTkn *token.Token - MethodName Vertex + Name Vertex OpenParenthesisTkn *token.Token Params []Vertex SeparatorTkns []*token.Token @@ -603,7 +603,7 @@ type StmtFunction struct { Position *position.Position FunctionTkn *token.Token AmpersandTkn *token.Token - FunctionName Vertex + Name Vertex OpenParenthesisTkn *token.Token Params []Vertex SeparatorTkns []*token.Token @@ -715,7 +715,7 @@ func (n *StmtInlineHtml) GetPosition() *position.Position { type StmtInterface struct { Position *position.Position InterfaceTkn *token.Token - InterfaceName Vertex + Name Vertex ExtendsTkn *token.Token Extends []Vertex ExtendsSeparatorTkns []*token.Token @@ -734,9 +734,9 @@ func (n *StmtInterface) GetPosition() *position.Position { // StmtLabel node type StmtLabel struct { - Position *position.Position - LabelName Vertex - ColonTkn *token.Token + Position *position.Position + Name Vertex + ColonTkn *token.Token } func (n *StmtLabel) Accept(v Visitor) { @@ -801,7 +801,7 @@ type StmtPropertyList struct { Position *position.Position Modifiers []Vertex Type Vertex - Properties []Vertex + Props []Vertex SeparatorTkns []*token.Token SemiColonTkn *token.Token } @@ -889,7 +889,7 @@ type StmtSwitch struct { ColonTkn *token.Token OpenCurlyBracketTkn *token.Token CaseSeparatorTkn *token.Token - CaseList []Vertex + Cases []Vertex CloseCurlyBracketTkn *token.Token EndSwitchTkn *token.Token SemiColonTkn *token.Token @@ -923,7 +923,7 @@ func (n *StmtThrow) GetPosition() *position.Position { type StmtTrait struct { Position *position.Position TraitTkn *token.Token - TraitName Vertex + Name Vertex OpenCurlyBracketTkn *token.Token Stmts []Vertex CloseCurlyBracketTkn *token.Token @@ -1035,26 +1035,26 @@ func (n *StmtUnset) GetPosition() *position.Position { return n.Position } -// StmtUse node -type StmtUse struct { - Position *position.Position - UseTkn *token.Token - Type Vertex - UseDeclarations []Vertex - SeparatorTkns []*token.Token - SemiColonTkn *token.Token +// StmtUseList node +type StmtUseList struct { + Position *position.Position + UseTkn *token.Token + Type Vertex + Uses []Vertex + SeparatorTkns []*token.Token + SemiColonTkn *token.Token } -func (n *StmtUse) Accept(v Visitor) { +func (n *StmtUseList) Accept(v Visitor) { v.StmtUse(n) } -func (n *StmtUse) GetPosition() *position.Position { +func (n *StmtUseList) GetPosition() *position.Position { return n.Position } -// StmtGroupUse node -type StmtGroupUse struct { +// StmtGroupUseList node +type StmtGroupUseList struct { Position *position.Position UseTkn *token.Token Type Vertex @@ -1062,22 +1062,22 @@ type StmtGroupUse struct { Prefix Vertex NsSeparatorTkn *token.Token OpenCurlyBracketTkn *token.Token - UseDeclarations []Vertex + Uses []Vertex SeparatorTkns []*token.Token CloseCurlyBracketTkn *token.Token SemiColonTkn *token.Token } -func (n *StmtGroupUse) Accept(v Visitor) { +func (n *StmtGroupUseList) Accept(v Visitor) { v.StmtGroupUse(n) } -func (n *StmtGroupUse) GetPosition() *position.Position { +func (n *StmtGroupUseList) GetPosition() *position.Position { return n.Position } -// StmtUseDeclaration node -type StmtUseDeclaration struct { +// StmtUse node +type StmtUse struct { Position *position.Position Type Vertex NsSeparatorTkn *token.Token @@ -1086,11 +1086,11 @@ type StmtUseDeclaration struct { Alias Vertex } -func (n *StmtUseDeclaration) Accept(v Visitor) { +func (n *StmtUse) Accept(v Visitor) { v.StmtUseDeclaration(n) } -func (n *StmtUseDeclaration) GetPosition() *position.Position { +func (n *StmtUse) GetPosition() *position.Position { return n.Position } @@ -1242,7 +1242,7 @@ type ExprClassConstFetch struct { Position *position.Position Class Vertex DoubleColonTkn *token.Token - ConstantName Vertex + Const Vertex } func (n *ExprClassConstFetch) Accept(v Visitor) { @@ -1280,7 +1280,7 @@ type ExprClosure struct { CloseParenthesisTkn *token.Token UseTkn *token.Token UseOpenParenthesisTkn *token.Token - Use []Vertex + Uses []Vertex UseSeparatorTkns []*token.Token UseCloseParenthesisTkn *token.Token ColonTkn *token.Token @@ -1398,7 +1398,7 @@ type ExprFunctionCall struct { Position *position.Position Function Vertex OpenParenthesisTkn *token.Token - Arguments []Vertex + Args []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1502,7 +1502,7 @@ type ExprMethodCall struct { Method Vertex CloseCurlyBracketTkn *token.Token OpenParenthesisTkn *token.Token - Arguments []Vertex + Args []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1521,7 +1521,7 @@ type ExprNew struct { NewTkn *token.Token Class Vertex OpenParenthesisTkn *token.Token - Arguments []Vertex + Args []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1615,7 +1615,7 @@ type ExprPropertyFetch struct { Var Vertex ObjectOperatorTkn *token.Token OpenCurlyBracketTkn *token.Token - Property Vertex + Prop Vertex CloseCurlyBracketTkn *token.Token } @@ -1682,7 +1682,7 @@ type ExprStaticCall struct { Call Vertex CloseCurlyBracketTkn *token.Token OpenParenthesisTkn *token.Token - Arguments []Vertex + Args []Vertex SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1700,7 +1700,7 @@ type ExprStaticPropertyFetch struct { Position *position.Position Class Vertex DoubleColonTkn *token.Token - Property Vertex + Prop Vertex } func (n *ExprStaticPropertyFetch) Accept(v Visitor) { @@ -1714,7 +1714,7 @@ func (n *ExprStaticPropertyFetch) GetPosition() *position.Position { // ExprTernary node type ExprTernary struct { Position *position.Position - Condition Vertex + Cond Vertex QuestionTkn *token.Token IfTrue Vertex ColonTkn *token.Token @@ -1764,7 +1764,7 @@ type ExprVariable struct { Position *position.Position DollarTkn *token.Token OpenCurlyBracketTkn *token.Token - VarName Vertex + Name Vertex CloseCurlyBracketTkn *token.Token } @@ -1782,7 +1782,7 @@ type ExprYield struct { YieldTkn *token.Token Key Vertex DoubleArrowTkn *token.Token - Value Vertex + Val Vertex } func (n *ExprYield) Accept(v Visitor) { @@ -2586,17 +2586,17 @@ func (n *ExprBinarySpaceship) GetPosition() *position.Position { return n.Position } -type NameName struct { +type Name struct { Position *position.Position Parts []Vertex SeparatorTkns []*token.Token } -func (n *NameName) Accept(v Visitor) { +func (n *Name) Accept(v Visitor) { v.NameName(n) } -func (n *NameName) GetPosition() *position.Position { +func (n *Name) GetPosition() *position.Position { return n.Position } @@ -2631,16 +2631,16 @@ func (n *NameRelative) GetPosition() *position.Position { return n.Position } -type NameNamePart struct { +type NamePart struct { Position *position.Position StringTkn *token.Token Value []byte } -func (n *NameNamePart) Accept(v Visitor) { +func (n *NamePart) Accept(v Visitor) { v.NameNamePart(n) } -func (n *NameNamePart) GetPosition() *position.Position { +func (n *NamePart) GetPosition() *position.Position { return n.Position } diff --git a/pkg/visitor/dumper/dumper.go b/pkg/visitor/dumper/dumper.go index 2aa6d0e..e38ebeb 100644 --- a/pkg/visitor/dumper/dumper.go +++ b/pkg/visitor/dumper/dumper.go @@ -99,7 +99,7 @@ func (v *Dumper) dumpToken(key string, tok *token.Token) { v.print(v.indent, "ID: token."+tok.ID.String()+",\n") } if tok.Value != nil { - v.print(v.indent, "Value: []byte("+strconv.Quote(string(tok.Value))+"),\n") + v.print(v.indent, "Val: []byte("+strconv.Quote(string(tok.Value))+"),\n") } v.dumpPosition(tok.Position) v.dumpTokenList("FreeFloating", tok.FreeFloating) @@ -209,7 +209,7 @@ func (v *Dumper) Identifier(n *ast.Identifier) { v.dumpPosition(n.Position) v.dumpToken("IdentifierTkn", n.IdentifierTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -281,9 +281,9 @@ func (v *Dumper) StmtClass(n *ast.StmtClass) { v.dumpPosition(n.Position) v.dumpVertexList("Modifiers", n.Modifiers) v.dumpToken("ClassTkn", n.ClassTkn) - v.dumpVertex("ClassName", n.ClassName) + v.dumpVertex("Name", n.Name) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Arguments", n.Arguments) + v.dumpVertexList("Args", n.Args) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) v.dumpToken("ExtendsTkn", n.ExtendsTkn) @@ -322,7 +322,7 @@ func (v *Dumper) StmtClassMethod(n *ast.StmtClassMethod) { v.dumpVertexList("Modifiers", n.Modifiers) v.dumpToken("FunctionTkn", n.FunctionTkn) v.dumpToken("AmpersandTkn", n.AmpersandTkn) - v.dumpVertex("MethodName", n.MethodName) + v.dumpVertex("Name", n.Name) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) v.dumpVertexList("Params", n.Params) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) @@ -549,7 +549,7 @@ func (v *Dumper) StmtFunction(n *ast.StmtFunction) { v.dumpPosition(n.Position) v.dumpToken("FunctionTkn", n.FunctionTkn) v.dumpToken("AmpersandTkn", n.AmpersandTkn) - v.dumpVertex("FunctionName", n.FunctionName) + v.dumpVertex("Name", n.Name) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) v.dumpVertexList("Params", n.Params) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) @@ -631,7 +631,7 @@ func (v *Dumper) StmtInlineHtml(n *ast.StmtInlineHtml) { v.dumpPosition(n.Position) v.dumpToken("InlineHtmlTkn", n.InlineHtmlTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -643,7 +643,7 @@ func (v *Dumper) StmtInterface(n *ast.StmtInterface) { v.dumpPosition(n.Position) v.dumpToken("InterfaceTkn", n.InterfaceTkn) - v.dumpVertex("InterfaceName", n.InterfaceName) + v.dumpVertex("Name", n.Name) v.dumpToken("ExtendsTkn", n.ExtendsTkn) v.dumpVertexList("Extends", n.Extends) v.dumpTokenList("ExtendsSeparatorTkns", n.ExtendsSeparatorTkns) @@ -660,7 +660,7 @@ func (v *Dumper) StmtLabel(n *ast.StmtLabel) { v.indent++ v.dumpPosition(n.Position) - v.dumpVertex("LabelName", n.LabelName) + v.dumpVertex("Name", n.Name) v.dumpToken("ColonTkn", n.ColonTkn) v.indent-- @@ -714,7 +714,7 @@ func (v *Dumper) StmtPropertyList(n *ast.StmtPropertyList) { v.dumpPosition(n.Position) v.dumpVertexList("Modifiers", n.Modifiers) v.dumpVertex("Type", n.Type) - v.dumpVertexList("Properties", n.Properties) + v.dumpVertexList("Props", n.Props) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("SemiColonTkn", n.SemiColonTkn) @@ -787,7 +787,7 @@ func (v *Dumper) StmtSwitch(n *ast.StmtSwitch) { v.dumpToken("ColonTkn", n.ColonTkn) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpToken("CaseSeparatorTkn", n.CaseSeparatorTkn) - v.dumpVertexList("CaseList", n.CaseList) + v.dumpVertexList("Cases", n.Cases) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("EndSwitchTkn", n.EndSwitchTkn) v.dumpToken("SemiColonTkn", n.SemiColonTkn) @@ -815,7 +815,7 @@ func (v *Dumper) StmtTrait(n *ast.StmtTrait) { v.dumpPosition(n.Position) v.dumpToken("TraitTkn", n.TraitTkn) - v.dumpVertex("TraitName", n.TraitName) + v.dumpVertex("Name", n.Name) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) v.dumpVertexList("Stmts", n.Stmts) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) @@ -907,14 +907,14 @@ func (v *Dumper) StmtUnset(n *ast.StmtUnset) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtUse(n *ast.StmtUse) { - v.print(0, "&ast.StmtUse{\n") +func (v *Dumper) StmtUse(n *ast.StmtUseList) { + v.print(0, "&ast.StmtUseList{\n") v.indent++ v.dumpPosition(n.Position) v.dumpToken("UseTkn", n.UseTkn) v.dumpVertex("Type", n.Type) - v.dumpVertexList("UseDeclarations", n.UseDeclarations) + v.dumpVertexList("Uses", n.Uses) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("SemiColonTkn", n.SemiColonTkn) @@ -922,8 +922,8 @@ func (v *Dumper) StmtUse(n *ast.StmtUse) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) { - v.print(0, "&ast.StmtGroupUse{\n") +func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUseList) { + v.print(0, "&ast.StmtGroupUseList{\n") v.indent++ v.dumpPosition(n.Position) @@ -933,7 +933,7 @@ func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) { v.dumpVertex("Prefix", n.Prefix) v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) - v.dumpVertexList("UseDeclarations", n.UseDeclarations) + v.dumpVertexList("Uses", n.Uses) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("SemiColonTkn", n.SemiColonTkn) @@ -942,14 +942,14 @@ func (v *Dumper) StmtGroupUse(n *ast.StmtGroupUse) { v.print(v.indent, "},\n") } -func (v *Dumper) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - v.print(0, "&ast.StmtUseDeclaration{\n") +func (v *Dumper) StmtUseDeclaration(n *ast.StmtUse) { + v.print(0, "&ast.StmtUse{\n") v.indent++ v.dumpPosition(n.Position) v.dumpVertex("Type", n.Type) v.dumpToken("NsSeparatorTkn", n.NsSeparatorTkn) - v.dumpVertex("Use", n.Use) + v.dumpVertex("Uses", n.Use) v.dumpToken("AsTkn", n.AsTkn) v.dumpVertex("Alias", n.Alias) @@ -1084,7 +1084,7 @@ func (v *Dumper) ExprClassConstFetch(n *ast.ExprClassConstFetch) { v.dumpPosition(n.Position) v.dumpVertex("Class", n.Class) v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) - v.dumpVertex("ConstantName", n.ConstantName) + v.dumpVertex("Const", n.Const) v.indent-- v.print(v.indent, "},\n") @@ -1116,7 +1116,7 @@ func (v *Dumper) ExprClosure(n *ast.ExprClosure) { v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) v.dumpToken("UseTkn", n.UseTkn) v.dumpToken("UseOpenParenthesisTkn", n.UseOpenParenthesisTkn) - v.dumpVertexList("Use", n.Use) + v.dumpVertexList("Uses", n.Uses) v.dumpTokenList("UseSeparatorTkns", n.UseSeparatorTkns) v.dumpToken("UseCloseParenthesisTkn", n.UseCloseParenthesisTkn) v.dumpToken("ColonTkn", n.ColonTkn) @@ -1213,7 +1213,7 @@ func (v *Dumper) ExprFunctionCall(n *ast.ExprFunctionCall) { v.dumpPosition(n.Position) v.dumpVertex("Function", n.Function) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Arguments", n.Arguments) + v.dumpVertexList("Args", n.Args) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) @@ -1299,7 +1299,7 @@ func (v *Dumper) ExprMethodCall(n *ast.ExprMethodCall) { v.dumpVertex("Method", n.Method) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Arguments", n.Arguments) + v.dumpVertexList("Args", n.Args) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) @@ -1315,7 +1315,7 @@ func (v *Dumper) ExprNew(n *ast.ExprNew) { v.dumpToken("NewTkn", n.NewTkn) v.dumpVertex("Class", n.Class) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Arguments", n.Arguments) + v.dumpVertexList("Args", n.Args) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) @@ -1391,7 +1391,7 @@ func (v *Dumper) ExprPropertyFetch(n *ast.ExprPropertyFetch) { v.dumpVertex("Var", n.Var) v.dumpToken("ObjectOperatorTkn", n.ObjectOperatorTkn) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) - v.dumpVertex("Property", n.Property) + v.dumpVertex("Prop", n.Prop) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- @@ -1446,7 +1446,7 @@ func (v *Dumper) ExprStaticCall(n *ast.ExprStaticCall) { v.dumpVertex("Call", n.Call) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.dumpToken("OpenParenthesisTkn", n.OpenParenthesisTkn) - v.dumpVertexList("Arguments", n.Arguments) + v.dumpVertexList("Args", n.Args) v.dumpTokenList("SeparatorTkns", n.SeparatorTkns) v.dumpToken("CloseParenthesisTkn", n.CloseParenthesisTkn) @@ -1461,7 +1461,7 @@ func (v *Dumper) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { v.dumpPosition(n.Position) v.dumpVertex("Class", n.Class) v.dumpToken("DoubleColonTkn", n.DoubleColonTkn) - v.dumpVertex("Property", n.Property) + v.dumpVertex("Prop", n.Prop) v.indent-- v.print(v.indent, "},\n") @@ -1472,7 +1472,7 @@ func (v *Dumper) ExprTernary(n *ast.ExprTernary) { v.indent++ v.dumpPosition(n.Position) - v.dumpVertex("Condition", n.Condition) + v.dumpVertex("Cond", n.Cond) v.dumpToken("QuestionTkn", n.QuestionTkn) v.dumpVertex("IfTrue", n.IfTrue) v.dumpToken("ColonTkn", n.ColonTkn) @@ -1513,7 +1513,7 @@ func (v *Dumper) ExprVariable(n *ast.ExprVariable) { v.dumpPosition(n.Position) v.dumpToken("DollarTkn", n.DollarTkn) v.dumpToken("OpenCurlyBracketTkn", n.OpenCurlyBracketTkn) - v.dumpVertex("VarName", n.VarName) + v.dumpVertex("Name", n.Name) v.dumpToken("CloseCurlyBracketTkn", n.CloseCurlyBracketTkn) v.indent-- @@ -1528,7 +1528,7 @@ func (v *Dumper) ExprYield(n *ast.ExprYield) { v.dumpToken("YieldTkn", n.YieldTkn) v.dumpVertex("Key", n.Key) v.dumpToken("DoubleArrowTkn", n.DoubleArrowTkn) - v.dumpVertex("Value", n.Value) + v.dumpVertex("Val", n.Val) v.indent-- v.print(v.indent, "},\n") @@ -2183,7 +2183,7 @@ func (v *Dumper) ScalarDnumber(n *ast.ScalarDnumber) { v.dumpPosition(n.Position) v.dumpToken("NumberTkn", n.NumberTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -2208,7 +2208,7 @@ func (v *Dumper) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { v.dumpPosition(n.Position) v.dumpToken("EncapsedStrTkn", n.EncapsedStrTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -2220,7 +2220,7 @@ func (v *Dumper) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { v.dumpPosition(n.Position) v.dumpToken("DollarOpenCurlyBracketTkn", n.DollarOpenCurlyBracketTkn) - v.dumpVertex("VarName", n.VarName) + v.dumpVertex("Name", n.Name) v.dumpToken("OpenSquareBracketTkn", n.OpenSquareBracketTkn) v.dumpVertex("Dim", n.Dim) v.dumpToken("CloseSquareBracketTkn", n.CloseSquareBracketTkn) @@ -2262,7 +2262,7 @@ func (v *Dumper) ScalarLnumber(n *ast.ScalarLnumber) { v.dumpPosition(n.Position) v.dumpToken("NumberTkn", n.NumberTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -2274,7 +2274,7 @@ func (v *Dumper) ScalarMagicConstant(n *ast.ScalarMagicConstant) { v.dumpPosition(n.Position) v.dumpToken("MagicConstTkn", n.MagicConstTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") @@ -2287,14 +2287,14 @@ func (v *Dumper) ScalarString(n *ast.ScalarString) { v.dumpPosition(n.Position) v.dumpToken("MinusTkn", n.MinusTkn) v.dumpToken("StringTkn", n.StringTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") } -func (v *Dumper) NameName(n *ast.NameName) { - v.print(0, "&ast.NameName{\n") +func (v *Dumper) NameName(n *ast.Name) { + v.print(0, "&ast.Name{\n") v.indent++ v.dumpPosition(n.Position) @@ -2332,13 +2332,13 @@ func (v *Dumper) NameRelative(n *ast.NameRelative) { v.print(v.indent, "},\n") } -func (v *Dumper) NameNamePart(n *ast.NameNamePart) { - v.print(0, "&ast.NameNamePart{\n") +func (v *Dumper) NameNamePart(n *ast.NamePart) { + v.print(0, "&ast.NamePart{\n") v.indent++ v.dumpPosition(n.Position) v.dumpToken("StringTkn", n.StringTkn) - v.dumpValue("Value", n.Value) + v.dumpValue("Val", n.Value) v.indent-- v.print(v.indent, "},\n") diff --git a/pkg/visitor/dumper/dumper_test.go b/pkg/visitor/dumper/dumper_test.go index 8c94ac2..2a9ec04 100644 --- a/pkg/visitor/dumper/dumper_test.go +++ b/pkg/visitor/dumper/dumper_test.go @@ -56,7 +56,7 @@ func TestDumper_root(t *testing.T) { FreeFloating: []*token.Token{ { ID: token.T_WHITESPACE, - Value: []byte(" "), + Val: []byte(" "), Position: &position.Position{ StartLine: 1, EndLine: 2, diff --git a/pkg/visitor/formatter/formatter.go b/pkg/visitor/formatter/formatter.go index e6cb6f6..4f9ce9c 100644 --- a/pkg/visitor/formatter/formatter.go +++ b/pkg/visitor/formatter/formatter.go @@ -267,14 +267,14 @@ func (f *formatter) StmtClass(n *ast.StmtClass) { n.ClassTkn = f.newToken(token.T_CLASS, []byte("class")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - n.ClassName.Accept(f) + n.Name.Accept(f) n.OpenParenthesisTkn = nil n.CloseParenthesisTkn = nil - if len(n.Arguments) > 0 { + if len(n.Args) > 0 { n.OpenParenthesisTkn = f.newToken('(', []byte("(")) - n.SeparatorTkns = f.formatList(n.Arguments, ',') + n.SeparatorTkns = f.formatList(n.Args, ',') n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } @@ -333,7 +333,7 @@ func (f *formatter) StmtClassMethod(n *ast.StmtClassMethod) { n.AmpersandTkn = f.newToken('&', []byte("&")) } - n.MethodName.Accept(f) + n.Name.Accept(f) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) @@ -564,7 +564,7 @@ func (f *formatter) StmtFunction(n *ast.StmtFunction) { n.AmpersandTkn = f.newToken('&', []byte("&")) } - n.FunctionName.Accept(f) + n.Name.Accept(f) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) @@ -661,7 +661,7 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) { n.InterfaceTkn = f.newToken(token.T_INTERFACE, []byte("interface")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - n.InterfaceName.Accept(f) + n.Name.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) if n.Extends != nil { @@ -685,7 +685,7 @@ func (f *formatter) StmtInterface(n *ast.StmtInterface) { } func (f *formatter) StmtLabel(n *ast.StmtLabel) { - n.LabelName.Accept(f) + n.Name.Accept(f) n.ColonTkn = f.newToken(':', []byte(":")) } @@ -746,7 +746,7 @@ func (f *formatter) StmtPropertyList(n *ast.StmtPropertyList) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } - n.SeparatorTkns = f.formatList(n.Properties, ',') + n.SeparatorTkns = f.formatList(n.Props, ',') n.SemiColonTkn = f.newSemicolonTkn() } @@ -816,9 +816,9 @@ func (f *formatter) StmtSwitch(n *ast.StmtSwitch) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) - if len(n.CaseList) > 0 { + if len(n.Cases) > 0 { f.indent++ - f.formatStmts(&n.CaseList) + f.formatStmts(&n.Cases) f.indent-- f.addFreeFloating(token.T_WHITESPACE, []byte("\n")) @@ -841,7 +841,7 @@ func (f *formatter) StmtTrait(n *ast.StmtTrait) { n.TraitTkn = f.newToken(token.T_TRAIT, []byte("trait")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) - n.TraitName.Accept(f) + n.Name.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) @@ -964,7 +964,7 @@ func (f *formatter) StmtUnset(n *ast.StmtUnset) { n.SemiColonTkn = f.newSemicolonTkn() } -func (f *formatter) StmtUse(n *ast.StmtUse) { +func (f *formatter) StmtUse(n *ast.StmtUseList) { n.UseTkn = f.newToken(token.T_USE, []byte("use")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) @@ -973,12 +973,12 @@ func (f *formatter) StmtUse(n *ast.StmtUse) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } - n.SeparatorTkns = f.formatList(n.UseDeclarations, ',') + n.SeparatorTkns = f.formatList(n.Uses, ',') n.SemiColonTkn = f.newSemicolonTkn() } -func (f *formatter) StmtGroupUse(n *ast.StmtGroupUse) { +func (f *formatter) StmtGroupUse(n *ast.StmtGroupUseList) { n.UseTkn = f.newToken(token.T_USE, []byte("use")) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) @@ -993,13 +993,13 @@ func (f *formatter) StmtGroupUse(n *ast.StmtGroupUse) { n.NsSeparatorTkn = f.newToken(token.T_NS_SEPARATOR, []byte("\\")) n.OpenCurlyBracketTkn = f.newToken('{', []byte("{")) - n.SeparatorTkns = f.formatList(n.UseDeclarations, ',') + n.SeparatorTkns = f.formatList(n.Uses, ',') n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) n.SemiColonTkn = f.newSemicolonTkn() } -func (f *formatter) StmtUseDeclaration(n *ast.StmtUseDeclaration) { +func (f *formatter) StmtUseDeclaration(n *ast.StmtUse) { if n.Type != nil { n.Type.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) @@ -1113,7 +1113,7 @@ func (f *formatter) ExprBrackets(n *ast.ExprBrackets) { func (f *formatter) ExprClassConstFetch(n *ast.ExprClassConstFetch) { n.Class.Accept(f) n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) - n.ConstantName.Accept(f) + n.Const.Accept(f) } func (f *formatter) ExprClone(n *ast.ExprClone) { @@ -1145,11 +1145,11 @@ func (f *formatter) ExprClosure(n *ast.ExprClosure) { n.UseOpenParenthesisTkn = nil n.UseCloseParenthesisTkn = nil n.UseSeparatorTkns = nil - if len(n.Use) > 0 { + if len(n.Uses) > 0 { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.UseTkn = f.newToken(token.T_USE, []byte("use")) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) - n.SeparatorTkns = f.formatList(n.Use, ',') + n.SeparatorTkns = f.formatList(n.Uses, ',') n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } @@ -1221,8 +1221,8 @@ func (f *formatter) ExprFunctionCall(n *ast.ExprFunctionCall) { n.Function.Accept(f) n.OpenParenthesisTkn = f.newToken('(', []byte("(")) n.SeparatorTkns = nil - if len(n.Arguments) > 0 { - n.SeparatorTkns = f.formatList(n.Arguments, ',') + if len(n.Args) > 0 { + n.SeparatorTkns = f.formatList(n.Args, ',') } n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } @@ -1281,8 +1281,8 @@ func (f *formatter) ExprMethodCall(n *ast.ExprMethodCall) { n.OpenParenthesisTkn = f.newToken('(', []byte("(")) n.SeparatorTkns = nil - if len(n.Arguments) > 0 { - n.SeparatorTkns = f.formatList(n.Arguments, ',') + if len(n.Args) > 0 { + n.SeparatorTkns = f.formatList(n.Args, ',') } n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } @@ -1296,9 +1296,9 @@ func (f *formatter) ExprNew(n *ast.ExprNew) { n.SeparatorTkns = nil n.OpenParenthesisTkn = nil n.CloseParenthesisTkn = nil - if len(n.Arguments) > 0 { + if len(n.Args) > 0 { n.OpenParenthesisTkn = f.newToken('(', []byte("(")) - n.SeparatorTkns = f.formatList(n.Arguments, ',') + n.SeparatorTkns = f.formatList(n.Args, ',') n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } } @@ -1336,7 +1336,7 @@ func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) { n.OpenCurlyBracketTkn = nil n.CloseCurlyBracketTkn = nil - switch n.Property.(type) { + switch n.Prop.(type) { case *ast.Identifier: case *ast.ExprVariable: default: @@ -1344,7 +1344,7 @@ func (f *formatter) ExprPropertyFetch(n *ast.ExprPropertyFetch) { n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) } - n.Property.Accept(f) + n.Prop.Accept(f) } func (f *formatter) ExprRequire(n *ast.ExprRequire) { @@ -1385,8 +1385,8 @@ func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) { n.OpenParenthesisTkn = f.newToken('(', []byte("(")) n.SeparatorTkns = nil - if len(n.Arguments) > 0 { - n.SeparatorTkns = f.formatList(n.Arguments, ',') + if len(n.Args) > 0 { + n.SeparatorTkns = f.formatList(n.Args, ',') } n.CloseParenthesisTkn = f.newToken(')', []byte(")")) } @@ -1394,11 +1394,11 @@ func (f *formatter) ExprStaticCall(n *ast.ExprStaticCall) { func (f *formatter) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { n.Class.Accept(f) n.DoubleColonTkn = f.newToken(token.T_PAAMAYIM_NEKUDOTAYIM, []byte("::")) - n.Property.Accept(f) + n.Prop.Accept(f) } func (f *formatter) ExprTernary(n *ast.ExprTernary) { - n.Condition.Accept(f) + n.Cond.Accept(f) f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) n.QuestionTkn = f.newToken('?', []byte("?")) if n.IfTrue != nil { @@ -1422,13 +1422,13 @@ func (f *formatter) ExprUnaryPlus(n *ast.ExprUnaryPlus) { } func (f *formatter) ExprVariable(n *ast.ExprVariable) { - if _, ok := n.VarName.(*ast.Identifier); !ok { + if _, ok := n.Name.(*ast.Identifier); !ok { n.DollarTkn = f.newToken('$', []byte("$")) } n.OpenCurlyBracketTkn = nil n.CloseCurlyBracketTkn = nil - switch n.VarName.(type) { + switch n.Name.(type) { case *ast.Identifier: case *ast.ExprVariable: default: @@ -1436,7 +1436,7 @@ func (f *formatter) ExprVariable(n *ast.ExprVariable) { n.CloseCurlyBracketTkn = f.newToken('}', []byte("}")) } - n.VarName.Accept(f) + n.Name.Accept(f) } func (f *formatter) ExprYield(n *ast.ExprYield) { @@ -1450,7 +1450,7 @@ func (f *formatter) ExprYield(n *ast.ExprYield) { f.addFreeFloating(token.T_WHITESPACE, []byte(" ")) } - n.Value.Accept(f) + n.Val.Accept(f) } func (f *formatter) ExprYieldFrom(n *ast.ExprYieldFrom) { @@ -1942,7 +1942,7 @@ func (f *formatter) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { func (f *formatter) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { n.DollarOpenCurlyBracketTkn = f.newToken(token.T_DOLLAR_OPEN_CURLY_BRACES, []byte("${")) - n.VarName.Accept(f) + n.Name.Accept(f) n.OpenSquareBracketTkn = nil n.CloseSquareBracketTkn = nil @@ -1993,7 +1993,7 @@ func (f *formatter) ScalarString(n *ast.ScalarString) { } } -func (f *formatter) NameName(n *ast.NameName) { +func (f *formatter) NameName(n *ast.Name) { separatorTkns := make([]*token.Token, len(n.Parts)-1) for i, v := range n.Parts { v.Accept(f) @@ -2031,7 +2031,7 @@ func (f *formatter) NameRelative(n *ast.NameRelative) { } } -func (f *formatter) NameNamePart(n *ast.NameNamePart) { +func (f *formatter) NameNamePart(n *ast.NamePart) { if n.StringTkn == nil { n.StringTkn = f.newToken(token.T_STRING, n.Value) } else { diff --git a/pkg/visitor/formatter/formatter_test.go b/pkg/visitor/formatter/formatter_test.go index a170d89..b78ad38 100644 --- a/pkg/visitor/formatter/formatter_test.go +++ b/pkg/visitor/formatter/formatter_test.go @@ -63,7 +63,7 @@ func TestFormatter_Parameter(t *testing.T) { n := &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -89,7 +89,7 @@ func TestFormatter_Parameter_Ref(t *testing.T) { n := &ast.Parameter{ AmpersandTkn: &token.Token{}, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -115,7 +115,7 @@ func TestFormatter_Parameter_Variadic(t *testing.T) { n := &ast.Parameter{ VariadicTkn: &token.Token{}, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -143,7 +143,7 @@ func TestFormatter_Parameter_Type(t *testing.T) { Value: []byte("array"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -168,7 +168,7 @@ func TestFormatter_Parameter_Default(t *testing.T) { n := &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -217,7 +217,7 @@ func TestFormatter_Argument(t *testing.T) { n := &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -243,7 +243,7 @@ func TestFormatter_Argument_Ref(t *testing.T) { n := &ast.Argument{ AmpersandTkn: &token.Token{}, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -269,7 +269,7 @@ func TestFormatter_Argument_Variadic(t *testing.T) { n := &ast.Argument{ VariadicTkn: &token.Token{}, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -313,7 +313,7 @@ func TestFormatter_StmtBreak_Expr(t *testing.T) { n := &ast.StmtBreak{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -338,7 +338,7 @@ func TestFormatter_Case(t *testing.T) { n := &ast.StmtCase{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -367,23 +367,23 @@ func TestFormatter_Catch(t *testing.T) { n := &ast.StmtCatch{ Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, }, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$baz"), }, }, @@ -412,7 +412,7 @@ func TestFormatter_Class(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClass{ - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -445,7 +445,7 @@ func TestFormatter_Class_Modifier(t *testing.T) { Value: []byte("final"), }, }, - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -473,20 +473,20 @@ func TestFormatter_Class_Anonymous(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClass{ - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -517,12 +517,12 @@ func TestFormatter_Class_Extends(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClass{ - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, - Extends: &ast.NameName{ + Extends: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -552,13 +552,13 @@ func TestFormatter_Class_Implements(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClass{ - ClassName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Implements: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -670,7 +670,7 @@ func TestFormatter_ClassMethod(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClassMethod{ - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmt: &ast.StmtNop{}, @@ -699,7 +699,7 @@ func TestFormatter_ClassMethod_Modifier(t *testing.T) { Value: []byte("public"), }, }, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmt: &ast.StmtStmtList{ @@ -730,7 +730,7 @@ func TestFormatter_ClassMethod_Ref(t *testing.T) { n := &ast.StmtClassMethod{ AmpersandTkn: &token.Token{}, - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmt: &ast.StmtStmtList{ @@ -760,20 +760,20 @@ func TestFormatter_ClassMethod_Params(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClassMethod{ - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Params: []ast.Vertex{ &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -806,12 +806,12 @@ func TestFormatter_ClassMethod_ReturnType(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtClassMethod{ - MethodName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -927,7 +927,7 @@ func TestFormatter_StmtContinue_Expr(t *testing.T) { n := &ast.StmtContinue{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -1047,7 +1047,7 @@ func TestFormatter_StmtDo(t *testing.T) { }, }, Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -1129,7 +1129,7 @@ func TestFormatter_StmtElseIf(t *testing.T) { n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -1161,7 +1161,7 @@ func TestFormatter_StmtExpression(t *testing.T) { n := &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$var"), }, }, @@ -1212,36 +1212,36 @@ func TestFormatter_StmtFor(t *testing.T) { n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, }, Cond: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, }, Loop: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -1274,12 +1274,12 @@ func TestFormatter_StmtForeach(t *testing.T) { n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$val"), }, }, @@ -1311,13 +1311,13 @@ func TestFormatter_StmtForeach_Reference(t *testing.T) { n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, AmpersandTkn: &token.Token{}, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$val"), }, }, @@ -1349,17 +1349,17 @@ func TestFormatter_StmtForeach_Key(t *testing.T) { n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Key: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$key"), }, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$val"), }, }, @@ -1390,7 +1390,7 @@ func TestFormatter_StmtFunction(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtFunction{ - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -1419,7 +1419,7 @@ func TestFormatter_StmtFunction_Ref(t *testing.T) { n := &ast.StmtFunction{ AmpersandTkn: &token.Token{}, - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -1447,20 +1447,20 @@ func TestFormatter_StmtFunction_Params(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtFunction{ - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Params: []ast.Vertex{ &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -1491,12 +1491,12 @@ func TestFormatter_StmtFunction_ReturnType(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtFunction{ - FunctionName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -1528,12 +1528,12 @@ func TestFormatter_StmtGlobal(t *testing.T) { n := &ast.StmtGlobal{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -1601,7 +1601,7 @@ func TestFormatter_StmtIf(t *testing.T) { n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -1633,7 +1633,7 @@ func TestFormatter_StmtIf_ElseIf(t *testing.T) { n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -1645,7 +1645,7 @@ func TestFormatter_StmtIf_ElseIf(t *testing.T) { ElseIf: []ast.Vertex{ &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -1657,7 +1657,7 @@ func TestFormatter_StmtIf_ElseIf(t *testing.T) { }, &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$baz"), }, }, @@ -1695,7 +1695,7 @@ func TestFormatter_StmtIf_Else(t *testing.T) { n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -1745,7 +1745,7 @@ func TestFormatter_StmtInlineHtml(t *testing.T) { &ast.StmtEcho{ Exprs: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -1784,7 +1784,7 @@ func TestFormatter_StmtInterface(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtInterface{ - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -1812,13 +1812,13 @@ func TestFormatter_StmtInterface_Extends(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtInterface{ - InterfaceName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Extends: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -1849,7 +1849,7 @@ func TestFormatter_StmtLabel(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtLabel{ - LabelName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("FOO"), }, } @@ -1872,9 +1872,9 @@ func TestFormatter_StmtNamespace_Name(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtNamespace{ - Name: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -1992,7 +1992,7 @@ func TestFormatter_StmtPropertyList(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtPropertyList{ - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Var: &ast.Identifier{ Value: []byte("$foo"), @@ -2032,7 +2032,7 @@ func TestFormatter_StmtPropertyList_Modifiers(t *testing.T) { Value: []byte("static"), }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Var: &ast.Identifier{ Value: []byte("$foo"), @@ -2067,7 +2067,7 @@ func TestFormatter_StmtPropertyList_Type(t *testing.T) { Type: &ast.Identifier{ Value: []byte("array"), }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Var: &ast.Identifier{ Value: []byte("$foo"), @@ -2144,14 +2144,14 @@ func TestFormatter_StmtStatic(t *testing.T) { Vars: []ast.Vertex{ &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -2178,7 +2178,7 @@ func TestFormatter_StmtStaticVar(t *testing.T) { n := &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -2203,7 +2203,7 @@ func TestFormatter_StmtStaticVar_Expr(t *testing.T) { n := &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -2268,11 +2268,11 @@ func TestFormatter_StmtSwitch(t *testing.T) { n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Cond: &ast.ScalarString{ Value: []byte("'bar'"), @@ -2313,7 +2313,7 @@ func TestFormatter_StmtThrow(t *testing.T) { n := &ast.StmtThrow{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -2337,7 +2337,7 @@ func TestFormatter_StmtTrait(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtTrait{ - TraitName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Stmts: []ast.Vertex{ @@ -2366,16 +2366,16 @@ func TestFormatter_StmtTraitUse(t *testing.T) { n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -2402,16 +2402,16 @@ func TestFormatter_StmtTraitUse_Adaptations(t *testing.T) { n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -2478,9 +2478,9 @@ func TestFormatter_StmtTraitUseAlias_Trait(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtTraitUseAlias{ - Trait: &ast.NameName{ + Trait: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -2570,16 +2570,16 @@ func TestFormatter_StmtTraitUsePrecedence(t *testing.T) { Value: []byte("foo"), }, Insteadof: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, }, - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("baz"), }, }, @@ -2605,9 +2605,9 @@ func TestFormatter_StmtTraitUsePrecedence_Trait(t *testing.T) { o := bytes.NewBufferString("") n := &ast.StmtTraitUsePrecedence{ - Trait: &ast.NameName{ + Trait: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -2616,9 +2616,9 @@ func TestFormatter_StmtTraitUsePrecedence_Trait(t *testing.T) { Value: []byte("bar"), }, Insteadof: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("baz"), }, }, @@ -2675,16 +2675,16 @@ func TestFormatter_StmtTry_Catch(t *testing.T) { Catches: []ast.Vertex{ &ast.StmtCatch{ Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -2694,16 +2694,16 @@ func TestFormatter_StmtTry_Catch(t *testing.T) { }, &ast.StmtCatch{ Types: []ast.Vertex{ - &ast.NameName{ + &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -2772,12 +2772,12 @@ func TestFormatter_StmtUnset(t *testing.T) { n := &ast.StmtUnset{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -2801,21 +2801,21 @@ func TestFormatter_StmtUnset(t *testing.T) { func TestFormatter_StmtUse(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + n := &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, }, - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -2841,15 +2841,15 @@ func TestFormatter_StmtUse(t *testing.T) { func TestFormatter_StmtUse_Type(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtUse{ + n := &ast.StmtUseList{ Type: &ast.Identifier{ Value: []byte("function"), }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -2875,28 +2875,28 @@ func TestFormatter_StmtUse_Type(t *testing.T) { func TestFormatter_StmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtGroupUse{ - Prefix: &ast.NameName{ + n := &ast.StmtGroupUseList{ + Prefix: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, }, }, - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("baz"), }, }, @@ -2922,31 +2922,31 @@ func TestFormatter_StmtGroupUse(t *testing.T) { func TestFormatter_StmtGroupUse_Type(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtGroupUse{ + n := &ast.StmtGroupUseList{ Type: &ast.Identifier{ Value: []byte("function"), }, - Prefix: &ast.NameName{ + Prefix: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, }, }, - &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("baz"), }, }, @@ -2972,10 +2972,10 @@ func TestFormatter_StmtGroupUse_Type(t *testing.T) { func TestFormatter_StmtUseDeclaration(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + n := &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -2999,13 +2999,13 @@ func TestFormatter_StmtUseDeclaration(t *testing.T) { func TestFormatter_StmtUseDeclaration_Type(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtUseDeclaration{ + n := &ast.StmtUse{ Type: &ast.Identifier{ Value: []byte("function"), }, - Use: &ast.NameName{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -3029,10 +3029,10 @@ func TestFormatter_StmtUseDeclaration_Type(t *testing.T) { func TestFormatter_StmtUseDeclaration_Alias(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.StmtUseDeclaration{ - Use: &ast.NameName{ + n := &ast.StmtUse{ + Use: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -3061,7 +3061,7 @@ func TestFormatter_StmtWhile(t *testing.T) { n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3089,14 +3089,14 @@ func TestFormatter_ExprArray(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -3123,12 +3123,12 @@ func TestFormatter_ExprArrayDimFetch(t *testing.T) { n := &ast.ExprArrayDimFetch{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Dim: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -3153,7 +3153,7 @@ func TestFormatter_ExprArrayItem(t *testing.T) { n := &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3178,12 +3178,12 @@ func TestFormatter_ExprArrayItem_Key(t *testing.T) { n := &ast.ExprArrayItem{ Key: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -3209,7 +3209,7 @@ func TestFormatter_ExprArrayItem_Variadic(t *testing.T) { n := &ast.ExprArrayItem{ EllipsisTkn: &token.Token{}, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3234,7 +3234,7 @@ func TestFormatter_ExprArrowFunction(t *testing.T) { n := &ast.ExprArrowFunction{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3260,7 +3260,7 @@ func TestFormatter_ExprArrowFunction_Ref(t *testing.T) { n := &ast.ExprArrowFunction{ AmpersandTkn: &token.Token{}, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3287,21 +3287,21 @@ func TestFormatter_ExprArrowFunction_Params(t *testing.T) { Params: []ast.Vertex{ &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3325,15 +3325,15 @@ func TestFormatter_ExprArrowFunction_ReturnType(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprArrowFunction{ - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -3358,7 +3358,7 @@ func TestFormatter_ExprBitwiseNot(t *testing.T) { n := &ast.ExprBitwiseNot{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3383,7 +3383,7 @@ func TestFormatter_ExprBooleanNot(t *testing.T) { n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3408,7 +3408,7 @@ func TestFormatter_ExprBrackets(t *testing.T) { n := &ast.ExprBrackets{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3433,11 +3433,11 @@ func TestFormatter_ExprClassConstFetch(t *testing.T) { n := &ast.ExprClassConstFetch{ Class: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Value: []byte("bar"), }, } @@ -3461,7 +3461,7 @@ func TestFormatter_ExprClone(t *testing.T) { n := &ast.ExprClone{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3539,14 +3539,14 @@ func TestFormatter_ExprClosure_Params(t *testing.T) { Params: []ast.Vertex{ &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -3577,9 +3577,9 @@ func TestFormatter_ExprClosure_ReturnType(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprClosure{ - ReturnType: &ast.NameName{ + ReturnType: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -3609,10 +3609,10 @@ func TestFormatter_ExprClosure_Use(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprClosure{ - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3644,7 +3644,7 @@ func TestFormatter_ExprClosureUse(t *testing.T) { n := &ast.ExprClosureUse{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, @@ -3670,7 +3670,7 @@ func TestFormatter_ExprClosureUse_Reference(t *testing.T) { n := &ast.ExprClosureUse{ AmpersandTkn: &token.Token{}, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, @@ -3694,9 +3694,9 @@ func TestFormatter_ExprConstFetch(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprConstFetch{ - Const: &ast.NameName{ + Const: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("FOO"), }, }, @@ -3722,7 +3722,7 @@ func TestFormatter_ExprEmpty(t *testing.T) { n := &ast.ExprEmpty{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3747,7 +3747,7 @@ func TestFormatter_ExprErrorSuppress(t *testing.T) { n := &ast.ExprErrorSuppress{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3772,7 +3772,7 @@ func TestFormatter_ExprEval(t *testing.T) { n := &ast.ExprEval{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3816,7 +3816,7 @@ func TestFormatter_ExprExit_Expr(t *testing.T) { n := &ast.ExprExit{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -3840,9 +3840,9 @@ func TestFormatter_ExprFunctionCall(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprFunctionCall{ - Function: &ast.NameName{ + Function: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -3867,17 +3867,17 @@ func TestFormatter_ExprFunctionCall_Arguments(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprFunctionCall{ - Function: &ast.NameName{ + Function: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -3950,13 +3950,13 @@ func TestFormatter_ExprInstanceOf(t *testing.T) { n := &ast.ExprInstanceOf{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -3983,12 +3983,12 @@ func TestFormatter_ExprIsset(t *testing.T) { n := &ast.ExprIsset{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -4016,14 +4016,14 @@ func TestFormatter_ExprList(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -4050,7 +4050,7 @@ func TestFormatter_ExprMethodCall(t *testing.T) { n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4078,7 +4078,7 @@ func TestFormatter_ExprMethodCall_Expr(t *testing.T) { n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4106,24 +4106,24 @@ func TestFormatter_ExprMethodCall_Arguments(t *testing.T) { n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Method: &ast.Identifier{ Value: []byte("bar"), }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -4149,9 +4149,9 @@ func TestFormatter_ExprNew(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprNew{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -4176,24 +4176,24 @@ func TestFormatter_ExprNew_Arguments(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprNew{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -4220,7 +4220,7 @@ func TestFormatter_ExprPreDec(t *testing.T) { n := &ast.ExprPreDec{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4245,7 +4245,7 @@ func TestFormatter_ExprPreInc(t *testing.T) { n := &ast.ExprPreInc{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4270,7 +4270,7 @@ func TestFormatter_ExprPostDec(t *testing.T) { n := &ast.ExprPostDec{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4295,7 +4295,7 @@ func TestFormatter_ExprPostInc(t *testing.T) { n := &ast.ExprPostInc{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4320,7 +4320,7 @@ func TestFormatter_ExprPrint(t *testing.T) { n := &ast.ExprPrint{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4345,11 +4345,11 @@ func TestFormatter_ExprPropertyFetch(t *testing.T) { n := &ast.ExprPropertyFetch{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - Property: &ast.Identifier{ + Prop: &ast.Identifier{ Value: []byte("bar"), }, } @@ -4373,11 +4373,11 @@ func TestFormatter_ExprPropertyFetch_Expr(t *testing.T) { n := &ast.ExprPropertyFetch{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - Property: &ast.ScalarString{ + Prop: &ast.ScalarString{ Value: []byte("'bar'"), }, } @@ -4495,7 +4495,7 @@ func TestFormatter_ExprShellExec_Parts(t *testing.T) { Value: []byte("foo "), }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4523,9 +4523,9 @@ func TestFormatter_ExprStaticCall(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprStaticCall{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -4553,9 +4553,9 @@ func TestFormatter_ExprStaticCall_Expr(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprStaticCall{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -4583,9 +4583,9 @@ func TestFormatter_ExprStaticCall_Arguments(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprStaticCall{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, @@ -4593,17 +4593,17 @@ func TestFormatter_ExprStaticCall_Arguments(t *testing.T) { Call: &ast.Identifier{ Value: []byte("bar"), }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$a"), }, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$b"), }, }, @@ -4629,15 +4629,15 @@ func TestFormatter_ExprStaticPropertyFetch(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprStaticPropertyFetch{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, }, }, - Property: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Prop: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4661,18 +4661,18 @@ func TestFormatter_ExprTernary(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprTernary{ - Condition: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Cond: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, IfTrue: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, IfFalse: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$baz"), }, }, @@ -4696,13 +4696,13 @@ func TestFormatter_ExprTernary_short(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprTernary{ - Condition: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Cond: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, IfFalse: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4727,7 +4727,7 @@ func TestFormatter_ExprUnaryMinus(t *testing.T) { n := &ast.ExprUnaryMinus{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4752,7 +4752,7 @@ func TestFormatter_ExprUnaryPlus(t *testing.T) { n := &ast.ExprUnaryPlus{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4776,7 +4776,7 @@ func TestFormatter_ExprVariable(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, } @@ -4799,8 +4799,8 @@ func TestFormatter_ExprVariable_Variable(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprVariable{ - VarName: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4824,7 +4824,7 @@ func TestFormatter_ExprVariable_Expression(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprVariable{ - VarName: &ast.ScalarString{ + Name: &ast.ScalarString{ Value: []byte("'foo'"), }, } @@ -4847,8 +4847,8 @@ func TestFormatter_ExprYield(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ExprYield{ - Value: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Val: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4873,12 +4873,12 @@ func TestFormatter_ExprYield_Key(t *testing.T) { n := &ast.ExprYield{ Key: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, - Value: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Val: &ast.ExprVariable{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4903,7 +4903,7 @@ func TestFormatter_ExprYieldFrom(t *testing.T) { n := &ast.ExprYieldFrom{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -4928,12 +4928,12 @@ func TestFormatter_ExprAssign(t *testing.T) { n := &ast.ExprAssign{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4958,12 +4958,12 @@ func TestFormatter_ExprAssignReference(t *testing.T) { n := &ast.ExprAssignReference{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -4988,12 +4988,12 @@ func TestFormatter_ExprAssignBitwiseAnd(t *testing.T) { n := &ast.ExprAssignBitwiseAnd{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5018,12 +5018,12 @@ func TestFormatter_ExprAssignBitwiseOr(t *testing.T) { n := &ast.ExprAssignBitwiseOr{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5048,12 +5048,12 @@ func TestFormatter_ExprAssignBitwiseXor(t *testing.T) { n := &ast.ExprAssignBitwiseXor{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5078,12 +5078,12 @@ func TestFormatter_ExprAssignCoalesce(t *testing.T) { n := &ast.ExprAssignCoalesce{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5108,12 +5108,12 @@ func TestFormatter_ExprAssignConcat(t *testing.T) { n := &ast.ExprAssignConcat{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5138,12 +5138,12 @@ func TestFormatter_ExprAssignDiv(t *testing.T) { n := &ast.ExprAssignDiv{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5168,12 +5168,12 @@ func TestFormatter_ExprAssignMinus(t *testing.T) { n := &ast.ExprAssignMinus{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5198,12 +5198,12 @@ func TestFormatter_ExprAssignMod(t *testing.T) { n := &ast.ExprAssignMod{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5228,12 +5228,12 @@ func TestFormatter_ExprAssignMul(t *testing.T) { n := &ast.ExprAssignMul{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5258,12 +5258,12 @@ func TestFormatter_ExprAssignPlus(t *testing.T) { n := &ast.ExprAssignPlus{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5288,12 +5288,12 @@ func TestFormatter_ExprAssignPow(t *testing.T) { n := &ast.ExprAssignPow{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5318,12 +5318,12 @@ func TestFormatter_ExprAssignShiftLeft(t *testing.T) { n := &ast.ExprAssignShiftLeft{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5348,12 +5348,12 @@ func TestFormatter_ExprAssignShiftRight(t *testing.T) { n := &ast.ExprAssignShiftRight{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5378,12 +5378,12 @@ func TestFormatter_ExprBinaryBitwiseAnd(t *testing.T) { n := &ast.ExprBinaryBitwiseAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5408,12 +5408,12 @@ func TestFormatter_ExprBinaryBitwiseOr(t *testing.T) { n := &ast.ExprBinaryBitwiseOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5438,12 +5438,12 @@ func TestFormatter_ExprBinaryBitwiseXor(t *testing.T) { n := &ast.ExprBinaryBitwiseXor{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5468,12 +5468,12 @@ func TestFormatter_ExprBinaryBooleanAnd(t *testing.T) { n := &ast.ExprBinaryBooleanAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5498,12 +5498,12 @@ func TestFormatter_ExprBinaryBooleanOr(t *testing.T) { n := &ast.ExprBinaryBooleanOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5528,12 +5528,12 @@ func TestFormatter_ExprBinaryCoalesce(t *testing.T) { n := &ast.ExprBinaryCoalesce{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5558,12 +5558,12 @@ func TestFormatter_ExprBinaryConcat(t *testing.T) { n := &ast.ExprBinaryConcat{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5588,12 +5588,12 @@ func TestFormatter_ExprBinaryDiv(t *testing.T) { n := &ast.ExprBinaryDiv{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5618,12 +5618,12 @@ func TestFormatter_ExprBinaryEqual(t *testing.T) { n := &ast.ExprBinaryEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5648,12 +5648,12 @@ func TestFormatter_ExprBinaryGreater(t *testing.T) { n := &ast.ExprBinaryGreater{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5678,12 +5678,12 @@ func TestFormatter_ExprBinaryGreaterOrEqual(t *testing.T) { n := &ast.ExprBinaryGreaterOrEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5708,12 +5708,12 @@ func TestFormatter_ExprBinaryIdentical(t *testing.T) { n := &ast.ExprBinaryIdentical{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5738,12 +5738,12 @@ func TestFormatter_ExprBinaryLogicalAnd(t *testing.T) { n := &ast.ExprBinaryLogicalAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5768,12 +5768,12 @@ func TestFormatter_ExprBinaryLogicalOr(t *testing.T) { n := &ast.ExprBinaryLogicalOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5798,12 +5798,12 @@ func TestFormatter_ExprBinaryLogicalXor(t *testing.T) { n := &ast.ExprBinaryLogicalXor{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5828,12 +5828,12 @@ func TestFormatter_ExprBinaryMinus(t *testing.T) { n := &ast.ExprBinaryMinus{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5858,12 +5858,12 @@ func TestFormatter_ExprBinaryMod(t *testing.T) { n := &ast.ExprBinaryMod{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5888,12 +5888,12 @@ func TestFormatter_ExprBinaryMul(t *testing.T) { n := &ast.ExprBinaryMul{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5918,12 +5918,12 @@ func TestFormatter_ExprBinaryNotEqual(t *testing.T) { n := &ast.ExprBinaryNotEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5948,12 +5948,12 @@ func TestFormatter_ExprBinaryNotIdentical(t *testing.T) { n := &ast.ExprBinaryNotIdentical{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -5978,12 +5978,12 @@ func TestFormatter_ExprBinaryPlus(t *testing.T) { n := &ast.ExprBinaryPlus{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6008,12 +6008,12 @@ func TestFormatter_ExprBinaryPow(t *testing.T) { n := &ast.ExprBinaryPow{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6038,12 +6038,12 @@ func TestFormatter_ExprBinaryShiftLeft(t *testing.T) { n := &ast.ExprBinaryShiftLeft{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6068,12 +6068,12 @@ func TestFormatter_ExprBinaryShiftRight(t *testing.T) { n := &ast.ExprBinaryShiftRight{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6098,12 +6098,12 @@ func TestFormatter_ExprBinarySmaller(t *testing.T) { n := &ast.ExprBinarySmaller{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6128,12 +6128,12 @@ func TestFormatter_ExprBinarySmallerOrEqual(t *testing.T) { n := &ast.ExprBinarySmallerOrEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6158,12 +6158,12 @@ func TestFormatter_ExprBinarySpaceship(t *testing.T) { n := &ast.ExprBinarySpaceship{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6188,7 +6188,7 @@ func TestFormatter_ExprCastArray(t *testing.T) { n := &ast.ExprCastArray{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6213,7 +6213,7 @@ func TestFormatter_ExprCastBool(t *testing.T) { n := &ast.ExprCastBool{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6238,7 +6238,7 @@ func TestFormatter_ExprCastDouble(t *testing.T) { n := &ast.ExprCastDouble{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6263,7 +6263,7 @@ func TestFormatter_ExprCastInt(t *testing.T) { n := &ast.ExprCastInt{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6288,7 +6288,7 @@ func TestFormatter_ExprCastObject(t *testing.T) { n := &ast.ExprCastObject{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6313,7 +6313,7 @@ func TestFormatter_ExprCastString(t *testing.T) { n := &ast.ExprCastString{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6338,7 +6338,7 @@ func TestFormatter_ExprCastUnset(t *testing.T) { n := &ast.ExprCastUnset{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6432,7 +6432,7 @@ func TestFormatter_ScalarEncapsed_Parts(t *testing.T) { Value: []byte("foo "), }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6481,7 +6481,7 @@ func TestFormatter_ScalarEncapsedStringVar(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ScalarEncapsedStringVar{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, } @@ -6504,7 +6504,7 @@ func TestFormatter_ScalarEncapsedStringVar_Dim(t *testing.T) { o := bytes.NewBufferString("") n := &ast.ScalarEncapsedStringVar{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("foo"), }, Dim: &ast.ScalarString{ @@ -6531,7 +6531,7 @@ func TestFormatter_ScalarEncapsedStringBrackets(t *testing.T) { n := &ast.ScalarEncapsedStringBrackets{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$foo"), }, }, @@ -6607,7 +6607,7 @@ func TestFormatter_ScalarHeredoc_Parts(t *testing.T) { Value: []byte("foo "), }, &ast.ExprVariable{ - VarName: &ast.Identifier{ + Name: &ast.Identifier{ Value: []byte("$bar"), }, }, @@ -6699,12 +6699,12 @@ func TestFormatter_ScalarString(t *testing.T) { func TestFormatter_NameName(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.NameName{ + n := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -6729,10 +6729,10 @@ func TestFormatter_NameFullyQualified(t *testing.T) { n := &ast.NameFullyQualified{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -6757,10 +6757,10 @@ func TestFormatter_NameRelative(t *testing.T) { n := &ast.NameRelative{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("bar"), }, }, @@ -6783,7 +6783,7 @@ func TestFormatter_NameRelative(t *testing.T) { func TestFormatter_NameNamePart(t *testing.T) { o := bytes.NewBufferString("") - n := &ast.NameNamePart{ + n := &ast.NamePart{ Value: []byte("foo"), } diff --git a/pkg/visitor/nsresolver/namespace_resolver.go b/pkg/visitor/nsresolver/namespace_resolver.go index 2b42a2c..4d17444 100644 --- a/pkg/visitor/nsresolver/namespace_resolver.go +++ b/pkg/visitor/nsresolver/namespace_resolver.go @@ -41,32 +41,32 @@ func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) { if n.Name == nil { nsr.Namespace = NewNamespace("") } else { - NSParts := n.Name.(*ast.NameName).Parts + NSParts := n.Name.(*ast.Name).Parts nsr.Namespace = NewNamespace(concatNameParts(NSParts)) } } -func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUse) { +func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUseList) { useType := "" if n.Type != nil { useType = string(n.Type.(*ast.Identifier).Value) } - for _, nn := range n.UseDeclarations { + for _, nn := range n.Uses { nsr.AddAlias(useType, nn, nil) } nsr.goDeep = false } -func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { +func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUseList) { useType := "" if n.Type != nil { useType = string(n.Type.(*ast.Identifier).Value) } - for _, nn := range n.UseDeclarations { - nsr.AddAlias(useType, nn, n.Prefix.(*ast.NameName).Parts) + for _, nn := range n.Uses { + nsr.AddAlias(useType, nn, n.Prefix.(*ast.Name).Parts) } nsr.goDeep = false @@ -83,8 +83,8 @@ func (nsr *NamespaceResolver) StmtClass(n *ast.StmtClass) { } } - if n.ClassName != nil { - nsr.AddNamespacedName(n, string(n.ClassName.(*ast.Identifier).Value)) + if n.Name != nil { + nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value)) } } @@ -95,15 +95,15 @@ func (nsr *NamespaceResolver) StmtInterface(n *ast.StmtInterface) { } } - nsr.AddNamespacedName(n, string(n.InterfaceName.(*ast.Identifier).Value)) + nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value)) } func (nsr *NamespaceResolver) StmtTrait(n *ast.StmtTrait) { - nsr.AddNamespacedName(n, string(n.TraitName.(*ast.Identifier).Value)) + nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value)) } func (nsr *NamespaceResolver) StmtFunction(n *ast.StmtFunction) { - nsr.AddNamespacedName(n, string(n.FunctionName.(*ast.Identifier).Value)) + nsr.AddNamespacedName(n, string(n.Name.(*ast.Identifier).Value)) for _, parameter := range n.Params { nsr.ResolveType(parameter.(*ast.Parameter).Type) @@ -218,15 +218,15 @@ func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex) { // AddAlias adds a new alias func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex) { switch use := nn.(type) { - case *ast.StmtUseDeclaration: + case *ast.StmtUse: if use.Type != nil { useType = string(use.Type.(*ast.Identifier).Value) } - useNameParts := use.Use.(*ast.NameName).Parts + useNameParts := use.Use.(*ast.Name).Parts var alias string if use.Alias == nil { - alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) + alias = string(useNameParts[len(useNameParts)-1].(*ast.NamePart).Value) } else { alias = string(use.Alias.(*ast.Identifier).Value) } @@ -257,7 +257,7 @@ func (nsr *NamespaceResolver) ResolveType(n ast.Vertex) { switch nn := n.(type) { case *ast.Nullable: nsr.ResolveType(nn.Expr) - case *ast.NameName: + case *ast.Name: nsr.ResolveName(n, "") case *ast.NameRelative: nsr.ResolveName(n, "") @@ -308,16 +308,16 @@ func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string, } return ns.Namespace + "\\" + concatNameParts(n.Parts), nil - case *ast.NameName: + case *ast.Name: if aliasType == "const" && len(n.Parts) == 1 { - part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value)) + part := strings.ToLower(string(n.Parts[0].(*ast.NamePart).Value)) if part == "true" || part == "false" || part == "null" { return part, nil } } if aliasType == "" && len(n.Parts) == 1 { - part := strings.ToLower(string(n.Parts[0].(*ast.NameNamePart).Value)) + part := strings.ToLower(string(n.Parts[0].(*ast.NamePart).Value)) switch part { case "self": @@ -366,9 +366,9 @@ func (ns *Namespace) ResolveName(nameNode ast.Vertex, aliasType string) (string, // ResolveAlias returns alias or error if not found func (ns *Namespace) ResolveAlias(nameNode ast.Vertex, aliasType string) (string, error) { aliasType = strings.ToLower(aliasType) - nameParts := nameNode.(*ast.NameName).Parts + nameParts := nameNode.(*ast.Name).Parts - firstPartStr := string(nameParts[0].(*ast.NameNamePart).Value) + firstPartStr := string(nameParts[0].(*ast.NamePart).Value) if len(nameParts) > 1 { // resolve aliases for qualified names, always against class alias type firstPartStr = strings.ToLower(firstPartStr) @@ -393,9 +393,9 @@ func concatNameParts(parts ...[]ast.Vertex) string { for _, p := range parts { for _, n := range p { if str == "" { - str = string(n.(*ast.NameNamePart).Value) + str = string(n.(*ast.NamePart).Value) } else { - str = str + "\\" + string(n.(*ast.NameNamePart).Value) + str = str + "\\" + string(n.(*ast.NamePart).Value) } } } diff --git a/pkg/visitor/nsresolver/namespace_resolver_test.go b/pkg/visitor/nsresolver/namespace_resolver_test.go index 1229822..324ba0d 100644 --- a/pkg/visitor/nsresolver/namespace_resolver_test.go +++ b/pkg/visitor/nsresolver/namespace_resolver_test.go @@ -11,14 +11,14 @@ import ( ) func TestResolveStaticCall(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, @@ -41,21 +41,21 @@ func TestResolveStaticCall(t *testing.T) { } func TestResolveStaticPropertyFetch(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, }, &ast.ExprStaticPropertyFetch{ - Class: nameBC, - Property: &ast.Identifier{Value: []byte("foo")}, + Class: nameBC, + Prop: &ast.Identifier{Value: []byte("foo")}, }, }, } @@ -71,21 +71,21 @@ func TestResolveStaticPropertyFetch(t *testing.T) { } func TestResolveClassConstFetch(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, }, &ast.ExprClassConstFetch{ - Class: nameBC, - ConstantName: &ast.Identifier{Value: []byte("FOO")}, + Class: nameBC, + Const: &ast.Identifier{Value: []byte("FOO")}, }, }, } @@ -101,14 +101,14 @@ func TestResolveClassConstFetch(t *testing.T) { } func TestResolveNew(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, @@ -130,20 +130,20 @@ func TestResolveNew(t *testing.T) { } func TestResolveInstanceOf(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, }, &ast.ExprInstanceOf{ - Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Expr: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, Class: nameBC, }, }, @@ -160,20 +160,20 @@ func TestResolveInstanceOf(t *testing.T) { } func TestResolveInstanceCatch(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} - nameDE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}, &ast.NameNamePart{Value: []byte("E")}}} - nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}} + nameDE := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("D")}, &ast.NamePart{Value: []byte("E")}}} + nameF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Use: nameDE, Alias: &ast.Identifier{Value: []byte("F")}, }, @@ -187,7 +187,7 @@ func TestResolveInstanceCatch(t *testing.T) { nameBC, nameF, }, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, Stmts: []ast.Vertex{}, }, }, @@ -207,15 +207,15 @@ func TestResolveInstanceCatch(t *testing.T) { } func TestResolveFunctionCall(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Type: &ast.Identifier{Value: []byte("function")}, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, @@ -237,15 +237,15 @@ func TestResolveFunctionCall(t *testing.T) { } func TestResolveConstFetch(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ + &ast.StmtUseList{ Type: &ast.Identifier{Value: []byte("const")}, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, @@ -267,32 +267,32 @@ func TestResolveConstFetch(t *testing.T) { } func TestResolveGroupUse(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("D")}}} - nameE := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("E")}}} - nameC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}}} - nameF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("D")}}} + nameE := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("E")}}} + nameC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}}} + nameF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Prefix: nameAB, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Type: &ast.Identifier{Value: []byte("Function")}, Use: nameF, }, - &ast.StmtUseDeclaration{ + &ast.StmtUse{ Type: &ast.Identifier{Value: []byte("const")}, Use: nameC, }, }, }, - &ast.StmtGroupUse{ + &ast.StmtGroupUseList{ Prefix: nameBD, Type: &ast.Identifier{Value: []byte("Function")}, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameE, }, }, @@ -322,20 +322,20 @@ func TestResolveGroupUse(t *testing.T) { } func TestResolveTraitUse(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} - nameD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("D")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}} + nameD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("D")}}} - fullyQualifiedNameB := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} - fullyQualifiedNameBC := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} - relativeNameB := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}}} - relativeNameBC := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + fullyQualifiedNameB := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}} + fullyQualifiedNameBC := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} + relativeNameB := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}}} + relativeNameBC := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAB, }, }, @@ -382,12 +382,12 @@ func TestResolveTraitUse(t *testing.T) { } func TestResolveClassName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} class := &ast.StmtClass{ - ClassName: &ast.Identifier{Value: []byte("A")}, - Extends: nameAB, + Name: &ast.Identifier{Value: []byte("A")}, + Extends: nameAB, Implements: []ast.Vertex{ nameBC, }, @@ -412,11 +412,11 @@ func TestResolveClassName(t *testing.T) { } func TestResolveInterfaceName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} interfaceNode := &ast.StmtInterface{ - InterfaceName: &ast.Identifier{Value: []byte("A")}, + Name: &ast.Identifier{Value: []byte("A")}, Extends: []ast.Vertex{ nameAB, nameBC, @@ -443,8 +443,8 @@ func TestResolveInterfaceName(t *testing.T) { func TestResolveTraitName(t *testing.T) { traitNode := &ast.StmtTrait{ - TraitName: &ast.Identifier{Value: []byte("A")}, - Stmts: []ast.Vertex{}, + Name: &ast.Identifier{Value: []byte("A")}, + Stmts: []ast.Vertex{}, } stxTree := &ast.StmtStmtList{ @@ -464,15 +464,15 @@ func TestResolveTraitName(t *testing.T) { } func TestResolveFunctionName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} functionNode := &ast.StmtFunction{ - FunctionName: &ast.Identifier{Value: []byte("A")}, + Name: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -498,15 +498,15 @@ func TestResolveFunctionName(t *testing.T) { } func TestResolveMethodName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} methodNode := &ast.StmtClassMethod{ - MethodName: &ast.Identifier{Value: []byte("A")}, + Name: &ast.Identifier{Value: []byte("A")}, Params: []ast.Vertex{ &ast.Parameter{ Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -527,14 +527,14 @@ func TestResolveMethodName(t *testing.T) { } func TestResolveClosureName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameBC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("B")}, &ast.NameNamePart{Value: []byte("C")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameBC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("B")}, &ast.NamePart{Value: []byte("C")}}} closureNode := &ast.ExprClosure{ Params: []ast.Vertex{ &ast.Parameter{ Type: nameAB, - Var: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Var: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, }, }, ReturnType: &ast.Nullable{Expr: nameBC}, @@ -553,7 +553,7 @@ func TestResolveClosureName(t *testing.T) { } func TestResolveConstantsName(t *testing.T) { - nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} constantB := &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("B")}, @@ -590,13 +590,13 @@ func TestResolveConstantsName(t *testing.T) { } func TestResolveNamespaces(t *testing.T) { - namespaceAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - namespaceCD := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("D")}}} + namespaceAB := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + namespaceCD := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("D")}}} - nameAC := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("C")}}} - nameCF := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("F")}}} - nameFG := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("F")}, &ast.NameNamePart{Value: []byte("G")}}} - relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("E")}}} + nameAC := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("C")}}} + nameCF := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("F")}}} + nameFG := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("F")}, &ast.NamePart{Value: []byte("G")}}} + relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("C")}, &ast.NamePart{Value: []byte("E")}}} constantB := &ast.StmtConstant{ Name: &ast.Identifier{Value: []byte("B")}, @@ -628,9 +628,9 @@ func TestResolveNamespaces(t *testing.T) { &ast.StmtNamespace{ Name: namespaceCD, Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + &ast.StmtUseList{ + Uses: []ast.Vertex{ + &ast.StmtUse{ Use: nameAC, }, }, @@ -666,7 +666,7 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.ExprStaticCall{ - Class: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("foo")}}, + Class: &ast.ExprVariable{Name: &ast.Identifier{Value: []byte("foo")}}, Call: &ast.Identifier{Value: []byte("foo")}, }, }, @@ -681,23 +681,23 @@ func TestResolveStaticCallDinamicClassName(t *testing.T) { } func TestDoNotResolveReservedConstants(t *testing.T) { - namespaceName := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}} + namespaceName := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}} - constantTrue := &ast.NameName{ + constantTrue := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("True")}, + &ast.NamePart{Value: []byte("True")}, }, } - constantFalse := &ast.NameName{ + constantFalse := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("False")}, + &ast.NamePart{Value: []byte("False")}, }, } - constantNull := &ast.NameName{ + constantNull := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("NULL")}, + &ast.NamePart{Value: []byte("NULL")}, }, } @@ -738,91 +738,91 @@ func TestDoNotResolveReservedConstants(t *testing.T) { func TestDoNotResolveReservedNames(t *testing.T) { - nameInt := &ast.NameName{ + nameInt := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("int")}, + &ast.NamePart{Value: []byte("int")}, }, } - nameFloat := &ast.NameName{ + nameFloat := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("float")}, + &ast.NamePart{Value: []byte("float")}, }, } - nameBool := &ast.NameName{ + nameBool := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("bool")}, + &ast.NamePart{Value: []byte("bool")}, }, } - nameString := &ast.NameName{ + nameString := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("string")}, + &ast.NamePart{Value: []byte("string")}, }, } - nameVoid := &ast.NameName{ + nameVoid := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("void")}, + &ast.NamePart{Value: []byte("void")}, }, } - nameIterable := &ast.NameName{ + nameIterable := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("iterable")}, + &ast.NamePart{Value: []byte("iterable")}, }, } - nameObject := &ast.NameName{ + nameObject := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("object")}, + &ast.NamePart{Value: []byte("object")}, }, } function := &ast.StmtFunction{ - FunctionName: &ast.Identifier{Value: []byte("bar")}, + Name: &ast.Identifier{Value: []byte("bar")}, Params: []ast.Vertex{ &ast.Parameter{ Type: nameInt, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Int")}, + Name: &ast.Identifier{Value: []byte("Int")}, }, }, &ast.Parameter{ Type: nameFloat, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Float")}, + Name: &ast.Identifier{Value: []byte("Float")}, }, }, &ast.Parameter{ Type: nameBool, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Bool")}, + Name: &ast.Identifier{Value: []byte("Bool")}, }, }, &ast.Parameter{ Type: nameString, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("String")}, + Name: &ast.Identifier{Value: []byte("String")}, }, }, &ast.Parameter{ Type: nameVoid, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Void")}, + Name: &ast.Identifier{Value: []byte("Void")}, }, }, &ast.Parameter{ Type: nameIterable, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Iterable")}, + Name: &ast.Identifier{Value: []byte("Iterable")}, }, }, &ast.Parameter{ Type: nameObject, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("Object")}, + Name: &ast.Identifier{Value: []byte("Object")}, }, }, }, @@ -831,9 +831,9 @@ func TestDoNotResolveReservedNames(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - Name: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Foo")}, + &ast.NamePart{Value: []byte("Foo")}, }, }, }, @@ -860,26 +860,26 @@ func TestDoNotResolveReservedNames(t *testing.T) { func TestDoNotResolveReservedSpecialNames(t *testing.T) { - nameSelf := &ast.NameName{ + nameSelf := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Self")}, + &ast.NamePart{Value: []byte("Self")}, }, } - nameStatic := &ast.NameName{ + nameStatic := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Static")}, + &ast.NamePart{Value: []byte("Static")}, }, } - nameParent := &ast.NameName{ + nameParent := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Parent")}, + &ast.NamePart{Value: []byte("Parent")}, }, } cls := &ast.StmtClass{ - ClassName: &ast.Identifier{Value: []byte("Bar")}, + Name: &ast.Identifier{Value: []byte("Bar")}, Stmts: []ast.Vertex{ &ast.StmtExpression{ Expr: &ast.ExprStaticCall{ @@ -905,9 +905,9 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - Name: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Foo")}, + &ast.NamePart{Value: []byte("Foo")}, }, }, }, @@ -928,9 +928,9 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { assert.DeepEqual(t, expected, nsResolver.ResolvedNames) } func TestResolvePropertyTypeName(t *testing.T) { - nameSimple := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameRelative := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} - nameFullyQualified := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} + nameSimple := &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameRelative := &ast.NameRelative{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} + nameFullyQualified := &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("A")}, &ast.NamePart{Value: []byte("B")}}} propertyNodeSimple := &ast.StmtPropertyList{ Type: nameSimple, @@ -945,7 +945,7 @@ func TestResolvePropertyTypeName(t *testing.T) { } classNode := &ast.StmtClass{ - ClassName: &ast.Identifier{Value: []byte("Bar")}, + Name: &ast.Identifier{Value: []byte("Bar")}, Stmts: []ast.Vertex{ propertyNodeSimple, propertyNodeRelative, @@ -956,9 +956,9 @@ func TestResolvePropertyTypeName(t *testing.T) { stmts := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - Name: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Foo")}, + &ast.NamePart{Value: []byte("Foo")}, }, }, }, diff --git a/pkg/visitor/null.go b/pkg/visitor/null.go index 2e15f24..e5edcc0 100644 --- a/pkg/visitor/null.go +++ b/pkg/visitor/null.go @@ -214,15 +214,15 @@ func (v *Null) StmtUnset(_ *ast.StmtUnset) { // do nothing } -func (v *Null) StmtUse(_ *ast.StmtUse) { +func (v *Null) StmtUse(_ *ast.StmtUseList) { // do nothing } -func (v *Null) StmtGroupUse(_ *ast.StmtGroupUse) { +func (v *Null) StmtGroupUse(_ *ast.StmtGroupUseList) { // do nothing } -func (v *Null) StmtUseDeclaration(_ *ast.StmtUseDeclaration) { +func (v *Null) StmtUseDeclaration(_ *ast.StmtUse) { // do nothing } @@ -626,7 +626,7 @@ func (v *Null) ScalarString(_ *ast.ScalarString) { // do nothing } -func (v *Null) NameName(_ *ast.NameName) { +func (v *Null) NameName(_ *ast.Name) { // do nothing } @@ -638,6 +638,6 @@ func (v *Null) NameRelative(_ *ast.NameRelative) { // do nothing } -func (v *Null) NameNamePart(_ *ast.NameNamePart) { +func (v *Null) NameNamePart(_ *ast.NamePart) { // do nothing } diff --git a/pkg/visitor/printer/printer.go b/pkg/visitor/printer/printer.go index fca712b..76e230e 100644 --- a/pkg/visitor/printer/printer.go +++ b/pkg/visitor/printer/printer.go @@ -190,10 +190,10 @@ func (p *printer) StmtCatch(n *ast.StmtCatch) { func (p *printer) StmtClass(n *ast.StmtClass) { p.printList(n.Modifiers) p.printToken(n.ClassTkn, []byte("class")) - p.printNode(n.ClassName) - p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) - p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) - p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) + p.printNode(n.Name) + p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("("))) + p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")"))) p.printToken(n.ExtendsTkn, p.ifNode(n.Extends, []byte("extends"))) p.printNode(n.Extends) p.printToken(n.ImplementsTkn, p.ifNodeList(n.Implements, []byte("implements"))) @@ -214,7 +214,7 @@ func (p *printer) StmtClassMethod(n *ast.StmtClassMethod) { p.printList(n.Modifiers) p.printToken(n.FunctionTkn, []byte("function")) p.printToken(n.AmpersandTkn, nil) - p.printNode(n.MethodName) + p.printNode(n.Name) p.printToken(n.OpenParenthesisTkn, []byte("(")) p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) @@ -366,7 +366,7 @@ func (p *printer) StmtForeach(n *ast.StmtForeach) { func (p *printer) StmtFunction(n *ast.StmtFunction) { p.printToken(n.FunctionTkn, []byte("function")) p.printToken(n.AmpersandTkn, nil) - p.printNode(n.FunctionName) + p.printNode(n.Name) p.printToken(n.OpenParenthesisTkn, []byte("(")) p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) @@ -427,7 +427,7 @@ func (p *printer) StmtInlineHtml(n *ast.StmtInlineHtml) { func (p *printer) StmtInterface(n *ast.StmtInterface) { p.printToken(n.InterfaceTkn, []byte("interface")) - p.printNode(n.InterfaceName) + p.printNode(n.Name) p.printToken(n.ExtendsTkn, p.ifNodeList(n.Extends, []byte("extends"))) p.printSeparatedList(n.Extends, n.ExtendsSeparatorTkns, []byte(",")) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) @@ -436,7 +436,7 @@ func (p *printer) StmtInterface(n *ast.StmtInterface) { } func (p *printer) StmtLabel(n *ast.StmtLabel) { - p.printNode(n.LabelName) + p.printNode(n.Name) p.printToken(n.ColonTkn, []byte(":")) } @@ -462,7 +462,7 @@ func (p *printer) StmtProperty(n *ast.StmtProperty) { func (p *printer) StmtPropertyList(n *ast.StmtPropertyList) { p.printList(n.Modifiers) p.printNode(n.Type) - p.printSeparatedList(n.Properties, n.SeparatorTkns, []byte(",")) + p.printSeparatedList(n.Props, n.SeparatorTkns, []byte(",")) p.printToken(n.SemiColonTkn, []byte(";")) } @@ -498,7 +498,7 @@ func (p *printer) StmtSwitch(n *ast.StmtSwitch) { p.printToken(n.ColonTkn, nil) p.printToken(n.OpenCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("{"))) p.printToken(n.CaseSeparatorTkn, nil) - p.printList(n.CaseList) + p.printList(n.Cases) p.printToken(n.CloseCurlyBracketTkn, p.ifNotToken(n.ColonTkn, []byte("}"))) p.printToken(n.EndSwitchTkn, p.ifToken(n.ColonTkn, []byte("endswitch"), nil)) p.printToken(n.SemiColonTkn, p.ifToken(n.ColonTkn, []byte(";"), nil)) @@ -512,7 +512,7 @@ func (p *printer) StmtThrow(n *ast.StmtThrow) { func (p *printer) StmtTrait(n *ast.StmtTrait) { p.printToken(n.TraitTkn, []byte("trait")) - p.printNode(n.TraitName) + p.printNode(n.Name) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) p.printList(n.Stmts) p.printToken(n.CloseCurlyBracketTkn, []byte("}")) @@ -563,26 +563,26 @@ func (p *printer) StmtUnset(n *ast.StmtUnset) { p.printToken(n.SemiColonTkn, []byte(";")) } -func (p *printer) StmtUse(n *ast.StmtUse) { +func (p *printer) StmtUse(n *ast.StmtUseList) { p.printToken(n.UseTkn, []byte("use")) p.printNode(n.Type) - p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(",")) + p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(",")) p.printToken(n.SemiColonTkn, []byte(";")) } -func (p *printer) StmtGroupUse(n *ast.StmtGroupUse) { +func (p *printer) StmtGroupUse(n *ast.StmtGroupUseList) { p.printToken(n.UseTkn, []byte("use")) p.printNode(n.Type) p.printToken(n.LeadingNsSeparatorTkn, nil) p.printNode(n.Prefix) p.printToken(n.NsSeparatorTkn, []byte("\\")) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) - p.printSeparatedList(n.UseDeclarations, n.SeparatorTkns, []byte(",")) + p.printSeparatedList(n.Uses, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseCurlyBracketTkn, []byte("}")) p.printToken(n.SemiColonTkn, []byte(";")) } -func (p *printer) StmtUseDeclaration(n *ast.StmtUseDeclaration) { +func (p *printer) StmtUseDeclaration(n *ast.StmtUse) { p.printNode(n.Type) p.printToken(n.NsSeparatorTkn, nil) p.printNode(n.Use) @@ -661,7 +661,7 @@ func (p *printer) ExprBrackets(n *ast.ExprBrackets) { func (p *printer) ExprClassConstFetch(n *ast.ExprClassConstFetch) { p.printNode(n.Class) p.printToken(n.DoubleColonTkn, []byte("::")) - p.printNode(n.ConstantName) + p.printNode(n.Const) } func (p *printer) ExprClone(n *ast.ExprClone) { @@ -676,10 +676,10 @@ func (p *printer) ExprClosure(n *ast.ExprClosure) { p.printToken(n.OpenParenthesisTkn, []byte("(")) p.printSeparatedList(n.Params, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) - p.printToken(n.UseTkn, p.ifNodeList(n.Use, []byte("use"))) - p.printToken(n.UseOpenParenthesisTkn, p.ifNodeList(n.Use, []byte("("))) - p.printSeparatedList(n.Use, n.UseSeparatorTkns, []byte(",")) - p.printToken(n.UseCloseParenthesisTkn, p.ifNodeList(n.Use, []byte(")"))) + p.printToken(n.UseTkn, p.ifNodeList(n.Uses, []byte("use"))) + p.printToken(n.UseOpenParenthesisTkn, p.ifNodeList(n.Uses, []byte("("))) + p.printSeparatedList(n.Uses, n.UseSeparatorTkns, []byte(",")) + p.printToken(n.UseCloseParenthesisTkn, p.ifNodeList(n.Uses, []byte(")"))) p.printToken(n.ColonTkn, p.ifNode(n.ReturnType, []byte(":"))) p.printNode(n.ReturnType) p.printToken(n.OpenCurlyBracketTkn, []byte("{")) @@ -725,7 +725,7 @@ func (p *printer) ExprExit(n *ast.ExprExit) { func (p *printer) ExprFunctionCall(n *ast.ExprFunctionCall) { p.printNode(n.Function) p.printToken(n.OpenParenthesisTkn, []byte("(")) - p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) } @@ -766,16 +766,16 @@ func (p *printer) ExprMethodCall(n *ast.ExprMethodCall) { p.printNode(n.Method) p.printToken(n.CloseCurlyBracketTkn, nil) p.printToken(n.OpenParenthesisTkn, []byte("(")) - p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) + p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(",")) p.printToken(n.CloseParenthesisTkn, []byte(")")) } func (p *printer) ExprNew(n *ast.ExprNew) { p.printToken(n.NewTkn, []byte("new")) p.printNode(n.Class) - p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) - p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) - p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) + p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("("))) + p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")"))) } func (p *printer) ExprPostDec(n *ast.ExprPostDec) { @@ -807,7 +807,7 @@ func (p *printer) ExprPropertyFetch(n *ast.ExprPropertyFetch) { p.printNode(n.Var) p.printToken(n.ObjectOperatorTkn, []byte("->")) p.printToken(n.OpenCurlyBracketTkn, nil) - p.printNode(n.Property) + p.printNode(n.Prop) p.printToken(n.CloseCurlyBracketTkn, nil) } @@ -833,19 +833,19 @@ func (p *printer) ExprStaticCall(n *ast.ExprStaticCall) { p.printToken(n.OpenCurlyBracketTkn, nil) p.printNode(n.Call) p.printToken(n.CloseCurlyBracketTkn, nil) - p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Arguments, []byte("("))) - p.printSeparatedList(n.Arguments, n.SeparatorTkns, []byte(",")) - p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Arguments, []byte(")"))) + p.printToken(n.OpenParenthesisTkn, p.ifNodeList(n.Args, []byte("("))) + p.printSeparatedList(n.Args, n.SeparatorTkns, []byte(",")) + p.printToken(n.CloseParenthesisTkn, p.ifNodeList(n.Args, []byte(")"))) } func (p *printer) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { p.printNode(n.Class) p.printToken(n.DoubleColonTkn, []byte("::")) - p.printNode(n.Property) + p.printNode(n.Prop) } func (p *printer) ExprTernary(n *ast.ExprTernary) { - p.printNode(n.Condition) + p.printNode(n.Cond) p.printToken(n.QuestionTkn, []byte("?")) p.printNode(n.IfTrue) p.printToken(n.ColonTkn, []byte(":")) @@ -865,7 +865,7 @@ func (p *printer) ExprUnaryPlus(n *ast.ExprUnaryPlus) { func (p *printer) ExprVariable(n *ast.ExprVariable) { p.printToken(n.DollarTkn, nil) p.printToken(n.OpenCurlyBracketTkn, nil) - p.printNode(n.VarName) + p.printNode(n.Name) p.printToken(n.CloseCurlyBracketTkn, nil) } @@ -873,7 +873,7 @@ func (p *printer) ExprYield(n *ast.ExprYield) { p.printToken(n.YieldTkn, []byte("yield")) p.printNode(n.Key) p.printToken(n.DoubleArrowTkn, p.ifNode(n.Key, []byte("=>"))) - p.printNode(n.Value) + p.printNode(n.Val) } func (p *printer) ExprYieldFrom(n *ast.ExprYieldFrom) { @@ -1185,7 +1185,7 @@ func (p *printer) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { func (p *printer) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { p.printToken(n.DollarOpenCurlyBracketTkn, []byte("${")) - p.printNode(n.VarName) + p.printNode(n.Name) p.printToken(n.OpenSquareBracketTkn, p.ifNode(n.Dim, []byte("["))) p.printNode(n.Dim) p.printToken(n.CloseSquareBracketTkn, p.ifNode(n.Dim, []byte("]"))) @@ -1217,7 +1217,7 @@ func (p *printer) ScalarString(n *ast.ScalarString) { p.printToken(n.StringTkn, n.Value) } -func (p *printer) NameName(n *ast.NameName) { +func (p *printer) NameName(n *ast.Name) { p.printSeparatedList(n.Parts, n.SeparatorTkns, []byte("\\")) } @@ -1232,6 +1232,6 @@ func (p *printer) NameRelative(n *ast.NameRelative) { p.printSeparatedList(n.Parts, n.SeparatorTkns, []byte("\\")) } -func (p *printer) NameNamePart(n *ast.NameNamePart) { +func (p *printer) NameNamePart(n *ast.NamePart) { p.printToken(n.StringTkn, n.Value) } diff --git a/pkg/visitor/printer/printer_php7_test.go b/pkg/visitor/printer/printer_php7_test.go index e0e274c..1039390 100644 --- a/pkg/visitor/printer/printer_php7_test.go +++ b/pkg/visitor/printer/printer_php7_test.go @@ -36,8 +36,8 @@ abstract class Bar extends Baz // change namespace - parts := &rootNode.(*ast.Root).Stmts[0].(*ast.StmtNamespace).Name.(*ast.NameName).Parts - *parts = append(*parts, &ast.NameNamePart{Value: []byte("Quuz")}) + parts := &rootNode.(*ast.Root).Stmts[0].(*ast.StmtNamespace).Name.(*ast.Name).Parts + *parts = append(*parts, &ast.NamePart{Value: []byte("Quuz")}) // print diff --git a/pkg/visitor/printer/printer_test.go b/pkg/visitor/printer/printer_test.go index 41c8f66..83a1adf 100644 --- a/pkg/visitor/printer/printer_test.go +++ b/pkg/visitor/printer/printer_test.go @@ -16,28 +16,28 @@ func TestPrinterPrintFile(t *testing.T) { n := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - Name: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Foo")}, + &ast.NamePart{Value: []byte("Foo")}, }, }, }, &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - ClassName: &ast.NameName{ + Name: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Bar")}, + &ast.NamePart{Value: []byte("Bar")}, }, }, - Extends: &ast.NameName{ + Extends: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{Value: []byte("Baz")}, + &ast.NamePart{Value: []byte("Baz")}, }, }, Stmts: []ast.Vertex{ &ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - MethodName: &ast.Identifier{Value: []byte("greet")}, + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Name: &ast.Identifier{Value: []byte("greet")}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtEcho{ @@ -122,7 +122,7 @@ func TestPrinterPrintParameter(t *testing.T) { n := &ast.Parameter{ Type: &ast.NameFullyQualified{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, }, @@ -131,7 +131,7 @@ func TestPrinterPrintParameter(t *testing.T) { Value: []byte("..."), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, DefaultValue: &ast.ScalarString{ Value: []byte("'default'"), @@ -155,7 +155,7 @@ func TestPrinterPrintNullable(t *testing.T) { Expr: &ast.Parameter{ Type: &ast.NameFullyQualified{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, }, @@ -164,7 +164,7 @@ func TestPrinterPrintNullable(t *testing.T) { Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, DefaultValue: &ast.ScalarString{ Value: []byte("'default'"), @@ -190,7 +190,7 @@ func TestPrinterPrintArgument(t *testing.T) { Value: []byte("..."), }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -211,7 +211,7 @@ func TestPrinterPrintArgumentByRef(t *testing.T) { Value: []byte("&"), }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -230,7 +230,7 @@ func TestPrinterPrintNameNamePart(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) - n := &ast.NameNamePart{ + n := &ast.NamePart{ Value: []byte("foo"), } n.Accept(p) @@ -247,12 +247,12 @@ func TestPrinterPrintNameName(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) - n := &ast.NameName{ + n := &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Bar"), }, }, @@ -273,10 +273,10 @@ func TestPrinterPrintNameFullyQualified(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameFullyQualified{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Bar"), }, }, @@ -297,10 +297,10 @@ func TestPrinterPrintNameRelative(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.NameRelative{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Bar"), }, }, @@ -393,7 +393,7 @@ func TestPrinterPrintScalarEncapsed(t *testing.T) { Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, &ast.ScalarEncapsedStringPart{Value: []byte(" world")}, }, @@ -416,7 +416,7 @@ func TestPrinterPrintScalarHeredoc(t *testing.T) { Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, &ast.ScalarEncapsedStringPart{Value: []byte(" world\n")}, }, @@ -455,10 +455,10 @@ func TestPrinterPrintAssign(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssign{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -477,10 +477,10 @@ func TestPrinterPrintReference(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignReference{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -499,10 +499,10 @@ func TestPrinterPrintAssignBitwiseAnd(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseAnd{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -521,10 +521,10 @@ func TestPrinterPrintAssignBitwiseOr(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseOr{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -543,10 +543,10 @@ func TestPrinterPrintAssignBitwiseXor(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignBitwiseXor{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -565,10 +565,10 @@ func TestPrinterPrintAssignCoalesce(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignCoalesce{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -587,10 +587,10 @@ func TestPrinterPrintAssignConcat(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignConcat{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -609,10 +609,10 @@ func TestPrinterPrintAssignDiv(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignDiv{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -631,10 +631,10 @@ func TestPrinterPrintAssignMinus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMinus{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -653,10 +653,10 @@ func TestPrinterPrintAssignMod(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMod{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -675,10 +675,10 @@ func TestPrinterPrintAssignMul(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignMul{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -697,10 +697,10 @@ func TestPrinterPrintAssignPlus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignPlus{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -719,10 +719,10 @@ func TestPrinterPrintAssignPow(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignPow{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -741,10 +741,10 @@ func TestPrinterPrintAssignShiftLeft(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignShiftLeft{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -763,10 +763,10 @@ func TestPrinterPrintAssignShiftRight(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprAssignShiftRight{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -787,10 +787,10 @@ func TestPrinterPrintBinaryBitwiseAnd(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -809,10 +809,10 @@ func TestPrinterPrintBinaryBitwiseOr(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -831,10 +831,10 @@ func TestPrinterPrintBinaryBitwiseXor(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBitwiseXor{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -853,10 +853,10 @@ func TestPrinterPrintBinaryBooleanAnd(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBooleanAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -875,10 +875,10 @@ func TestPrinterPrintBinaryBooleanOr(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryBooleanOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -897,10 +897,10 @@ func TestPrinterPrintBinaryCoalesce(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryCoalesce{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -919,10 +919,10 @@ func TestPrinterPrintBinaryConcat(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryConcat{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -941,10 +941,10 @@ func TestPrinterPrintBinaryDiv(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryDiv{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -963,10 +963,10 @@ func TestPrinterPrintBinaryEqual(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -985,10 +985,10 @@ func TestPrinterPrintBinaryGreaterOrEqual(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryGreaterOrEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1007,10 +1007,10 @@ func TestPrinterPrintBinaryGreater(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryGreater{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1029,10 +1029,10 @@ func TestPrinterPrintBinaryIdentical(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryIdentical{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1051,10 +1051,10 @@ func TestPrinterPrintBinaryLogicalAnd(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalAnd{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1073,10 +1073,10 @@ func TestPrinterPrintBinaryLogicalOr(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalOr{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1095,10 +1095,10 @@ func TestPrinterPrintBinaryLogicalXor(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryLogicalXor{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1117,10 +1117,10 @@ func TestPrinterPrintBinaryMinus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMinus{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1139,10 +1139,10 @@ func TestPrinterPrintBinaryMod(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMod{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1161,10 +1161,10 @@ func TestPrinterPrintBinaryMul(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryMul{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1183,10 +1183,10 @@ func TestPrinterPrintBinaryNotEqual(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryNotEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1205,10 +1205,10 @@ func TestPrinterPrintBinaryNotIdentical(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryNotIdentical{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1227,10 +1227,10 @@ func TestPrinterPrintBinaryPlus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryPlus{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1249,10 +1249,10 @@ func TestPrinterPrintBinaryPow(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryPow{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1271,10 +1271,10 @@ func TestPrinterPrintBinaryShiftLeft(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryShiftLeft{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1293,10 +1293,10 @@ func TestPrinterPrintBinaryShiftRight(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinaryShiftRight{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1315,10 +1315,10 @@ func TestPrinterPrintBinarySmallerOrEqual(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySmallerOrEqual{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1337,10 +1337,10 @@ func TestPrinterPrintBinarySmaller(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySmaller{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1359,10 +1359,10 @@ func TestPrinterPrintBinarySpaceship(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBinarySpaceship{ Left: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Right: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -1383,7 +1383,7 @@ func TestPrinterPrintArray(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastArray{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1402,7 +1402,7 @@ func TestPrinterPrintBool(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastBool{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1421,7 +1421,7 @@ func TestPrinterPrintDouble(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastDouble{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1440,7 +1440,7 @@ func TestPrinterPrintInt(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastInt{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1459,7 +1459,7 @@ func TestPrinterPrintObject(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastObject{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1478,7 +1478,7 @@ func TestPrinterPrintString(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastString{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1497,7 +1497,7 @@ func TestPrinterPrintUnset(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprCastUnset{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1518,7 +1518,7 @@ func TestPrinterPrintExprArrayDimFetch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayDimFetch{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, Dim: &ast.ScalarLnumber{Value: []byte("1")}, } @@ -1539,7 +1539,7 @@ func TestPrinterPrintExprArrayItemWithKey(t *testing.T) { n := &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, } n.Accept(p) @@ -1558,7 +1558,7 @@ func TestPrinterPrintExprArrayItem(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, } n.Accept(p) @@ -1580,7 +1580,7 @@ func TestPrinterPrintExprArrayItem_Reference(t *testing.T) { Value: []byte("&"), }, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, } n.Accept(p) @@ -1602,7 +1602,7 @@ func TestPrinterPrintExprArrayItemUnpack(t *testing.T) { Value: []byte("..."), }, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, } n.Accept(p) @@ -1627,7 +1627,7 @@ func TestPrinterPrintExprArray(t *testing.T) { &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, }, &ast.ExprArrayItem{ @@ -1636,12 +1636,12 @@ func TestPrinterPrintExprArray(t *testing.T) { Value: []byte("&"), }, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, }, @@ -1662,7 +1662,7 @@ func TestPrinterPrintExprBitwiseNot(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBitwiseNot{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1681,7 +1681,7 @@ func TestPrinterPrintExprBooleanNot(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1700,7 +1700,7 @@ func TestPrinterPrintExprBracket(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprBooleanNot{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1719,9 +1719,9 @@ func TestPrinterPrintExprClassConstFetch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClassConstFetch{ Class: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, - ConstantName: &ast.Identifier{ + Const: &ast.Identifier{ Value: []byte("CONST"), }, } @@ -1741,7 +1741,7 @@ func TestPrinterPrintExprClone(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClone{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1760,7 +1760,7 @@ func TestPrinterPrintExprClosureUse(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprClosureUse{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$foo")}, + Name: &ast.Identifier{Value: []byte("$foo")}, }, } n.Accept(p) @@ -1782,7 +1782,7 @@ func TestPrinterPrintExprClosureUse_Reference(t *testing.T) { Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$foo")}, + Name: &ast.Identifier{Value: []byte("$foo")}, }, } n.Accept(p) @@ -1809,31 +1809,31 @@ func TestPrinterPrintExprClosure(t *testing.T) { Params: []ast.Vertex{ &ast.Parameter{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, }, - Use: []ast.Vertex{ + Uses: []ast.Vertex{ &ast.ExprClosureUse{ AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.ExprClosureUse{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, ReturnType: &ast.NameFullyQualified{ - Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}, + Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}, }, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, } @@ -1865,15 +1865,15 @@ func TestPrinterPrintExprArrowFunction(t *testing.T) { Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, }, ReturnType: &ast.NameFullyQualified{ - Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}, + Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}, }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, } @@ -1892,7 +1892,7 @@ func TestPrinterPrintExprConstFetch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprConstFetch{ - Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}, + Const: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("null")}}}, } n.Accept(p) @@ -1910,7 +1910,7 @@ func TestPrinterPrintEmpty(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprEmpty{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1929,7 +1929,7 @@ func TestPrinterPrettyPrinterrorSuppress(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprErrorSuppress{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1948,7 +1948,7 @@ func TestPrinterPrintEval(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprEval{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1967,7 +1967,7 @@ func TestPrinterPrintExit(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprExit{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -1989,7 +1989,7 @@ func TestPrinterPrintDie(t *testing.T) { Value: []byte("die"), }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2008,15 +2008,15 @@ func TestPrinterPrintFunctionCall(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprFunctionCall{ Function: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ AmpersandTkn: &token.Token{ Value: []byte("&"), }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.Argument{ @@ -2024,12 +2024,12 @@ func TestPrinterPrintFunctionCall(t *testing.T) { Value: []byte("..."), }, Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, }, }, @@ -2084,9 +2084,9 @@ func TestPrinterPrintInstanceOf(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprInstanceOf{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, - Class: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Class: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, } n.Accept(p) @@ -2105,10 +2105,10 @@ func TestPrinterPrintIsset(t *testing.T) { n := &ast.ExprIsset{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, } @@ -2130,7 +2130,7 @@ func TestPrinterPrintList(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.ExprArrayItem{ @@ -2138,12 +2138,12 @@ func TestPrinterPrintList(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, }, }, @@ -2167,18 +2167,18 @@ func TestPrinterPrintMethodCall(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprMethodCall{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$foo")}, + Name: &ast.Identifier{Value: []byte("$foo")}, }, Method: &ast.Identifier{Value: []byte("bar")}, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -2198,22 +2198,22 @@ func TestPrinterPrintNew(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprNew{ - Class: &ast.NameName{ + Class: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, }, }, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -2234,7 +2234,7 @@ func TestPrinterPrintPostDec(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPostDec{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2253,7 +2253,7 @@ func TestPrinterPrintPostInc(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPostInc{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2272,7 +2272,7 @@ func TestPrinterPrintPreDec(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPreDec{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2291,7 +2291,7 @@ func TestPrinterPrintPreInc(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPreInc{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2310,7 +2310,7 @@ func TestPrinterPrintPrint(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPrint{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2329,9 +2329,9 @@ func TestPrinterPrintPropertyFetch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprPropertyFetch{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$foo")}, + Name: &ast.Identifier{Value: []byte("$foo")}, }, - Property: &ast.Identifier{Value: []byte("bar")}, + Prop: &ast.Identifier{Value: []byte("bar")}, } n.Accept(p) @@ -2385,7 +2385,7 @@ func TestPrinterPrintShellExec(t *testing.T) { Parts: []ast.Vertex{ &ast.ScalarEncapsedStringPart{Value: []byte("hello ")}, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, &ast.ScalarEncapsedStringPart{Value: []byte("!")}, }, @@ -2409,7 +2409,7 @@ func TestPrinterPrintExprShortArray(t *testing.T) { &ast.ExprArrayItem{ Key: &ast.ScalarString{Value: []byte("'Hello'")}, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$world")}, + Name: &ast.Identifier{Value: []byte("$world")}, }, }, &ast.ExprArrayItem{ @@ -2418,12 +2418,12 @@ func TestPrinterPrintExprShortArray(t *testing.T) { Value: []byte("&"), }, Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, }, @@ -2449,7 +2449,7 @@ func TestPrinterPrintShortList(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.ExprArrayItem{ @@ -2457,12 +2457,12 @@ func TestPrinterPrintShortList(t *testing.T) { Items: []ast.Vertex{ &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, &ast.ExprArrayItem{ Val: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, }, }, @@ -2490,15 +2490,15 @@ func TestPrinterPrintStaticCall(t *testing.T) { n := &ast.ExprStaticCall{ Class: &ast.Identifier{Value: []byte("Foo")}, Call: &ast.Identifier{Value: []byte("bar")}, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -2519,8 +2519,8 @@ func TestPrinterPrintStaticPropertyFetch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprStaticPropertyFetch{ Class: &ast.Identifier{Value: []byte("Foo")}, - Property: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$bar")}, + Prop: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$bar")}, }, } n.Accept(p) @@ -2538,11 +2538,11 @@ func TestPrinterPrintTernary(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprTernary{ - Condition: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Cond: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$a")}, }, IfFalse: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, } n.Accept(p) @@ -2560,14 +2560,14 @@ func TestPrinterPrintTernaryFull(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprTernary{ - Condition: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Cond: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$a")}, }, IfTrue: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, IfFalse: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, } n.Accept(p) @@ -2586,7 +2586,7 @@ func TestPrinterPrintUnaryMinus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprUnaryMinus{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2605,7 +2605,7 @@ func TestPrinterPrintUnaryPlus(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprUnaryPlus{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2629,8 +2629,8 @@ func TestPrinterPrintVariable(t *testing.T) { OpenCurlyBracketTkn: &token.Token{ Value: []byte("{"), }, - VarName: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$var")}, }, CloseCurlyBracketTkn: &token.Token{ Value: []byte("}"), @@ -2652,7 +2652,7 @@ func TestPrinterPrintYieldFrom(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYieldFrom{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2670,8 +2670,8 @@ func TestPrinterPrintYield(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYield{ - Value: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Val: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2690,10 +2690,10 @@ func TestPrinterPrintYieldFull(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.ExprYield{ Key: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$k")}, + Name: &ast.Identifier{Value: []byte("$k")}, }, - Value: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Val: &ast.ExprVariable{ + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -2714,7 +2714,7 @@ func TestPrinterPrintAltElseIf(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2722,7 +2722,7 @@ func TestPrinterPrintAltElseIf(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -2743,7 +2743,7 @@ func TestPrinterPrintAltElseIfEmpty(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2771,7 +2771,7 @@ func TestPrinterPrintAltElse(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -2813,17 +2813,17 @@ func TestPrinterPrintAltFor(t *testing.T) { n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, Cond: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, Loop: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, }, ColonTkn: &token.Token{ @@ -2832,7 +2832,7 @@ func TestPrinterPrintAltFor(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }}, }, }, @@ -2853,13 +2853,13 @@ func TestPrinterPrintAltForeach(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, Key: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$key")}, + Name: &ast.Identifier{Value: []byte("$key")}, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$val")}, + Name: &ast.Identifier{Value: []byte("$val")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2867,7 +2867,7 @@ func TestPrinterPrintAltForeach(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }}, }, }, @@ -2888,16 +2888,16 @@ func TestPrinterPrintAltForeach_Reference(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, Key: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$key")}, + Name: &ast.Identifier{Value: []byte("$key")}, }, AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$val")}, + Name: &ast.Identifier{Value: []byte("$val")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2905,7 +2905,7 @@ func TestPrinterPrintAltForeach_Reference(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }}, }, }, @@ -2926,7 +2926,7 @@ func TestPrinterPrintAltIf(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2934,14 +2934,14 @@ func TestPrinterPrintAltIf(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }}, }, }, ElseIf: []ast.Vertex{ &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2949,14 +2949,14 @@ func TestPrinterPrintAltIf(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, }, &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -2971,7 +2971,7 @@ func TestPrinterPrintAltIf(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -2993,17 +2993,17 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, ColonTkn: &token.Token{ Value: []byte(":"), }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Cond: &ast.ScalarString{Value: []byte("'a'")}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -3011,7 +3011,7 @@ func TestPrinterPrintStmtAltSwitch(t *testing.T) { Cond: &ast.ScalarString{Value: []byte("'b'")}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -3033,7 +3033,7 @@ func TestPrinterPrintAltWhile(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, ColonTkn: &token.Token{ Value: []byte(":"), @@ -3041,7 +3041,7 @@ func TestPrinterPrintAltWhile(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -3081,11 +3081,11 @@ func TestPrinterPrintStmtCase(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCase{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, } @@ -3105,7 +3105,7 @@ func TestPrinterPrintStmtCaseEmpty(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCase{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmts: []ast.Vertex{}, } @@ -3125,15 +3125,15 @@ func TestPrinterPrintStmtCatch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtCatch{ Types: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, - &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Exception")}}}, + &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("RuntimeException")}}}, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$e")}, + Name: &ast.Identifier{Value: []byte("$e")}, }, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, } @@ -3156,34 +3156,34 @@ func TestPrinterPrintStmtClassMethod(t *testing.T) { AmpersandTkn: &token.Token{ Value: []byte("&"), }, - MethodName: &ast.Identifier{Value: []byte("foo")}, + Name: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Type: &ast.Nullable{Expr: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("int")}}}}, AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, - DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ VariadicTkn: &token.Token{ Value: []byte("..."), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, - ReturnType: &ast.NameName{ - Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}, + ReturnType: &ast.Name{ + Parts: []ast.Vertex{&ast.NamePart{Value: []byte("void")}}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -3210,29 +3210,29 @@ func TestPrinterPrintStmtAbstractClassMethod(t *testing.T) { AmpersandTkn: &token.Token{ Value: []byte("&"), }, - MethodName: &ast.Identifier{Value: []byte("foo")}, + Name: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ - Type: &ast.Nullable{Expr: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("int")}}}}, + Type: &ast.Nullable{Expr: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("int")}}}}, AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, - DefaultValue: &ast.ExprConstFetch{Const: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("null")}}}}, + DefaultValue: &ast.ExprConstFetch{Const: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("null")}}}}, }, &ast.Parameter{ VariadicTkn: &token.Token{ Value: []byte("..."), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, - ReturnType: &ast.NameName{ - Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("void")}}, + ReturnType: &ast.Name{ + Parts: []ast.Vertex{&ast.NamePart{Value: []byte("void")}}, }, Stmt: &ast.StmtNop{}, } @@ -3252,11 +3252,11 @@ func TestPrinterPrintStmtClass(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - ClassName: &ast.Identifier{Value: []byte("Foo")}, - Extends: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Name: &ast.Identifier{Value: []byte("Foo")}, + Extends: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, Implements: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Quuz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassConstList{ @@ -3289,22 +3289,22 @@ func TestPrinterPrintStmtAnonymousClass(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtClass{ Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("abstract")}}, - Arguments: []ast.Vertex{ + Args: []ast.Vertex{ &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.Argument{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, - Extends: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + Extends: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, Implements: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Quuz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Quuz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassConstList{ @@ -3498,7 +3498,7 @@ func TestPrinterPrintStmtDefalut(t *testing.T) { n := &ast.StmtDefault{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, } @@ -3537,7 +3537,7 @@ func TestPrinterPrintStmtDo_Expression(t *testing.T) { Cond: &ast.ScalarLnumber{Value: []byte("1")}, Stmt: &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, } @@ -3560,7 +3560,7 @@ func TestPrinterPrintStmtDo_StmtList(t *testing.T) { Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -3584,10 +3584,10 @@ func TestPrinterPrintStmtEchoHtmlState(t *testing.T) { &ast.StmtEcho{ Exprs: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -3610,10 +3610,10 @@ func TestPrinterPrintStmtEchoPhpState(t *testing.T) { n := &ast.StmtEcho{ Exprs: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, } @@ -3633,7 +3633,7 @@ func TestPrinterPrintStmtElseIfStmts(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -3657,7 +3657,7 @@ func TestPrinterPrintStmtElseIfExpr(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, } @@ -3677,7 +3677,7 @@ func TestPrinterPrintStmtElseIfNop(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtNop{}, } @@ -3752,7 +3752,7 @@ func TestPrinterPrintExpression(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, } n.Accept(p) @@ -3791,26 +3791,26 @@ func TestPrinterPrintStmtFor(t *testing.T) { n := &ast.StmtFor{ Init: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, Cond: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }, }, Loop: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$e")}, + Name: &ast.Identifier{Value: []byte("$e")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$f")}, + Name: &ast.Identifier{Value: []byte("$f")}, }, }, Stmt: &ast.StmtStmtList{ @@ -3835,13 +3835,13 @@ func TestPrinterPrintStmtForeach(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Key: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$k")}, + Name: &ast.Identifier{Value: []byte("$k")}, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$v")}, + Name: &ast.Identifier{Value: []byte("$v")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -3865,16 +3865,16 @@ func TestPrinterPrintStmtForeach_Reference(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtForeach{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Key: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$k")}, + Name: &ast.Identifier{Value: []byte("$k")}, }, AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$v")}, + Name: &ast.Identifier{Value: []byte("$v")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ @@ -3900,19 +3900,19 @@ func TestPrinterPrintStmtFunction(t *testing.T) { AmpersandTkn: &token.Token{ Value: []byte("&"), }, - FunctionName: &ast.Identifier{Value: []byte("foo")}, + Name: &ast.Identifier{Value: []byte("foo")}, Params: []ast.Vertex{ &ast.Parameter{ AmpersandTkn: &token.Token{ Value: []byte("&"), }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, }, }, ReturnType: &ast.NameFullyQualified{ - Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}, + Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}, }, Stmts: []ast.Vertex{ &ast.StmtNop{}, @@ -3935,10 +3935,10 @@ func TestPrinterPrintStmtGlobal(t *testing.T) { n := &ast.StmtGlobal{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, } @@ -3990,23 +3990,23 @@ func TestPrinterPrintIfExpression(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, ElseIf: []ast.Vertex{ &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$d")}, + Name: &ast.Identifier{Value: []byte("$d")}, }, }, }, @@ -4014,7 +4014,7 @@ func TestPrinterPrintIfExpression(t *testing.T) { }, &ast.StmtElseIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$e")}, + Name: &ast.Identifier{Value: []byte("$e")}, }, Stmt: &ast.StmtNop{}, }, @@ -4022,7 +4022,7 @@ func TestPrinterPrintIfExpression(t *testing.T) { Else: &ast.StmtElse{ Stmt: &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$f")}, + Name: &ast.Identifier{Value: []byte("$f")}, }, }, }, @@ -4043,13 +4043,13 @@ func TestPrinterPrintIfStmtList(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -4071,7 +4071,7 @@ func TestPrinterPrintIfNop(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtIf{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtNop{}, } @@ -4111,20 +4111,20 @@ func TestPrinterPrintInterface(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtInterface{ - InterfaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Extends: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, }, Stmts: []ast.Vertex{ &ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - MethodName: &ast.Identifier{Value: []byte("foo")}, - Params: []ast.Vertex{}, + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Name: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -4146,7 +4146,7 @@ func TestPrinterPrintLabel(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtLabel{ - LabelName: &ast.Identifier{Value: []byte("FOO")}, + Name: &ast.Identifier{Value: []byte("FOO")}, } n.Accept(p) @@ -4163,7 +4163,7 @@ func TestPrinterPrintNamespace(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtNamespace{ - Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, } n.Accept(p) @@ -4180,10 +4180,10 @@ func TestPrinterPrintNamespaceWithStmts(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtNamespace{ - Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, } @@ -4221,23 +4221,23 @@ func TestPrinterPrintPropertyList(t *testing.T) { &ast.Identifier{Value: []byte("public")}, &ast.Identifier{Value: []byte("static")}, }, - Type: &ast.NameName{ + Type: &ast.Name{ Parts: []ast.Vertex{ - &ast.NameNamePart{ + &ast.NamePart{ Value: []byte("Foo"), }, }, }, - Properties: []ast.Vertex{ + Props: []ast.Vertex{ &ast.StmtProperty{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ScalarString{Value: []byte("'a'")}, }, &ast.StmtProperty{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -4258,7 +4258,7 @@ func TestPrinterPrintProperty(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtProperty{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ScalarLnumber{Value: []byte("1")}, } @@ -4295,7 +4295,7 @@ func TestPrinterPrintStaticVar(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Expr: &ast.ScalarLnumber{Value: []byte("1")}, } @@ -4317,12 +4317,12 @@ func TestPrinterPrintStatic(t *testing.T) { Vars: []ast.Vertex{ &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, }, &ast.StmtStaticVar{ Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, }, @@ -4344,10 +4344,10 @@ func TestPrinterPrintStmtList(t *testing.T) { n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, } @@ -4368,17 +4368,17 @@ func TestPrinterPrintStmtListNested(t *testing.T) { n := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$c")}, + Name: &ast.Identifier{Value: []byte("$c")}, }}, }, }, @@ -4402,14 +4402,14 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtSwitch{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, - CaseList: []ast.Vertex{ + Cases: []ast.Vertex{ &ast.StmtCase{ Cond: &ast.ScalarString{Value: []byte("'a'")}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -4417,7 +4417,7 @@ func TestPrinterPrintStmtSwitch(t *testing.T) { Cond: &ast.ScalarString{Value: []byte("'b'")}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -4439,7 +4439,7 @@ func TestPrinterPrintStmtThrow(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtThrow{ Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$var")}, + Name: &ast.Identifier{Value: []byte("$var")}, }, } n.Accept(p) @@ -4457,7 +4457,7 @@ func TestPrinterPrintStmtTraitUseAlias(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUseAlias{ - Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Trait: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, Modifier: &ast.Identifier{Value: []byte("public")}, Alias: &ast.Identifier{Value: []byte("b")}, @@ -4477,11 +4477,11 @@ func TestPrinterPrintStmtTraitUsePrecedence(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUsePrecedence{ - Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Trait: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, Insteadof: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, }, } n.Accept(p) @@ -4500,8 +4500,8 @@ func TestPrinterPrintStmtTraitUse(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, }, } n.Accept(p) @@ -4520,12 +4520,12 @@ func TestPrinterPrintStmtTraitAdaptations(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTraitUse{ Traits: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Bar")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Bar")}}}, }, Adaptations: []ast.Vertex{ &ast.StmtTraitUseAlias{ - Trait: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Trait: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Method: &ast.Identifier{Value: []byte("a")}, Alias: &ast.Identifier{Value: []byte("b")}, }, @@ -4546,16 +4546,16 @@ func TestPrinterPrintTrait(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtTrait{ - TraitName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ &ast.StmtClassMethod{ - Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, - MethodName: &ast.Identifier{Value: []byte("foo")}, - Params: []ast.Vertex{}, + Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, + Name: &ast.Identifier{Value: []byte("foo")}, + Params: []ast.Vertex{}, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, @@ -4579,21 +4579,21 @@ func TestPrinterPrintStmtTry(t *testing.T) { n := &ast.StmtTry{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, Catches: []ast.Vertex{ &ast.StmtCatch{ Types: []ast.Vertex{ - &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Exception")}}}, - &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("RuntimeException")}}}, + &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Exception")}}}, + &ast.NameFullyQualified{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("RuntimeException")}}}, }, Var: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$e")}, + Name: &ast.Identifier{Value: []byte("$e")}, }, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }}, }, }, @@ -4621,10 +4621,10 @@ func TestPrinterPrintStmtUnset(t *testing.T) { n := &ast.StmtUnset{ Vars: []ast.Vertex{ &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$b")}, + Name: &ast.Identifier{Value: []byte("$b")}, }, }, } @@ -4642,15 +4642,15 @@ func TestPrinterPrintUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) - n := &ast.StmtUse{ + n := &ast.StmtUseList{ Type: &ast.Identifier{Value: []byte("function")}, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Alias: &ast.Identifier{Value: []byte("Bar")}, }, - &ast.StmtUseDeclaration{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.StmtUse{ + Use: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, }, }, } @@ -4668,16 +4668,16 @@ func TestPrinterPrintStmtGroupUse(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) - n := &ast.StmtGroupUse{ + n := &ast.StmtGroupUseList{ Type: &ast.Identifier{Value: []byte("function")}, - Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Prefix: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, + Uses: []ast.Vertex{ + &ast.StmtUse{ + Use: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Alias: &ast.Identifier{Value: []byte("Bar")}, }, - &ast.StmtUseDeclaration{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + &ast.StmtUse{ + Use: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Baz")}}}, }, }, } @@ -4695,9 +4695,9 @@ func TestPrinterPrintUseDeclaration(t *testing.T) { o := bytes.NewBufferString("") p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) - n := &ast.StmtUseDeclaration{ + n := &ast.StmtUse{ Type: &ast.Identifier{Value: []byte("function")}, - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Use: &ast.Name{Parts: []ast.Vertex{&ast.NamePart{Value: []byte("Foo")}}}, Alias: &ast.Identifier{Value: []byte("Bar")}, } n.Accept(p) @@ -4716,12 +4716,12 @@ func TestPrinterPrintWhileStmtList(t *testing.T) { p := printer.NewPrinter(o).WithState(printer.PrinterStatePHP) n := &ast.StmtWhile{ Cond: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }, Stmt: &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{ - VarName: &ast.Identifier{Value: []byte("$a")}, + Name: &ast.Identifier{Value: []byte("$a")}, }}, }, }, diff --git a/pkg/visitor/traverser/traverser.go b/pkg/visitor/traverser/traverser.go index 128f7ea..8cc0e30 100644 --- a/pkg/visitor/traverser/traverser.go +++ b/pkg/visitor/traverser/traverser.go @@ -85,8 +85,8 @@ func (t *Traverser) StmtClass(n *ast.StmtClass) { for _, nn := range n.Modifiers { nn.Accept(t) } - t.Traverse(n.ClassName) - for _, nn := range n.Arguments { + t.Traverse(n.Name) + for _, nn := range n.Args { nn.Accept(t) } t.Traverse(n.Extends) @@ -115,7 +115,7 @@ func (t *Traverser) StmtClassMethod(n *ast.StmtClassMethod) { for _, nn := range n.Modifiers { nn.Accept(t) } - t.Traverse(n.MethodName) + t.Traverse(n.Name) for _, nn := range n.Params { nn.Accept(t) } @@ -230,7 +230,7 @@ func (t *Traverser) StmtForeach(n *ast.StmtForeach) { func (t *Traverser) StmtFunction(n *ast.StmtFunction) { n.Accept(t.v) - t.Traverse(n.FunctionName) + t.Traverse(n.Name) for _, nn := range n.Params { nn.Accept(t) } @@ -276,7 +276,7 @@ func (t *Traverser) StmtInlineHtml(n *ast.StmtInlineHtml) { func (t *Traverser) StmtInterface(n *ast.StmtInterface) { n.Accept(t.v) - t.Traverse(n.InterfaceName) + t.Traverse(n.Name) for _, nn := range n.Extends { nn.Accept(t) } @@ -288,7 +288,7 @@ func (t *Traverser) StmtInterface(n *ast.StmtInterface) { func (t *Traverser) StmtLabel(n *ast.StmtLabel) { n.Accept(t.v) - t.Traverse(n.LabelName) + t.Traverse(n.Name) } func (t *Traverser) StmtNamespace(n *ast.StmtNamespace) { @@ -318,7 +318,7 @@ func (t *Traverser) StmtPropertyList(n *ast.StmtPropertyList) { nn.Accept(t) } t.Traverse(n.Type) - for _, nn := range n.Properties { + for _, nn := range n.Props { nn.Accept(t) } } @@ -356,7 +356,7 @@ func (t *Traverser) StmtSwitch(n *ast.StmtSwitch) { n.Accept(t.v) t.Traverse(n.Cond) - for _, nn := range n.CaseList { + for _, nn := range n.Cases { nn.Accept(t) } } @@ -370,7 +370,7 @@ func (t *Traverser) StmtThrow(n *ast.StmtThrow) { func (t *Traverser) StmtTrait(n *ast.StmtTrait) { n.Accept(t.v) - t.Traverse(n.TraitName) + t.Traverse(n.Name) for _, nn := range n.Stmts { nn.Accept(t) } @@ -426,26 +426,26 @@ func (t *Traverser) StmtUnset(n *ast.StmtUnset) { } } -func (t *Traverser) StmtUse(n *ast.StmtUse) { +func (t *Traverser) StmtUse(n *ast.StmtUseList) { n.Accept(t.v) t.Traverse(n.Type) - for _, nn := range n.UseDeclarations { + for _, nn := range n.Uses { nn.Accept(t) } } -func (t *Traverser) StmtGroupUse(n *ast.StmtGroupUse) { +func (t *Traverser) StmtGroupUse(n *ast.StmtGroupUseList) { n.Accept(t.v) t.Traverse(n.Type) t.Traverse(n.Prefix) - for _, nn := range n.UseDeclarations { + for _, nn := range n.Uses { nn.Accept(t) } } -func (t *Traverser) StmtUseDeclaration(n *ast.StmtUseDeclaration) { +func (t *Traverser) StmtUseDeclaration(n *ast.StmtUse) { n.Accept(t.v) t.Traverse(n.Type) @@ -514,7 +514,7 @@ func (t *Traverser) ExprClassConstFetch(n *ast.ExprClassConstFetch) { n.Accept(t.v) t.Traverse(n.Class) - t.Traverse(n.ConstantName) + t.Traverse(n.Const) } func (t *Traverser) ExprClone(n *ast.ExprClone) { @@ -529,7 +529,7 @@ func (t *Traverser) ExprClosure(n *ast.ExprClosure) { for _, nn := range n.Params { nn.Accept(t) } - for _, nn := range n.Use { + for _, nn := range n.Uses { nn.Accept(t) } t.Traverse(n.ReturnType) @@ -578,7 +578,7 @@ func (t *Traverser) ExprFunctionCall(n *ast.ExprFunctionCall) { n.Accept(t.v) t.Traverse(n.Function) - for _, nn := range n.Arguments { + for _, nn := range n.Args { nn.Accept(t) } } @@ -623,7 +623,7 @@ func (t *Traverser) ExprMethodCall(n *ast.ExprMethodCall) { t.Traverse(n.Var) t.Traverse(n.Method) - for _, nn := range n.Arguments { + for _, nn := range n.Args { nn.Accept(t) } } @@ -632,7 +632,7 @@ func (t *Traverser) ExprNew(n *ast.ExprNew) { n.Accept(t.v) t.Traverse(n.Class) - for _, nn := range n.Arguments { + for _, nn := range n.Args { nn.Accept(t) } } @@ -671,7 +671,7 @@ func (t *Traverser) ExprPropertyFetch(n *ast.ExprPropertyFetch) { n.Accept(t.v) t.Traverse(n.Var) - t.Traverse(n.Property) + t.Traverse(n.Prop) } func (t *Traverser) ExprRequire(n *ast.ExprRequire) { @@ -699,7 +699,7 @@ func (t *Traverser) ExprStaticCall(n *ast.ExprStaticCall) { t.Traverse(n.Class) t.Traverse(n.Call) - for _, nn := range n.Arguments { + for _, nn := range n.Args { nn.Accept(t) } } @@ -708,13 +708,13 @@ func (t *Traverser) ExprStaticPropertyFetch(n *ast.ExprStaticPropertyFetch) { n.Accept(t.v) t.Traverse(n.Class) - t.Traverse(n.Property) + t.Traverse(n.Prop) } func (t *Traverser) ExprTernary(n *ast.ExprTernary) { n.Accept(t.v) - t.Traverse(n.Condition) + t.Traverse(n.Cond) t.Traverse(n.IfTrue) t.Traverse(n.IfFalse) } @@ -734,14 +734,14 @@ func (t *Traverser) ExprUnaryPlus(n *ast.ExprUnaryPlus) { func (t *Traverser) ExprVariable(n *ast.ExprVariable) { n.Accept(t.v) - t.Traverse(n.VarName) + t.Traverse(n.Name) } func (t *Traverser) ExprYield(n *ast.ExprYield) { n.Accept(t.v) t.Traverse(n.Key) - t.Traverse(n.Value) + t.Traverse(n.Val) } func (t *Traverser) ExprYieldFrom(n *ast.ExprYieldFrom) { @@ -1105,7 +1105,7 @@ func (t *Traverser) ScalarEncapsedStringPart(n *ast.ScalarEncapsedStringPart) { func (t *Traverser) ScalarEncapsedStringVar(n *ast.ScalarEncapsedStringVar) { n.Accept(t.v) - t.Traverse(n.VarName) + t.Traverse(n.Name) t.Traverse(n.Dim) } @@ -1135,7 +1135,7 @@ func (t *Traverser) ScalarString(n *ast.ScalarString) { n.Accept(t.v) } -func (t *Traverser) NameName(n *ast.NameName) { +func (t *Traverser) NameName(n *ast.Name) { n.Accept(t.v) for _, nn := range n.Parts { @@ -1159,6 +1159,6 @@ func (t *Traverser) NameRelative(n *ast.NameRelative) { } } -func (t *Traverser) NameNamePart(n *ast.NameNamePart) { +func (t *Traverser) NameNamePart(n *ast.NamePart) { n.Accept(t.v) } From e3b133f3de707857311c5bf27f40dfb8a1b44625 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Tue, 29 Dec 2020 21:23:22 +0200 Subject: [PATCH 140/140] refactoring: update api --- cmd/php-parser/main.go | 37 +- internal/php5/parser.go | 11 +- internal/php5/parser_test.go | 2118 ++++++++++++++++---- internal/php5/php5_bench_test.go | 12 +- internal/php7/parser.go | 11 +- internal/php7/parser_test.go | 2330 +++++++++++++++++----- internal/php7/php7_bench_test.go | 12 +- internal/scanner/lexer.go | 23 +- internal/scanner/scanner_test.go | 272 ++- internal/version/version.go | 61 - internal/version/version_test.go | 29 - pkg/cfg/cfg.go | 11 + pkg/parser/parser.go | 50 +- pkg/version/version.go | 102 + pkg/version/version_test.go | 48 + pkg/visitor/printer/printer_php5_test.go | 21 +- pkg/visitor/printer/printer_php7_test.go | 32 +- 17 files changed, 4086 insertions(+), 1094 deletions(-) delete mode 100644 internal/version/version.go delete mode 100644 internal/version/version_test.go create mode 100644 pkg/cfg/cfg.go create mode 100644 pkg/version/version.go create mode 100644 pkg/version/version_test.go diff --git a/cmd/php-parser/main.go b/cmd/php-parser/main.go index a94d348..796e87e 100644 --- a/cmd/php-parser/main.go +++ b/cmd/php-parser/main.go @@ -3,10 +3,7 @@ package main import ( "bytes" "flag" - "github.com/z7zmey/php-parser/pkg/visitor/dumper" - "github.com/z7zmey/php-parser/pkg/visitor/nsresolver" - "github.com/z7zmey/php-parser/pkg/visitor/printer" - "github.com/z7zmey/php-parser/pkg/visitor/traverser" + "fmt" "io" "io/ioutil" "log" @@ -21,15 +18,20 @@ import ( "github.com/yookoala/realpath" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/parser" + "github.com/z7zmey/php-parser/pkg/version" + "github.com/z7zmey/php-parser/pkg/visitor/dumper" + "github.com/z7zmey/php-parser/pkg/visitor/nsresolver" + "github.com/z7zmey/php-parser/pkg/visitor/printer" + "github.com/z7zmey/php-parser/pkg/visitor/traverser" ) var wg sync.WaitGroup -var phpVersion string +var phpVersion *version.Version var profiler string var dump *bool -var withFreeFloating *bool var showResolvedNs *bool var printBack *bool var printPath *bool @@ -49,19 +51,26 @@ type result struct { func main() { start := time.Now() + var phpVer string printExecTime = flag.Bool("time", false, "print execution time") - withFreeFloating = flag.Bool("ff", false, "parse and show free floating strings") showResolvedNs = flag.Bool("r", false, "resolve names") printBack = flag.Bool("pb", false, "print AST back into the parsed file") printPath = flag.Bool("p", false, "print filepath") printErrors = flag.Bool("e", false, "print errors") dump = flag.Bool("d", false, "dump") flag.StringVar(&profiler, "prof", "", "start profiler: [cpu, mem, trace]") - flag.StringVar(&phpVersion, "phpver", "7.4", "php version") + flag.StringVar(&phpVer, "phpver", "7.4", "php version") flag.Parse() + var err error + phpVersion, err = version.New(phpVer) + if err != nil { + fmt.Println("Error: " + err.Error()) + os.Exit(1) + } + if len(flag.Args()) == 0 { flag.Usage() return @@ -128,16 +137,16 @@ func parserWorker(fileCh <-chan *file, r chan<- result) { return } - parserErrors := []*errors.Error{} - cfg := parser.Config{ - WithTokens: *withFreeFloating, + var parserErrors []*errors.Error + rootNode, err := parser.Parse(f.content, cfg.Config{ + Version: phpVersion, ErrorHandlerFunc: func(e *errors.Error) { parserErrors = append(parserErrors, e) }, - } - rootNode, err := parser.Parse(f.content, phpVersion, cfg) + }) if err != nil { - panic(err.Error()) + fmt.Println("Error:" + err.Error()) + os.Exit(1) } r <- result{path: f.path, rootNode: rootNode, errors: parserErrors} diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 84015d2..a8c8dcf 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -1,9 +1,10 @@ package php5 import ( - builder "github.com/z7zmey/php-parser/internal/position" + "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/token" ) @@ -14,15 +15,15 @@ type Parser struct { currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) - builder *builder.Builder + builder *position.Builder } // NewParser creates and returns new Parser -func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser { +func NewParser(lexer *scanner.Lexer, config cfg.Config) *Parser { return &Parser{ Lexer: lexer, - errHandlerFunc: errHandlerFunc, - builder: builder.NewBuilder(), + errHandlerFunc: config.ErrorHandlerFunc, + builder: position.NewBuilder(), } } diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 6c1dfde..a8a9bd5 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -8,9 +8,11 @@ import ( "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/version" ) func TestIdentifier(t *testing.T) { @@ -95,8 +97,14 @@ func TestIdentifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1394,8 +1402,14 @@ func TestPhp5ArgumentNode(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -2986,8 +3000,14 @@ func TestPhp5ParameterNode(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3040,8 +3060,14 @@ func TestCommentEndFile(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3161,8 +3187,14 @@ func TestName(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3290,8 +3322,14 @@ func TestFullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3429,8 +3467,14 @@ func TestRelative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3569,8 +3613,14 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3707,8 +3757,14 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3864,8 +3920,14 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4057,8 +4119,14 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4251,8 +4319,14 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4409,8 +4483,14 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4606,8 +4686,14 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4829,8 +4915,14 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5002,8 +5094,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5175,8 +5273,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5302,8 +5406,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5407,8 +5517,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5534,8 +5650,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5616,8 +5738,14 @@ func TestScalarMagicConstant(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5697,8 +5825,14 @@ func TestScalarNumber_LNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5778,8 +5912,14 @@ func TestScalarNumber_DNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5859,8 +5999,14 @@ func TestScalarNumber_Float(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5940,8 +6086,14 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6021,8 +6173,14 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6102,8 +6260,14 @@ func TestScalarNumber_HLNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6183,8 +6347,14 @@ func TestScalarNumber_HDNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6264,8 +6434,14 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6345,8 +6521,14 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6428,8 +6610,14 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6509,8 +6697,14 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6592,8 +6786,14 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6780,8 +6980,14 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7091,8 +7297,14 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7341,8 +7553,14 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7811,8 +8029,14 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8176,8 +8400,14 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8425,8 +8655,14 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8893,8 +9129,14 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9216,8 +9458,14 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9539,8 +9787,14 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9665,8 +9919,14 @@ func TestStmtClass_SimpleClass(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9824,8 +10084,14 @@ func TestStmtClass_AbstractClass(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10058,8 +10324,14 @@ func TestStmtClass_ClassExtends(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10294,8 +10566,14 @@ func TestStmtClass_ClassImplement(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10583,8 +10861,14 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10853,8 +11137,14 @@ func TestStmtConstList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11060,8 +11350,14 @@ func TestStmtContinue_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11298,8 +11594,14 @@ func TestStmtContinue_Light(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11552,8 +11854,14 @@ func TestStmtContinue(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11710,8 +12018,14 @@ func TestStmtDeclare(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11971,8 +12285,14 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12162,8 +12482,14 @@ func TestStmtDeclare_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12336,8 +12662,14 @@ func TestStmtDo(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12492,8 +12824,14 @@ func TestStmtEcho(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12621,8 +12959,14 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12758,8 +13102,14 @@ func TestStmtExpression(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13221,8 +13571,14 @@ func TestStmtFor(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13547,8 +13903,14 @@ func TestStmtFor_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13770,8 +14132,14 @@ func TestStmtForeach(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13994,8 +14362,14 @@ func TestStmtForeach_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14239,8 +14613,14 @@ func TestStmtForeach_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14523,8 +14903,14 @@ func TestStmtForeach_WithKey(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14808,8 +15194,14 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15102,8 +15494,14 @@ func TestStmtForeach_WithRef(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15434,8 +15832,14 @@ func TestStmtForeach_WithList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15580,8 +15984,14 @@ func TestStmtFunction(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15755,8 +16165,14 @@ func TestStmtFunction_Return(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16127,8 +16543,14 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16343,8 +16765,14 @@ func TestStmtFunction_Ref(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16456,8 +16884,14 @@ func TestStmtGlobal(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16804,8 +17238,14 @@ func TestStmtGlobal_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16956,8 +17396,14 @@ func TestStmtGotoLabel(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17048,8 +17494,14 @@ func TestStmtHaltCompiler(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17210,8 +17662,14 @@ func TestStmtIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17504,8 +17962,14 @@ func TestStmtIf_ElseIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17737,8 +18201,14 @@ func TestStmtIf_Else(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18232,8 +18702,14 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18757,8 +19233,14 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18838,8 +19320,14 @@ func TestStmtInlineHtml(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18964,8 +19452,14 @@ func TestStmtInterface(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19155,8 +19649,14 @@ func TestStmtInterface_Extend(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19399,8 +19899,14 @@ func TestStmtInterface_Extends(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19512,8 +20018,14 @@ func TestStmtNamespace(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19648,8 +20160,14 @@ func TestStmtNamespace_Stmts(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19743,8 +20261,14 @@ func TestStmtNamespace_Anonymous(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19958,8 +20482,14 @@ func TestStmtProperty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20316,8 +20846,14 @@ func TestStmtProperty_Properties(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20674,8 +21210,14 @@ func TestStmtProperty_Properties2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20795,8 +21337,14 @@ func TestStmtStaticVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21028,8 +21576,14 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21261,8 +21815,14 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21650,8 +22210,14 @@ func TestStmtSwitch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22049,8 +22615,14 @@ func TestStmtSwitch_Semicolon(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22408,8 +22980,14 @@ func TestStmtSwitch_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22735,8 +23313,14 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22846,8 +23430,14 @@ func TestStmtThrow(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22972,8 +23562,14 @@ func TestStmtTrait(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23194,8 +23790,14 @@ func TestStmtTraitUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23469,8 +24071,14 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23766,8 +24374,14 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24179,8 +24793,14 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24623,8 +25243,14 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25281,8 +25907,14 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25378,8 +26010,14 @@ func TestStmtTry_Try(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25641,8 +26279,14 @@ func TestStmtTry_TryCatch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26069,8 +26713,14 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26395,8 +27045,14 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27017,8 +27673,14 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27138,8 +27800,14 @@ func TestStmtUnset(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27310,8 +27978,14 @@ func TestStmtUnset_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27433,8 +28107,14 @@ func TestStmtUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27566,8 +28246,14 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27752,8 +28438,14 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27936,8 +28628,14 @@ func TestStmtUse_List(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28173,8 +28871,14 @@ func TestStmtUse_ListAlias(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28398,8 +29102,14 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28729,8 +29439,14 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28954,8 +29670,14 @@ func TestStmtUse_ListConstType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29285,8 +30007,14 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29492,8 +30220,14 @@ func TestStmtBreak_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29730,8 +30464,14 @@ func TestStmtBreak_Light(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29994,8 +30734,14 @@ func TestStmtBreak(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30132,8 +30878,14 @@ func TestExprArrayDimFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30315,8 +31067,14 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30415,8 +31173,14 @@ func TestExprArray(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30544,8 +31308,14 @@ func TestExprArray_Item(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30782,8 +31552,14 @@ func TestExprArray_Items(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30889,8 +31665,14 @@ func TestExprBitwiseNot(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30996,8 +31778,14 @@ func TestExprBooleanNot(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31124,8 +31912,14 @@ func TestExprClassConstFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31242,8 +32036,14 @@ func TestExprClassConstFetch_Static(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31377,8 +32177,14 @@ func TestExprClone_Brackets(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31496,8 +32302,14 @@ func TestExprClone(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31617,8 +32429,14 @@ func TestExprClosure(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32006,8 +32824,14 @@ func TestExprClosure_Use(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32395,8 +33219,14 @@ func TestExprClosure_Use2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32494,8 +33324,14 @@ func TestExprConstFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32613,8 +33449,14 @@ func TestExprConstFetch_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32722,8 +33564,14 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32849,8 +33697,14 @@ func TestExprEmpty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32956,8 +33810,14 @@ func TestExprErrorSuppress(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33083,8 +33943,14 @@ func TestExprEval(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33163,8 +34029,14 @@ func TestExprExit(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33263,8 +34135,14 @@ func TestExprExit_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33390,8 +34268,14 @@ func TestExprExit_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33470,8 +34354,14 @@ func TestExprDie(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33570,8 +34460,14 @@ func TestExprDie_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33697,8 +34593,14 @@ func TestExprDie_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33816,8 +34718,14 @@ func TestExprFunctionCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33955,8 +34863,14 @@ func TestExprFunctionCall_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34122,8 +35036,14 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34306,8 +35226,14 @@ func TestExprFunctionCall_Var(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34499,8 +35425,14 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34606,8 +35538,14 @@ func TestExprPostDec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34713,8 +35651,14 @@ func TestExprPostInc(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34820,8 +35764,14 @@ func TestExprPreDec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34927,8 +35877,14 @@ func TestExprPreInc(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35046,8 +36002,14 @@ func TestExprInclude(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35165,8 +36127,14 @@ func TestExprInclude_Once(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35284,8 +36252,14 @@ func TestExprRequire(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35403,8 +36377,14 @@ func TestExprRequire_Once(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35563,8 +36543,14 @@ func TestExprInstanceOf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35743,8 +36729,14 @@ func TestExprInstanceOf_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35913,8 +36905,14 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36042,8 +37040,14 @@ func TestExprIsset(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36222,8 +37226,14 @@ func TestExprIsset_Variables(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36394,8 +37404,14 @@ func TestExprList_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36600,8 +37616,14 @@ func TestExprList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36834,8 +37856,14 @@ func TestExprList_ArrayIndex(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37088,8 +38116,14 @@ func TestExprList_List(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37319,8 +38353,14 @@ func TestExprList_EmptyItem(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37596,8 +38636,14 @@ func TestExprList_EmptyItems(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37742,8 +38788,14 @@ func TestExprMethodCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37863,8 +38915,14 @@ func TestExprNew(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38024,8 +39082,14 @@ func TestExprNew_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38175,8 +39239,14 @@ func TestExprNew_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38310,8 +39380,14 @@ func TestExprPrint(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38438,8 +39514,14 @@ func TestExprPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38576,8 +39658,14 @@ func TestExprShellExec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38666,8 +39754,14 @@ func TestExprShortArray(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38785,8 +39879,14 @@ func TestExprShortArray_Item(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39013,8 +40113,14 @@ func TestExprShortArray_Items(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39161,8 +40267,14 @@ func TestExprStaticCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39329,8 +40441,14 @@ func TestExprStaticCall_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39487,8 +40605,14 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39643,8 +40767,14 @@ func TestExprStaticCall_Var(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39797,8 +40927,14 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39933,8 +41069,14 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40089,8 +41231,14 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40235,8 +41383,14 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40454,8 +41608,14 @@ func TestExprTernary(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40634,8 +41794,14 @@ func TestExprTernary_Simple(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40983,8 +42149,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41332,8 +42504,14 @@ func TestExprTernary_NestedCond(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41439,8 +42617,14 @@ func TestExprUnaryMinus(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41546,8 +42730,14 @@ func TestExprUnaryPlus(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41635,8 +42825,14 @@ func TestExprVariable(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41742,8 +42938,14 @@ func TestExprVariable_Variable(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41822,8 +43024,14 @@ func TestExprYield(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41941,8 +43149,14 @@ func TestExprYield_Val(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42121,8 +43335,14 @@ func TestExprYield_KeyVal(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42232,8 +43452,14 @@ func TestExprYield_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42404,8 +43630,14 @@ func TestExprYield_KeyExpr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44621,8 +45853,14 @@ func TestExprAssign(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47830,8 +49068,14 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -48700,8 +49944,14 @@ func TestExprCast_Array(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -49000,8 +50250,14 @@ func TestPhp5Strings(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -49480,8 +50736,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() actual := php5parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -49502,12 +50764,18 @@ func TestPhp5ControlCharsErrors(t *testing.T) { } parserErrors := []*errors.Error{} - errorHandlerFunc := func(e *errors.Error) { - parserErrors = append(parserErrors, e) - } - lexer := scanner.NewLexer([]byte(src), "5.6", errorHandlerFunc) - php5parser := php5.NewParser(lexer, errorHandlerFunc) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + ErrorHandlerFunc: func(e *errors.Error) { + parserErrors = append(parserErrors, e) + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() assert.DeepEqual(t, expected, parserErrors) } diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 77c67cc..b17c36f 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -6,6 +6,8 @@ import ( "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/version" ) func BenchmarkPhp5(b *testing.B) { @@ -15,8 +17,14 @@ func BenchmarkPhp5(b *testing.B) { } for n := 0; n < b.N; n++ { - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer(src, config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() } } diff --git a/internal/php7/parser.go b/internal/php7/parser.go index f053888..eda2135 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -1,9 +1,10 @@ package php7 import ( - builder "github.com/z7zmey/php-parser/internal/position" + "github.com/z7zmey/php-parser/internal/position" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/token" ) @@ -14,15 +15,15 @@ type Parser struct { currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) - builder *builder.Builder + builder *position.Builder } // NewParser creates and returns new Parser -func NewParser(lexer *scanner.Lexer, errHandlerFunc func(*errors.Error)) *Parser { +func NewParser(lexer *scanner.Lexer, config cfg.Config) *Parser { return &Parser{ Lexer: lexer, - errHandlerFunc: errHandlerFunc, - builder: builder.NewBuilder(), + errHandlerFunc: config.ErrorHandlerFunc, + builder: position.NewBuilder(), } } diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index b35eece..3df90af 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -1,7 +1,6 @@ package php7_test import ( - "github.com/z7zmey/php-parser/pkg/errors" "testing" "gotest.tools/assert" @@ -9,8 +8,11 @@ import ( "github.com/z7zmey/php-parser/internal/php7" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/version" ) func TestIdentifier(t *testing.T) { @@ -95,8 +97,14 @@ func TestIdentifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -1665,8 +1673,14 @@ func TestPhp7ArgumentNode(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3343,8 +3357,14 @@ func TestPhp7ParameterNode(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3397,8 +3417,14 @@ func TestCommentEndFile(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3518,8 +3544,14 @@ func TestName(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3647,8 +3679,14 @@ func TestFullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3786,8 +3824,14 @@ func TestRelative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -3926,8 +3970,14 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4064,8 +4114,14 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4221,8 +4277,14 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4414,8 +4476,14 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4608,8 +4676,14 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4766,8 +4840,14 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -4963,8 +5043,14 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5186,8 +5272,14 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5359,8 +5451,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5532,8 +5630,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5659,8 +5763,14 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5764,8 +5874,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5891,8 +6007,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -5973,8 +6095,14 @@ func TestScalarMagicConstant(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6054,8 +6182,14 @@ func TestScalarNumber_LNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6135,8 +6269,14 @@ func TestScalarNumber_DNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6216,8 +6356,14 @@ func TestScalarNumber_Float(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6297,8 +6443,14 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6378,8 +6530,14 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6459,8 +6617,14 @@ func TestScalarNumber_HLNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6540,8 +6704,14 @@ func TestScalarNumber_HDNumber(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6621,8 +6791,14 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6702,8 +6878,14 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6785,8 +6967,14 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6866,8 +7054,14 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -6949,8 +7143,14 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7151,8 +7351,14 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7462,8 +7668,14 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -7712,8 +7924,14 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8182,8 +8400,14 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8580,8 +8804,14 @@ func TestStmtClassConstList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -8945,8 +9175,14 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9194,8 +9430,14 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -9662,8 +9904,14 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10036,8 +10284,14 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10359,8 +10613,14 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10702,8 +10962,14 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10828,8 +11094,14 @@ func TestStmtClass_SimpleClass(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -10987,8 +11259,14 @@ func TestStmtClass_AbstractClass(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11221,8 +11499,14 @@ func TestStmtClass_ClassExtends(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11457,8 +11741,14 @@ func TestStmtClass_ClassImplement(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -11746,8 +12036,14 @@ func TestStmtClass_ClassImplements(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12102,8 +12398,14 @@ func TestStmtClass_AnonimousClass(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12372,8 +12674,14 @@ func TestStmtConstList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12579,8 +12887,14 @@ func TestStmtContinue_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -12817,8 +13131,14 @@ func TestStmtContinue_Light(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13071,8 +13391,14 @@ func TestStmtContinue(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13229,8 +13555,14 @@ func TestStmtDeclare(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13490,8 +13822,14 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13681,8 +14019,14 @@ func TestStmtDeclare_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -13855,8 +14199,14 @@ func TestStmtDo(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14011,8 +14361,14 @@ func TestStmtEcho(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14140,8 +14496,14 @@ func TestStmtEcho_Parenthesis(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14221,8 +14583,14 @@ func TestStmtExpression(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -14684,8 +15052,14 @@ func TestStmtFor(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15010,8 +15384,14 @@ func TestStmtFor_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15233,8 +15613,14 @@ func TestStmtForeach(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15457,8 +15843,14 @@ func TestStmtForeach_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15702,8 +16094,14 @@ func TestStmtForeach_Alt(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -15986,8 +16384,14 @@ func TestStmtForeach_WithKey(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16271,8 +16675,14 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16565,8 +16975,14 @@ func TestStmtForeach_WithRef(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -16897,8 +17313,14 @@ func TestStmtForeach_WithList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17043,8 +17465,14 @@ func TestStmtFunction(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17218,8 +17646,14 @@ func TestStmtFunction_Return(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17590,8 +18024,14 @@ func TestStmtFunction_ReturnVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -17806,8 +18246,14 @@ func TestStmtFunction_Ref(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18013,8 +18459,14 @@ func TestStmtFunction_ReturnType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18126,8 +18578,14 @@ func TestStmtGlobal(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18474,8 +18932,14 @@ func TestStmtGlobal_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18626,8 +19090,14 @@ func TestStmtGotoLabel(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18718,8 +19188,14 @@ func TestStmtHaltCompiler(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -18880,8 +19356,14 @@ func TestStmtIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19174,8 +19656,14 @@ func TestStmtIf_ElseIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19407,8 +19895,14 @@ func TestStmtIf_Else(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -19902,8 +20396,14 @@ func TestStmtIf_ElseElseIf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20427,8 +20927,14 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20508,8 +21014,14 @@ func TestStmtInlineHtml(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20634,8 +21146,14 @@ func TestStmtInterface(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -20825,8 +21343,14 @@ func TestStmtInterface_Extend(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21069,8 +21593,14 @@ func TestStmtInterface_Extends(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21182,8 +21712,14 @@ func TestStmtNamespace(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21318,8 +21854,14 @@ func TestStmtNamespace_Stmts(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21413,8 +21955,14 @@ func TestStmtNamespace_Anonymous(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21628,8 +22176,14 @@ func TestStmtProperty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -21986,8 +22540,14 @@ func TestStmtProperty_Properties(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22344,8 +22904,14 @@ func TestStmtProperty_Properties2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22600,8 +23166,14 @@ func TestStmtProperty_PropertyType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22721,8 +23293,14 @@ func TestStmtStaticVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -22954,8 +23532,14 @@ func TestStmtStaticVar_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23187,8 +23771,14 @@ func TestStmtStaticVar_Vars2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -23590,8 +24180,14 @@ func TestStmtSwitch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24003,8 +24599,14 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24376,8 +24978,14 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24703,8 +25311,14 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24814,8 +25428,14 @@ func TestStmtThrow(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -24940,8 +25560,14 @@ func TestStmtTrait(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25162,8 +25788,14 @@ func TestStmtTraitUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25437,8 +26069,14 @@ func TestStmtTraitUse_Uses(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -25734,8 +26372,14 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26147,8 +26791,14 @@ func TestStmtTraitUse_Modifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -26591,8 +27241,14 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27249,8 +27905,14 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27360,8 +28022,14 @@ func TestStmtTry_Try(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27637,8 +28305,14 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -27955,8 +28629,14 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28397,8 +29077,14 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -28737,8 +29423,14 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29359,8 +30051,14 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29480,8 +30178,14 @@ func TestStmtUnset(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29652,8 +30356,14 @@ func TestStmtUnset_Vars(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29834,8 +30544,14 @@ func TestStmtUnset_TrailingComma(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -29957,8 +30673,14 @@ func TestStmtUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30090,8 +30812,14 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30276,8 +31004,14 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30460,8 +31194,14 @@ func TestStmtUse_List(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30697,8 +31437,14 @@ func TestStmtUse_ListAlias(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -30922,8 +31668,14 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31253,8 +32005,14 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31478,8 +32236,14 @@ func TestStmtUse_ListConstType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -31809,8 +32573,14 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32052,8 +32822,14 @@ func TestStmtUse_GroupUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32348,8 +33124,14 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32622,8 +33404,14 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -32896,8 +33684,14 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33201,8 +33995,14 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33408,8 +34208,14 @@ func TestStmtBreak_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33646,8 +34452,14 @@ func TestStmtBreak_Light(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -33910,8 +34722,14 @@ func TestStmtBreak(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34048,8 +34866,14 @@ func TestExprArrayDimFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34231,8 +35055,14 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34331,8 +35161,14 @@ func TestExprArray(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34460,8 +35296,14 @@ func TestExprArray_Item(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34698,8 +35540,14 @@ func TestExprArray_Items(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -34845,8 +35693,14 @@ func TestExprArray_ItemUnpack(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35006,8 +35860,14 @@ func TestExprArrowFunction(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35264,8 +36124,14 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35371,8 +36237,14 @@ func TestExprBitwiseNot(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35478,8 +36350,14 @@ func TestExprBooleanNot(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35606,8 +36484,14 @@ func TestExprClassConstFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35724,8 +36608,14 @@ func TestExprClassConstFetch_Static(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35859,8 +36749,14 @@ func TestExprClone_Brackets(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -35978,8 +36874,14 @@ func TestExprClone(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36099,8 +37001,14 @@ func TestExprClosure(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36488,8 +37396,14 @@ func TestExprClosure_Use(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -36877,8 +37791,14 @@ func TestExprClosure_Use2(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37061,8 +37981,14 @@ func TestExprClosure_ReturnType(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37160,8 +38086,14 @@ func TestExprConstFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37279,8 +38211,14 @@ func TestExprConstFetch_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37388,8 +38326,14 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37515,8 +38459,14 @@ func TestExprEmpty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37622,8 +38572,14 @@ func TestExprErrorSuppress(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37749,8 +38705,14 @@ func TestExprEval(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37829,8 +38791,14 @@ func TestExprExit(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -37929,8 +38897,14 @@ func TestExprExit_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38056,8 +39030,14 @@ func TestExprExit_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38136,8 +39116,14 @@ func TestExprDie(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38236,8 +39222,14 @@ func TestExprDie_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38363,8 +39355,14 @@ func TestExprDie_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38482,8 +39480,14 @@ func TestExprFunctionCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38621,8 +39625,14 @@ func TestExprFunctionCall_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38788,8 +39798,14 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -38972,8 +39988,14 @@ func TestExprFunctionCall_Var(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39165,8 +40187,14 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39272,8 +40300,14 @@ func TestExprPostDec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39379,8 +40413,14 @@ func TestExprPostInc(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39486,8 +40526,14 @@ func TestExprPreDec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39593,8 +40639,14 @@ func TestExprPreInc(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39712,8 +40764,14 @@ func TestExprInclude(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39831,8 +40889,14 @@ func TestExprInclude_Once(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -39950,8 +41014,14 @@ func TestExprRequire(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40069,8 +41139,14 @@ func TestExprRequire_Once(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40229,8 +41305,14 @@ func TestExprInstanceOf(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40409,8 +41491,14 @@ func TestExprInstanceOf_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40579,8 +41667,14 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40708,8 +41802,14 @@ func TestExprIsset(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -40888,8 +41988,14 @@ func TestExprIsset_Variables(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41057,8 +42163,14 @@ func TestExprList_Empty(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41263,8 +42375,14 @@ func TestExprList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41497,8 +42615,14 @@ func TestExprList_ArrayIndex(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41751,8 +42875,14 @@ func TestExprList_List(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -41982,8 +43112,14 @@ func TestExprList_EmptyItem(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42259,8 +43395,14 @@ func TestExprList_EmptyItems(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42405,8 +43547,14 @@ func TestExprMethodCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42526,8 +43674,14 @@ func TestExprNew(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42687,8 +43841,14 @@ func TestExprNew_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -42838,8 +43998,14 @@ func TestExprNew_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43119,8 +44285,14 @@ func TestExprNew_Anonymous(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43254,8 +44426,14 @@ func TestExprPrint(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43380,8 +44558,14 @@ func TestExprPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43518,8 +44702,14 @@ func TestExprShellExec(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43608,8 +44798,14 @@ func TestExprShortArray(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43727,8 +44923,14 @@ func TestExprShortArray_Item(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -43955,8 +45157,14 @@ func TestExprShortArray_Items(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44151,8 +45359,14 @@ func TestExprShortList(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44375,8 +45589,14 @@ func TestExprShortList_ArrayIndex(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44619,8 +45839,14 @@ func TestExprShortList_List(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44767,8 +45993,14 @@ func TestExprStaticCall(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -44935,8 +46167,14 @@ func TestExprStaticCall_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45093,8 +46331,14 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45249,8 +46493,14 @@ func TestExprStaticCall_Var(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45403,8 +46653,14 @@ func TestExprStaticCall_VarVar(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45539,8 +46795,14 @@ func TestExprStaticPropertyFetch(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45695,8 +46957,14 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -45841,8 +47109,14 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -46060,8 +47334,14 @@ func TestExprTernary(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -46240,8 +47520,14 @@ func TestExprTernary_Simple(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -46589,8 +47875,14 @@ func TestExprTernary_NestedTrue(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -46938,8 +48230,14 @@ func TestExprTernary_NestedCond(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47045,8 +48343,14 @@ func TestExprUnaryMinus(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47152,8 +48456,14 @@ func TestExprUnaryPlus(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47241,8 +48551,14 @@ func TestExprVariable(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47348,8 +48664,14 @@ func TestExprVariable_Variable(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47428,8 +48750,14 @@ func TestExprYield(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47547,8 +48875,14 @@ func TestExprYield_Val(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47727,8 +49061,14 @@ func TestExprYield_KeyVal(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -47838,8 +49178,14 @@ func TestExprYield_Expr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -48010,8 +49356,14 @@ func TestExprYield_KeyExpr(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -48129,8 +49481,14 @@ func TestExprYieldFrom(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -50473,8 +51831,14 @@ func TestExprAssign_Assign(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -53936,8 +55300,14 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -54806,8 +56176,14 @@ func TestExprCast_Array(t *testing.T) { EndTkn: &token.Token{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -55106,8 +56482,14 @@ func TestStrings(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -55586,8 +56968,14 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() actual := php7parser.GetRootNode() assert.DeepEqual(t, expected, actual) @@ -55608,12 +56996,18 @@ func TestControlCharsErrors(t *testing.T) { } parserErrors := []*errors.Error{} - errorHandlerFunc := func(e *errors.Error) { - parserErrors = append(parserErrors, e) - } - lexer := scanner.NewLexer([]byte(src), "7.4", errorHandlerFunc) - php7parser := php7.NewParser(lexer, errorHandlerFunc) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + ErrorHandlerFunc: func(e *errors.Error) { + parserErrors = append(parserErrors, e) + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() assert.DeepEqual(t, expected, parserErrors) } diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index 3ba6578..961688d 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -6,6 +6,8 @@ import ( "github.com/z7zmey/php-parser/internal/php7" "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/version" ) func BenchmarkPhp7(b *testing.B) { @@ -16,8 +18,14 @@ func BenchmarkPhp7(b *testing.B) { } for n := 0; n < b.N; n++ { - lexer := scanner.NewLexer(src, "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer(src, config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() } } diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 6a26ffc..eea6e16 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -4,15 +4,16 @@ import ( "bytes" "strings" - "github.com/z7zmey/php-parser/internal/version" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/version" ) type Lexer struct { data []byte - phpVersion string + phpVersion *version.Version errHandlerFunc func(*errors.Error) p, pe, cs int @@ -26,11 +27,11 @@ type Lexer struct { newLines NewLines } -func NewLexer(data []byte, phpVersion string, errHandlerFunc func(*errors.Error)) *Lexer { +func NewLexer(data []byte, config cfg.Config) *Lexer { lex := &Lexer{ data: data, - phpVersion: phpVersion, - errHandlerFunc: errHandlerFunc, + phpVersion: config.Version, + errHandlerFunc: config.ErrorHandlerFunc, pe: len(data), stack: make([]int, 0), @@ -101,16 +102,16 @@ func (lex *Lexer) isNotStringEnd(s byte) bool { } func (lex *Lexer) isHeredocEnd(p int) bool { - r, err := version.Compare(lex.phpVersion, "7.3") + o, err := version.New("7.3") if err != nil { + panic(err) + } + + if lex.phpVersion.GreaterOrEqual(o) { return lex.isHeredocEndSince73(p) } - if r == -1 { - return lex.isHeredocEndBefore73(p) - } - - return lex.isHeredocEndSince73(p) + return lex.isHeredocEndBefore73(p) } func (lex *Lexer) isHeredocEndBefore73(p int) bool { diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index a51e6ea..af6da1f 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -4,9 +4,11 @@ import ( "gotest.tools/assert" "testing" + "github.com/z7zmey/php-parser/pkg/cfg" "github.com/z7zmey/php-parser/pkg/errors" "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/pkg/version" ) func TestTokens(t *testing.T) { @@ -353,7 +355,13 @@ func TestTokens(t *testing.T) { token.T_UNSET_CAST.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -380,7 +388,13 @@ func TestShebang(t *testing.T) { "\n", } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} tkn := lexer.Lex() @@ -399,7 +413,13 @@ func TestShebangHtml(t *testing.T) { 0.1 ` - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() assert.Equal(t, tkn.ID, token.T_INLINE_HTML) @@ -448,7 +468,13 @@ func TestNumberTokens(t *testing.T) { token.T_DNUMBER.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -504,7 +530,13 @@ func TestConstantStrings(t *testing.T) { token.T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -550,7 +582,13 @@ func TestSingleQuoteStringTokens(t *testing.T) { token.T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -644,7 +682,13 @@ func TestTeplateStringTokens(t *testing.T) { token.ID(int('"')).String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -734,7 +778,13 @@ func TestBackquoteStringTokens(t *testing.T) { token.ID(int('`')).String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -827,7 +877,13 @@ CAT; token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -899,7 +955,13 @@ CAT token.T_END_HEREDOC.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -937,7 +999,13 @@ CAT; token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -967,7 +1035,13 @@ func TestHereDocTokens73(t *testing.T) { token.T_VARIABLE.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -996,8 +1070,13 @@ CAT;` token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", nil) - lexer.phpVersion = "7.2" + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 2, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -1028,7 +1107,13 @@ func TestInlineHtmlNopTokens(t *testing.T) { token.T_INLINE_HTML.String(), } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} for { @@ -1062,7 +1147,13 @@ func TestStringTokensAfterVariable(t *testing.T) { "\"", } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} actualTokens := []string{} @@ -1095,7 +1186,13 @@ func TestSlashAfterVariable(t *testing.T) { "3", } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) actual := []string{} actualTokens := []string{} @@ -1132,7 +1229,13 @@ func TestCommentEnd(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1163,7 +1266,13 @@ func TestCommentNewLine(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1194,7 +1303,13 @@ func TestCommentNewLine1(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1225,7 +1340,13 @@ func TestCommentNewLine2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1257,7 +1378,13 @@ func TestCommentWithPhpEndTag(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1289,7 +1416,13 @@ func TestInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1321,7 +1454,13 @@ func TestInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1357,7 +1496,13 @@ func TestEmptyInlineComment(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1389,7 +1534,13 @@ func TestEmptyInlineComment2(t *testing.T) { }, } - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) tkn := lexer.Lex() @@ -1405,7 +1556,13 @@ func TestMethodCallTokens(t *testing.T) { src := ` bar ( '' ) ;` - lexer := NewLexer([]byte(src), "7.4", nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := NewLexer([]byte(src), config) expected := []*token.Token{ { @@ -1507,7 +1664,13 @@ func TestYieldFromTokens(t *testing.T) { src := ` second.major { - return 1, nil - } - - if first.minor < second.minor { - return -1, nil - } - - if first.minor > second.minor { - return 1, nil - } - - return 0, nil -} - -func parse(v string) (version, error) { - i := strings.Index(v, ".") - if i == -1 { - return version{}, errors.New("version must contain major and minor parts") - } - - major, err := strconv.Atoi(v[:i]) - if err != nil { - return version{}, err - } - - minor, err := strconv.Atoi(v[i+1:]) - if err != nil { - return version{}, err - } - - return version{major, minor}, nil -} diff --git a/internal/version/version_test.go b/internal/version/version_test.go deleted file mode 100644 index 5f8a2f7..0000000 --- a/internal/version/version_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package version_test - -import ( - "gotest.tools/assert" - "testing" - - "github.com/z7zmey/php-parser/internal/version" -) - -func TestSmaller(t *testing.T) { - r, err := version.Compare("7.3", "5.6") - - assert.NilError(t, err) - assert.Equal(t, 1, r) -} - -func TestGreater(t *testing.T) { - r, err := version.Compare("5.6", "7.3") - - assert.NilError(t, err) - assert.Equal(t, -1, r) -} - -func TestEqual(t *testing.T) { - r, err := version.Compare("7.3", "7.3") - - assert.NilError(t, err) - assert.Equal(t, 0, r) -} diff --git a/pkg/cfg/cfg.go b/pkg/cfg/cfg.go new file mode 100644 index 0000000..1134e04 --- /dev/null +++ b/pkg/cfg/cfg.go @@ -0,0 +1,11 @@ +package cfg + +import ( + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/version" +) + +type Config struct { + Version *version.Version + ErrorHandlerFunc func(e *errors.Error) +} diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index a50d09e..343c60d 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -1,12 +1,25 @@ package parser import ( + "errors" + "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/php7" "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/internal/version" "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/version" +) + +var ( + // ErrVersionOutOfRange is returned if the version is not supported + ErrVersionOutOfRange = errors.New("the version is out of supported range") + + php5RangeStart = &version.Version{Major: 5} + php5RangeEnd = &version.Version{Major: 5, Minor: 6} + + php7RangeStart = &version.Version{Major: 7} + php7RangeEnd = &version.Version{Major: 7, Minor: 4} ) // Parser interface @@ -15,29 +28,26 @@ type Parser interface { GetRootNode() ast.Vertex } -type Config struct { - WithTokens bool - WithPositions bool - ErrorHandlerFunc func(e *errors.Error) -} - -func Parse(src []byte, ver string, cfg Config) (ast.Vertex, error) { +func Parse(src []byte, config cfg.Config) (ast.Vertex, error) { var parser Parser - r, err := version.Compare(ver, "7.0") - if err != nil { - return nil, err + if config.Version == nil { + config.Version = php7RangeEnd } - lexer := scanner.NewLexer(src, ver, cfg.ErrorHandlerFunc) - - if r == -1 { - parser = php5.NewParser(lexer, cfg.ErrorHandlerFunc) - } else { - parser = php7.NewParser(lexer, cfg.ErrorHandlerFunc) + if config.Version.InRange(php5RangeStart, php5RangeEnd) { + lexer := scanner.NewLexer(src, config) + parser = php5.NewParser(lexer, config) + parser.Parse() + return parser.GetRootNode(), nil } - parser.Parse() + if config.Version.InRange(php7RangeStart, php7RangeEnd) { + lexer := scanner.NewLexer(src, config) + parser = php7.NewParser(lexer, config) + parser.Parse() + return parser.GetRootNode(), nil + } - return parser.GetRootNode(), nil + return nil, ErrVersionOutOfRange } diff --git a/pkg/version/version.go b/pkg/version/version.go new file mode 100644 index 0000000..632baeb --- /dev/null +++ b/pkg/version/version.go @@ -0,0 +1,102 @@ +package version + +import ( + "errors" + "strconv" + "strings" +) + +type Version struct { + Major, Minor uint64 +} + +var ( + // ErrInvalidSemVer is returned if a version can not be parsed + ErrInvalidSemVer = errors.New("invalid semantic version") + + // ErrUnsupportedVer is returned if a version out of supported range + ErrUnsupportedVer = errors.New("the version is out of supported range") + + php5RangeStart = &Version{Major: 5} + php5RangeEnd = &Version{Major: 5, Minor: 6} + + php7RangeStart = &Version{Major: 7} + php7RangeEnd = &Version{Major: 7, Minor: 4} +) + +func New(v string) (*Version, error) { + // Split the parts into [0]Major, [1]Minor + parts := strings.SplitN(v, ".", 2) + if len(parts) != 2 { + return nil, ErrInvalidSemVer + } + + var ver = new(Version) + var err error + + ver.Major, err = strconv.ParseUint(parts[0], 10, 64) + if err != nil { + return nil, err + } + + ver.Minor, err = strconv.ParseUint(parts[1], 10, 64) + if err != nil { + return nil, err + } + + return ver, nil +} + +func (v *Version) Validate() error { + if !v.InRange(php5RangeStart, php5RangeEnd) && !v.InRange(php7RangeStart, php7RangeEnd) { + return ErrUnsupportedVer + } + + return nil +} + +// Less tests if one version is less than another one +func (v *Version) Less(o *Version) bool { + return v.Compare(o) < 0 +} + +// LessOrEqual tests if one version is less than another one or equal +func (v *Version) LessOrEqual(o *Version) bool { + return v.Compare(o) <= 0 +} + +// Greater tests if one version is greater than another one +func (v *Version) Greater(o *Version) bool { + return v.Compare(o) > 0 +} + +// GreaterOrEqual tests if one version is greater than another one or equal +func (v *Version) GreaterOrEqual(o *Version) bool { + return v.Compare(o) >= 0 +} + +// GreaterOrEqual tests if one version is greater than another one or equal +func (v *Version) InRange(s, e *Version) bool { + return v.Compare(s) >= 0 && v.Compare(e) <= 0 +} + +// Compare compares this version to another one. It returns -1, 0, or 1 if +// the version smaller, equal, or larger than the other version. +func (v *Version) Compare(o *Version) int { + if d := compareSegment(v.Major, o.Major); d != 0 { + return d + } + + return compareSegment(v.Minor, o.Minor) +} + +func compareSegment(v, o uint64) int { + if v < o { + return -1 + } + if v > o { + return 1 + } + + return 0 +} diff --git a/pkg/version/version_test.go b/pkg/version/version_test.go new file mode 100644 index 0000000..a2bde8b --- /dev/null +++ b/pkg/version/version_test.go @@ -0,0 +1,48 @@ +package version_test + +import ( + "gotest.tools/assert" + "testing" + + "github.com/z7zmey/php-parser/pkg/version" +) + +func Test(t *testing.T) { + ver, err := version.New("7.4") + assert.NilError(t, err) + + assert.Equal(t, *ver, version.Version{ + Major: 7, + Minor: 4, + }) +} + +func TestLeadingZero(t *testing.T) { + ver, err := version.New("07.04") + assert.NilError(t, err) + + assert.Equal(t, *ver, version.Version{ + Major: 7, + Minor: 4, + }) +} + +func TestInRange(t *testing.T) { + s, err := version.New("7.0") + assert.NilError(t, err) + + e, err := version.New("7.4") + assert.NilError(t, err) + + ver, err := version.New("7.0") + assert.NilError(t, err) + assert.Assert(t, ver.InRange(s, e)) + + ver, err = version.New("7.2") + assert.NilError(t, err) + assert.Assert(t, ver.InRange(s, e)) + + ver, err = version.New("7.4") + assert.NilError(t, err) + assert.Assert(t, ver.InRange(s, e)) +} diff --git a/pkg/visitor/printer/printer_php5_test.go b/pkg/visitor/printer/printer_php5_test.go index 69a8460..f73a055 100644 --- a/pkg/visitor/printer/printer_php5_test.go +++ b/pkg/visitor/printer/printer_php5_test.go @@ -2,18 +2,25 @@ package printer_test import ( "bytes" - printer2 "github.com/z7zmey/php-parser/pkg/visitor/printer" "testing" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/scanner" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/version" + "github.com/z7zmey/php-parser/pkg/visitor/printer" ) func parsePhp5(src string) ast.Vertex { - lexer := scanner.NewLexer([]byte(src), "5.6", nil) - php5parser := php5.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 5, + Minor: 6, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php5parser := php5.NewParser(lexer, config) php5parser.Parse() return php5parser.GetRootNode() @@ -22,8 +29,8 @@ func parsePhp5(src string) ast.Vertex { func printPhp5(n ast.Vertex) string { o := bytes.NewBufferString("") - printer := printer2.NewPrinter(o) - n.Accept(printer) + p := printer.NewPrinter(o) + n.Accept(p) return o.String() } diff --git a/pkg/visitor/printer/printer_php7_test.go b/pkg/visitor/printer/printer_php7_test.go index 1039390..3aceb4d 100644 --- a/pkg/visitor/printer/printer_php7_test.go +++ b/pkg/visitor/printer/printer_php7_test.go @@ -2,13 +2,15 @@ package printer_test import ( "bytes" - printer2 "github.com/z7zmey/php-parser/pkg/visitor/printer" "os" "testing" "github.com/z7zmey/php-parser/internal/php7" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/cfg" + "github.com/z7zmey/php-parser/pkg/version" + "github.com/z7zmey/php-parser/pkg/visitor/printer" ) func ExamplePrinter() { @@ -28,8 +30,14 @@ abstract class Bar extends Baz // parse - lexer := scanner.NewLexer([]byte(src), "7.4", nil) - php7parser := php7.NewParser(lexer, nil) + config := cfg.Config{ + Version: &version.Version{ + Major: 7, + Minor: 4, + }, + } + lexer := scanner.NewLexer([]byte(src), config) + php7parser := php7.NewParser(lexer, config) php7parser.Parse() rootNode := php7parser.GetRootNode() @@ -41,8 +49,8 @@ abstract class Bar extends Baz // print - printer := printer2.NewPrinter(os.Stdout) - r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fum!DBd=BS~*ZrSu%`sZi<%t<#ilUJ70UJ?+tv{7ZUIHeK$-KByrat)J*lD_Vy1rn#x-$OZ_jp zm!IHLR3g1(k_kQ>;WCoUH#adA7vMJ7xs_9PxhuL0)ii{gT5cpG zOF_Y_lT#Sphd(#35{3$UmBw}$#$c7`bmj^kXyApa+6N1DJ;S(%3fJ!Zj=#~7dtSti zFziSCaP`RFX%_eQGfu)TN($?luKUnzVkVob5w*TNsIl=co)(C`liBkT3btmPY-kKH z)1Ozn`+|%t32Wocy|$5_46)AtV67T14MB2Ic#_9Lj6A!ztKB4o_a<(#ox*h$u{8LV zw>HHh)p1MoDqM0+Gb6)Ju7TmuB2{6tmXn&pAb>{rJu4V1 zZt}GVh}K}!&Ms+zg^BX*7RD&METYSdH3B&~%E(s+Q<&WyrKjO_a3JxJXzh;`D*=Ja zU4Xm0V3@Uc!)^4a2~ma*A9WeY=C#QkV+`XyODL49h8TWa9*YkGLY+S)*V!x5ZvL!8mvB$dit^~Fo}XlvYW^|P@?PZJSX z6fApnF!17|-#@GekGe~?KbLjFF|6khKY6N?fnO-vG&Pg(2xV)S3q1iWJ(NuY;yWutvHR|H2#QwsL zOk=pZaz#nxcRxgwT+-WEigzgK=x3buUOjN4=hdgRgN%>W6O|6S#Y2t9>eX) Date: Fri, 4 Dec 2020 11:36:12 +0200 Subject: [PATCH 095/140] [refactoring] update ast structure of "Parameter", "Class", "FunctionCall", "MethodCall", "New" and "StaticCall" nodes --- internal/php5/php5.go | Bin 264971 -> 263926 bytes internal/php5/php5.y | 113 +++++++++++++--------------------- internal/php7/php7.go | Bin 219158 -> 217768 bytes internal/php7/php7.y | 107 +++++++++++--------------------- pkg/ast/ast.go | 2 - pkg/ast/node.go | 29 +++------ pkg/ast/traverser/dfs.go | 24 -------- pkg/ast/visitor/dump.go | 12 ---- pkg/ast/visitor/null.go | 8 --- pkg/printer/pretty_printer.go | 18 ------ pkg/printer/printer.go | 24 -------- 11 files changed, 85 insertions(+), 252 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 77d735f17fe72f66daf0d99cb947605c2f560427..384171331321d906823c36b5920101b8e76080e1 100644 GIT binary patch delta 11013 zcmb7KcYM}G(*NvkLQO(K2_PZQlh766DS4he4=tex(lmHT6Da~BMGWOcg+OBC4o@$L zWI#m1NfTRu3#%d!iie;GoHXT--~obk6;VofzgvD!!kxZ%mp}5^=ex7Bv$M0aGqb-J z3gUlyF}`R*eI7`ECcD1OuFswm#1eS2tkaNHVy4+PnLTNmw9m!vr3Ep#%!h?o!6ADVzhTHc=l?}7&iou z-p(d7T78ZuuWQNL>y}Fnxsye44a%omvuN8~;bqB;j-?0}o%FE-x}W~xXAjfFbm5XC z(%1mQNgfWc;hc_57RhpOh|R~K$snlHhUFQQ*0o~?bw9n+9^*BozXKbnDU;>f8IkdK zc2eW}Tmh>So!Qe|H)&Q^j0fnVncdhZ(;aoU8m}pHx~uWJS=LjHUoxIGl*PT-Gu$-$ zXR$(Inu&ec!?wAwKbvM~DKHQkRHNvvfoysYB>M8W&4w_=qn z#Rn|Wg5eL@U=337hfa6udiH_szV?v=KC*$mZ^6t>Y_4JS!zMP#g3oQXl=S^(_6{xC z!k$q7+_LRfRu@*Y1;S3=#@>g8p-H{Avt0&k^9efv@3E6zRR7%4|0(;9QNrgS>adIL zm1tGt`nPPihaI!c4qvchVbIzKS(X_fpF6~Ij65>+EB3f;zJHjlwNk!t#97bJN7xIt z|Ba*UVcXy0n4^wmkygq#Y>!!P!avz5MsvDN71Md3P0o$Bnr!?rM zE@xOz3CiYn{>J2m#sC03oPHshkfbHJvhZL=3gL!kTIB!V~lnYs`Z*Y$~rsGv~4xnR$(U#{NgXIaGTJuS*#>*htNn zdp*=~CrhN=16drMzG0_Ra7qGiK*M_QkE!NO3o|d}J;9PRI zA7v*QqUkiG8lR?7?(@>bBMdo`MaoaEe=1rS8BE{9uCm(L!t*Q zbD7-+5~fS7cq&cEht)Q81MZW=GbkntN_x@FU&O@><#4avMWsPGER{z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ZvK!YE>OS*qWP z4}5C0uIPc%Zj!hFeDmDV9fUgTKQ4* zBW>9_tdZDEvrhXCCmPF=ADtGtem45kE!AsvzBzj8oF%|2>fuNJbWZGbMN-`!d>t_==^y#UFk7|gIxPY1_`Y)kd?*`)(u)ydqoDI;V zy>h`Xz7=>(7j)=M|0aHNZI(7(77b*--<`Z%OR_eO-mQC$wRh<0PUo>4S=o&DWHj-z zZ>w=Ch$1)p-Um~?pZ@CQqVS5Hs9v@zQTVAke*;@MJwZ3|)S@Ep^v&fZ-2y1%7N@!( b&SPD&qCD)WQ@2}Gw_Q=a!DvTPLgaq|zs2NY diff --git a/internal/php5/php5.y b/internal/php5/php5.y index d3072b8..5349205 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -2028,40 +2028,6 @@ non_empty_parameter_list: parameter: optional_class_type is_reference is_variadic T_VARIABLE { - var variable ast.Vertex - variable = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - }, - } - - if $3 != nil { - variable = &ast.Variadic{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $4), - }, - VariadicTkn: $3, - Var: variable, - } - } - - if $2 != nil { - variable = &ast.Reference{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - AmpersandTkn: $2, - Var: variable, - } - } - pos := position.NewTokenPosition($4) if $1 != nil { pos = position.NewNodeTokenPosition($1, $4) @@ -2075,46 +2041,25 @@ parameter: Node: ast.Node{ Position: pos, }, - Type: $1, - Var: variable, + Type: $1, + AmpersandTkn: $2, + VariadicTkn: $3, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, } } | optional_class_type is_reference is_variadic T_VARIABLE '=' expr { - var variable ast.Vertex - variable = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - }, - } - - if $3 != nil { - variable = &ast.Variadic{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $4), - }, - VariadicTkn: $3, - Var: variable, - } - } - - if $2 != nil { - variable = &ast.Reference{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - AmpersandTkn: $2, - Var: variable, - } - } - pos := position.NewTokenNodePosition($4, $6) if $1 != nil { pos = position.NewNodesPosition($1, $6) @@ -2129,7 +2074,20 @@ parameter: Position: pos, }, Type: $1, - Var: variable, + AmpersandTkn: $2, + VariadicTkn: $3, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, EqualTkn: $5, DefaultValue: $6, } @@ -3116,6 +3074,7 @@ new_expr: Class: $2, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, + SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, } } else { @@ -3185,6 +3144,7 @@ expr_without_variable: Class: $5, OpenParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $6.(*ast.ArgumentList).Arguments, + SeparatorTkns: $6.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $6.(*ast.ArgumentList).OpenParenthesisTkn, } } else { @@ -4228,6 +4188,7 @@ function_call: }, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4247,6 +4208,7 @@ function_call: }, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4265,6 +4227,7 @@ function_call: }, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, + SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4279,6 +4242,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4293,6 +4257,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4307,6 +4272,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4321,6 +4287,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4333,6 +4300,7 @@ function_call: Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -5462,6 +5430,7 @@ variable: }, OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, + SeparatorTkns: mc.SeparatorTkns, CloseParenthesisTkn: mc.OpenParenthesisTkn, }, ) @@ -5555,6 +5524,7 @@ variable_property: }, OpenParenthesisTkn: mc.OpenParenthesisTkn, Arguments: mc.Arguments, + SeparatorTkns: mc.SeparatorTkns, CloseParenthesisTkn: mc.OpenParenthesisTkn, }, ) @@ -5610,6 +5580,7 @@ method: }, OpenParenthesisTkn: $1.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $1.(*ast.ArgumentList).Arguments, + SeparatorTkns: $1.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $1.(*ast.ArgumentList).CloseParenthesisTkn, } } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index b85c2a17f378eeab6b22649cbe35b73398ebced7..ee03b47f693dffc962ba58b832347e3481c01121 100644 GIT binary patch delta 9194 zcmb_hd32RUvOiTHSy_^>B!(pSUI+mMguCZn5G06ff+Xz75(0>zBgi&@ii81CR4|N? zV%}qsr#wUjf+(#BN*n~0Ehyu01A+^?giTardDY8zlk0nDX8w48B&Yh<)m7Ei)m8QN zEiJ42>e{+x#p$*D;ZShP{PazyC@&KoqCY|`kS7-U(FO~0G}XM8O|6blx5e1lk_eR; ztFak++4WdxE-5ED6Twe2;`FQ;UW^_-93M6NWAv~vA!_!kn!}+rbnH)z;_F_!#?VJQ zYu7NyNA2rG4d03ktLn13?dsZV)o^{yp;4(OR@RH+OG}CxE{Pu2POdTQqxs3U1uV)( zH=~C$Q|#FfQoyKW%1@8fx234z$>?EGgQ(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ad?!}2NdZs z>||kfar1*$Zy62C=La8l%@}3=NR%J`8BeE3r!qh0KsvgT?qd z^Ze=zdPHWof@PUG{LLCP<>s%n$lh`{dPGDCueyWvB1<hhL{?9hi2T+is?GU{!Sp>?;;&6@@iMnLf zjt|=hp<*I!0Gk`Lb+#o|i71PvE-;ak7H}<>$?v7|z=Txjs2d5_5fW{OmaynOC1(Kd zo6pp@a=AU1U&pKPmW8*M;mEVytghoC7D87R{Dgf{l&B`aDG!rPdb$5$(Qdb{L8-Kg zVy{~EN@ql{SBfhb0H`^MPi?|J)^fwxJQ8v_GWC|1fDp&R!IL9ysWl|VIK|9nP}-c5MO$9#??oQY59Jir{g2sS0MBsjDZ%ex63 zSOQc>kbLJR=>XDKxRZ6E*8oHph*nf}fX%YEoJGP>ULIuXhYNC-BPw|d!DBgkI79aS z+zD#x?k diff --git a/internal/php7/php7.y b/internal/php7/php7.y index e40fa5f..35d271e 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -1849,40 +1849,6 @@ non_empty_parameter_list: parameter: optional_type is_reference is_variadic T_VARIABLE { - var variable ast.Vertex - variable = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - }, - } - - if $3 != nil { - variable = &ast.Variadic{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $4), - }, - VariadicTkn: $3, - Var: variable, - } - } - - if $2 != nil { - variable = &ast.Reference{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - AmpersandTkn: $2, - Var: variable, - } - } - pos := position.NewTokenPosition($4) if $1 != nil { pos = position.NewNodeTokenPosition($1, $4) @@ -1896,46 +1862,25 @@ parameter: Node: ast.Node{ Position: pos, }, - Type: $1, - Var: variable, + Type: $1, + AmpersandTkn: $2, + VariadicTkn: $3, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, } } | optional_type is_reference is_variadic T_VARIABLE '=' expr { - var variable ast.Vertex - variable = &ast.ExprVariable{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - VarName: &ast.Identifier{ - Node: ast.Node{ - Position: position.NewTokenPosition($4), - }, - IdentifierTkn: $4, - Value: $4.Value, - }, - } - - if $3 != nil { - variable = &ast.Variadic{ - Node: ast.Node{ - Position: position.NewTokensPosition($3, $4), - }, - VariadicTkn: $3, - Var: variable, - } - } - - if $2 != nil { - variable = &ast.Reference{ - Node: ast.Node{ - Position: position.NewTokensPosition($2, $4), - }, - AmpersandTkn: $2, - Var: variable, - } - } - pos := position.NewTokenNodePosition($4, $6) if $1 != nil { pos = position.NewNodesPosition($1, $6) @@ -1950,7 +1895,20 @@ parameter: Position: pos, }, Type: $1, - Var: variable, + AmpersandTkn: $2, + VariadicTkn: $3, + Var: &ast.ExprVariable{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + VarName: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($4), + }, + IdentifierTkn: $4, + Value: $4.Value, + }, + }, EqualTkn: $5, DefaultValue: $6, } @@ -2758,6 +2716,7 @@ anonymous_class: ClassTkn: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Extends: $3, Implements: $4, @@ -2780,6 +2739,7 @@ new_expr: Class: $2, OpenParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $3.(*ast.ArgumentList).Arguments, + SeparatorTkns: $3.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $3.(*ast.ArgumentList).OpenParenthesisTkn, } } else { @@ -3777,6 +3737,7 @@ function_call: Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -3791,6 +3752,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -3805,6 +3767,7 @@ function_call: Call: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -3817,6 +3780,7 @@ function_call: Function: $1, OpenParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $2.(*ast.ArgumentList).Arguments, + SeparatorTkns: $2.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $2.(*ast.ArgumentList).OpenParenthesisTkn, } } @@ -4285,6 +4249,7 @@ callable_variable: Method: $3, OpenParenthesisTkn: $4.(*ast.ArgumentList).OpenParenthesisTkn, Arguments: $4.(*ast.ArgumentList).Arguments, + SeparatorTkns: $4.(*ast.ArgumentList).SeparatorTkns, CloseParenthesisTkn: $4.(*ast.ArgumentList).CloseParenthesisTkn, } } diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 526c4e8..b711aaa 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -20,8 +20,6 @@ type Visitor interface { type NodeVisitor interface { Root(n *Root) Nullable(n *Nullable) - Reference(n *Reference) - Variadic(n *Variadic) Parameter(n *Parameter) Identifier(n *Identifier) Argument(n *Argument) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index e3298cb..6283064 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -42,32 +42,12 @@ func (n *Nullable) Accept(v NodeVisitor) { v.Nullable(n) } -// Reference node -type Reference struct { - Node - AmpersandTkn *token.Token - Var Vertex -} - -func (n *Reference) Accept(v NodeVisitor) { - v.Reference(n) -} - -// Variadic node -type Variadic struct { - Node - VariadicTkn *token.Token - Var Vertex -} - -func (n *Variadic) Accept(v NodeVisitor) { - v.Variadic(n) -} - // Parameter node type Parameter struct { Node Type Vertex + AmpersandTkn *token.Token + VariadicTkn *token.Token Var Vertex EqualTkn *token.Token DefaultValue Vertex @@ -231,6 +211,7 @@ type StmtClass struct { ClassName Vertex OpenParenthesisTkn *token.Token Arguments []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token Extends Vertex Implements Vertex @@ -1131,6 +1112,7 @@ type ExprFunctionCall struct { Function Vertex OpenParenthesisTkn *token.Token Arguments []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1208,6 +1190,7 @@ type ExprMethodCall struct { Method Vertex OpenParenthesisTkn *token.Token Arguments []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1222,6 +1205,7 @@ type ExprNew struct { Class Vertex OpenParenthesisTkn *token.Token Arguments []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } @@ -1349,6 +1333,7 @@ type ExprStaticCall struct { Call Vertex OpenParenthesisTkn *token.Token Arguments []Vertex + SeparatorTkns []*token.Token CloseParenthesisTkn *token.Token } diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 6e3fe74..d9e198e 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -40,30 +40,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Expr) t.visitor.Leave("Expr", true) } - case *ast.Reference: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } - case *ast.Variadic: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Var != nil { - t.visitor.Enter("Var", true) - t.Traverse(nn.Var) - t.visitor.Leave("Var", true) - } case *ast.Parameter: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index ea0ae75..d6546f3 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -203,18 +203,6 @@ func (v *Dump) Nullable(n *ast.Nullable) { v.printNode(n.GetNode()) } -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()) -} - func (v *Dump) Parameter(n *ast.Parameter) { v.printIndent(v.indent - 1) v.print("&ast.Parameter{\n") diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index ce4f433..92b9b55 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -30,14 +30,6 @@ func (v *Null) Nullable(_ *ast.Nullable) { // do nothing } -func (v *Null) Reference(_ *ast.Reference) { - // do nothing -} - -func (v *Null) Variadic(_ *ast.Variadic) { - // do nothing -} - func (v *Null) Parameter(_ *ast.Parameter) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index eae729a..c263d3f 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -64,10 +64,6 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printNodeRoot(n) case *ast.Identifier: p.printNodeIdentifier(n) - case *ast.Reference: - p.printNodeReference(n) - case *ast.Variadic: - p.printNodeVariadic(n) case *ast.Parameter: p.printNodeParameter(n) case *ast.Nullable: @@ -421,20 +417,6 @@ func (p *PrettyPrinter) printNodeIdentifier(n ast.Vertex) { io.WriteString(p.w, v) } -func (p *PrettyPrinter) printNodeReference(n ast.Vertex) { - nn := n.(*ast.Reference) - - io.WriteString(p.w, "&") - p.Print(nn.Var) -} - -func (p *PrettyPrinter) printNodeVariadic(n ast.Vertex) { - nn := n.(*ast.Variadic) - - io.WriteString(p.w, "...") - p.Print(nn.Var) -} - func (p *PrettyPrinter) printNodeParameter(n ast.Vertex) { nn := n.(*ast.Parameter) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 328e0f9..0109652 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -149,10 +149,6 @@ func (p *Printer) printNode(n ast.Vertex) { p.printNodeRoot(n) case *ast.Identifier: p.printNodeIdentifier(n) - case *ast.Reference: - p.printNodeReference(n) - case *ast.Variadic: - p.printNodeVariadic(n) case *ast.Parameter: p.printNodeParameter(n) case *ast.Nullable: @@ -505,26 +501,6 @@ func (p *Printer) printNodeIdentifier(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printNodeReference(n ast.Vertex) { - nn := n.(*ast.Reference) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("&")) - p.Print(nn.Var) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printNodeVariadic(n ast.Vertex) { - nn := n.(*ast.Variadic) - p.printFreeFloating(nn, token.Start) - - p.write([]byte("...")) - p.Print(nn.Var) - - p.printFreeFloating(nn, token.End) -} - func (p *Printer) printNodeParameter(n ast.Vertex) { nn := n.(*ast.Parameter) p.printFreeFloating(nn, token.Start) From 132db0e06bdc444fece1750c27ca0576cc8f2ade Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Fri, 4 Dec 2020 12:22:06 +0200 Subject: [PATCH 096/140] [refactoring] update ast structure of "ClassMethod", "Function", "ArrowFunction" and "Closure" nodes --- internal/php5/php5.go | Bin 263926 -> 264589 bytes internal/php5/php5.y | 30 ++++++++++++++++++------------ internal/php7/php7.go | Bin 217768 -> 219415 bytes internal/php7/php7.y | 28 +++++++++++++++++----------- pkg/ast/node.go | 4 ++++ 5 files changed, 39 insertions(+), 23 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 384171331321d906823c36b5920101b8e76080e1..664719238ff45eadb75c96c1a8e75f16e221581f 100644 GIT binary patch delta 11519 zcmb7J37n4Q+W+16Ju?`~3^8KxzLv3MUfz9?ZLF1p(We#12-PRm(57-4qE3>+%Uq`r zm6MKRi*gI+&_+lZLRm6|Y%!`YmGJ$q>v`Xq>D2j_-*290o_oFa>-yjK`@^)%Y4OYz z_chSrz^cLqgBnMDUT-+pjdv*59f;++LlHkWeRzigzFc?2&jUexp)-)1UM(Dp@=)AF zTIqlTGeMHb$n92D4m=gjHZSjpUf#$X<&C^iUdPnDL8r}n z@;Zu)L|7}{2vhUIK>TI`Ldvmw1mChV>&54VPWUbBB1Q7e%VcNKt~V^SLzu_H$xf^u zcny;Z$u2?JMaW=pwvu!QWE(aG1VLvY=EI^ef1<!Cs7wP#($!Id0~C>4@^3?iN?ooyE=_Y`(p8zw#{nKEBw3? zG{v%h(E{G+X9e?%rDso!dE-MqZczk2*m>pQ(Taza!HdNE@LyEuyjW02S`l1c2}AJ$ z=A+U})GaU31zxOsJP45@Yy}-6mVW*CIEE`;LCj^1dCOm7H|NE>`gvE-m4{j37((Pa z4+wBLad^nXI&z*OC>&qxq{)ZFm>>48N>6$<_FsNDtdkG>aplK{0Vs}#*%2#0?57Bl z#EYXJPh5XepDn^p9l_o)bn_#AkC&T0pZ#7Qn1jQDb4V;2@Bc}&c(anM5I93e<%c7I zpC~rq$LD9g;l-@6CH#R^>pz*H>hm|pH1Z0Jftk(|AF*S6Du_ly@nbvM7jb|l9?+_2 zBs(kqLuDM(crdY|k?j1v|Nr~M_W#c<Gjrb>n47xxcs#WRB#bdn+_Nwy8Z97sIr)jZ$~U7`5I1C3NH{_=r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9KY{!o%n5l?h$lg zi|V0*xWajCmm18!P?#`%%gH+&pD~<1I9vZVG6QsOJ3Q7OxngHR=+~h$KZ@FV!w&U< z6xK43R!*A6HcO~@0?fDTb{u_+C#ykv#a?xt`x8=iuS^w>D(LI)vJ>I|Y1X6H_Nsen zT8eBzgTGK8)=+o+mNkR!-Dk2iem%+7+xKBh$ef6`8^6LVY8`B>VdGn_$gFUd)+Vm4HxBaB* zxE9A4?VXvjK9b4$+W(*=JHN1)dRTQ4(r)>g@wu{TjL}n=)B@AGF8# variable_name variable_without_objects dynamic_class_name_reference new_expr class_name_reference static_member %type function_call fully_qualified_class_name combined_scalar combined_scalar_offset general_constant parenthesis_expr %type exit_expr yield_expr function_declaration_statement class_declaration_statement constant_declaration -%type else_single new_else_single unset_variable declare_statement +%type else_single new_else_single unset_variable declare_statement parameter_list non_empty_parameter_list %type finally_statement additional_catch unticked_function_declaration_statement unticked_class_declaration_statement %type optional_class_type parameter class_entry_type class_statement class_constant_declaration %type trait_use_statement function_call_parameter trait_adaptation_statement trait_precedence trait_alias @@ -250,7 +250,7 @@ import ( %type inner_statement_list encaps_list %type elseif_list new_elseif_list non_empty_for_expr %type for_expr case_list catch_statement additional_catches -%type non_empty_additional_catches parameter_list non_empty_parameter_list class_statement_list +%type non_empty_additional_catches class_statement_list %type class_statement_list variable_modifiers method_modifiers %type trait_adaptation_list non_empty_trait_adaptation_list %type non_empty_member_modifiers backticks_expr @@ -1383,7 +1383,8 @@ unticked_function_declaration_statement: Value: $3.Value, }, OpenParenthesisTkn: $4, - Params: $5, + Params: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $6, OpenCurlyBracketTkn: $7, Stmts: $8, @@ -2003,25 +2004,27 @@ new_else_single: parameter_list: non_empty_parameter_list { - $$ = $1; + $$ = $1 } | /* empty */ { - $$ = nil + $$ = &ast.ParserSeparatedList{} } ; non_empty_parameter_list: parameter { - $$ = []ast.Vertex{$1} + $$ = &ast.ParserSeparatedList{ + Items: []ast.Vertex{$1}, + } } | non_empty_parameter_list ',' parameter { - $$ = append($1, $3) + $1.(*ast.ParserSeparatedList).SeparatorTkns = append($1.(*ast.ParserSeparatedList).SeparatorTkns, $2) + $1.(*ast.ParserSeparatedList).Items = append($1.(*ast.ParserSeparatedList).Items, $3) - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = $1 } ; @@ -2447,7 +2450,8 @@ class_statement: Value: $4.Value, }, OpenParenthesisTkn: $5, - Params: $6, + Params: $6.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $6.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $7, Stmt: $8, } @@ -3893,7 +3897,8 @@ expr_without_variable: FunctionTkn: $1, AmpersandTkn: $2, OpenParenthesisTkn: $3, - Params: $4, + Params: $4.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $4.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $5, ClosureUse: $6, OpenCurlyBracketTkn: $7, @@ -3911,7 +3916,8 @@ expr_without_variable: FunctionTkn: $2, AmpersandTkn: $3, OpenParenthesisTkn: $4, - Params: $5, + Params: $5.(*ast.ParserSeparatedList).Items, + SeparatorTkns: $5.(*ast.ParserSeparatedList).SeparatorTkns, CloseParenthesisTkn: $6, ClosureUse: $7, OpenCurlyBracketTkn: $8, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index ee03b47f693dffc962ba58b832347e3481c01121..4eb37848a20a7b3a6b5af32abbbeab70a995845e 100644 GIT binary patch delta 15938 zcmcIrXPi~lwg2sXXfp!?LmOd+xfki>;yt%tK#Cnvnms5C7#k{rMvX=tG}agcawE$E z5n`|efdPbLL=zAd5LB?l76oF|rx=RuS@HeX+NW&hz4-DaAI_P(_u6ai)z{klz{88% z(8@NAH+0d()T$f1?5*xr$QK93)2YJ1cp)P%cVIl1&kZauOJ%dAId12Md@+X=g)Clq z24*oV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ZgcTN4y* zMvdyPV{1(&+OQq2u!+H=5fzB!4|YHeNb1okwJHW(Cu+1Ftr7D`?lzhZzX@s|zon+h zgKyz$=}zPUd(Fz&X@#-)t=egFcUGv^5d$_2u+1kK_YREbJl44#{MC~yQWn+m9TJ;I zAL)kOCIq3@p{{j)SfEev$1TUxbYyQmsj_xt${dp>#BpQAIaN)S6ij^2SJ4o z@3&ZKUW-gw`H{*u$|Kv}{0RccsR|nMK1-5;(<L@Z$GZ~pzrbNW_4<;;R)TYmzsKA171$aZeFV!`KOW^;3mmy5^jjV!TV&6Mwt zQ=}Y-;YgW{Ykeq*T*dLq56YwPWTLUZ8*X=vS5te1T8CHwHj5;s3x%7DRf2y0e@r>C zoolHq`WK9uX}07AFEf#5Z=CM>iz-3xYiy)Lp|snazPf227!)i)ULJvWlWi~X6~Uwa z4d%auUUFyz^8M_O)h>DOS7eJc{~r!_*Xw>$9r04?({Gc@W3H@!d_0qaV%13+cA+sE z<#Hvnd42`=jRK>!whZxh<7(gdjA9=Me6pKeM`UGFSAO7C;7{q*e~k-uP%pm5wFHfW zZfNFuSDEHMq}ZRzRKGZvEmId;x?-LG8f4jg$dsJm>dul=qC9$Wq6_$O-m`2$63m3_ zu1PL*mS== Position(len(_Position_index)-1) { From fd5d891037f05f0238e3a5d0ae366e883f2e9eb5 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 9 Aug 2020 00:56:21 +0200 Subject: [PATCH 041/140] [refactoring] add Parser nodes for `use` --- internal/php5/parser_test.go | 276 ++++++++++++++++++++++- internal/php5/php5.go | Bin 330857 -> 332754 bytes internal/php5/php5.y | 78 ++++--- internal/php5/php5_test.go | 21 +- internal/php7/parser_test.go | 300 ++++++++++++++++++++++++- internal/php7/php7.go | Bin 272180 -> 274511 bytes internal/php7/php7.y | 78 ++++--- internal/php7/php7_test.go | 21 +- pkg/ast/ast.go | 4 + pkg/ast/node.go | 27 +++ pkg/ast/traverser/dfs.go | 36 +++ pkg/ast/visitor/dump.go | 18 ++ pkg/ast/visitor/filter_parser_nodes.go | 42 ++++ pkg/ast/visitor/null.go | 12 + pkg/printer/printer.go | 78 ++++--- 15 files changed, 880 insertions(+), 111 deletions(-) create mode 100644 pkg/ast/visitor/filter_parser_nodes.go diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index b210323..6d72de0 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -8,6 +8,8 @@ import ( "github.com/z7zmey/php-parser/internal/php5" "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/ast/traverser" + "github.com/z7zmey/php-parser/pkg/ast/visitor" "github.com/z7zmey/php-parser/pkg/position" ) @@ -62,6 +64,7 @@ func TestIdentifier(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -845,6 +848,7 @@ func TestPhp5ArgumentNode(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1658,6 +1662,7 @@ func TestPhp5ParameterNode(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1680,6 +1685,7 @@ func TestCommentEndFile(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1758,6 +1764,7 @@ func TestName(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1834,6 +1841,7 @@ func TestFullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1910,6 +1918,7 @@ func TestRelative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1989,6 +1998,7 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2066,6 +2076,7 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2154,6 +2165,7 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2252,6 +2264,7 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2361,6 +2374,7 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2438,6 +2452,7 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2536,6 +2551,7 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2644,6 +2660,7 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2736,6 +2753,7 @@ LBL; php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2828,6 +2846,7 @@ LBL; php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2888,6 +2907,7 @@ LBL; php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2934,6 +2954,7 @@ CAD; php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2994,6 +3015,7 @@ CAD; php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3039,6 +3061,7 @@ func TestScalarMagicConstant(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3083,6 +3106,7 @@ func TestScalarNumber_LNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3127,6 +3151,7 @@ func TestScalarNumber_DNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3171,6 +3196,7 @@ func TestScalarNumber_Float(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3215,6 +3241,7 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3259,6 +3286,7 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3303,6 +3331,7 @@ func TestScalarNumber_HLNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3347,6 +3376,7 @@ func TestScalarNumber_HDNumber(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3391,6 +3421,7 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3435,6 +3466,7 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3481,6 +3513,7 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3525,6 +3558,7 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3571,6 +3605,7 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3641,6 +3676,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3754,6 +3790,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3844,6 +3881,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4022,6 +4060,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4144,6 +4183,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4223,6 +4263,7 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4372,6 +4413,7 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4475,6 +4517,7 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4590,6 +4633,7 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4635,6 +4679,7 @@ func TestStmtClass_SimpleClass(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4693,6 +4738,7 @@ func TestStmtClass_AbstractClass(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4784,6 +4830,7 @@ func TestStmtClass_ClassExtends(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4877,6 +4924,7 @@ func TestStmtClass_ClassImplement(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4993,6 +5041,7 @@ func TestStmtClass_ClassImplements(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5092,6 +5141,7 @@ func TestStmtConstList(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5158,6 +5208,7 @@ func TestStmtContinue_Empty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5235,6 +5286,7 @@ func TestStmtContinue_Light(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5312,6 +5364,7 @@ func TestStmtContinue(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5389,6 +5442,7 @@ func TestStmtDeclare(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5499,6 +5553,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5578,6 +5633,7 @@ func TestStmtDeclare_Alt(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5633,6 +5689,7 @@ func TestStmtDo(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5700,6 +5757,7 @@ func TestStmtEcho(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5756,6 +5814,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5800,6 +5859,7 @@ func TestStmtExpression(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5996,6 +6056,7 @@ func TestStmtFor(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6117,6 +6178,7 @@ func TestStmtFor_Alt(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6203,6 +6265,7 @@ func TestStmtForeach(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6279,6 +6342,7 @@ func TestStmtForeach_Expr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6365,6 +6429,7 @@ func TestStmtForeach_Alt(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6472,6 +6537,7 @@ func TestStmtForeach_WithKey(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6569,6 +6635,7 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6686,6 +6753,7 @@ func TestStmtForeach_WithRef(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6815,6 +6883,7 @@ func TestStmtForeach_WithList(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6861,6 +6930,7 @@ func TestStmtFunction(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6918,6 +6988,7 @@ func TestStmtFunction_Return(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7082,6 +7153,7 @@ func TestStmtFunction_ReturnVar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7150,6 +7222,7 @@ func TestStmtFunction_Ref(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7206,6 +7279,7 @@ func TestStmtGlobal(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7367,6 +7441,7 @@ func TestStmtGlobal_Vars(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7432,6 +7507,7 @@ func TestStmtGotoLabel(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7465,6 +7541,7 @@ func TestStmtHaltCompiler(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7530,6 +7607,7 @@ func TestStmtIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7639,6 +7717,7 @@ func TestStmtIf_ElseIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7725,6 +7804,7 @@ func TestStmtIf_Else(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7897,6 +7977,7 @@ func TestStmtIf_ElseElseIf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8079,6 +8160,7 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8123,6 +8205,7 @@ func TestStmtInlineHtml(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8168,6 +8251,7 @@ func TestStmtInterface(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8248,6 +8332,7 @@ func TestStmtInterface_Extend(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8351,6 +8436,7 @@ func TestStmtInterface_Extends(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8407,6 +8493,7 @@ func TestStmtNamespace(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8464,6 +8551,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8498,6 +8586,7 @@ func TestStmtNamespace_Anonymous(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8600,6 +8689,7 @@ func TestStmtProperty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8755,6 +8845,7 @@ func TestStmtProperty_Properties(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8910,6 +9001,7 @@ func TestStmtProperty_Properties2(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8976,6 +9068,7 @@ func TestStmtStaticVar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9084,6 +9177,7 @@ func TestStmtStaticVar_Vars(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9192,6 +9286,7 @@ func TestStmtStaticVar_Vars2(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9319,6 +9414,7 @@ func TestStmtSwitch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9446,6 +9542,7 @@ func TestStmtSwitch_Semicolon(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9563,6 +9660,7 @@ func TestStmtSwitch_Alt(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9668,6 +9766,7 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9722,6 +9821,7 @@ func TestStmtThrow(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9767,6 +9867,7 @@ func TestStmtTrait(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9858,6 +9959,7 @@ func TestStmtTraitUse(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9972,6 +10074,7 @@ func TestStmtTraitUse_Uses(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10086,6 +10189,7 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10244,6 +10348,7 @@ func TestStmtTraitUse_Modifier(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10413,6 +10518,7 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10696,6 +10802,7 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10733,6 +10840,7 @@ func TestStmtTry_Try(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10828,6 +10936,7 @@ func TestStmtTry_TryCatch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10980,6 +11089,7 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11086,6 +11196,7 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11293,6 +11404,7 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11349,6 +11461,7 @@ func TestStmtUnset(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11426,6 +11539,7 @@ func TestStmtUnset_Vars(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11504,6 +11618,7 @@ func TestStmtUse(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11534,7 +11649,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 8, + StartPos: 7, EndPos: 11, }, }, @@ -11544,7 +11659,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 8, + StartPos: 7, EndPos: 11, }, }, @@ -11582,6 +11697,7 @@ func TestStmtUse_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11612,7 +11728,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 8, + StartPos: 7, EndPos: 18, }, }, @@ -11622,7 +11738,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 8, + StartPos: 7, EndPos: 18, }, }, @@ -11671,6 +11787,7 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11782,6 +11899,7 @@ func TestStmtUse_List(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11904,6 +12022,7 @@ func TestStmtUse_ListAlias(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11997,7 +12116,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 22, + StartPos: 21, EndPos: 25, }, }, @@ -12036,6 +12155,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12140,7 +12260,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 29, + StartPos: 28, EndPos: 39, }, }, @@ -12190,6 +12310,7 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12284,7 +12405,7 @@ func TestStmtUse_ListConstType(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 19, + StartPos: 18, EndPos: 22, }, }, @@ -12323,6 +12444,7 @@ func TestStmtUse_ListConstType(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12427,7 +12549,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 26, + StartPos: 25, EndPos: 36, }, }, @@ -12477,6 +12599,7 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12543,6 +12666,7 @@ func TestStmtBreak_Empty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12620,6 +12744,7 @@ func TestStmtBreak_Light(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12697,6 +12822,7 @@ func TestStmtBreak(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12774,6 +12900,7 @@ func TestExprArrayDimFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12870,6 +12997,7 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12914,6 +13042,7 @@ func TestExprArray(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12980,6 +13109,7 @@ func TestExprArray_Item(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13099,6 +13229,7 @@ func TestExprArray_Items(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13163,6 +13294,7 @@ func TestExprBitwiseNot(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13227,6 +13359,7 @@ func TestExprBooleanNot(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13304,6 +13437,7 @@ func TestExprClassConstFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13369,6 +13503,7 @@ func TestExprClassConstFetch_Static(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13433,6 +13568,7 @@ func TestExprClone_Brackets(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13497,6 +13633,7 @@ func TestExprClone(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13543,6 +13680,7 @@ func TestExprClosure(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13717,6 +13855,7 @@ func TestExprClosure_Use(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13891,6 +14030,7 @@ func TestExprClosure_Use2(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13957,6 +14097,7 @@ func TestExprConstFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14023,6 +14164,7 @@ func TestExprConstFetch_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14089,6 +14231,7 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14153,6 +14296,7 @@ func TestExprEmpty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14217,6 +14361,7 @@ func TestExprErrorSuppress(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14281,6 +14426,7 @@ func TestExprEval(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14325,6 +14471,7 @@ func TestExprExit(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14369,6 +14516,7 @@ func TestExprExit_Empty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14434,6 +14582,7 @@ func TestExprExit_Expr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14478,6 +14627,7 @@ func TestExprDie(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14522,6 +14672,7 @@ func TestExprDie_Empty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14587,6 +14738,7 @@ func TestExprDie_Expr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14663,6 +14815,7 @@ func TestExprFunctionCall(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14739,6 +14892,7 @@ func TestExprFunctionCall_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14840,6 +14994,7 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14959,6 +15114,7 @@ func TestExprFunctionCall_Var(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15091,6 +15247,7 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15155,6 +15312,7 @@ func TestExprPostDec(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15219,6 +15377,7 @@ func TestExprPostInc(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15283,6 +15442,7 @@ func TestExprPreDec(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15347,6 +15507,7 @@ func TestExprPreInc(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15411,6 +15572,7 @@ func TestExprInclude(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15475,6 +15637,7 @@ func TestExprInclude_Once(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15539,6 +15702,7 @@ func TestExprRequire(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15603,6 +15767,7 @@ func TestExprRequire_Once(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15690,6 +15855,7 @@ func TestExprInstanceOf(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15777,6 +15943,7 @@ func TestExprInstanceOf_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15864,6 +16031,7 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15930,6 +16098,7 @@ func TestExprIsset(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16017,6 +16186,7 @@ func TestExprIsset_Variables(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16092,6 +16262,7 @@ func TestExprList_Empty(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16199,6 +16370,7 @@ func TestExprList(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16316,6 +16488,7 @@ func TestExprList_ArrayIndex(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16445,6 +16618,7 @@ func TestExprList_List(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16553,6 +16727,7 @@ func TestExprList_EmptyItem(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16663,6 +16838,7 @@ func TestExprList_EmptyItems(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16748,6 +16924,7 @@ func TestExprMethodCall(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16814,6 +16991,7 @@ func TestExprNew(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16890,6 +17068,7 @@ func TestExprNew_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16966,6 +17145,7 @@ func TestExprNew_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17030,6 +17210,7 @@ func TestExprPrint(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17105,6 +17286,7 @@ func TestExprPropertyFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17223,6 +17405,7 @@ func TestExprReference_ForeachWithRef(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17300,6 +17483,7 @@ func TestExprShellExec(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17344,6 +17528,7 @@ func TestExprShortArray(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17410,6 +17595,7 @@ func TestExprShortArray_Item(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17529,6 +17715,7 @@ func TestExprShortArray_Items(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17616,6 +17803,7 @@ func TestExprStaticCall(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17703,6 +17891,7 @@ func TestExprStaticCall_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17790,6 +17979,7 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17887,6 +18077,7 @@ func TestExprStaticCall_Var(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17982,6 +18173,7 @@ func TestExprStaticCall_VarVar(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18069,6 +18261,7 @@ func TestExprStaticPropertyFetch(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18156,6 +18349,7 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18243,6 +18437,7 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18349,6 +18544,7 @@ func TestExprTernary(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18434,6 +18630,7 @@ func TestExprTernary_Simple(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18592,6 +18789,7 @@ func TestExprTernary_NestedTrue(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18750,6 +18948,7 @@ func TestExprTernary_NestedCond(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18814,6 +19013,7 @@ func TestExprUnaryMinus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18878,6 +19078,7 @@ func TestExprUnaryPlus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18932,6 +19133,7 @@ func TestExprVariable(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18996,6 +19198,7 @@ func TestExprVariable_Variable(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19039,6 +19242,7 @@ func TestExprYield(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19103,6 +19307,7 @@ func TestExprYield_Val(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19188,6 +19393,7 @@ func TestExprYield_KeyVal(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19242,6 +19448,7 @@ func TestExprYield_Expr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19317,6 +19524,7 @@ func TestExprYield_KeyExpr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19404,6 +19612,7 @@ func TestExprAssign_Assign(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19489,6 +19698,7 @@ func TestExprAssign_Reference(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19586,6 +19796,7 @@ func TestExprAssign_ReferenceNew(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19728,6 +19939,7 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19813,6 +20025,7 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19898,6 +20111,7 @@ func TestExprAssign_BitwiseOr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19983,6 +20197,7 @@ func TestExprAssign_BitwiseXor(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20068,6 +20283,7 @@ func TestExprAssign_Concat(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20153,6 +20369,7 @@ func TestExprAssign_Div(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20238,6 +20455,7 @@ func TestExprAssign_Minus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20323,6 +20541,7 @@ func TestExprAssign_Mod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20408,6 +20627,7 @@ func TestExprAssign_Mul(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20493,6 +20713,7 @@ func TestExprAssign_Plus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20578,6 +20799,7 @@ func TestExprAssign_Pow(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20663,6 +20885,7 @@ func TestExprAssign_ShiftLeft(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20748,6 +20971,7 @@ func TestExprAssign_ShiftRight(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20835,6 +21059,7 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20920,6 +21145,7 @@ func TestExprBinary_BitwiseOr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21005,6 +21231,7 @@ func TestExprBinary_BitwiseXor(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21090,6 +21317,7 @@ func TestExprBinary_BooleanAnd(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21175,6 +21403,7 @@ func TestExprBinary_BooleanOr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21260,6 +21489,7 @@ func TestExprBinary_Concat(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21345,6 +21575,7 @@ func TestExprBinary_Div(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21430,6 +21661,7 @@ func TestExprBinary_Equal(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21515,6 +21747,7 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21600,6 +21833,7 @@ func TestExprBinary_Greater(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21685,6 +21919,7 @@ func TestExprBinary_Identical(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21770,6 +22005,7 @@ func TestExprBinary_LogicalAnd(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21855,6 +22091,7 @@ func TestExprBinary_LogicalOr(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21940,6 +22177,7 @@ func TestExprBinary_LogicalXor(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22025,6 +22263,7 @@ func TestExprBinary_Minus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22110,6 +22349,7 @@ func TestExprBinary_Mod(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22195,6 +22435,7 @@ func TestExprBinary_Mul(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22280,6 +22521,7 @@ func TestExprBinary_NotEqual(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22365,6 +22607,7 @@ func TestExprBinary_NotIdentical(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22450,6 +22693,7 @@ func TestExprBinary_Plus(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22535,6 +22779,7 @@ func TestExprBinary_Pow(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22620,6 +22865,7 @@ func TestExprBinary_ShiftLeft(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22705,6 +22951,7 @@ func TestExprBinary_ShiftRight(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22790,6 +23037,7 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22875,6 +23123,7 @@ func TestExprBinary_Smaller(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22941,6 +23190,7 @@ func TestExprCast_Array(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23005,6 +23255,7 @@ func TestExprCast_Bool(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23069,6 +23320,7 @@ func TestExprCast_BoolShort(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23133,6 +23385,7 @@ func TestExprCast_Double(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23197,6 +23450,7 @@ func TestExprCast_CastFloat(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23261,6 +23515,7 @@ func TestExprCast_Int(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23325,6 +23580,7 @@ func TestExprCast_IntShort(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23389,6 +23645,7 @@ func TestExprCast_Object(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23453,6 +23710,7 @@ func TestExprCast_String(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23517,6 +23775,7 @@ func TestExprCast_BinaryString(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23581,5 +23840,6 @@ func TestExprCast_Unset(t *testing.T) { php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() + traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) assert.DeepEqual(t, expected, actual) } diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 397fb9de03ab0b5bc305150efa6fa4373bd2fc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| Bin 332754 -> 332763 bytes internal/php5/php5.y | 12 ++++++------ internal/php7/php7.go | Bin 274511 -> 274514 bytes internal/php7/php7.y | 10 +++++----- pkg/printer/printer.go | 35 ++++++++++------------------------- pkg/token/position.go | 1 - pkg/token/position_string.go | 17 ++++++++--------- 7 files changed, 29 insertions(+), 46 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index b8faaea75d4a1919d0548cc90a1edbdccd90df6f..908d035f2e05f28aaef5b8a6c4ea7a489a37dac3 100644 GIT binary patch delta 74 zcmcb#T;%q0k%kt=ElgaQ(-S5zN=|op%91s`;5B3L_Pd!(_Ka}Bz1!bsGo41_xA*2T N0WtIT-aHo9r2u+#9%cXl delta 112 zcmcb;T;$Snk%kt=ElgaQ(-Y1xXR0THvnC)-WY+e;>kR$2k3h3#0k;eQOwb zrZ?C!iA{g7hS7){rp_m`czUBTv+(pTD@NVv5o;M;5Jnt4!K6IB!H$V-`YT5!`}XbO MOxw4IGta&O0Kt|mo&W#< diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 5193903..4a2af09 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -2318,8 +2318,8 @@ argument_list: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2331,11 +2331,11 @@ argument_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) if $3 != nil { - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, append($3.Tokens, $4.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($3.Tokens, $4.Tokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.ArgumentList, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index a5c5db5..e269a6d 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1587,12 +1587,9 @@ func (p *Printer) printExprFunctionCall(n ast.Vertex) { p.Print(nn.Function) - p.printFreeFloating(nn.ArgumentList, token.Start) - io.WriteString(p.w, "(") + p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, token.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, token.End) + p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") p.printFreeFloating(nn, token.End) } @@ -1674,12 +1671,9 @@ func (p *Printer) printExprMethodCall(n ast.Vertex) { io.WriteString(p.w, "->") p.Print(nn.Method) - p.printFreeFloating(nn.ArgumentList, token.Start) - io.WriteString(p.w, "(") + p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, token.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, token.End) + p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") p.printFreeFloating(nn, token.End) } @@ -1693,12 +1687,9 @@ func (p *Printer) printExprNew(n ast.Vertex) { p.Print(nn.Class) if nn.ArgumentList != nil { - p.printFreeFloating(nn.ArgumentList, token.Start) - io.WriteString(p.w, "(") + p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, token.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, token.End) + p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") } p.printFreeFloating(nn, token.End) @@ -1851,12 +1842,9 @@ func (p *Printer) printExprStaticCall(n ast.Vertex) { io.WriteString(p.w, "::") p.Print(nn.Call) - p.printFreeFloating(nn.ArgumentList, token.Start) - io.WriteString(p.w, "(") + p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, token.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, token.End) + p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") p.printFreeFloating(nn, token.End) } @@ -2320,12 +2308,9 @@ func (p *Printer) printStmtClass(n ast.Vertex) { } if nn.ArgumentList != nil { - p.printFreeFloating(nn.ArgumentList, token.Start) - io.WriteString(p.w, "(") + p.printFreeFloatingOrDefault(nn.ArgumentList, token.Start, "(") p.joinPrint(",", nn.ArgumentList.Arguments) - p.printFreeFloating(nn.ArgumentList, token.ArgumentList) - io.WriteString(p.w, ")") - p.printFreeFloating(nn.ArgumentList, token.End) + p.printFreeFloatingOrDefault(nn.ArgumentList, token.End, ")") } if nn.Extends != nil { diff --git a/pkg/token/position.go b/pkg/token/position.go index 09559e8..329f8aa 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -63,7 +63,6 @@ const ( ArrayPairList CaseListStart CaseListEnd - ArgumentList PropertyList ParameterList AdaptationList diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index 5a62283..389ec94 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -65,18 +65,17 @@ func _() { _ = x[ArrayPairList-54] _ = x[CaseListStart-55] _ = x[CaseListEnd-56] - _ = x[ArgumentList-57] - _ = x[PropertyList-58] - _ = x[ParameterList-59] - _ = x[AdaptationList-60] - _ = x[LexicalVarList-61] - _ = x[OpenParenthesisToken-62] - _ = x[CloseParenthesisToken-63] + _ = x[PropertyList-57] + _ = x[ParameterList-58] + _ = x[AdaptationList-59] + _ = x[LexicalVarList-60] + _ = x[OpenParenthesisToken-61] + _ = x[CloseParenthesisToken-62] } -const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondNamespaceStaticClassUseWhileForSwitchForeachDeclareLabelFinallyListDefaultIfElseIfElseFunctionAliasEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndArgumentListPropertyListParameterListAdaptationListLexicalVarListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondNamespaceStaticClassUseWhileForSwitchForeachDeclareLabelFinallyListDefaultIfElseIfElseFunctionAliasEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndPropertyListParameterListAdaptationListLexicalVarListOpenParenthesisTokenCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 133, 139, 144, 147, 152, 155, 161, 168, 175, 180, 187, 191, 198, 200, 206, 210, 218, 223, 228, 232, 237, 242, 247, 251, 255, 258, 263, 268, 273, 280, 289, 297, 306, 318, 331, 344, 355, 367, 379, 392, 406, 420, 440, 461} +var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 133, 139, 144, 147, 152, 155, 161, 168, 175, 180, 187, 191, 198, 200, 206, 210, 218, 223, 228, 232, 237, 242, 247, 251, 255, 258, 263, 268, 273, 280, 289, 297, 306, 318, 331, 344, 355, 367, 380, 394, 408, 428, 449} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) { From b8b4439015325f2c285e7d961d86ea3eb3b0328e Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 9 Aug 2020 14:41:56 +0200 Subject: [PATCH 043/140] [refactoring] store `alt_if` node brackets --- internal/php5/php5.go | Bin 332763 -> 333714 bytes internal/php5/php5.y | 39 ++++++---- internal/php7/php7.go | Bin 274514 -> 275578 bytes internal/php7/php7.y | 41 +++++++---- pkg/ast/visitor/filter_parser_nodes.go | 26 +++++++ pkg/printer/printer.go | 95 ++++++++++++++++++------- 6 files changed, 150 insertions(+), 51 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 908d035f2e05f28aaef5b8a6c4ea7a489a37dac3..466cd09082db85449cd8a5f078ebb74433527d55 100644 GIT binary patch delta 9835 zcmbtadtB93w*Tz4_W?mj6vYq`@RgbAIfuhJP^qYZnlB1d^NE(3iOGmfnVFbH8Li?1`XuT>OQKV3kX5URole{6%wS&MEre*A>k(TMeIe_tbgwdnDTh{JxhubRT@r z6*EmG2=awC=HhzMnopOA?vagL+%k$fbMaK6xPH27#qDQOl*IN8^mc816M7a*FPd|G zWJE+n6G;unfbw&q8DE-6*KqDl6sGf^6oW+b#@*-exsf8CFFY=ixMBds@qnkruBayS zMVzvS;`#F9!pr@i7JlCHglNwf7mJRZUnat%nw)3%>dw6u$re29GvVWy`&DF;e?rgu zp_HE8x*PrEL6Q9m=42NXO}*X@__hU<$Pd3rEjY5fXwH8-BwFy{S5#O6E;B!QDj1We z-;-Q0_5N;i=Vr|+D40BZTpF)k2t~D6BNFWyH>EiW7p@j79t_&|va zK36N->kG@oY!`Vv8cZ%lsp*Z}8r&^h(D$#-Qvzo`B9z`;A#NnTZGLdf7`NiR^JtuQ z|5lU;ZvLvs!Ooudq_cpl){8d!P=)wX@YwZ`#^dJON+6`&4U@MJjM{QZh|>Ob>@QLq zPh?PH8%}sa@c7MQP!j>Jo_?oN41~lD0_eo8q6cxm52(F!=JYp3Z-R)8XMXfHq#&=m z@lf6A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).setFreeFloatingTokens($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.GetNode().Tokens[token.OpenParenthesisToken]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) } if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $2.GetNode().Tokens[token.CloseParenthesisToken]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) + } + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.Tokens) + if $6 != nil { + yylex.(*Parser).setFreeFloating($6.(*ast.StmtAltElse).Stmt, token.End, append($7.Tokens, $8.Tokens...)) + } else if len($5) > 0 { + yylex.(*Parser).setFreeFloating($5[len($5)-1].(*ast.StmtAltElseIf).Stmt, token.End, append($7.Tokens, $8.Tokens...)) + } else { + yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($7.Tokens, $8.Tokens...)) } - yylex.(*Parser).setFreeFloating($$, token.Cond, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $8.Tokens) yylex.(*Parser).setToken($$, token.SemiColon, $8.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2175,23 +2184,27 @@ new_elseif_list: } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} stmts := &ast.StmtStmtList{ast.Node{}, $5} - _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmts} + stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, exprBrackets, stmtsBrackets} $$ = append($1, _elseIf) // save position + exprBrackets.GetNode().Position = position.NewNodePosition($3) stmts.GetNode().Position = position.NewNodeListPosition($5) + exprBrackets.GetNode().Position = position.NewTokenNodeListPosition($4, $5) _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.GetNode().Tokens[token.OpenParenthesisToken]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) } if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $3.GetNode().Tokens[token.CloseParenthesisToken]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) } - yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2230,15 +2243,17 @@ new_else_single: | T_ELSE ':' inner_statement_list { stmts := &ast.StmtStmtList{ast.Node{}, $3} - $$ = &ast.StmtAltElse{ast.Node{}, stmts} + stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} + $$ = &ast.StmtAltElse{ast.Node{}, stmtsBrackets} // save position stmts.GetNode().Position = position.NewNodeListPosition($3) + stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($2, $3) $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Else, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 1cf81e70c28eeca2736666f12fa3b0a34e2102a4..0c50734c8604d3340d13baae13c4a73f91c8fa61 100644 GIT binary patch delta 5453 zcmZ`-d32T4wO?nSFA0GJ0%RZwkQ;IrjXEww~U)a$y^shkzD$TXhtax^;I$j3oaflgKPzF4iyewluhBh`%9T< z%L*onjyz_lU*^}=EOZdg;QDX(RQvw3jv0{ns>F?RY58B&={PF|EoAx+Hn z50|7-m*^&zJZvggc_@|tnMU(%b?yuiL-=5vWy~!2cNU5aKKZnW;CH*wKOeSlL=&r4 zw6VH2HE8NCQN(|7Q9qHzd;TgSxo#HDDE}peSH1xC%eTw?mgA<*o;=CXwTEN={9ok^ z;Fet|GD_PF;nb4pNoG2&@6@uACnoXEGHTCZT|`)XQ}M`0*ZoJTYcv;E%Sdj&RJ7yn zJ3)}D9-6dw&s_^6wX}injvz)l*P=bq}$K13Z)`T~03#@=%}ukNQdv zIRkArX^8jxS2VyI1e?Z|OfBOrhbTp}#?5EEbi;tzh*?o!l1*Q*B!Z_^%V7R7LK7_B zYQaZeskh7&#y18{R-Q&t`lt&pJZoP}Tshz#(S3=F`K|fp4?Q}K>j|Acru}nl(dPOdO z@dWPmaQsCm2d@_KlK%QYFIN=MGu$mlG>n+q?VfB0=eENE`H9~zl zl2!`ofvbVeeI7an#<)E8L6Ku|kekontGD~(u~04Dt+2GW*1&k85$B`hG%N6ky2lpPEQ9&$N@=SgPX^EYTzDBiZOg0Qp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Y|LK zu44X+6tJXMzvp+52LX+#5>rf3I$cuNfUY`r%GahQ6NQYza1UpdS!)=Qp5D{J>)nqRoS_XFy`5i~mVoR}(#!go rbzxE?7)0qpxAOuP<9%fM>%Csblz;f`hOG5Dmekn4H-<|=hU5Kz%KM9) diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 4a2af09..e125503 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -2037,38 +2037,46 @@ if_stmt: alt_if_stmt_without_else: T_IF '(' expr ')' ':' inner_statement_list { + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} stmts := &ast.StmtStmtList{ast.Node{}, $6} - $$ = &ast.StmtAltIf{ast.Node{}, $3, stmts, nil, nil} + stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} + $$ = &ast.StmtAltIf{ast.Node{}, exprBrackets, stmtsBrackets, nil, nil} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) stmts.GetNode().Position = position.NewNodeListPosition($6) + stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($5, $6) $$.GetNode().Position = position.NewTokenNodeListPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list { + exprBrackets := &ast.ParserBrackets{ast.Node{}, $4} stmts := &ast.StmtStmtList{ast.Node{}, $7} - _elseIf := &ast.StmtAltElseIf{ast.Node{}, $4, stmts} + stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, exprBrackets, stmtsBrackets} $1.(*ast.StmtAltIf).ElseIf = append($1.(*ast.StmtAltIf).ElseIf, _elseIf) $$ = $1 // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($3, $5) stmts.GetNode().Position = position.NewNodeListPosition($7) + stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($6, $7) _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $7) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Cond, $6.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2083,8 +2091,12 @@ alt_if_stmt: $$.GetNode().Position = position.NewNodeTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $3.Tokens) + altif := $$.(*ast.StmtAltIf) + if len(altif.ElseIf) > 0 { + yylex.(*Parser).setFreeFloating(altif.ElseIf[len(altif.ElseIf)-1], token.End, append($2.Tokens, $3.Tokens...)) + } else { + yylex.(*Parser).setFreeFloating(altif.Stmt, token.End, append($2.Tokens, $3.Tokens...)) + } yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -2092,21 +2104,22 @@ alt_if_stmt: | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { stmts := &ast.StmtStmtList{ast.Node{}, $4} - _else := &ast.StmtAltElse{ast.Node{}, stmts} + stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} + _else := &ast.StmtAltElse{ast.Node{}, stmtsBrackets} $1.(*ast.StmtAltIf).Else = _else $$ = $1 // save position stmts.GetNode().Position = position.NewNodeListPosition($4) + stmtsBrackets.GetNode().Position = position.NewTokensPosition($3, $5) _else.GetNode().Position = position.NewTokenNodeListPosition($2, $4) $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_else, token.Else, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $6.Tokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($5.Tokens, $6.Tokens...)) yylex.(*Parser).setToken($$, token.SemiColon, $6.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index c8eaabf..a7f5529 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -40,3 +40,29 @@ func (v *FilterParserNodes) StmtUseDeclaration(n *ast.StmtUseDeclaration) { n.Alias = nn.Child } } + +func (v *FilterParserNodes) StmtAltIf(n *ast.StmtAltIf) { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } + + if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { + n.Stmt = nn.Child + } +} + +func (v *FilterParserNodes) StmtAltElseIf(n *ast.StmtAltElseIf) { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } + + if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { + n.Stmt = nn.Child + } +} + +func (v *FilterParserNodes) StmtAltElse(n *ast.StmtAltElse) { + if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { + n.Stmt = nn.Child + } +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index e269a6d..64a32c9 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1967,16 +1967,32 @@ func (p *Printer) printStmtAltElseIf(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "elseif") - p.printFreeFloating(nn, token.ElseIf) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") - if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { - p.printNodes(s) + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + + p.Print(nn.Cond) + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } + + stmtList, _ := nn.Stmt.(*ast.StmtStmtList) + brackets, ok := nn.Stmt.(*ast.ParserBrackets) + if ok { + p.printFreeFloating(brackets, token.Start) + stmtList = brackets.Child.(*ast.StmtStmtList) + } else { + io.WriteString(p.w, ":") + } + + p.printFreeFloating(stmtList, token.Stmts) + p.printNodes(stmtList.Stmts) + p.printFreeFloating(stmtList, token.End) + + if ok { + p.printFreeFloating(brackets, token.End) } p.printFreeFloating(nn, token.End) @@ -1987,11 +2003,22 @@ func (p *Printer) printStmtAltElse(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "else") - p.printFreeFloating(nn, token.Else) - io.WriteString(p.w, ":") - if s := nn.Stmt.(*ast.StmtStmtList).Stmts; len(s) > 0 { - p.printNodes(s) + stmtList, _ := nn.Stmt.(*ast.StmtStmtList) + brackets, ok := nn.Stmt.(*ast.ParserBrackets) + if ok { + p.printFreeFloating(brackets, token.Start) + stmtList = brackets.Child.(*ast.StmtStmtList) + } else { + io.WriteString(p.w, ":") + } + + p.printFreeFloating(stmtList, token.Stmts) + p.printNodes(stmtList.Stmts) + p.printFreeFloating(stmtList, token.End) + + if ok { + p.printFreeFloating(brackets, token.End) } p.printFreeFloating(nn, token.End) @@ -2083,16 +2110,33 @@ func (p *Printer) printStmtAltIf(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "if") - p.printFreeFloating(nn, token.If) - io.WriteString(p.w, "(") - p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") - p.printFreeFloating(nn, token.Cond) - io.WriteString(p.w, ":") - s := nn.Stmt.(*ast.StmtStmtList) - p.printNodes(s.Stmts) + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + + p.Print(nn.Cond) + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } + + stmtList, _ := nn.Stmt.(*ast.StmtStmtList) + brackets, ok := nn.Stmt.(*ast.ParserBrackets) + if ok { + p.printFreeFloating(brackets, token.Start) + stmtList = brackets.Child.(*ast.StmtStmtList) + } else { + io.WriteString(p.w, ":") + } + + p.printFreeFloating(stmtList, token.Stmts) + p.printNodes(stmtList.Stmts) + p.printFreeFloating(stmtList, token.End) + + if ok { + p.printFreeFloating(brackets, token.End) + } for _, elseif := range nn.ElseIf { p.Print(elseif) @@ -2102,9 +2146,10 @@ func (p *Printer) printStmtAltIf(n ast.Vertex) { p.Print(nn.Else) } - p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "endif") - p.printFreeFloating(nn, token.AltEnd) + if !ok { + io.WriteString(p.w, "endif") + } + p.printFreeFloating(nn, token.SemiColon) if nn.GetNode().Tokens.IsEmpty() { io.WriteString(p.w, ";") From 394092269ad298c1160d46a9253aa2f53fed4cfb Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sun, 9 Aug 2020 22:40:55 +0200 Subject: [PATCH 044/140] [refactoring] store expr parenthesis --- internal/php5/parser_test.go | 14 +- internal/php5/php5.go | Bin 333714 -> 327033 bytes internal/php5/php5.y | 139 +-- internal/php5/php5_test.go | 4 +- internal/php7/parser_test.go | 4 +- internal/php7/php7.go | Bin 275578 -> 276863 bytes internal/php7/php7.y | 107 ++- internal/php7/php7_test.go | 12 +- pkg/ast/visitor/filter_parser_nodes.go | 1207 +++++++++++++++++++++++- pkg/printer/printer.go | 122 ++- pkg/token/position.go | 10 - pkg/token/position_string.go | 76 +- 12 files changed, 1439 insertions(+), 256 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 6d72de0..a33aa36 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -5819,7 +5819,7 @@ func TestStmtEcho_Parenthesis(t *testing.T) { } func TestStmtExpression(t *testing.T) { - src := `MZYh>r|F) zssD4;U8U=rL^}e`=;%pP3x?b2*lO8m_WmYne-q~W1C?jWt`zqI%ZzaOqNAdw)0!99 zIvU@NM^R~xh@?m6vPbCiJl zPM5;h$!QVCxT=x84nLqqEGo>Xu_P9yt4(U(e>v3R<+g{`NnZ?P=y2vFi} z8QQCOGrKFaSG&#F%Tc3;!f)+3b6UIO<0hkuZ5ZP=DyZU**mXwjwp$uP16918b>Nh6 zTQ;R3AMyxwM_~c(^jmA@zQb(l@ekPZ5C!PQ7s5KlyC1R_ncjCNR@n3rYt3m$N!Yai z*v)?8-0e`;_p;?S;qsfm+H*Q|Q#PacA{nD94l<{JmYCm=%Hw2|$~elNcH>{t;p2j&no-ZKQYzoe8_|%r`A}MLfn{@_mr5#lJ4%?(B-!`zZq)Z8 z_V@TbzuTYgzb5Nh(b)bHV^Vm60ZKcKh|E1L^Xc8ISj>Sq`i}oXRoAe+Qy<&dE05l) zur%Fl88D9qT!$)W{|H0Do_Q2oiP;`Eb-clv)AUM&kjJk-8q%(gyea)d|LpZ>$r$bp z)cWO{8(7#!XWB6+s(!3J&X z@Dy4b$rt1J3LnQ9cLu9fOd)S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Hlbvm@-D14v( z)_4-^E(gC9GQKC7NY!?#OZ~Xv>!Nz?lU*V2gtZn#OiO0a%t66 zT<&E|1=-)ePYzQ9-jzYzy3f(^K^48P>yU81b{FO=2?t<=KCdb`An(ATJFF|;`io5K zh7x6hW@^gEa=otgm`bXt{&)|`bi8A-i3B=T3q@6RWX)8@1F{+Ju~xAtIi+~UEb4uV z4IzAkc_a0yHMk4bY`diKLysB%1d~ZnFCCNRW)C*P&k%L{aS4{MIU3Kpm8SLti@_yo zxV5mjb?oHx);;h~tyU|?^Oq#jzW^yhpULbJ2u+kYzm#Q6di8Bp+1K(#Jhd*W%uUIl zIx`2DuKrHww>n7Xv1s7t(>fwJbOKeuY55sVzhEzC 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.If, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $2} stmts := &ast.StmtStmtList{ast.Node{}, $4} stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - $$ = &ast.StmtAltIf{ast.Node{}, exprBrackets, stmtsBrackets, $5, $6} + $$ = &ast.StmtAltIf{ast.Node{}, $2, stmtsBrackets, $5, $6} // save position - exprBrackets.GetNode().Position = position.NewNodePosition($2) stmts.GetNode().Position = position.NewNodeListPosition($4) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($3, $4) $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.GetNode().Tokens[token.OpenParenthesisToken]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $2.GetNode().Tokens[token.CloseParenthesisToken]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.Tokens) if $6 != nil { yylex.(*Parser).setFreeFloating($6.(*ast.StmtAltElse).Stmt, token.End, append($7.Tokens, $8.Tokens...)) @@ -977,12 +963,6 @@ unticked_statement: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.While, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -996,13 +976,7 @@ unticked_statement: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - if len($4.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.While, $4.GetNode().Tokens[token.OpenParenthesisToken][:len($4.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($4.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($4.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.GetNode().Tokens[token.CloseParenthesisToken][:len($4.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($4.GetNode().Tokens, token.CloseParenthesisToken) - } - yylex.(*Parser).setFreeFloating($$, token.Cond, $5.Tokens) + yylex.(*Parser).setFreeFloating($4, token.End, $5.Tokens) yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1052,12 +1026,6 @@ unticked_statement: // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Switch, $2.GetNode().Tokens[token.OpenParenthesisToken][:len($2.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($2.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.GetNode().Tokens[token.CloseParenthesisToken][:len($2.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($2.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2163,12 +2131,6 @@ elseif_list: // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.ElseIf, $3.GetNode().Tokens[token.OpenParenthesisToken][:len($3.GetNode().Tokens[token.OpenParenthesisToken])-1]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(_elseIf, token.Expr, $3.GetNode().Tokens[token.CloseParenthesisToken][:len($3.GetNode().Tokens[token.CloseParenthesisToken])-1]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -2184,26 +2146,18 @@ new_elseif_list: } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { - exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} stmts := &ast.StmtStmtList{ast.Node{}, $5} stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} - _elseIf := &ast.StmtAltElseIf{ast.Node{}, exprBrackets, stmtsBrackets} + _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmtsBrackets} $$ = append($1, _elseIf) // save position - exprBrackets.GetNode().Position = position.NewNodePosition($3) stmts.GetNode().Position = position.NewNodeListPosition($5) - exprBrackets.GetNode().Position = position.NewTokenNodeListPosition($4, $5) + stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($4, $5) _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - if len($3.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.GetNode().Tokens[token.OpenParenthesisToken]); delete($3.GetNode().Tokens, token.OpenParenthesisToken) - } - if len($3.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $3.GetNode().Tokens[token.CloseParenthesisToken]); delete($3.GetNode().Tokens, token.CloseParenthesisToken) - } yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -4089,9 +4043,6 @@ expr_without_variable: $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - - yylex.(*Parser).setFreeFloatingTokens($1, token.Start, append($1.GetNode().Tokens[token.OpenParenthesisToken], $1.GetNode().Tokens[token.Start]...)); delete($1.GetNode().Tokens, token.OpenParenthesisToken) - yylex.(*Parser).setFreeFloatingTokens($1, token.End, append($1.GetNode().Tokens[token.End], $1.GetNode().Tokens[token.CloseParenthesisToken]...)); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } | new_expr { @@ -4258,15 +4209,14 @@ expr_without_variable: } | T_EXIT exit_expr { - e := $2.(*ast.ExprExit) - $$ = $2 + $$ = &ast.ExprExit{ast.Node{}, false, $2} if (bytes.EqualFold($1.Value, []byte("die"))) { - e.Die = true + $$.(*ast.ExprExit).Die = true } // save position - if $2.GetNode().Position == nil { + if $2 == nil { $$.GetNode().Position = position.NewTokenPosition($1) } else { $$.GetNode().Position = position.NewTokenNodePosition($1, $2) @@ -4930,39 +4880,28 @@ dynamic_class_name_variable_property: exit_expr: /* empty */ { - $$ = &ast.ExprExit{ast.Node{}, false, nil}; + $$ = nil yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' ')' { - $$ = &ast.ExprExit{ast.Node{}, false, nil}; + $$ = &ast.ParserBrackets{ast.Node{}, nil} // save position $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | parenthesis_expr { - $$ = &ast.ExprExit{ast.Node{}, false, $1}; - - // save position - if bytes.Compare(yylex.(*Parser).currentToken.Value, []byte(")")) == 0 { - $$.GetNode().Position = position.NewTokenPosition(yylex.(*Parser).currentToken) - } else { - $$.GetNode().Position = position.NewNodePosition($1) - } + $$ = $1 yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) - - // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.GetNode().Tokens[token.OpenParenthesisToken]); delete($1.GetNode().Tokens, token.OpenParenthesisToken) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $1.GetNode().Tokens[token.CloseParenthesisToken]); delete($1.GetNode().Tokens, token.CloseParenthesisToken) } ; @@ -5945,33 +5884,27 @@ expr: parenthesis_expr: '(' expr ')' { - $$ = $2 + $$ = &ast.ParserBrackets{ast.Node{}, $2} + + // save position + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) - } - yylex.(*Parser).setFreeFloatingTokens($2, token.OpenParenthesisToken, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($2, token.CloseParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' yield_expr ')' { - $$ = $2 + $$ = &ast.ParserBrackets{ast.Node{}, $2} + + // save position + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - if len($2.GetNode().Tokens[token.OpenParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, token.Start, append($2.GetNode().Tokens[token.OpenParenthesisToken], $2.GetNode().Tokens[token.Start]...)) - } - if len($2.GetNode().Tokens[token.CloseParenthesisToken]) > 0 { - yylex.(*Parser).setFreeFloating($2, token.End, append($2.GetNode().Tokens[token.End], $2.GetNode().Tokens[token.CloseParenthesisToken]...)) - } - yylex.(*Parser).setFreeFloatingTokens($2, token.OpenParenthesisToken, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($2, token.CloseParenthesisToken, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6943,29 +6876,33 @@ internal_functions_in_yacc: } | T_EMPTY '(' variable ')' { - $$ = &ast.ExprEmpty{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' expr ')' { - $$ = &ast.ExprEmpty{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -6995,15 +6932,17 @@ internal_functions_in_yacc: } | T_EVAL '(' expr ')' { - $$ = &ast.ExprEval{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.ExprEval{ast.Node{}, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index 07cbd58..b1a1ada 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -10048,7 +10048,7 @@ func TestPhp5(t *testing.T) { StartLine: 175, EndLine: 175, StartPos: 3593, - EndPos: 3601, + EndPos: 3602, }, }, Expr: &ast.ExprVariable{ @@ -12426,7 +12426,7 @@ func TestPhp5(t *testing.T) { StartLine: 223, EndLine: 223, StartPos: 4168, - EndPos: 4176, + EndPos: 4177, }, }, Expr: &ast.ExprVariable{ diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 99ac89f..9ef81b7 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -15577,7 +15577,7 @@ func TestExprClone_Brackets(t *testing.T) { StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 11, + EndPos: 12, }, }, Expr: &ast.ExprVariable{ @@ -19422,7 +19422,7 @@ func TestExprPrint(t *testing.T) { StartLine: 1, EndLine: 1, StartPos: 3, - EndPos: 11, + EndPos: 12, }, }, Expr: &ast.ExprVariable{ diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 0c50734c8604d3340d13baae13c4a73f91c8fa61..89954b66035054f2ade09e65668ad66583eb60ef 100644 GIT binary patch delta 6610 zcmb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cc zAfZA)APpYhC-YUsUR`>h-;ci#6n~Gs10gT%mk!nIpln4PcQAO}_CvOF%oG8UM)COn z%6#bs#uz=?9R@o@jzOf^hjAHYr2nRiMB1jPUn8vXg0t(e)#c%-AId&@PQQg~j!}R8 ze)(T@>Zn|)TOozT9olochhgMts9Jtb_80u*3AsgeJuVN4%9An|?^VEeJwY0gwx5)F z7D%SaOHz>sF}6Xz zE7*13_E~~{lNuoSqt7)O`4k4|bHG=`s?mMQm#__ry`EbFJ7d0vkJ9zDlce1_Yfds#s^KER`C>F@U>3Z!{`PUer>3>Gy35e4 zOfy5AEu}PsmyA{CqpcIVDF{Snuz>VXx3#l+nsLe86Quut%v-9i9jth%2RJieo0{n2 z<=LVm*X)*icw&N8V2{QcjhfK4t>EZHt02^4=9S}#!-nWAFiU;Tq9zvN#zeeW?tkftK>l5 zl4_Z^Dm@Lf`J;u-0ps~RFS6j>Gz*Pspus-iwA%1C-GSefljcS_V_aGDg{dxRSa&xr qsBl?GS2W&c)F|>;t4!Bx-hRhs*`n*0>}s!NIy+;rp*+NAW&986V5gP< diff --git a/internal/php7/php7.y b/internal/php7/php7.y index e125503..d43148c 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -993,38 +993,42 @@ statement: } | T_WHILE '(' expr ')' while_statement { + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + switch n := $5.(type) { case *ast.StmtWhile : - n.Cond = $3 + n.Cond = exprBrackets case *ast.StmtAltWhile : - n.Cond = $3 + n.Cond = exprBrackets } $$ = $5 // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.While, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DO statement T_WHILE '(' expr ')' ';' { - $$ = &ast.StmtDo{ast.Node{}, $2, $5} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $5} + $$ = &ast.StmtDo{ast.Node{}, $2, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($4, $6) $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.While, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $7.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(exprBrackets, token.End, append($6.Tokens, $7.Tokens...)) yylex.(*Parser).setToken($$, token.SemiColon, $7.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) @@ -1058,11 +1062,13 @@ statement: } | T_SWITCH '(' expr ')' switch_case_list { + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + switch n := $5.(type) { case *ast.StmtSwitch: - n.Cond = $3 + n.Cond = exprBrackets case *ast.StmtAltSwitch: - n.Cond = $3 + n.Cond = exprBrackets default: panic("unexpected node type") } @@ -1070,12 +1076,13 @@ statement: $$ = $5 // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Switch, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -1977,33 +1984,37 @@ while_statement: if_stmt_without_else: T_IF '(' expr ')' statement { - $$ = &ast.StmtIf{ast.Node{}, $3, $5, nil, nil} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.StmtIf{ast.Node{}, exprBrackets, $5, nil, nil} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.If, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | if_stmt_without_else T_ELSEIF '(' expr ')' statement { - _elseIf := &ast.StmtElseIf{ast.Node{}, $4, $6} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $4} + _elseIf := &ast.StmtElseIf{ast.Node{}, exprBrackets, $6} $1.(*ast.StmtIf).ElseIf = append($1.(*ast.StmtIf).ElseIf, _elseIf) $$ = $1 // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($3, $5) _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $6) $$.GetNode().Position = position.NewNodesPosition($1, $6) // save comments yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.ElseIf, $3.Tokens) - yylex.(*Parser).setFreeFloating(_elseIf, token.Expr, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -3862,11 +3873,14 @@ expr_without_variable: } | '(' expr ')' { - $$ = $2; + $$ = &ast.ParserBrackets{ast.Node{}, $2} + + // save position + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4016,17 +4030,10 @@ expr_without_variable: } | T_EXIT exit_expr { - var e *ast.ExprExit; - if $2 != nil { - e = $2.(*ast.ExprExit) - } else { - e = &ast.ExprExit{ast.Node{}, false, nil} - } - - $$ = e + $$ = &ast.ExprExit{ast.Node{}, false, $2} if (bytes.EqualFold($1.Value, []byte("die"))) { - e.Die = true + $$.(*ast.ExprExit).Die = true } // save position @@ -4405,14 +4412,14 @@ exit_expr: } | '(' optional_expr ')' { - $$ = &ast.ExprExit{ast.Node{}, false, $2}; + $$ = &ast.ParserBrackets{ast.Node{}, $2} // save position $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Exit, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $3.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4780,11 +4787,14 @@ dereferencable: } | '(' expr ')' { - $$ = $2; + $$ = &ast.ParserBrackets{ast.Node{}, $2} + + // save position + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -4805,11 +4815,14 @@ callable_expr: } | '(' expr ')' { - $$ = $2; + $$ = &ast.ParserBrackets{ast.Node{}, $2} + + // save position + $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5528,15 +5541,17 @@ internal_functions_in_yacc: } | T_EMPTY '(' expr ')' { - $$ = &ast.ExprEmpty{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.ExprEmpty{ast.Node{}, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Empty, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } @@ -5566,15 +5581,17 @@ internal_functions_in_yacc: } | T_EVAL '(' expr ')' { - $$ = &ast.ExprEval{ast.Node{}, $3} + exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} + $$ = &ast.ExprEval{ast.Node{}, exprBrackets} // save position + exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Eval, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 49f450b..68364f5 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -11046,7 +11046,7 @@ func TestPhp7(t *testing.T) { StartLine: 187, EndLine: 187, StartPos: 3780, - EndPos: 3788, + EndPos: 3789, }, }, Expr: &ast.ExprVariable{ @@ -13123,7 +13123,7 @@ func TestPhp7(t *testing.T) { StartLine: 232, EndLine: 232, StartPos: 4298, - EndPos: 4306, + EndPos: 4307, }, }, Expr: &ast.ExprVariable{ @@ -18632,7 +18632,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 5518, + StartPos: 5517, EndPos: 5532, }, }, @@ -18641,7 +18641,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 332, EndLine: 332, - StartPos: 5518, + StartPos: 5517, EndPos: 5531, }, }, @@ -18696,7 +18696,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 5534, + StartPos: 5533, EndPos: 5545, }, }, @@ -18705,7 +18705,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 333, EndLine: 333, - StartPos: 5534, + StartPos: 5533, EndPos: 5544, }, }, diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index a7f5529..f1a5655 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -42,8 +42,12 @@ func (v *FilterParserNodes) StmtUseDeclaration(n *ast.StmtUseDeclaration) { } func (v *FilterParserNodes) StmtAltIf(n *ast.StmtAltIf) { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } } if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { @@ -52,8 +56,12 @@ func (v *FilterParserNodes) StmtAltIf(n *ast.StmtAltIf) { } func (v *FilterParserNodes) StmtAltElseIf(n *ast.StmtAltElseIf) { - if nn, ok := n.Cond.(*ast.ParserBrackets); ok { - n.Cond = nn.Child + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } } if nn, ok := n.Stmt.(*ast.ParserBrackets); ok { @@ -66,3 +74,1194 @@ func (v *FilterParserNodes) StmtAltElse(n *ast.StmtAltElse) { n.Stmt = nn.Child } } + +func (v *FilterParserNodes) StmtIf(n *ast.StmtIf) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtElseIf(n *ast.StmtElseIf) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtWhile(n *ast.StmtWhile) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtAltWhile(n *ast.StmtAltWhile) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtDo(n *ast.StmtDo) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtSwitch(n *ast.StmtSwitch) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtAltSwitch(n *ast.StmtAltSwitch) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprExit(n *ast.ExprExit) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtContinue(n *ast.StmtContinue) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtBreak(n *ast.StmtBreak) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprClone(n *ast.ExprClone) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprPrint(n *ast.ExprPrint) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtExpression(n *ast.StmtExpression) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtEcho(n *ast.StmtEcho) { + for k, v := range n.Exprs { + for { + if nn, ok := v.(*ast.ParserBrackets); ok { + v = nn.Child + } else { + break + } + } + + n.Exprs[k] = v + } +} + +func (v *FilterParserNodes) ExprIsset(n *ast.ExprIsset) { + for k, v := range n.Vars { + for { + if nn, ok := v.(*ast.ParserBrackets); ok { + v = nn.Child + } else { + break + } + } + + n.Vars[k] = v + } +} + +func (v *FilterParserNodes) StmtReturn(n *ast.StmtReturn) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtForeach(n *ast.StmtForeach) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtAltForeach(n *ast.StmtAltForeach) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprYield(n *ast.ExprYield) { + for { + if nn, ok := n.Key.(*ast.ParserBrackets); ok { + n.Key = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Value.(*ast.ParserBrackets); ok { + n.Value = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) Argument(n *ast.Argument) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtThrow(n *ast.StmtThrow) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtCase(n *ast.StmtCase) { + for { + if nn, ok := n.Cond.(*ast.ParserBrackets); ok { + n.Cond = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprVariable(n *ast.ExprVariable) { + for { + if nn, ok := n.VarName.(*ast.ParserBrackets); ok { + n.VarName = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) StmtFor(n *ast.StmtFor) { + for k, v := range n.Init { + for { + if nn, ok := v.(*ast.ParserBrackets); ok { + v = nn.Child + } else { + break + } + } + + n.Init[k] = v + } + + for k, v := range n.Cond { + for { + if nn, ok := v.(*ast.ParserBrackets); ok { + v = nn.Child + } else { + break + } + } + + n.Cond[k] = v + } + + for k, v := range n.Loop { + for { + if nn, ok := v.(*ast.ParserBrackets); ok { + v = nn.Child + } else { + break + } + } + + n.Loop[k] = v + } +} + +func (v *FilterParserNodes) ExprAssign(n *ast.ExprAssign) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignBitwiseAnd(n *ast.ExprAssignBitwiseAnd) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignBitwiseOr(n *ast.ExprAssignBitwiseOr) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignBitwiseXor(n *ast.ExprAssignBitwiseXor) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignCoalesce(n *ast.ExprAssignCoalesce) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignConcat(n *ast.ExprAssignConcat) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignDiv(n *ast.ExprAssignDiv) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignMinus(n *ast.ExprAssignMinus) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignMod(n *ast.ExprAssignMod) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignMul(n *ast.ExprAssignMul) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignPlus(n *ast.ExprAssignPlus) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignPow(n *ast.ExprAssignPow) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignShiftLeft(n *ast.ExprAssignShiftLeft) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprAssignShiftRight(n *ast.ExprAssignShiftRight) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} +func (v *FilterParserNodes) ExprBinaryBitwiseAnd(n *ast.ExprBinaryBitwiseAnd) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryBitwiseOr(n *ast.ExprBinaryBitwiseOr) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryBitwiseXor(n *ast.ExprBinaryBitwiseXor) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryBooleanAnd(n *ast.ExprBinaryBooleanAnd) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryBooleanOr(n *ast.ExprBinaryBooleanOr) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryCoalesce(n *ast.ExprBinaryCoalesce) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryConcat(n *ast.ExprBinaryConcat) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryDiv(n *ast.ExprBinaryDiv) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryEqual(n *ast.ExprBinaryEqual) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryGreater(n *ast.ExprBinaryGreater) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryGreaterOrEqual(n *ast.ExprBinaryGreaterOrEqual) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryIdentical(n *ast.ExprBinaryIdentical) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryLogicalAnd(n *ast.ExprBinaryLogicalAnd) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryLogicalOr(n *ast.ExprBinaryLogicalOr) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryLogicalXor(n *ast.ExprBinaryLogicalXor) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryMinus(n *ast.ExprBinaryMinus) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryMod(n *ast.ExprBinaryMod) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryMul(n *ast.ExprBinaryMul) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryNotEqual(n *ast.ExprBinaryNotEqual) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryNotIdentical(n *ast.ExprBinaryNotIdentical) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryPlus(n *ast.ExprBinaryPlus) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryPow(n *ast.ExprBinaryPow) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryShiftLeft(n *ast.ExprBinaryShiftLeft) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinaryShiftRight(n *ast.ExprBinaryShiftRight) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinarySmaller(n *ast.ExprBinarySmaller) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinarySmallerOrEqual(n *ast.ExprBinarySmallerOrEqual) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBinarySpaceship(n *ast.ExprBinarySpaceship) { + for { + if nn, ok := n.Left.(*ast.ParserBrackets); ok { + n.Left = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Right.(*ast.ParserBrackets); ok { + n.Right = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprUnaryMinus(n *ast.ExprUnaryMinus) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprUnaryPlus(n *ast.ExprUnaryPlus) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBooleanNot(n *ast.ExprBooleanNot) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprBitwiseNot(n *ast.ExprBitwiseNot) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprInstanceOf(n *ast.ExprInstanceOf) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprTernary(n *ast.ExprTernary) { + for { + if nn, ok := n.Condition.(*ast.ParserBrackets); ok { + n.Condition = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.IfTrue.(*ast.ParserBrackets); ok { + n.IfTrue = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.IfFalse.(*ast.ParserBrackets); ok { + n.IfFalse = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastArray(n *ast.ExprCastArray) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastBool(n *ast.ExprCastBool) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastDouble(n *ast.ExprCastDouble) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastInt(n *ast.ExprCastInt) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastObject(n *ast.ExprCastObject) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastString(n *ast.ExprCastString) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprCastUnset(n *ast.ExprCastUnset) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprErrorSuppress(n *ast.ExprErrorSuppress) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprArrayDimFetch(n *ast.ExprArrayDimFetch) { + for { + if nn, ok := n.Dim.(*ast.ParserBrackets); ok { + n.Dim = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprArrayItem(n *ast.ExprArrayItem) { + for { + if nn, ok := n.Key.(*ast.ParserBrackets); ok { + n.Key = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Val.(*ast.ParserBrackets); ok { + n.Val = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprEmpty(n *ast.ExprEmpty) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprInclude(n *ast.ExprInclude) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprIncludeOnce(n *ast.ExprIncludeOnce) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprEval(n *ast.ExprEval) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprRequire(n *ast.ExprRequire) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprRequireOnce(n *ast.ExprRequireOnce) { + for { + if nn, ok := n.Expr.(*ast.ParserBrackets); ok { + n.Expr = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprPropertyFetch(n *ast.ExprPropertyFetch) { + for { + if nn, ok := n.Var.(*ast.ParserBrackets); ok { + n.Var = nn.Child + } else { + break + } + } + + for { + if nn, ok := n.Property.(*ast.ParserBrackets); ok { + n.Property = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprFunctionCall(n *ast.ExprFunctionCall) { + for { + if nn, ok := n.Function.(*ast.ParserBrackets); ok { + n.Function = nn.Child + } else { + break + } + } +} + +func (v *FilterParserNodes) ExprStaticCall(n *ast.ExprStaticCall) { + for { + if nn, ok := n.Call.(*ast.ParserBrackets); ok { + n.Call = nn.Child + } else { + break + } + } +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 64a32c9..3951b6f 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -1530,11 +1530,16 @@ func (p *Printer) printExprEmpty(n ast.Vertex) { nn := n.(*ast.ExprEmpty) p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "empty") - p.printFreeFloating(nn, token.Empty) - io.WriteString(p.w, "(") + + if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.printFreeFloating(nn, token.End) } @@ -1551,12 +1556,18 @@ func (p *Printer) printExprErrorSuppress(n ast.Vertex) { func (p *Printer) printExprEval(n ast.Vertex) { nn := n.(*ast.ExprEval) p.printFreeFloating(nn, token.Start) + io.WriteString(p.w, "eval") - p.printFreeFloating(nn, token.Eval) - io.WriteString(p.w, "(") + + if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Expr) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Expr.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.printFreeFloating(nn, token.End) } @@ -1570,7 +1581,6 @@ func (p *Printer) printExprExit(n ast.Vertex) { } else { io.WriteString(p.w, "exit") } - p.printFreeFloating(nn, token.Exit) if nn.Expr != nil && nn.Expr.GetNode().Tokens.IsEmpty() && nn.GetNode().Tokens.IsEmpty() { io.WriteString(p.w, " ") @@ -2163,11 +2173,17 @@ func (p *Printer) printStmtAltSwitch(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "switch") - p.printFreeFloating(nn, token.Switch) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } + p.printFreeFloating(nn, token.Cond) io.WriteString(p.w, ":") @@ -2192,11 +2208,17 @@ func (p *Printer) printStmtAltWhile(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "while") - p.printFreeFloating(nn, token.While) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } + p.printFreeFloating(nn, token.Cond) io.WriteString(p.w, ":") @@ -2543,11 +2565,17 @@ func (p *Printer) printStmtDo(n ast.Vertex) { p.printFreeFloating(nn, token.Stmts) io.WriteString(p.w, "while") - p.printFreeFloating(nn, token.While) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } + p.printFreeFloating(nn, token.Cond) p.printFreeFloating(nn, token.SemiColon) @@ -2587,11 +2615,16 @@ func (p *Printer) printStmtElseif(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "elseif") - p.printFreeFloating(nn, token.ElseIf) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.Print(nn.Stmt) @@ -2794,11 +2827,16 @@ func (p *Printer) printStmtIf(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "if") - p.printFreeFloating(n, token.If) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(n, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.Print(nn.Stmt) @@ -3020,11 +3058,16 @@ func (p *Printer) printStmtSwitch(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "switch") - p.printFreeFloating(nn, token.Switch) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.printFreeFloating(nn.CaseList, token.Start) io.WriteString(p.w, "{") @@ -3292,11 +3335,16 @@ func (p *Printer) printStmtWhile(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "while") - p.printFreeFloating(nn, token.While) - io.WriteString(p.w, "(") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, "(") + } + p.Print(nn.Cond) - p.printFreeFloating(nn, token.Expr) - io.WriteString(p.w, ")") + + if _, ok := nn.Cond.(*ast.ParserBrackets); !ok { + io.WriteString(p.w, ")") + } p.Print(nn.Stmt) diff --git a/pkg/token/position.go b/pkg/token/position.go index 329f8aa..2ea40d4 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -27,28 +27,19 @@ const ( Namespace Static - Class Use - While For - Switch Foreach Declare Label Finally List Default - If - ElseIf - Else Function Alias Equal - Exit Array Isset - Empty - Eval Echo Try Catch @@ -68,7 +59,6 @@ const ( AdaptationList LexicalVarList - OpenParenthesisToken CloseParenthesisToken ) diff --git a/pkg/token/position_string.go b/pkg/token/position_string.go index 389ec94..ac7c7b5 100644 --- a/pkg/token/position_string.go +++ b/pkg/token/position_string.go @@ -30,52 +30,42 @@ func _() { _ = x[Cond-19] _ = x[Namespace-20] _ = x[Static-21] - _ = x[Class-22] - _ = x[Use-23] - _ = x[While-24] - _ = x[For-25] - _ = x[Switch-26] - _ = x[Foreach-27] - _ = x[Declare-28] - _ = x[Label-29] - _ = x[Finally-30] - _ = x[List-31] - _ = x[Default-32] - _ = x[If-33] - _ = x[ElseIf-34] - _ = x[Else-35] - _ = x[Function-36] - _ = x[Alias-37] - _ = x[Equal-38] - _ = x[Exit-39] - _ = x[Array-40] - _ = x[Isset-41] - _ = x[Empty-42] - _ = x[Eval-43] - _ = x[Echo-44] - _ = x[Try-45] - _ = x[Catch-46] - _ = x[Unset-47] - _ = x[Stmts-48] - _ = x[VarList-49] - _ = x[ConstList-50] - _ = x[NameList-51] - _ = x[ParamList-52] - _ = x[ModifierList-53] - _ = x[ArrayPairList-54] - _ = x[CaseListStart-55] - _ = x[CaseListEnd-56] - _ = x[PropertyList-57] - _ = x[ParameterList-58] - _ = x[AdaptationList-59] - _ = x[LexicalVarList-60] - _ = x[OpenParenthesisToken-61] - _ = x[CloseParenthesisToken-62] + _ = x[Use-22] + _ = x[For-23] + _ = x[Foreach-24] + _ = x[Declare-25] + _ = x[Label-26] + _ = x[Finally-27] + _ = x[List-28] + _ = x[Default-29] + _ = x[Function-30] + _ = x[Alias-31] + _ = x[Equal-32] + _ = x[Array-33] + _ = x[Isset-34] + _ = x[Echo-35] + _ = x[Try-36] + _ = x[Catch-37] + _ = x[Unset-38] + _ = x[Stmts-39] + _ = x[VarList-40] + _ = x[ConstList-41] + _ = x[NameList-42] + _ = x[ParamList-43] + _ = x[ModifierList-44] + _ = x[ArrayPairList-45] + _ = x[CaseListStart-46] + _ = x[CaseListEnd-47] + _ = x[PropertyList-48] + _ = x[ParameterList-49] + _ = x[AdaptationList-50] + _ = x[LexicalVarList-51] + _ = x[CloseParenthesisToken-52] } -const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondNamespaceStaticClassUseWhileForSwitchForeachDeclareLabelFinallyListDefaultIfElseIfElseFunctionAliasEqualExitArrayIssetEmptyEvalEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndPropertyListParameterListAdaptationListLexicalVarListOpenParenthesisTokenCloseParenthesisToken" +const _Position_name = "StartEndSemiColonAltEndAmpersandNameKeyVarReturnTypeCaseSeparatorLexicalVarsParamsRefCastExprInitExprCondExprIncExprTrueCondNamespaceStaticUseForForeachDeclareLabelFinallyListDefaultFunctionAliasEqualArrayIssetEchoTryCatchUnsetStmtsVarListConstListNameListParamListModifierListArrayPairListCaseListStartCaseListEndPropertyListParameterListAdaptationListLexicalVarListCloseParenthesisToken" -var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 133, 139, 144, 147, 152, 155, 161, 168, 175, 180, 187, 191, 198, 200, 206, 210, 218, 223, 228, 232, 237, 242, 247, 251, 255, 258, 263, 268, 273, 280, 289, 297, 306, 318, 331, 344, 355, 367, 380, 394, 408, 428, 449} +var _Position_index = [...]uint16{0, 5, 8, 17, 23, 32, 36, 39, 42, 52, 65, 76, 82, 85, 89, 93, 101, 109, 116, 120, 124, 133, 139, 142, 145, 152, 159, 164, 171, 175, 182, 190, 195, 200, 205, 210, 214, 217, 222, 227, 232, 239, 248, 256, 265, 277, 290, 303, 314, 326, 339, 353, 367, 388} func (i Position) String() string { if i < 0 || i >= Position(len(_Position_index)-1) { From 97747c5ac093dbc525b19a183b827d53c5e694fe Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Mon, 17 Aug 2020 20:31:04 +0300 Subject: [PATCH 045/140] [refactoring] remove scanner token --- internal/php5/parser.go | 31 +- internal/php5/parser_test.go | 774 +++++--- internal/php5/php5.go | Bin 327033 -> 301917 bytes internal/php5/php5.y | 2314 +++++++---------------- internal/php5/php5_bench_test.go | 2 +- internal/php5/php5_test.go | 11 +- internal/php7/parser.go | 31 +- internal/php7/parser_test.go | 846 ++++++--- internal/php7/php7.go | Bin 276863 -> 256975 bytes internal/php7/php7.y | 1909 ++++++------------- internal/php7/php7_bench_test.go | 2 +- internal/php7/php7_test.go | 11 +- internal/position/position.go | 16 +- internal/position/position_test.go | 54 +- internal/scanner/lexer.go | 56 +- internal/scanner/lexer_tokens.go | 145 -- internal/scanner/scanner.go | Bin 411853 -> 412458 bytes internal/scanner/scanner.rl | 402 ++-- internal/scanner/scanner_test.go | 1062 ++++++----- internal/scanner/token.go | 14 - internal/scanner/token_pool.go | 22 - internal/scanner/token_pool_test.go | 34 - internal/scanner/tokenid_string.go | 161 -- pkg/ast/node.go | 4 + pkg/ast/visitor/dump.go | 2 +- pkg/ast/visitor/dump_test.go | 4 +- pkg/ast/visitor/filter_tokens.go | 14 + pkg/parser/parser.go | 2 +- pkg/position/pool.go | 29 + pkg/printer/printer_parsed_php5_test.go | 2 +- pkg/printer/printer_parsed_php7_test.go | 4 +- pkg/printer/printer_test.go | 4 +- pkg/token/pool.go | 29 + pkg/token/pool_bench_test.go | 173 ++ pkg/token/position.go | 2 +- pkg/token/token.go | 13 +- 36 files changed, 3396 insertions(+), 4783 deletions(-) delete mode 100644 internal/scanner/lexer_tokens.go delete mode 100644 internal/scanner/token.go delete mode 100644 internal/scanner/token_pool.go delete mode 100644 internal/scanner/token_pool_test.go delete mode 100644 internal/scanner/tokenid_string.go create mode 100644 pkg/ast/visitor/filter_tokens.go create mode 100644 pkg/position/pool.go create mode 100644 pkg/token/pool.go create mode 100644 pkg/token/pool_bench_test.go diff --git a/internal/php5/parser.go b/internal/php5/parser.go index 1fe5085..5b06343 100644 --- a/internal/php5/parser.go +++ b/internal/php5/parser.go @@ -12,7 +12,7 @@ import ( // Parser structure type Parser struct { Lexer *scanner.Lexer - currentToken *scanner.Token + currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) } @@ -40,8 +40,7 @@ func (p *Parser) Error(msg string) { return } - var pos = p.currentToken.Position - p.errHandlerFunc(errors.NewError(msg, &pos)) + p.errHandlerFunc(errors.NewError(msg, p.currentToken.Position)) } // Parse the php7 Parser entrypoint @@ -82,7 +81,7 @@ func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { delete(src.GetNode().Tokens, token.Start) } -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -98,7 +97,7 @@ func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []to } } -func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -108,14 +107,14 @@ func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, token *dstCollection = make(token.Collection) } - (*dstCollection)[pos] = make([]token.Token, 0) + (*dstCollection)[pos] = make([]*token.Token, 0) for _, v := range tokens { (*dstCollection)[pos] = append((*dstCollection)[pos], v) } } -func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -141,7 +140,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - p.setFreeFloatingTokens(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloatingTokens(prevNode, token.SemiColon, []*token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -155,28 +154,18 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. tlen = 3 } - phpCloseTag := []token.Token{} + phpCloseTag := []*token.Token{} if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, token.Token{ + phpCloseTag = append(phpCloseTag, &token.Token{ ID: token.T_WHITESPACE, Value: semiColon[0].Value[1 : vlen-tlen], }) } - phpCloseTag = append(phpCloseTag, token.Token{ + phpCloseTag = append(phpCloseTag, &token.Token{ ID: T_CLOSE_TAG, Value: semiColon[0].Value[vlen-tlen:], }) p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } - -func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { - for i := 1; i < len(yyDollar); i++ { - if yyDollar[i].token != nil { - p.Lexer.ReturnTokenToPool(yyDollar[i].token) - } - yyDollar[i].token = nil - } - yyVAL.token = nil -} diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index a33aa36..bc6d43c 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -60,11 +60,12 @@ func TestIdentifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -844,11 +845,12 @@ func TestPhp5ArgumentNode(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1658,11 +1660,12 @@ func TestPhp5ParameterNode(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1681,11 +1684,12 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1760,11 +1764,12 @@ func TestName(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1837,11 +1842,12 @@ func TestFullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1914,11 +1920,12 @@ func TestRelative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1994,11 +2001,12 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2072,11 +2080,12 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2161,11 +2170,12 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2260,11 +2270,12 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2370,11 +2381,12 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2448,11 +2460,12 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2547,11 +2560,12 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2656,11 +2670,12 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2749,11 +2764,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2842,11 +2858,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2903,11 +2920,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2950,11 +2968,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3011,11 +3030,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3057,11 +3077,12 @@ func TestScalarMagicConstant(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3102,11 +3123,12 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3147,11 +3169,12 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3192,11 +3215,12 @@ func TestScalarNumber_Float(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3237,11 +3261,12 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3282,11 +3307,12 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3327,11 +3353,12 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3372,11 +3399,12 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3417,11 +3445,12 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3462,11 +3491,12 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3509,11 +3539,12 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3554,11 +3585,12 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3601,11 +3633,12 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3672,11 +3705,12 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3786,11 +3820,12 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3877,11 +3912,12 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4056,11 +4092,12 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4179,11 +4216,12 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4259,11 +4297,12 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4409,11 +4448,12 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4513,11 +4553,12 @@ func TestStmtClassMethod_Php5ClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4629,11 +4670,12 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4675,11 +4717,12 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4734,11 +4777,12 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4826,11 +4870,12 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4920,11 +4965,12 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5037,11 +5083,12 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5137,11 +5184,12 @@ func TestStmtConstList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5204,11 +5252,12 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5282,11 +5331,12 @@ func TestStmtContinue_Light(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5360,11 +5410,12 @@ func TestStmtContinue(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5438,11 +5489,12 @@ func TestStmtDeclare(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5549,11 +5601,12 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5629,11 +5682,12 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5685,11 +5739,12 @@ func TestStmtDo(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5753,11 +5808,12 @@ func TestStmtEcho(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5810,11 +5866,12 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5855,11 +5912,12 @@ func TestStmtExpression(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6052,11 +6110,12 @@ func TestStmtFor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6174,11 +6233,12 @@ func TestStmtFor_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6261,11 +6321,12 @@ func TestStmtForeach(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6338,11 +6399,12 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6425,11 +6487,12 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6533,11 +6596,12 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6631,11 +6695,12 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6749,11 +6814,12 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6879,11 +6945,12 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6926,11 +6993,12 @@ func TestStmtFunction(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6984,11 +7052,12 @@ func TestStmtFunction_Return(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7149,11 +7218,12 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7218,11 +7288,12 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7275,11 +7346,12 @@ func TestStmtGlobal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7437,11 +7509,12 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7503,11 +7576,12 @@ func TestStmtGotoLabel(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7537,11 +7611,12 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7603,11 +7678,12 @@ func TestStmtIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7713,11 +7789,12 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7800,11 +7877,12 @@ func TestStmtIf_Else(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7973,11 +8051,12 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8156,11 +8235,12 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8201,11 +8281,12 @@ func TestStmtInlineHtml(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8247,11 +8328,12 @@ func TestStmtInterface(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8328,11 +8410,12 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8432,11 +8515,12 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8489,11 +8573,12 @@ func TestStmtNamespace(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8547,11 +8632,12 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8582,11 +8668,12 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8685,11 +8772,12 @@ func TestStmtProperty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8841,11 +8929,12 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8997,11 +9086,12 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9064,11 +9154,12 @@ func TestStmtStaticVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9173,11 +9264,12 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9282,11 +9374,12 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9410,11 +9503,12 @@ func TestStmtSwitch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9538,11 +9632,12 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9656,11 +9751,12 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9762,11 +9858,12 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9817,11 +9914,12 @@ func TestStmtThrow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9863,11 +9961,12 @@ func TestStmtTrait(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9955,11 +10054,12 @@ func TestStmtTraitUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10070,11 +10170,12 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10185,11 +10286,12 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10344,11 +10446,12 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10514,11 +10617,12 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10798,11 +10902,12 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10836,11 +10941,12 @@ func TestStmtTry_Try(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10932,11 +11038,12 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11085,11 +11192,12 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11192,11 +11300,12 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11400,11 +11509,12 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11457,11 +11567,12 @@ func TestStmtUnset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11535,11 +11646,12 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11614,11 +11726,12 @@ func TestStmtUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11693,11 +11806,12 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11783,11 +11897,12 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11895,11 +12010,12 @@ func TestStmtUse_List(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12018,11 +12134,12 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12151,11 +12268,12 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12306,11 +12424,12 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12440,11 +12559,12 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12595,11 +12715,12 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12662,11 +12783,12 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12740,11 +12862,12 @@ func TestStmtBreak_Light(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12818,11 +12941,12 @@ func TestStmtBreak(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12896,11 +13020,12 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12993,11 +13118,12 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13038,11 +13164,12 @@ func TestExprArray(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13105,11 +13232,12 @@ func TestExprArray_Item(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13225,11 +13353,12 @@ func TestExprArray_Items(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13290,11 +13419,12 @@ func TestExprBitwiseNot(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13355,11 +13485,12 @@ func TestExprBooleanNot(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13433,11 +13564,12 @@ func TestExprClassConstFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13499,11 +13631,12 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13564,11 +13697,12 @@ func TestExprClone_Brackets(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13629,11 +13763,12 @@ func TestExprClone(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13676,11 +13811,12 @@ func TestExprClosure(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13851,11 +13987,12 @@ func TestExprClosure_Use(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14026,11 +14163,12 @@ func TestExprClosure_Use2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14093,11 +14231,12 @@ func TestExprConstFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14160,11 +14299,12 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14227,11 +14367,12 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14292,11 +14433,12 @@ func TestExprEmpty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14357,11 +14499,12 @@ func TestExprErrorSuppress(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14422,11 +14565,12 @@ func TestExprEval(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14467,11 +14611,12 @@ func TestExprExit(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14512,11 +14657,12 @@ func TestExprExit_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14578,11 +14724,12 @@ func TestExprExit_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14623,11 +14770,12 @@ func TestExprDie(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14668,11 +14816,12 @@ func TestExprDie_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14734,11 +14883,12 @@ func TestExprDie_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14811,11 +14961,12 @@ func TestExprFunctionCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14888,11 +15039,12 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14990,11 +15142,12 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15110,11 +15263,12 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15243,11 +15397,12 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15308,11 +15463,12 @@ func TestExprPostDec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15373,11 +15529,12 @@ func TestExprPostInc(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15438,11 +15595,12 @@ func TestExprPreDec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15503,11 +15661,12 @@ func TestExprPreInc(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15568,11 +15727,12 @@ func TestExprInclude(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15633,11 +15793,12 @@ func TestExprInclude_Once(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15698,11 +15859,12 @@ func TestExprRequire(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15763,11 +15925,12 @@ func TestExprRequire_Once(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15851,11 +16014,12 @@ func TestExprInstanceOf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15939,11 +16103,12 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16027,11 +16192,12 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16094,11 +16260,12 @@ func TestExprIsset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16182,11 +16349,12 @@ func TestExprIsset_Variables(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16258,11 +16426,12 @@ func TestExprList_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16366,11 +16535,12 @@ func TestExprList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16484,11 +16654,12 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16614,11 +16785,12 @@ func TestExprList_List(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16723,11 +16895,12 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16834,11 +17007,12 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16920,11 +17094,12 @@ func TestExprMethodCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16987,11 +17162,12 @@ func TestExprNew(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17064,11 +17240,12 @@ func TestExprNew_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17141,11 +17318,12 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17206,11 +17384,12 @@ func TestExprPrint(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17282,11 +17461,12 @@ func TestExprPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17401,11 +17581,12 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17479,11 +17660,12 @@ func TestExprShellExec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17524,11 +17706,12 @@ func TestExprShortArray(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17591,11 +17774,12 @@ func TestExprShortArray_Item(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17711,11 +17895,12 @@ func TestExprShortArray_Items(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17799,11 +17984,12 @@ func TestExprStaticCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17887,11 +18073,12 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17975,11 +18162,12 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18073,11 +18261,12 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18169,11 +18358,12 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18257,11 +18447,12 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18345,11 +18536,12 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18433,11 +18625,12 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18540,11 +18733,12 @@ func TestExprTernary(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18626,11 +18820,12 @@ func TestExprTernary_Simple(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18785,11 +18980,12 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18944,11 +19140,12 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19009,11 +19206,12 @@ func TestExprUnaryMinus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19074,11 +19272,12 @@ func TestExprUnaryPlus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19129,11 +19328,12 @@ func TestExprVariable(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19194,11 +19394,12 @@ func TestExprVariable_Variable(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19238,11 +19439,12 @@ func TestExprYield(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19303,11 +19505,12 @@ func TestExprYield_Val(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19389,11 +19592,12 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19444,11 +19648,12 @@ func TestExprYield_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19520,11 +19725,12 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19608,11 +19814,12 @@ func TestExprAssign_Assign(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19694,11 +19901,12 @@ func TestExprAssign_Reference(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19792,11 +20000,12 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19935,11 +20144,12 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20021,11 +20231,12 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20107,11 +20318,12 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20193,11 +20405,12 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20279,11 +20492,12 @@ func TestExprAssign_Concat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20365,11 +20579,12 @@ func TestExprAssign_Div(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20451,11 +20666,12 @@ func TestExprAssign_Minus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20537,11 +20753,12 @@ func TestExprAssign_Mod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20623,11 +20840,12 @@ func TestExprAssign_Mul(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20709,11 +20927,12 @@ func TestExprAssign_Plus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20795,11 +21014,12 @@ func TestExprAssign_Pow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20881,11 +21101,12 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20967,11 +21188,12 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21055,11 +21277,12 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21141,11 +21364,12 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21227,11 +21451,12 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21313,11 +21538,12 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21399,11 +21625,12 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21485,11 +21712,12 @@ func TestExprBinary_Concat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21571,11 +21799,12 @@ func TestExprBinary_Div(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21657,11 +21886,12 @@ func TestExprBinary_Equal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21743,11 +21973,12 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21829,11 +22060,12 @@ func TestExprBinary_Greater(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21915,11 +22147,12 @@ func TestExprBinary_Identical(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22001,11 +22234,12 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22087,11 +22321,12 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22173,11 +22408,12 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22259,11 +22495,12 @@ func TestExprBinary_Minus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22345,11 +22582,12 @@ func TestExprBinary_Mod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22431,11 +22669,12 @@ func TestExprBinary_Mul(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22517,11 +22756,12 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22603,11 +22843,12 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22689,11 +22930,12 @@ func TestExprBinary_Plus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22775,11 +23017,12 @@ func TestExprBinary_Pow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22861,11 +23104,12 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22947,11 +23191,12 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23033,11 +23278,12 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23119,11 +23365,12 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23186,11 +23433,12 @@ func TestExprCast_Array(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23251,11 +23499,12 @@ func TestExprCast_Bool(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23316,11 +23565,12 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23381,11 +23631,12 @@ func TestExprCast_Double(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23446,11 +23697,12 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23511,11 +23763,12 @@ func TestExprCast_Int(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23576,11 +23829,12 @@ func TestExprCast_IntShort(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23641,11 +23895,12 @@ func TestExprCast_Object(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23706,11 +23961,12 @@ func TestExprCast_String(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23771,11 +24027,12 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23836,10 +24093,11 @@ func TestExprCast_Unset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 1134714ebd42dc839c0eee38c41e5b3f83393e2b..f05d4520c2db1614610b9a406fafb5cd28d64c81 100644 GIT binary patch delta 24427 zcmb_kd3;nw^8a+d#}No5+;}4t?S&APMFkUZvZy~8im-ImFgk6;5?VEJ?GPgVXjW#YKW&$Z`wHa3I4KxpohO~sQ<**ly{7xLsP zff{jfGpI{<)_}IOV81pQFmXb0@wl-AWv6Lv@Z-!HabreL8<#@s`bE4UCAMU>;z95B*}jdZQI~X<#C_RxPb=1u%2U~IwIT+gHm#Un z5i!4*(TWXV)%5SQ%+K1A?+i2P;uS2-(`{6m?nZ6zU>TH{4q4<-ESrvZH8W^uSi|TO zMg~pJuqcv=ZQ>c!qBZl$4$0&nWHzJ1doax6*6e3z^ezvWSJSQorb(lw@WjNd;q8?w z+uPEOn$A)k;yKe<)6|H0wQt|PjryT#t@W`V!X+CL{)guG-JU3Z z_hx~gKi^2MlBfHg zgxDM&DMX*zg z2UCabXfIsKuAqd)tTy#I!{QtnvG{V8+tL2~DD5>U&?3^L5UW8?UCp2LsO6?YO~Hb6 zuosL$?pHeYM_!j2cY&(Z{Bm=oMfSH=b7vR!F_m@2Z*_J@%W$TSVFrZ% zp~mzc31|B1;iRaTVaZXpx@p9w4Bw1dbZ`N0Lggc{(bhLKlj(Rj9-trk$zuT`vw*W@ zlBmP=AWB?k)D2V2Q~fn1t?J1F0wl{XQ!V{(kSo#EOlHphx3p53u%-9n{5?BV%4zT9 z|3*h|55w5o$C*iVzCY~bn{K?8RFh{t;zvjc=V7pe<033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>)BB%TTDWmYYPI(i-n}+mwbQNxM!4 z4sudiBz!S_44fyQ40ghZ^x%tJnov>jtzxCH|0e8uh&R3xam60kdbmLSO>-SexP6*Vk^x-A(yan~(QFh9EL97Rgl z#cC36fUicN7ZRVxX$}<;a=HBy>VZ;rHF*9(hQkL%qz8Pknfa2re0??6Nk*aUVJx4T z;V<86^`fFur~?GXTL%3PZyv9p>qbJswA9oYkU5NYjK3$8Ryn~sl8j&Sx`}E8775Gb zJ^L+rz;dki+*4-RHx|=}yxuK$4p0=9iv)>!FTi@TIvkgZ%X`t~qGx79__a6Itjhav z##Fq6OTX)^sg^-||CLkK@D!iF5Xs#j1B4CBt&(Io_xIbK$gyW4mQ1$-h8f#e-=XkW zQK64NdWUtyKp8!JrxOQlBC#vPp6v?VhG7rh!PnC$Li61F~^aa+6oG?ttdZh>z2Gmi zErS~1ZL<|NEs8>e1=i^E1ifjl0~%fNGW4E%uT{H)fTq=fa5ho#fB*jzX z{IPjfJp=i8X}%(qr!BDFN}jDx+^-;G9g;k}`NH4L-HnOSZjr*W3m3fnkwr!`ty)|I zYENHGZAQmAK zpWpYNGuX9d6^pB7Wr!dSdnSedGrSvd*tpVWm_6O#mbHu~m2f}yL50VBX!0eU!r%H4 GEBe26G5d4? diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 63b1661..d328d44 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -5,17 +5,16 @@ import ( "bytes" "strconv" - "github.com/z7zmey/php-parser/internal/position" - "github.com/z7zmey/php-parser/internal/scanner" - "github.com/z7zmey/php-parser/pkg/ast" - "github.com/z7zmey/php-parser/pkg/token" + "github.com/z7zmey/php-parser/internal/position" + "github.com/z7zmey/php-parser/pkg/ast" + "github.com/z7zmey/php-parser/pkg/token" ) %} %union{ node ast.Vertex - token *scanner.Token + token *token.Token list []ast.Vertex simpleIndirectReference simpleIndirectReference @@ -25,7 +24,6 @@ import ( ClosureUse *ast.ExprClosureUse } -%type $unk %token T_INCLUDE %token T_INCLUDE_ONCE %token T_EXIT @@ -278,9 +276,7 @@ start: yylex.(*Parser).rootNode = &ast.Root{ast.Node{}, $1} yylex.(*Parser).rootNode.GetNode().Position = position.NewNodeListPosition($1) - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.SkippedTokens) } ; @@ -295,14 +291,10 @@ top_statement_list: if $2 != nil { $$ = append($1, $2) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -316,9 +308,7 @@ namespace_name: namePart.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.SkippedTokens) } | namespace_name T_NS_SEPARATOR T_STRING { @@ -329,10 +319,8 @@ namespace_name: namePart.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.SkippedTokens) } ; @@ -341,26 +329,18 @@ top_statement: { // error $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { @@ -370,10 +350,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.Tokens, append($3.Tokens, $4.Tokens...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) } | T_NAMESPACE namespace_name ';' { @@ -385,11 +363,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { @@ -401,11 +377,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.SkippedTokens) } | T_NAMESPACE '{' top_statement_list '}' { @@ -415,11 +389,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } | T_USE use_declarations ';' { @@ -431,10 +403,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_USE T_FUNCTION use_function_declarations ';' { @@ -450,11 +420,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) } | T_USE T_CONST use_const_declarations ';' { @@ -470,11 +438,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(identifier, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) } | constant_declaration ';' { @@ -484,10 +450,8 @@ top_statement: $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } ; @@ -497,15 +461,11 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | use_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -518,8 +478,6 @@ use_declaration: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { @@ -535,10 +493,8 @@ use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -552,9 +508,7 @@ use_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { @@ -572,11 +526,9 @@ use_declaration: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.SkippedTokens) } ; @@ -586,15 +538,11 @@ use_function_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | use_function_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -607,8 +555,6 @@ use_function_declaration: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { @@ -624,10 +570,8 @@ use_function_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -641,9 +585,7 @@ use_function_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { @@ -661,11 +603,9 @@ use_function_declaration: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.SkippedTokens) } ; @@ -675,15 +615,11 @@ use_const_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | use_const_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -696,8 +632,6 @@ use_const_declaration: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { @@ -713,10 +647,8 @@ use_const_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -730,9 +662,7 @@ use_const_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_AS T_STRING { @@ -750,11 +680,9 @@ use_const_declaration: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.SkippedTokens) } ; @@ -774,11 +702,9 @@ constant_declaration: $$.GetNode().Position = position.NewNodeNodeListPosition($1, constList.Consts) // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { @@ -793,11 +719,9 @@ constant_declaration: $$.GetNode().Position = position.NewTokenNodeListPosition($1, constList) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.SkippedTokens) } ; @@ -812,14 +736,10 @@ inner_statement_list: if $2 != nil { $$ = append($1, $2) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -829,26 +749,18 @@ inner_statement: { // error $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { @@ -858,10 +770,8 @@ inner_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.Tokens, append($3.Tokens, $4.Tokens...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) } ; @@ -870,8 +780,6 @@ statement: unticked_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STRING ':' { @@ -883,10 +791,8 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.SkippedTokens) } ; @@ -899,10 +805,8 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) } | T_IF parenthesis_expr statement elseif_list else_single { @@ -918,9 +822,7 @@ unticked_statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { @@ -934,18 +836,16 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.SkippedTokens) if $6 != nil { - yylex.(*Parser).setFreeFloating($6.(*ast.StmtAltElse).Stmt, token.End, append($7.Tokens, $8.Tokens...)) + yylex.(*Parser).setFreeFloating($6.(*ast.StmtAltElse).Stmt, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) } else if len($5) > 0 { - yylex.(*Parser).setFreeFloating($5[len($5)-1].(*ast.StmtAltElseIf).Stmt, token.End, append($7.Tokens, $8.Tokens...)) + yylex.(*Parser).setFreeFloating($5[len($5)-1].(*ast.StmtAltElseIf).Stmt, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) } else { - yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($7.Tokens, $8.Tokens...)) + yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($7.SkippedTokens, $8.SkippedTokens...)) } - yylex.(*Parser).setToken($$, token.SemiColon, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.SemiColon, $8.SkippedTokens) } | T_WHILE parenthesis_expr while_statement { @@ -962,9 +862,7 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DO statement T_WHILE parenthesis_expr ';' { @@ -974,12 +872,10 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($4, token.End, $5.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($4, token.End, $5.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) } | T_FOR '(' for_expr ';' for_expr ';' for_expr ')' for_statement { @@ -1000,13 +896,11 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.SkippedTokens) } | T_SWITCH parenthesis_expr switch_case_list { @@ -1025,9 +919,7 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_BREAK ';' { @@ -1037,11 +929,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_BREAK expr ';' { @@ -1051,11 +941,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_CONTINUE ';' { @@ -1065,11 +953,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_CONTINUE expr ';' { @@ -1079,11 +965,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_RETURN ';' { @@ -1093,11 +977,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_RETURN expr_without_variable ';' { @@ -1107,11 +989,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_RETURN variable ';' { @@ -1121,11 +1001,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | yield_expr ';' { @@ -1136,10 +1014,8 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_GLOBAL global_var_list ';' { @@ -1149,11 +1025,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_STATIC static_var_list ';' { @@ -1163,11 +1037,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_ECHO echo_expr_list ';' { @@ -1177,12 +1049,10 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Echo, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Echo, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_INLINE_HTML { @@ -1192,9 +1062,7 @@ unticked_statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr ';' { @@ -1205,10 +1073,8 @@ unticked_statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_UNSET '(' unset_variables ')' ';' { @@ -1218,13 +1084,11 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $5.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) } | T_FOREACH '(' variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { @@ -1256,15 +1120,13 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) if $6 != nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_FOREACH '(' expr_without_variable T_AS foreach_variable foreach_optional_arg ')' foreach_statement { @@ -1296,15 +1158,13 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) if $6 != nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Key, $6.GetNode().Tokens[token.Key]); delete($6.GetNode().Tokens, token.Key) } - yylex.(*Parser).setFreeFloating($$, token.Var, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $7.SkippedTokens) } | T_DECLARE '(' declare_list ')' declare_statement { @@ -1315,11 +1175,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) } | ';' { @@ -1329,10 +1187,8 @@ unticked_statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | T_TRY '{' inner_statement_list '}' catch_statement finally_statement { @@ -1346,11 +1202,9 @@ unticked_statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } | T_THROW expr ';' { @@ -1360,11 +1214,9 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_GOTO T_STRING ';' { @@ -1376,12 +1228,10 @@ unticked_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } ; @@ -1389,8 +1239,6 @@ catch_statement: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CATCH '(' fully_qualified_class_name T_VARIABLE ')' '{' inner_statement_list '}' additional_catches { @@ -1405,14 +1253,12 @@ catch_statement: catchNode.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.Tokens) - yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(catchNode, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Catch, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Var, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Cond, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating(catchNode, token.Stmts, $8.SkippedTokens) } ; @@ -1420,8 +1266,6 @@ finally_statement: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINALLY '{' inner_statement_list '}' { @@ -1431,11 +1275,9 @@ finally_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } ; @@ -1443,14 +1285,10 @@ additional_catches: non_empty_additional_catches { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1458,14 +1296,10 @@ non_empty_additional_catches: additional_catch { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_additional_catches additional_catch { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1482,14 +1316,12 @@ additional_catch: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Catch, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Cond, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Catch, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Cond, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; @@ -1497,17 +1329,13 @@ unset_variables: unset_variable { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | unset_variables ',' unset_variable { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -1515,8 +1343,6 @@ unset_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1524,8 +1350,6 @@ function_declaration_statement: unticked_function_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1533,8 +1357,6 @@ class_declaration_statement: unticked_class_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1571,19 +1393,17 @@ unticked_function_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Params, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Params, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.SkippedTokens) } ; @@ -1610,11 +1430,9 @@ unticked_class_declaration_statement: $$.GetNode().Position = position.NewNodeTokenPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.SkippedTokens) } | interface_entry T_STRING interface_extends_list '{' class_statement_list '}' { @@ -1626,12 +1444,10 @@ unticked_class_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.SkippedTokens) } ; @@ -1645,9 +1461,7 @@ class_entry_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ABSTRACT T_CLASS { @@ -1659,10 +1473,8 @@ class_entry_type: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } | T_TRAIT { @@ -1672,9 +1484,7 @@ class_entry_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FINAL T_CLASS { @@ -1686,10 +1496,8 @@ class_entry_type: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } ; @@ -1697,8 +1505,6 @@ extends_from: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS fully_qualified_class_name { @@ -1708,9 +1514,7 @@ extends_from: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1725,8 +1529,6 @@ interface_extends_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS interface_list { @@ -1736,9 +1538,7 @@ interface_extends_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1746,8 +1546,6 @@ implements_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IMPLEMENTS interface_list { @@ -1757,9 +1555,7 @@ implements_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1767,17 +1563,13 @@ interface_list: fully_qualified_class_name { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | interface_list ',' fully_qualified_class_name { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -1785,17 +1577,13 @@ foreach_optional_arg: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_DOUBLE_ARROW foreach_variable { $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($$, token.Key, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Key, $1.SkippedTokens) } ; @@ -1803,8 +1591,6 @@ foreach_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' variable { @@ -1814,9 +1600,7 @@ foreach_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_LIST '(' assignment_list ')' { @@ -1826,11 +1610,9 @@ foreach_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) } ; @@ -1841,8 +1623,6 @@ for_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOR ';' { @@ -1854,12 +1634,10 @@ for_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1870,8 +1648,6 @@ foreach_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOREACH ';' { @@ -1883,12 +1659,10 @@ foreach_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1900,8 +1674,6 @@ declare_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { @@ -1913,12 +1685,10 @@ declare_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1935,10 +1705,8 @@ declare_list: constant.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(constant, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(constant, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $2.SkippedTokens) } | declare_list ',' T_STRING '=' static_scalar { @@ -1951,11 +1719,9 @@ declare_list: constant.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) } ; @@ -1971,10 +1737,8 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.SkippedTokens) } | '{' ';' case_list '}' { @@ -1986,11 +1750,9 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.SkippedTokens) } | ':' case_list T_ENDSWITCH ';' { @@ -2002,12 +1764,10 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } | ':' ';' case_list T_ENDSWITCH ';' { @@ -2020,13 +1780,11 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) } ; @@ -2035,8 +1793,6 @@ case_list: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_CASE expr case_separator inner_statement_list { @@ -2047,11 +1803,9 @@ case_list: _case.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.Tokens) - yylex.(*Parser).setToken(_case, token.CaseSeparator, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, $4.SkippedTokens) + yylex.(*Parser).setToken(_case, token.CaseSeparator, $4.SkippedTokens) } | case_list T_DEFAULT case_separator inner_statement_list { @@ -2062,11 +1816,9 @@ case_list: _default.GetNode().Position = position.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) - yylex.(*Parser).setToken(_default, token.CaseSeparator, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.SkippedTokens) + yylex.(*Parser).setToken(_default, token.CaseSeparator, $3.SkippedTokens) } ; @@ -2090,8 +1842,6 @@ while_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDWHILE ';' { @@ -2103,12 +1853,10 @@ while_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -2118,8 +1866,6 @@ elseif_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | elseif_list T_ELSEIF parenthesis_expr statement { @@ -2130,9 +1876,7 @@ elseif_list: _elseIf.GetNode().Position = position.NewTokenNodePosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) } ; @@ -2141,8 +1885,6 @@ new_elseif_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { @@ -2157,10 +1899,8 @@ new_elseif_list: _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $4.SkippedTokens) } ; @@ -2169,8 +1909,6 @@ else_single: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE statement { @@ -2180,9 +1918,7 @@ else_single: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2191,8 +1927,6 @@ new_else_single: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELSE ':' inner_statement_list { @@ -2206,10 +1940,8 @@ new_else_single: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $2.SkippedTokens) } ; @@ -2218,14 +1950,10 @@ parameter_list: non_empty_parameter_list { $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2233,17 +1961,13 @@ non_empty_parameter_list: parameter { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_parameter_list ',' parameter { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2256,18 +1980,18 @@ parameter: var variable ast.Vertex variable = &ast.ExprVariable{ast.Node{}, identifier} variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) if $3 != nil { variable = &ast.Variadic{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($3, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } if $2 != nil { variable = &ast.Reference{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($2, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } $$ = &ast.Parameter{ast.Node{}, $1, variable, nil} @@ -2281,8 +2005,6 @@ parameter: } else { $$.GetNode().Position = position.NewTokenPosition($4) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | optional_class_type is_reference is_variadic T_VARIABLE '=' static_scalar { @@ -2292,19 +2014,19 @@ parameter: var variable ast.Vertex variable = &ast.ExprVariable{ast.Node{}, identifier} variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.End, $5.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.End, $5.SkippedTokens) if $3 != nil { variable = &ast.Variadic{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($3, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } if $2 != nil { variable = &ast.Reference{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($2, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } $$ = &ast.Parameter{ast.Node{}, $1, variable, $6} @@ -2318,8 +2040,6 @@ parameter: } else { $$.GetNode().Position = position.NewTokenNodePosition($4, $6) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2328,8 +2048,6 @@ optional_class_type: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ARRAY { @@ -2339,9 +2057,7 @@ optional_class_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CALLABLE { @@ -2351,15 +2067,11 @@ optional_class_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | fully_qualified_class_name { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2373,10 +2085,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) } | '(' non_empty_function_call_parameter_list ')' { @@ -2386,10 +2096,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | '(' yield_expr ')' { @@ -2401,10 +2109,8 @@ function_call_parameter_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -2413,17 +2119,13 @@ non_empty_function_call_parameter_list: function_call_parameter { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_function_call_parameter_list ',' function_call_parameter { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2437,8 +2139,6 @@ function_call_parameter: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable { @@ -2449,8 +2149,6 @@ function_call_parameter: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' w_variable { @@ -2460,9 +2158,7 @@ function_call_parameter: $$.GetNode().Position = position.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ELLIPSIS expr { @@ -2472,9 +2168,7 @@ function_call_parameter: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2484,15 +2178,11 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | global_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2508,9 +2198,7 @@ global_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' r_variable { @@ -2520,9 +2208,7 @@ global_var: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' '{' expr '}' { @@ -2532,11 +2218,9 @@ global_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.SkippedTokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.SkippedTokens...)) } ; @@ -2555,10 +2239,8 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.SkippedTokens) } | static_var_list ',' T_VARIABLE '=' static_scalar { @@ -2573,11 +2255,9 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $4.SkippedTokens) } | T_VARIABLE { @@ -2592,9 +2272,7 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' static_scalar { @@ -2609,10 +2287,8 @@ static_var_list: staticVar.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(staticVar, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(staticVar, token.Var, $2.SkippedTokens) } ; @@ -2621,14 +2297,10 @@ class_statement_list: class_statement_list class_statement { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2643,10 +2315,8 @@ class_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | class_constant_declaration ';' { @@ -2656,16 +2326,12 @@ class_statement: $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | trait_use_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | method_modifiers function is_reference T_STRING '(' parameter_list ')' method_body { @@ -2683,20 +2349,18 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $7.SkippedTokens) } ; @@ -2709,9 +2373,7 @@ trait_use_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2719,17 +2381,13 @@ trait_list: fully_qualified_class_name { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_list ',' fully_qualified_class_name { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2741,10 +2399,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | '{' trait_adaptation_list '}' { @@ -2753,10 +2409,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.SkippedTokens) } ; @@ -2764,14 +2418,10 @@ trait_adaptation_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2779,14 +2429,10 @@ non_empty_trait_adaptation_list: trait_adaptation_statement { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_trait_adaptation_list trait_adaptation_statement { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2796,20 +2442,16 @@ trait_adaptation_statement: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | trait_alias ';' { $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } ; @@ -2823,9 +2465,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } ; @@ -2833,17 +2473,13 @@ trait_reference_list: fully_qualified_class_name { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_reference_list ',' fully_qualified_class_name { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2858,15 +2494,11 @@ trait_method_reference: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | trait_method_reference_fully_qualified { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2882,10 +2514,8 @@ trait_method_reference_fully_qualified: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.SkippedTokens) } ; @@ -2901,10 +2531,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.SkippedTokens) } | trait_method_reference T_AS member_modifier { @@ -2915,9 +2543,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } ; @@ -2925,14 +2551,10 @@ trait_modifiers: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | member_modifier { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2945,10 +2567,8 @@ method_body: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | '{' inner_statement_list '}' { @@ -2958,10 +2578,8 @@ method_body: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) } ; @@ -2969,8 +2587,6 @@ variable_modifiers: non_empty_member_modifiers { $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VAR { @@ -2981,9 +2597,7 @@ variable_modifiers: modifier.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.SkippedTokens) } ; @@ -2991,14 +2605,10 @@ method_modifiers: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3006,14 +2616,10 @@ non_empty_member_modifiers: member_modifier { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers member_modifier { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3026,9 +2632,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PROTECTED { @@ -3038,9 +2642,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PRIVATE { @@ -3050,9 +2652,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_STATIC { @@ -3062,9 +2662,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ABSTRACT { @@ -3074,9 +2672,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FINAL { @@ -3086,9 +2682,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -3106,10 +2700,8 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.SkippedTokens) } | class_variable_declaration ',' T_VARIABLE '=' static_scalar { @@ -3124,11 +2716,9 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenNodePosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Var, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(property, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $4.SkippedTokens) } | T_VARIABLE { @@ -3143,9 +2733,7 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(property, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(property, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' static_scalar { @@ -3160,10 +2748,8 @@ class_variable_declaration: property.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(property, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(property, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(property, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(property, token.Var, $2.SkippedTokens) } ; @@ -3183,11 +2769,9 @@ class_constant_declaration: $1.GetNode().Position = position.NewNodesPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { @@ -3201,11 +2785,9 @@ class_constant_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(constant, token.Name, $3.SkippedTokens) } ; @@ -3215,15 +2797,11 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | expr { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3232,14 +2810,10 @@ for_expr: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_for_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3249,15 +2823,11 @@ non_empty_for_expr: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | expr { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3265,14 +2835,10 @@ chaining_method_or_property: chaining_method_or_property variable_property { $$ = append($1, $2...) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_property { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3286,10 +2852,8 @@ chaining_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.SkippedTokens) } | '[' dim_offset ']' { @@ -3300,10 +2864,8 @@ chaining_dereference: fetch.GetNode().Position = position.NewNodePosition($2) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $3.SkippedTokens) } ; @@ -3311,20 +2873,14 @@ chaining_instance_call: chaining_dereference chaining_method_or_property { $$ = append($1, $2...) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_dereference { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_method_or_property { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3332,14 +2888,10 @@ instance_call: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | chaining_instance_call { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3356,9 +2908,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -3373,12 +2923,10 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) } | variable '=' expr { @@ -3389,9 +2937,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable '=' '&' variable { @@ -3402,10 +2948,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) } | variable '=' '&' T_NEW class_name_reference ctor_arguments { @@ -3428,11 +2972,9 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) - yylex.(*Parser).setFreeFloating(_new, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(_new, token.Start, $4.SkippedTokens) } | T_CLONE expr { @@ -3442,9 +2984,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | variable T_PLUS_EQUAL expr { @@ -3454,9 +2994,7 @@ expr_without_variable: $$.GetNode().Position = position.NewNodesPosition($1, $3) yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MINUS_EQUAL expr { @@ -3467,9 +3005,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MUL_EQUAL expr { @@ -3480,9 +3016,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_POW_EQUAL expr { @@ -3493,9 +3027,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_DIV_EQUAL expr { @@ -3506,9 +3038,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_CONCAT_EQUAL expr { @@ -3519,9 +3049,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MOD_EQUAL expr { @@ -3532,9 +3060,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_AND_EQUAL expr { @@ -3545,9 +3071,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_OR_EQUAL expr { @@ -3558,9 +3082,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_XOR_EQUAL expr { @@ -3571,9 +3093,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_SL_EQUAL expr { @@ -3584,9 +3104,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_SR_EQUAL expr { @@ -3597,9 +3115,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | rw_variable T_INC { @@ -3610,9 +3126,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | T_INC rw_variable { @@ -3622,9 +3136,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | rw_variable T_DEC { @@ -3635,9 +3147,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | T_DEC rw_variable { @@ -3647,9 +3157,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr T_BOOLEAN_OR expr { @@ -3660,9 +3168,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_BOOLEAN_AND expr { @@ -3673,9 +3179,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_OR expr { @@ -3686,9 +3190,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_AND expr { @@ -3699,9 +3201,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_XOR expr { @@ -3712,9 +3212,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '|' expr { @@ -3725,9 +3223,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '&' expr { @@ -3738,9 +3234,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '^' expr { @@ -3751,9 +3245,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '.' expr { @@ -3764,9 +3256,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '+' expr { @@ -3777,9 +3267,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '-' expr { @@ -3790,9 +3278,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '*' expr { @@ -3803,9 +3289,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_POW expr { @@ -3816,9 +3300,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '/' expr { @@ -3829,9 +3311,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '%' expr { @@ -3842,9 +3322,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_SL expr { @@ -3855,9 +3333,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_SR expr { @@ -3868,9 +3344,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | '+' expr %prec T_INC { @@ -3880,9 +3354,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '-' expr %prec T_INC { @@ -3892,9 +3364,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '!' expr { @@ -3904,9 +3374,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '~' expr { @@ -3916,9 +3384,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr T_IS_IDENTICAL expr { @@ -3929,9 +3395,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_NOT_IDENTICAL expr { @@ -3942,9 +3406,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_EQUAL expr { @@ -3955,9 +3417,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_NOT_EQUAL expr { @@ -3968,10 +3428,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | expr '<' expr { @@ -3982,9 +3440,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_SMALLER_OR_EQUAL expr { @@ -3995,9 +3451,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '>' expr { @@ -4008,9 +3462,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_GREATER_OR_EQUAL expr { @@ -4021,9 +3473,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_INSTANCEOF class_name_reference { @@ -4034,29 +3484,23 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | parenthesis_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' new_expr ')' instance_call { $$ = $2 // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) for _, n := range($4) { switch nn := n.(type) { @@ -4079,8 +3523,6 @@ expr_without_variable: // save position $$.GetNode().Position = position.NewNodesPosition($$, n) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' expr ':' expr { @@ -4091,10 +3533,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.SkippedTokens) } | expr '?' ':' expr { @@ -4105,16 +3545,12 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.SkippedTokens) } | internal_functions_in_yacc { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INT_CAST expr { @@ -4124,10 +3560,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_DOUBLE_CAST expr { @@ -4137,10 +3571,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_STRING_CAST expr { @@ -4150,10 +3582,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_ARRAY_CAST expr { @@ -4163,10 +3593,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_OBJECT_CAST expr { @@ -4176,10 +3604,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_BOOL_CAST expr { @@ -4189,10 +3615,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_UNSET_CAST expr { @@ -4202,10 +3626,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_EXIT exit_expr { @@ -4223,9 +3645,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '@' expr { @@ -4235,27 +3655,19 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar_offset { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | combined_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '`' backticks_expr '`' { @@ -4265,9 +3677,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PRINT expr { @@ -4277,9 +3687,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD { @@ -4289,9 +3697,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { @@ -4301,23 +3707,21 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.SkippedTokens) // normalize if $6 == nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC function is_reference '(' parameter_list ')' lexical_vars '{' inner_statement_list '}' { @@ -4327,24 +3731,22 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $10) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Static, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Static, $2.SkippedTokens) if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVars, $8.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $10.SkippedTokens) // normalize if $7 == nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVars]); delete($$.GetNode().Tokens, token.LexicalVars) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4357,9 +3759,7 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD variable { @@ -4369,9 +3769,7 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD expr T_DOUBLE_ARROW expr_without_variable { @@ -4381,10 +3779,8 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) } | T_YIELD expr T_DOUBLE_ARROW variable { @@ -4394,10 +3790,8 @@ yield_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) } ; @@ -4410,10 +3804,8 @@ combined_scalar_offset: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | combined_scalar_offset '[' dim_offset ']' { @@ -4423,10 +3815,8 @@ combined_scalar_offset: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | T_CONSTANT_ENCAPSED_STRING '[' dim_offset ']' { @@ -4438,11 +3828,9 @@ combined_scalar_offset: $$.GetNode().Position = position.NewNodeTokenPosition(str, $4) // save comments - yylex.(*Parser).setFreeFloating(str, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(str, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | general_constant '[' dim_offset ']' { @@ -4452,10 +3840,8 @@ combined_scalar_offset: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } ; @@ -4468,11 +3854,9 @@ combined_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) } | '[' array_pair_list ']' { @@ -4482,10 +3866,8 @@ combined_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) } ; @@ -4500,8 +3882,6 @@ lexical_vars: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE '(' lexical_var_list ')' { @@ -4511,11 +3891,9 @@ lexical_vars: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.SkippedTokens) } ; @@ -4531,10 +3909,8 @@ lexical_var_list: variable.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } | lexical_var_list ',' '&' T_VARIABLE { @@ -4549,11 +3925,9 @@ lexical_var_list: reference.GetNode().Position = position.NewTokensPosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) } | T_VARIABLE { @@ -4566,9 +3940,7 @@ lexical_var_list: variable.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(variable, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(variable, token.Start, $1.SkippedTokens) } | '&' T_VARIABLE { @@ -4583,10 +3955,8 @@ lexical_var_list: reference.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(reference, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(reference, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } ; @@ -4599,8 +3969,6 @@ function_call: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodesPosition(name, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name function_call_parameter_list { @@ -4612,10 +3980,8 @@ function_call: $$.GetNode().Position = position.NewNodesPosition(funcName, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(funcName, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name function_call_parameter_list { @@ -4627,9 +3993,7 @@ function_call: $$.GetNode().Position = position.NewNodesPosition(funcName, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { @@ -4640,9 +4004,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { @@ -4653,9 +4015,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_name function_call_parameter_list { @@ -4666,9 +4026,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects function_call_parameter_list { @@ -4679,9 +4037,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_without_objects function_call_parameter_list { @@ -4692,8 +4048,6 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4706,9 +4060,7 @@ class_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | namespace_name { @@ -4716,8 +4068,6 @@ class_name: // save position $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { @@ -4727,10 +4077,8 @@ class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -4740,9 +4088,7 @@ class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -4753,8 +4099,6 @@ fully_qualified_class_name: // save position $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { @@ -4764,10 +4108,8 @@ fully_qualified_class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -4777,9 +4119,7 @@ fully_qualified_class_name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -4787,14 +4127,10 @@ class_name_reference: class_name { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dynamic_class_name_reference { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4804,7 +4140,7 @@ dynamic_class_name_reference: $$ = $1 // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.SkippedTokens) for _, n := range($3) { switch nn := n.(type) { @@ -4837,14 +4173,10 @@ dynamic_class_name_reference: yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | base_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4853,14 +4185,10 @@ dynamic_class_name_variable_properties: dynamic_class_name_variable_properties dynamic_class_name_variable_property { $$ = append($1, $2...) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4871,9 +4199,7 @@ dynamic_class_name_variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.SkippedTokens) } ; @@ -4881,8 +4207,6 @@ exit_expr: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' ')' { @@ -4892,16 +4216,12 @@ exit_expr: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) } | parenthesis_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4909,8 +4229,6 @@ backticks_expr: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE { @@ -4919,14 +4237,10 @@ backticks_expr: // save position part.GetNode().Position = position.NewTokenPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list { $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4934,14 +4248,10 @@ ctor_arguments: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call_parameter_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4954,9 +4264,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DNUMBER { @@ -4966,9 +4274,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CONSTANT_ENCAPSED_STRING { @@ -4978,9 +4284,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_LINE { @@ -4990,9 +4294,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FILE { @@ -5002,9 +4304,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DIR { @@ -5014,9 +4314,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_TRAIT_C { @@ -5026,9 +4324,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_METHOD_C { @@ -5038,9 +4334,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FUNC_C { @@ -5050,9 +4344,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NS_C { @@ -5062,9 +4354,7 @@ common_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { @@ -5076,9 +4366,7 @@ common_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC T_END_HEREDOC { @@ -5088,9 +4376,7 @@ common_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -5106,10 +4392,8 @@ static_class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } ; @@ -5117,8 +4401,6 @@ static_scalar: static_scalar_value { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5126,14 +4408,10 @@ static_scalar_value: common_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_class_name_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { @@ -5143,8 +4421,6 @@ static_scalar_value: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodePosition(name) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { @@ -5156,10 +4432,8 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -5171,9 +4445,7 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ARRAY '(' static_array_pair_list ')' { @@ -5183,11 +4455,9 @@ static_scalar_value: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) } | '[' static_array_pair_list ']' { @@ -5197,16 +4467,12 @@ static_scalar_value: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) } | static_class_constant { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_CLASS_C { @@ -5216,15 +4482,11 @@ static_scalar_value: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | static_operation { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5237,10 +4499,8 @@ static_operation: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | static_scalar_value '+' static_scalar_value { @@ -5251,9 +4511,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '-' static_scalar_value { @@ -5264,9 +4522,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '*' static_scalar_value { @@ -5277,9 +4533,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_POW static_scalar_value { @@ -5290,9 +4544,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '/' static_scalar_value { @@ -5303,9 +4555,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '%' static_scalar_value { @@ -5316,9 +4566,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | '!' static_scalar_value { @@ -5328,9 +4576,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '~' static_scalar_value { @@ -5340,9 +4586,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | static_scalar_value '|' static_scalar_value { @@ -5353,9 +4597,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '&' static_scalar_value { @@ -5366,9 +4608,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '^' static_scalar_value { @@ -5379,9 +4619,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_SL static_scalar_value { @@ -5392,9 +4630,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_SR static_scalar_value { @@ -5405,9 +4641,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '.' static_scalar_value { @@ -5418,9 +4652,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_LOGICAL_XOR static_scalar_value { @@ -5431,9 +4663,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_LOGICAL_AND static_scalar_value { @@ -5444,9 +4674,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_LOGICAL_OR static_scalar_value { @@ -5457,9 +4685,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_BOOLEAN_AND static_scalar_value { @@ -5470,9 +4696,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_BOOLEAN_OR static_scalar_value { @@ -5483,9 +4707,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_IDENTICAL static_scalar_value { @@ -5496,9 +4718,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_NOT_IDENTICAL static_scalar_value { @@ -5509,9 +4729,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_EQUAL static_scalar_value { @@ -5522,9 +4740,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_NOT_EQUAL static_scalar_value { @@ -5535,10 +4751,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | static_scalar_value '<' static_scalar_value { @@ -5549,9 +4763,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '>' static_scalar_value { @@ -5562,9 +4774,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_SMALLER_OR_EQUAL static_scalar_value { @@ -5575,9 +4785,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value T_IS_GREATER_OR_EQUAL static_scalar_value { @@ -5588,9 +4796,7 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | static_scalar_value '?' ':' static_scalar_value { @@ -5601,10 +4807,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.SkippedTokens) } | static_scalar_value '?' static_scalar_value ':' static_scalar_value { @@ -5615,10 +4819,8 @@ static_operation: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.SkippedTokens) } | '+' static_scalar_value { @@ -5628,9 +4830,7 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '-' static_scalar_value { @@ -5640,19 +4840,15 @@ static_operation: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '(' static_scalar_value ')' { $$ = $2 // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) } ; @@ -5660,8 +4856,6 @@ general_constant: class_constant { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name { @@ -5671,8 +4865,6 @@ general_constant: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodePosition(name) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { @@ -5684,10 +4876,8 @@ general_constant: $$.GetNode().Position = position.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -5699,9 +4889,7 @@ general_constant: $$.GetNode().Position = position.NewNodePosition(name) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -5716,27 +4904,19 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | general_constant { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | common_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '"' encaps_list '"' { @@ -5746,9 +4926,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC encaps_list T_END_HEREDOC { @@ -5758,9 +4936,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CLASS_C { @@ -5770,9 +4946,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -5780,8 +4954,6 @@ static_array_pair_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_static_array_pair_list possible_comma { @@ -5789,10 +4961,8 @@ static_array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5817,11 +4987,9 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) } | non_empty_static_array_pair_list ',' static_scalar_value { @@ -5832,10 +5000,8 @@ non_empty_static_array_pair_list: arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_scalar_value T_DOUBLE_ARROW static_scalar_value { @@ -5847,9 +5013,7 @@ non_empty_static_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.SkippedTokens) } | static_scalar_value { @@ -5861,8 +5025,6 @@ non_empty_static_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5870,14 +5032,10 @@ expr: r_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5890,10 +5048,8 @@ parenthesis_expr: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | '(' yield_expr ')' { @@ -5903,10 +5059,8 @@ parenthesis_expr: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -5915,8 +5069,6 @@ r_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5925,8 +5077,6 @@ w_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5934,8 +5084,6 @@ rw_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5950,7 +5098,7 @@ variable: } // save comments - yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.Tokens) + yylex.(*Parser).setFreeFloating($3[0], token.Var, $2.SkippedTokens) for _, n := range($3) { switch nn := n.(type) { @@ -5995,14 +5143,10 @@ variable: yylex.(*Parser).MoveFreeFloating(nn.Var, $$) } } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | base_variable_with_function_calls { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6010,14 +5154,10 @@ variable_properties: variable_properties variable_property { $$ = append($1, $2...) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6033,9 +5173,7 @@ variable_property: $$ = $2 // save comments - yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($2[0], token.Var, $1.SkippedTokens) } ; @@ -6049,10 +5187,8 @@ array_method_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.SkippedTokens) } | method '[' dim_offset ']' { @@ -6063,10 +5199,8 @@ array_method_dereference: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.SkippedTokens) } ; @@ -6077,8 +5211,6 @@ method: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6086,20 +5218,14 @@ method_or_not: method { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_method_dereference { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6107,8 +5233,6 @@ variable_without_objects: reference_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { @@ -6119,8 +5243,6 @@ variable_without_objects: } $$ = $1.all[0] - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6134,9 +5256,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM variable_without_objects { @@ -6147,9 +5267,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -6157,8 +5275,6 @@ variable_class_name: reference_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6171,10 +5287,8 @@ array_function_dereference: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | function_call '[' dim_offset ']' { @@ -6184,10 +5298,8 @@ array_function_dereference: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } ; @@ -6195,20 +5307,14 @@ base_variable_with_function_calls: base_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_function_dereference { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_call { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6217,8 +5323,6 @@ base_variable: reference_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | simple_indirect_reference reference_variable { @@ -6229,14 +5333,10 @@ base_variable: } $$ = $1.all[0] - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_member { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6249,10 +5349,8 @@ reference_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | reference_variable '{' expr '}' { @@ -6262,16 +5360,12 @@ reference_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | compound_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6287,9 +5381,7 @@ compound_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' '{' expr '}' { @@ -6299,11 +5391,9 @@ compound_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.SkippedTokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.SkippedTokens...)) } ; @@ -6311,14 +5401,10 @@ dim_offset: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6327,8 +5413,6 @@ object_property: object_dim_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | variable_without_objects { @@ -6337,8 +5421,6 @@ object_property: // save position fetch.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6352,10 +5434,8 @@ object_dim_list: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.SkippedTokens) } | object_dim_list '{' expr '}' { @@ -6366,10 +5446,8 @@ object_dim_list: fetch.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(fetch, token.Expr, $4.SkippedTokens) } | variable_name { @@ -6378,8 +5456,6 @@ object_dim_list: // save position fetch.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6392,9 +5468,7 @@ variable_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '{' expr '}' { @@ -6404,10 +5478,8 @@ variable_name: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) } ; @@ -6421,9 +5493,7 @@ simple_indirect_reference: n.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(n, token.Start, $1.SkippedTokens) } | simple_indirect_reference '$' { @@ -6438,9 +5508,7 @@ simple_indirect_reference: n.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(n, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(n, token.Start, $2.SkippedTokens) } ; @@ -6454,9 +5522,7 @@ assignment_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | assignment_list_element { @@ -6465,8 +5531,6 @@ assignment_list: } else { $$ = []ast.Vertex{$1} } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6481,8 +5545,6 @@ assignment_list_element: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_LIST '(' assignment_list ')' { @@ -6494,17 +5556,13 @@ assignment_list_element: $$.GetNode().Position = position.NewNodePosition(listNode) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) } | /* empty */ { $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6513,8 +5571,6 @@ array_pair_list: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list possible_comma { @@ -6526,10 +5582,8 @@ array_pair_list: // save comments if $2 != nil { - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -6543,11 +5597,9 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $5) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) } | non_empty_array_pair_list ',' expr { @@ -6558,10 +5610,8 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodePosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW expr { @@ -6573,9 +5623,7 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.SkippedTokens) } | expr { @@ -6587,8 +5635,6 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_array_pair_list ',' expr T_DOUBLE_ARROW '&' w_variable { @@ -6601,12 +5647,10 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewNodesPosition($3, $6) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) yylex.(*Parser).MoveFreeFloating($3, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $5.SkippedTokens) } | non_empty_array_pair_list ',' '&' w_variable { @@ -6619,10 +5663,8 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewTokenNodePosition($3, $4) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $3.SkippedTokens) } | expr T_DOUBLE_ARROW '&' w_variable { @@ -6636,10 +5678,8 @@ non_empty_array_pair_list: // save comments yylex.(*Parser).MoveFreeFloating($1, arrayItem) - yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.SkippedTokens) } | '&' w_variable { @@ -6652,9 +5692,7 @@ non_empty_array_pair_list: arrayItem.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(arrayItem, token.Start, $1.SkippedTokens) } ; @@ -6662,8 +5700,6 @@ encaps_list: encaps_list encaps_var { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list T_ENCAPSED_AND_WHITESPACE { @@ -6674,15 +5710,11 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.SkippedTokens) } | encaps_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE encaps_var { @@ -6693,9 +5725,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.SkippedTokens) } ; @@ -6710,9 +5740,7 @@ encaps_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '[' encaps_var_offset ']' { @@ -6726,10 +5754,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { @@ -6745,10 +5771,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { @@ -6760,10 +5784,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { @@ -6777,10 +5799,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { @@ -6794,22 +5814,18 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setToken(variable, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken(variable, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.SkippedTokens) } | T_CURLY_OPEN variable '}' { $$ = $2; // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -6822,9 +5838,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NUM_STRING { @@ -6839,9 +5853,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE { @@ -6853,9 +5865,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -6868,11 +5878,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $4.SkippedTokens) } | T_EMPTY '(' variable ')' { @@ -6884,11 +5892,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_EMPTY '(' expr ')' { @@ -6900,11 +5906,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_INCLUDE expr { @@ -6914,9 +5918,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_INCLUDE_ONCE expr { @@ -6926,9 +5928,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_EVAL '(' expr ')' { @@ -6940,11 +5940,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_REQUIRE expr { @@ -6954,9 +5952,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_REQUIRE_ONCE expr { @@ -6966,9 +5962,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -6976,17 +5970,13 @@ isset_variables: isset_variable { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | isset_variables ',' isset_variable { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -6994,14 +5984,10 @@ isset_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -7017,10 +6003,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM T_STRING { @@ -7033,10 +6017,8 @@ class_constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } ; @@ -7052,10 +6034,8 @@ static_class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } ; @@ -7071,10 +6051,8 @@ class_name_scalar: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } ; diff --git a/internal/php5/php5_bench_test.go b/internal/php5/php5_bench_test.go index 49efe90..3cbd675 100644 --- a/internal/php5/php5_bench_test.go +++ b/internal/php5/php5_bench_test.go @@ -414,7 +414,7 @@ CAD; ` for n := 0; n < b.N; n++ { - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() } diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index b1a1ada..051917b 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -22212,11 +22212,12 @@ func TestPhp5(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22351,11 +22352,12 @@ func TestPhp5Strings(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22579,11 +22581,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "5.6", false, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() actual := php5parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22606,7 +22609,7 @@ func TestPhp5ControlCharsErrors(t *testing.T) { parserErrors = append(parserErrors, e) } - lexer := scanner.NewLexer([]byte(src), "5.6", false, errorHandlerFunc) + lexer := scanner.NewLexer([]byte(src), "5.6", errorHandlerFunc) php5parser := php5.NewParser(lexer, errorHandlerFunc) php5parser.Parse() assert.DeepEqual(t, expected, parserErrors) diff --git a/internal/php7/parser.go b/internal/php7/parser.go index a910f9c..32f3fa5 100644 --- a/internal/php7/parser.go +++ b/internal/php7/parser.go @@ -12,7 +12,7 @@ import ( // Parser structure type Parser struct { Lexer *scanner.Lexer - currentToken *scanner.Token + currentToken *token.Token rootNode ast.Vertex errHandlerFunc func(*errors.Error) } @@ -39,8 +39,7 @@ func (p *Parser) Error(msg string) { return } - var pos = p.currentToken.Position - p.errHandlerFunc(errors.NewError(msg, &pos)) + p.errHandlerFunc(errors.NewError(msg, p.currentToken.Position)) } // Parse the php7 Parser entrypoint @@ -82,7 +81,7 @@ func (p *Parser) MoveFreeFloating(src ast.Vertex, dst ast.Vertex) { delete(src.GetNode().Tokens, token.Start) } -func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -98,7 +97,7 @@ func (p *Parser) setFreeFloating(dst ast.Vertex, pos token.Position, tokens []to } } -func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -108,14 +107,14 @@ func (p *Parser) setFreeFloatingTokens(dst ast.Vertex, pos token.Position, token *dstCollection = make(token.Collection) } - (*dstCollection)[pos] = make([]token.Token, 0) + (*dstCollection)[pos] = make([]*token.Token, 0) for _, v := range tokens { (*dstCollection)[pos] = append((*dstCollection)[pos], v) } } -func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []token.Token) { +func (p *Parser) setToken(dst ast.Vertex, pos token.Position, tokens []*token.Token) { if len(tokens) == 0 { return } @@ -141,7 +140,7 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. } if semiColon[0].Value[0] == ';' { - p.setFreeFloatingTokens(prevNode, token.SemiColon, []token.Token{ + p.setFreeFloatingTokens(prevNode, token.SemiColon, []*token.Token{ { ID: token.ID(';'), Value: semiColon[0].Value[0:1], @@ -155,28 +154,18 @@ func (p *Parser) splitSemiColonAndPhpCloseTag(htmlNode ast.Vertex, prevNode ast. tlen = 3 } - phpCloseTag := []token.Token{} + phpCloseTag := []*token.Token{} if vlen-tlen > 1 { - phpCloseTag = append(phpCloseTag, token.Token{ + phpCloseTag = append(phpCloseTag, &token.Token{ ID: token.T_WHITESPACE, Value: semiColon[0].Value[1 : vlen-tlen], }) } - phpCloseTag = append(phpCloseTag, token.Token{ + phpCloseTag = append(phpCloseTag, &token.Token{ ID: T_CLOSE_TAG, Value: semiColon[0].Value[vlen-tlen:], }) p.setFreeFloatingTokens(htmlNode, token.Start, append(phpCloseTag, htmlNode.GetNode().Tokens[token.Start]...)) } - -func (p *Parser) returnTokenToPool(yyDollar []yySymType, yyVAL *yySymType) { - for i := 1; i < len(yyDollar); i++ { - if yyDollar[i].token != nil { - p.Lexer.ReturnTokenToPool(yyDollar[i].token) - } - yyDollar[i].token = nil - } - yyVAL.token = nil -} diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 9ef81b7..d909c98 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -60,11 +60,12 @@ func TestIdentifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -955,11 +956,12 @@ func TestPhp7ArgumentNode(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1809,11 +1811,12 @@ func TestPhp7ParameterNode(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1832,11 +1835,12 @@ func TestCommentEndFile(t *testing.T) { Stmts: []ast.Vertex{}, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1911,11 +1915,12 @@ func TestName(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -1988,11 +1993,12 @@ func TestFullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2065,11 +2071,12 @@ func TestRelative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2145,11 +2152,12 @@ func TestScalarEncapsed_SimpleVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2223,11 +2231,12 @@ func TestScalarEncapsed_SimpleVarOneChar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2312,11 +2321,12 @@ func TestScalarEncapsed_SimpleVarEndsEcapsed(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2411,11 +2421,12 @@ func TestScalarEncapsed_StringVarCurveOpen(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2521,11 +2532,12 @@ func TestScalarEncapsed_SimpleVarPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2599,11 +2611,12 @@ func TestScalarEncapsed_DollarOpenCurlyBraces(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2698,11 +2711,12 @@ func TestScalarEncapsed_DollarOpenCurlyBracesDimNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2807,11 +2821,12 @@ func TestScalarEncapsed_CurlyOpenMethodCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2900,11 +2915,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -2993,11 +3009,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3054,11 +3071,12 @@ LBL; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3101,11 +3119,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3162,11 +3181,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3208,11 +3228,12 @@ func TestScalarMagicConstant(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3253,11 +3274,12 @@ func TestScalarNumber_LNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3298,11 +3320,12 @@ func TestScalarNumber_DNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3343,11 +3366,12 @@ func TestScalarNumber_Float(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3388,11 +3412,12 @@ func TestScalarNumber_BinaryLNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3433,11 +3458,12 @@ func TestScalarNumber_BinaryDNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3478,11 +3504,12 @@ func TestScalarNumber_HLNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3523,11 +3550,12 @@ func TestScalarNumber_HDNumber(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3568,11 +3596,12 @@ func TestScalarString_DoubleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3613,11 +3642,12 @@ func TestScalarString_DoubleQuotedScalarStringWithEscapedVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3660,11 +3690,12 @@ func TestScalarString_MultilineDoubleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3705,11 +3736,12 @@ func TestScalarString_SingleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3752,11 +3784,12 @@ func TestScalarString_MultilineSingleQuotedScalarString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3823,11 +3856,12 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -3937,11 +3971,12 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4028,11 +4063,12 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4207,11 +4243,12 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4343,11 +4380,12 @@ func TestStmtClassConstList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4466,11 +4504,12 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4546,11 +4585,12 @@ func TestStmtClassMethod_SimpleClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4696,11 +4736,12 @@ func TestStmtClassMethod_PrivateProtectedClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4823,11 +4864,12 @@ func TestStmtClassMethod_Php7ClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -4939,11 +4981,12 @@ func TestStmtClassMethod_AbstractClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5067,11 +5110,12 @@ func TestStmtClassMethod_Php7AbstractClassMethod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5113,11 +5157,12 @@ func TestStmtClass_SimpleClass(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5172,11 +5217,12 @@ func TestStmtClass_AbstractClass(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5264,11 +5310,12 @@ func TestStmtClass_ClassExtends(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5358,11 +5405,12 @@ func TestStmtClass_ClassImplement(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5475,11 +5523,12 @@ func TestStmtClass_ClassImplements(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5631,11 +5680,12 @@ func TestStmtClass_AnonimousClass(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5731,11 +5781,12 @@ func TestStmtConstList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5798,11 +5849,12 @@ func TestStmtContinue_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5876,11 +5928,12 @@ func TestStmtContinue_Light(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -5954,11 +6007,12 @@ func TestStmtContinue(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6032,11 +6086,12 @@ func TestStmtDeclare(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6143,11 +6198,12 @@ func TestStmtDeclare_Stmts(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6223,11 +6279,12 @@ func TestStmtDeclare_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6279,11 +6336,12 @@ func TestStmtDo(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6347,11 +6405,12 @@ func TestStmtEcho(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6404,11 +6463,12 @@ func TestStmtEcho_Parenthesis(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6449,11 +6509,12 @@ func TestStmtExpression(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6646,11 +6707,12 @@ func TestStmtFor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6768,11 +6830,12 @@ func TestStmtFor_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6855,11 +6918,12 @@ func TestStmtForeach(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -6932,11 +6996,12 @@ func TestStmtForeach_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7019,11 +7084,12 @@ func TestStmtForeach_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7127,11 +7193,12 @@ func TestStmtForeach_WithKey(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7225,11 +7292,12 @@ func TestStmtForeach_ExprWithKey(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7343,11 +7411,12 @@ func TestStmtForeach_WithRef(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7473,11 +7542,12 @@ func TestStmtForeach_WithList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7520,11 +7590,12 @@ func TestStmtFunction(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7578,11 +7649,12 @@ func TestStmtFunction_Return(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7743,11 +7815,12 @@ func TestStmtFunction_ReturnVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7812,11 +7885,12 @@ func TestStmtFunction_Ref(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7882,11 +7956,12 @@ func TestStmtFunction_ReturnType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -7939,11 +8014,12 @@ func TestStmtGlobal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8101,11 +8177,12 @@ func TestStmtGlobal_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8167,11 +8244,12 @@ func TestStmtGotoLabel(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8201,11 +8279,12 @@ func TestStmtHaltCompiler(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8267,11 +8346,12 @@ func TestStmtIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8377,11 +8457,12 @@ func TestStmtIf_ElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8464,11 +8545,12 @@ func TestStmtIf_Else(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8637,11 +8719,12 @@ func TestStmtIf_ElseElseIf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8820,11 +8903,12 @@ func TestStmtIf_ElseIfElseIfElse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8865,11 +8949,12 @@ func TestStmtInlineHtml(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8911,11 +8996,12 @@ func TestStmtInterface(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -8992,11 +9078,12 @@ func TestStmtInterface_Extend(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9096,11 +9183,12 @@ func TestStmtInterface_Extends(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9153,11 +9241,12 @@ func TestStmtNamespace(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9211,11 +9300,12 @@ func TestStmtNamespace_Stmts(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9246,11 +9336,12 @@ func TestStmtNamespace_Anonymous(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9349,11 +9440,12 @@ func TestStmtProperty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9505,11 +9597,12 @@ func TestStmtProperty_Properties(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9661,11 +9754,12 @@ func TestStmtProperty_Properties2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9787,11 +9881,12 @@ func TestStmtProperty_PropertyType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9854,11 +9949,12 @@ func TestStmtStaticVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -9963,11 +10059,12 @@ func TestStmtStaticVar_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10072,11 +10169,12 @@ func TestStmtStaticVar_Vars2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10200,11 +10298,12 @@ func TestStmtSwitch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10328,11 +10427,12 @@ func TestStmtSwitch_Semicolon(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10446,11 +10546,12 @@ func TestStmtSwitch_Alt(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10552,11 +10653,12 @@ func TestStmtSwitch_AltSemicolon(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10607,11 +10709,12 @@ func TestStmtThrow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10653,11 +10756,12 @@ func TestStmtTrait(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10745,11 +10849,12 @@ func TestStmtTraitUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10860,11 +10965,12 @@ func TestStmtTraitUse_Uses(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -10975,11 +11081,12 @@ func TestStmtTraitUse_EmptyAdaptations(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11134,11 +11241,12 @@ func TestStmtTraitUse_Modifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11304,11 +11412,12 @@ func TestStmtTraitUse_AliasModifier(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11588,11 +11697,12 @@ func TestStmtTraitUse_Adaptions(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11626,11 +11736,12 @@ func TestStmtTry_Try(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11722,11 +11833,12 @@ func TestStmtTry_TryCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11841,11 +11953,12 @@ func TestStmtTry_Php7TryCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -11994,11 +12107,12 @@ func TestStmtTry_TryCatchCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12101,11 +12215,12 @@ func TestStmtTry_TryCatchFinally(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12309,11 +12424,12 @@ func TestStmtTry_TryCatchCatchCatch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12366,11 +12482,12 @@ func TestStmtUnset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12444,11 +12561,12 @@ func TestStmtUnset_Vars(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12522,11 +12640,12 @@ func TestStmtUnset_TrailingComma(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12601,11 +12720,12 @@ func TestStmtUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12680,11 +12800,12 @@ func TestStmtUse_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12770,11 +12891,12 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -12882,11 +13004,12 @@ func TestStmtUse_List(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13005,11 +13128,12 @@ func TestStmtUse_ListAlias(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13138,11 +13262,12 @@ func TestStmtUse_ListFunctionType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13293,11 +13418,12 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13427,11 +13553,12 @@ func TestStmtUse_ListConstType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13582,11 +13709,12 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13727,11 +13855,12 @@ func TestStmtUse_GroupUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -13883,11 +14012,12 @@ func TestStmtUse_GroupUseAlias(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14049,11 +14179,12 @@ func TestStmtUse_FunctionGroupUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14215,11 +14346,12 @@ func TestStmtUse_ConstGroupUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14402,11 +14534,12 @@ func TestStmtUse_MixedGroupUse(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14469,11 +14602,12 @@ func TestStmtBreak_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14547,11 +14681,12 @@ func TestStmtBreak_Light(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14625,11 +14760,12 @@ func TestStmtBreak(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14703,11 +14839,12 @@ func TestExprArrayDimFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14800,11 +14937,12 @@ func TestExprArrayDimFetch_Nested(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14845,11 +14983,12 @@ func TestExprArray(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -14912,11 +15051,12 @@ func TestExprArray_Item(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15032,11 +15172,12 @@ func TestExprArray_Items(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15110,11 +15251,12 @@ func TestExprArray_ItemUnpack(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15177,11 +15319,12 @@ func TestExprArrowFunction(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15267,11 +15410,12 @@ func TestExprArrowFunction_ReturnType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15332,11 +15476,12 @@ func TestExprBitwiseNot(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15397,11 +15542,12 @@ func TestExprBooleanNot(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15475,11 +15621,12 @@ func TestExprClassConstFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15541,11 +15688,12 @@ func TestExprClassConstFetch_Static(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15606,11 +15754,12 @@ func TestExprClone_Brackets(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15671,11 +15820,12 @@ func TestExprClone(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15718,11 +15868,12 @@ func TestExprClosure(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -15893,11 +16044,12 @@ func TestExprClosure_Use(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16068,11 +16220,12 @@ func TestExprClosure_Use2(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16138,11 +16291,12 @@ func TestExprClosure_ReturnType(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16205,11 +16359,12 @@ func TestExprConstFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16272,11 +16427,12 @@ func TestExprConstFetch_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16339,11 +16495,12 @@ func TestExprConstFetch_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16404,11 +16561,12 @@ func TestExprEmpty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16469,11 +16627,12 @@ func TestExprErrorSuppress(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16534,11 +16693,12 @@ func TestExprEval(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16579,11 +16739,12 @@ func TestExprExit(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16624,11 +16785,12 @@ func TestExprExit_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16690,11 +16852,12 @@ func TestExprExit_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16735,11 +16898,12 @@ func TestExprDie(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16780,11 +16944,12 @@ func TestExprDie_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16846,11 +17011,12 @@ func TestExprDie_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -16923,11 +17089,12 @@ func TestExprFunctionCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17000,11 +17167,12 @@ func TestExprFunctionCall_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17102,11 +17270,12 @@ func TestExprFunctionCall_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17222,11 +17391,12 @@ func TestExprFunctionCall_Var(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17355,11 +17525,12 @@ func TestExprFunctionCall_ExprArg(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17420,11 +17591,12 @@ func TestExprPostDec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17485,11 +17657,12 @@ func TestExprPostInc(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17550,11 +17723,12 @@ func TestExprPreDec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17615,11 +17789,12 @@ func TestExprPreInc(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17680,11 +17855,12 @@ func TestExprInclude(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17745,11 +17921,12 @@ func TestExprInclude_Once(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17810,11 +17987,12 @@ func TestExprRequire(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17875,11 +18053,12 @@ func TestExprRequire_Once(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -17963,11 +18142,12 @@ func TestExprInstanceOf(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18051,11 +18231,12 @@ func TestExprInstanceOf_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18139,11 +18320,12 @@ func TestExprInstanceOf_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18206,11 +18388,12 @@ func TestExprIsset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18294,11 +18477,12 @@ func TestExprIsset_Variables(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18370,11 +18554,12 @@ func TestExprList_Empty(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18478,11 +18663,12 @@ func TestExprList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18596,11 +18782,12 @@ func TestExprList_ArrayIndex(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18726,11 +18913,12 @@ func TestExprList_List(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18835,11 +19023,12 @@ func TestExprList_EmptyItem(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -18946,11 +19135,12 @@ func TestExprList_EmptyItems(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19032,11 +19222,12 @@ func TestExprMethodCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19099,11 +19290,12 @@ func TestExprNew(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19176,11 +19368,12 @@ func TestExprNew_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19253,11 +19446,12 @@ func TestExprNew_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19386,11 +19580,12 @@ func TestExprNew_Anonymous(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19451,11 +19646,12 @@ func TestExprPrint(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19527,11 +19723,12 @@ func TestExprPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19646,11 +19843,12 @@ func TestExprReference_ForeachWithRef(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19724,11 +19922,12 @@ func TestExprShellExec(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19769,11 +19968,12 @@ func TestExprShortArray(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19836,11 +20036,12 @@ func TestExprShortArray_Item(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19956,11 +20157,12 @@ func TestExprShortArray_Items(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20064,11 +20266,12 @@ func TestExprShortList(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20182,11 +20385,12 @@ func TestExprShortList_ArrayIndex(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20312,11 +20516,12 @@ func TestExprShortList_List(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20400,11 +20605,12 @@ func TestExprStaticCall(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20488,11 +20694,12 @@ func TestExprStaticCall_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20576,11 +20783,12 @@ func TestExprStaticCall_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20674,11 +20882,12 @@ func TestExprStaticCall_Var(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20770,11 +20979,12 @@ func TestExprStaticCall_VarVar(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20858,11 +21068,12 @@ func TestExprStaticPropertyFetch(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -20946,11 +21157,12 @@ func TestExprStaticPropertyFetch_Relative(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21034,11 +21246,12 @@ func TestExprStaticPropertyFetch_FullyQualified(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21141,11 +21354,12 @@ func TestExprTernary(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21227,11 +21441,12 @@ func TestExprTernary_Simple(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21386,11 +21601,12 @@ func TestExprTernary_NestedTrue(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21545,11 +21761,12 @@ func TestExprTernary_NestedCond(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21610,11 +21827,12 @@ func TestExprUnaryMinus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21675,11 +21893,12 @@ func TestExprUnaryPlus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21730,11 +21949,12 @@ func TestExprVariable(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21795,11 +22015,12 @@ func TestExprVariable_Variable(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21839,11 +22060,12 @@ func TestExprYield(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21904,11 +22126,12 @@ func TestExprYield_Val(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -21990,11 +22213,12 @@ func TestExprYield_KeyVal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22045,11 +22269,12 @@ func TestExprYield_Expr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22121,11 +22346,12 @@ func TestExprYield_KeyExpr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22186,11 +22412,12 @@ func TestExprYieldFrom(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22274,11 +22501,12 @@ func TestExprAssign_Assign(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22360,11 +22588,12 @@ func TestExprAssign_Reference(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22458,11 +22687,12 @@ func TestExprAssign_ReferenceNew(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22601,11 +22831,12 @@ func TestExprAssign_ReferenceArgs(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22687,11 +22918,12 @@ func TestExprAssign_BitwiseAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22773,11 +23005,12 @@ func TestExprAssign_BitwiseOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22859,11 +23092,12 @@ func TestExprAssign_BitwiseXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -22945,11 +23179,12 @@ func TestExprAssign_Concat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23031,11 +23266,12 @@ func TestExprAssign_Div(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23117,11 +23353,12 @@ func TestExprAssign_Minus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23203,11 +23440,12 @@ func TestExprAssign_Mod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23289,11 +23527,12 @@ func TestExprAssign_Mul(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23375,11 +23614,12 @@ func TestExprAssign_Plus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23461,11 +23701,12 @@ func TestExprAssign_Pow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23547,11 +23788,12 @@ func TestExprAssign_ShiftLeft(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23633,11 +23875,12 @@ func TestExprAssign_ShiftRight(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23719,11 +23962,12 @@ func TestExprAssign_Coalesce(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23807,11 +24051,12 @@ func TestExprBinary_BitwiseAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23893,11 +24138,12 @@ func TestExprBinary_BitwiseOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -23979,11 +24225,12 @@ func TestExprBinary_BitwiseXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24065,11 +24312,12 @@ func TestExprBinary_BooleanAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24151,11 +24399,12 @@ func TestExprBinary_BooleanOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24237,11 +24486,12 @@ func TestExprBinary_Coalesce(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24323,11 +24573,12 @@ func TestExprBinary_Concat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24409,11 +24660,12 @@ func TestExprBinary_Div(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24495,11 +24747,12 @@ func TestExprBinary_Equal(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24581,11 +24834,12 @@ func TestExprBinary_GreaterOrEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24667,11 +24921,12 @@ func TestExprBinary_Greater(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24753,11 +25008,12 @@ func TestExprBinary_Identical(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24839,11 +25095,12 @@ func TestExprBinary_LogicalAnd(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -24925,11 +25182,12 @@ func TestExprBinary_LogicalOr(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25011,11 +25269,12 @@ func TestExprBinary_LogicalXor(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25097,11 +25356,12 @@ func TestExprBinary_Minus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25183,11 +25443,12 @@ func TestExprBinary_Mod(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25269,11 +25530,12 @@ func TestExprBinary_Mul(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25355,11 +25617,12 @@ func TestExprBinary_NotEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25441,11 +25704,12 @@ func TestExprBinary_NotIdentical(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25527,11 +25791,12 @@ func TestExprBinary_Plus(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25613,11 +25878,12 @@ func TestExprBinary_Pow(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25699,11 +25965,12 @@ func TestExprBinary_ShiftLeft(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25785,11 +26052,12 @@ func TestExprBinary_ShiftRight(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25871,11 +26139,12 @@ func TestExprBinary_SmallerOrEqual(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -25957,11 +26226,12 @@ func TestExprBinary_Smaller(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26043,11 +26313,12 @@ func TestExprBinary_Spaceship(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26110,11 +26381,12 @@ func TestExprCast_Array(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26175,11 +26447,12 @@ func TestExprCast_Bool(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26240,11 +26513,12 @@ func TestExprCast_BoolShort(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26305,11 +26579,12 @@ func TestExprCast_Double(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26370,11 +26645,12 @@ func TestExprCast_CastFloat(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26435,11 +26711,12 @@ func TestExprCast_Int(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26500,11 +26777,12 @@ func TestExprCast_IntShort(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26565,11 +26843,12 @@ func TestExprCast_Object(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26630,11 +26909,12 @@ func TestExprCast_String(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26695,11 +26975,12 @@ func TestExprCast_BinaryString(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -26760,10 +27041,11 @@ func TestExprCast_Unset(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 89954b66035054f2ade09e65668ad66583eb60ef..7ed02ea323fabec80f8b9c38a16cd76601804ce7 100644 GIT binary patch delta 21076 zcmc&cYj~8!)z8c<2?-Dqt|7NwkR(7b?0q-LErJw8AQ7y9fI(425E4PH6}eRl0t$%a z2tp-Qp{|}Rd+`kMr#t*% zU-(6L#)hw9b2W7~@g*lE-3O%wq%E9aB$0PuB!RRTF=cXj`7IMAkr^<~K|D~LOq|3I zq!sbO7Y@={0jfG6U~Cf$P?3#*eG!1-jtCf*U}2=?B49@ZU_vtSLf=G^tB6X#%h3QI zc$+GW03e1BHrfGsNj8jic0fjQ6vilnqe(BNS=5(4SZD{(<~EF35dcpL%JjV*P~O5C zA~C+vfFK~i6hVIW!J!m|Z30HMv;p3?1FlK6VQjYp`lVSIasgk7251rFmz!Fd*zmjq zSG-H>s6YQ0{byF2sBbHy|4eNg_3fhQKOOBNzV*TV?MR+n4#C$4KScjo(cbv>TKKpA zbW6H|eWpK+?x0{F=ubm46l{n7RGg_`TlJ?vmV!MmKBc9QYoTkl`t+3kl%1nspg*NK z6>PEo)WoG=bHu03ZIRxO`qPY#3U*w7n$$_b4(m@hT&7_A^rzvS73^*ElamAh57sC+ z*_n)h*K<*|@>4iZeR@HE>YlG)>-8sB7ld`JrA}16JfN!;0IHfGtaVr9xUGx01bEsU zGKj!|Zp1CtD+f2pglFhw9l#CX-;R+mwig z1K_D489d)ZT98PBz2U%>B-=)Cmlp|c8^m13pq@U`+AjEFzYu&h3SI=C`B7E90>}#i zIXL6AwWJ-?-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c@xk3Xr$|w_?^Etd5 zVjXP77YYnWgF+XgX0zf&k1xsS8_A1#=PGq5FHWYh@6Tza5>|Yz(1;t#7>bA+fK_9& t&ubkGKKxB3L^xiJ $unk %token T_INCLUDE %token T_INCLUDE_ONCE %token T_EXIT @@ -297,9 +296,7 @@ start: // save position yylex.(*Parser).rootNode.GetNode().Position = position.NewNodeListPosition($1) - yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(yylex.(*Parser).rootNode, token.End, yylex.(*Parser).currentToken.SkippedTokens) } ; @@ -343,14 +340,10 @@ top_statement_list: if $2 != nil { $$ = append($1, $2) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -364,9 +357,7 @@ namespace_name: namePart.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.SkippedTokens) } | namespace_name T_NS_SEPARATOR T_STRING { @@ -377,10 +368,8 @@ namespace_name: namePart.GetNode().Position = position.NewTokenPosition($3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.SkippedTokens) } ; @@ -391,8 +380,6 @@ name: // save position $$.GetNode().Position = position.NewNodeListPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NAMESPACE T_NS_SEPARATOR namespace_name { @@ -402,10 +389,8 @@ name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name { @@ -415,9 +400,7 @@ name: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -426,38 +409,26 @@ top_statement: { // error $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | interface_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { @@ -467,10 +438,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.Tokens, append($3.Tokens, $4.Tokens...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) } | T_NAMESPACE namespace_name ';' { @@ -482,12 +451,10 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_NAMESPACE namespace_name '{' top_statement_list '}' { @@ -499,12 +466,10 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.SkippedTokens) } | T_NAMESPACE '{' top_statement_list '}' { @@ -514,11 +479,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } | T_USE mixed_group_use_declaration ';' { @@ -528,10 +491,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_USE use_type group_use_declaration ';' { @@ -543,10 +504,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) } | T_USE use_declarations ';' { @@ -558,10 +517,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_USE use_type use_declarations ';' { @@ -575,10 +532,8 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) } | T_CONST const_list ';' { @@ -588,11 +543,9 @@ top_statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } ; @@ -605,9 +558,7 @@ use_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CONST { @@ -617,9 +568,7 @@ use_type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -641,13 +590,11 @@ group_use_declaration: // save comments if $5 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.SkippedTokens) } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.Tokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { @@ -667,15 +614,13 @@ group_use_declaration: $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.SkippedTokens) if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.SkippedTokens) } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.Tokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.SkippedTokens) } ; @@ -697,13 +642,11 @@ mixed_group_use_declaration: // save comments if $5 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.SkippedTokens) } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.Tokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { @@ -723,15 +666,13 @@ mixed_group_use_declaration: $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.SkippedTokens) if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.Tokens) + yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.SkippedTokens) } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.Tokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.SkippedTokens) } ; @@ -752,15 +693,11 @@ inline_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | inline_use_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -770,15 +707,11 @@ unprefixed_use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | unprefixed_use_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -788,15 +721,11 @@ use_declarations: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | use_declaration { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -804,8 +733,6 @@ inline_use_declaration: unprefixed_use_declaration { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | use_type unprefixed_use_declaration { @@ -813,8 +740,6 @@ inline_use_declaration: // save position $$.GetNode().Position = position.NewNodesPosition($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -827,8 +752,6 @@ unprefixed_use_declaration: // save position name.GetNode().Position = position.NewNodeListPosition($1) $$.GetNode().Position = position.NewNodePosition(name) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | namespace_name T_AS T_STRING { @@ -844,10 +767,8 @@ unprefixed_use_declaration: $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } ; @@ -855,8 +776,6 @@ use_declaration: unprefixed_use_declaration { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_NS_SEPARATOR unprefixed_use_declaration { @@ -867,9 +786,7 @@ use_declaration: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -879,15 +796,11 @@ const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | const_decl { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -902,14 +815,10 @@ inner_statement_list: if $2 != nil { $$ = append($1, $2) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -918,38 +827,26 @@ inner_statement: { // error $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | function_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | interface_declaration_statement { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_HALT_COMPILER '(' ')' ';' { @@ -959,10 +856,8 @@ inner_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.Tokens, append($3.Tokens, $4.Tokens...)...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) } statement: @@ -974,22 +869,16 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) } | if_stmt { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | alt_if_stmt { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_WHILE '(' expr ')' while_statement { @@ -1009,11 +898,9 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_DO statement T_WHILE '(' expr ')' ';' { @@ -1025,13 +912,11 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloating(exprBrackets, token.End, append($6.Tokens, $7.Tokens...)) - yylex.(*Parser).setToken($$, token.SemiColon, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(exprBrackets, token.End, append($6.SkippedTokens, $7.SkippedTokens...)) + yylex.(*Parser).setToken($$, token.SemiColon, $7.SkippedTokens) } | T_FOR '(' for_exprs ';' for_exprs ';' for_exprs ')' for_statement { @@ -1052,13 +937,11 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.For, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.For, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.InitExpr, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.CondExpr, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.IncExpr, $8.SkippedTokens) } | T_SWITCH '(' expr ')' switch_case_list { @@ -1080,11 +963,9 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_BREAK optional_expr ';' { @@ -1094,11 +975,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_CONTINUE optional_expr ';' { @@ -1108,11 +987,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_RETURN optional_expr ';' { @@ -1122,11 +999,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_GLOBAL global_var_list ';' { @@ -1136,11 +1011,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_STATIC static_var_list ';' { @@ -1150,11 +1023,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.VarList, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_ECHO echo_expr_list ';' { @@ -1164,12 +1035,10 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Echo, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Echo, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_INLINE_HTML { @@ -1179,9 +1048,7 @@ statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr ';' { @@ -1192,10 +1059,8 @@ statement: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | T_UNSET '(' unset_variables possible_comma ')' ';' { @@ -1205,17 +1070,15 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Unset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Unset, $2.SkippedTokens) if $4 != nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, $5.Tokens...)) + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.SkippedTokens, $5.SkippedTokens...)) } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.CloseParenthesisToken, $6.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $6.SkippedTokens) } | T_FOREACH '(' expr T_AS foreach_variable ')' foreach_statement { @@ -1234,13 +1097,10 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $6.Tokens) - - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $6.SkippedTokens) } | T_FOREACH '(' expr T_AS variable T_DOUBLE_ARROW foreach_variable ')' foreach_statement { @@ -1261,13 +1121,11 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Key, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Foreach, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Key, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $8.SkippedTokens) } | T_DECLARE '(' const_list ')' declare_statement { @@ -1278,11 +1136,9 @@ statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Declare, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Declare, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) } | ';' { @@ -1292,10 +1148,8 @@ statement: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | T_TRY '{' inner_statement_list '}' catch_list finally_statement { @@ -1308,11 +1162,9 @@ statement: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Try, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Try, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } | T_THROW expr ';' { @@ -1322,11 +1174,9 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_GOTO T_STRING ';' { @@ -1338,12 +1188,10 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(label, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $3.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(label, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $3.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | T_STRING ':' { @@ -1355,18 +1203,14 @@ statement: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Label, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Label, $2.SkippedTokens) } catch_list: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | catch_list T_CATCH '(' catch_name_list T_VARIABLE ')' '{' inner_statement_list '}' { @@ -1381,31 +1225,25 @@ catch_list: catch.GetNode().Position = position.NewTokensPosition($2, $9) // save comments - yylex.(*Parser).setFreeFloating(catch, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $5.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Var, $6.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.Tokens) - yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(catch, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(catch, token.Catch, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating(catch, token.Var, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating(catch, token.Cond, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating(catch, token.Stmts, $9.SkippedTokens) } ; catch_name_list: name { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | catch_name_list '|' name { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -1413,8 +1251,6 @@ finally_statement: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FINALLY '{' inner_statement_list '}' { @@ -1424,11 +1260,9 @@ finally_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Finally, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Finally, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) } ; @@ -1436,17 +1270,13 @@ unset_variables: unset_variable { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | unset_variables ',' unset_variable { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -1454,8 +1284,6 @@ unset_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1471,24 +1299,22 @@ function_declaration_statement: // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) if $2 != nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ParamList, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.SkippedTokens) // normalize if $8 == nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1526,12 +1352,10 @@ class_declaration_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $7.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $7.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $9.SkippedTokens) } | T_CLASS T_STRING extends_from implements_list backup_doc_comment '{' class_statement_list '}' { @@ -1543,12 +1367,10 @@ class_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; @@ -1556,14 +1378,10 @@ class_modifiers: class_modifier { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_modifiers class_modifier { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -1576,9 +1394,7 @@ class_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FINAL { @@ -1588,9 +1404,7 @@ class_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1605,12 +1419,10 @@ trait_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $6.SkippedTokens) } ; @@ -1625,12 +1437,10 @@ interface_declaration_statement: $$.GetNode().Position = position.NewTokensPosition($1, $7) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(name, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(name, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $7.SkippedTokens) } ; @@ -1638,8 +1448,6 @@ extends_from: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS name { @@ -1649,9 +1457,7 @@ extends_from: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1659,8 +1465,6 @@ interface_extends_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EXTENDS name_list { @@ -1670,9 +1474,7 @@ interface_extends_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1680,8 +1482,6 @@ implements_list: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_IMPLEMENTS name_list { @@ -1691,9 +1491,7 @@ implements_list: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -1701,8 +1499,6 @@ foreach_variable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '&' variable { @@ -1712,9 +1508,7 @@ foreach_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_LIST '(' array_pair_list ')' { @@ -1724,11 +1518,9 @@ foreach_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) } | '[' array_pair_list ']' { @@ -1738,10 +1530,8 @@ foreach_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save commentsc - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) } ; @@ -1752,8 +1542,6 @@ for_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOR ';' { @@ -1765,12 +1553,10 @@ for_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1781,8 +1567,6 @@ foreach_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDFOREACH ';' { @@ -1794,12 +1578,10 @@ foreach_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1810,8 +1592,6 @@ declare_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDDECLARE ';' { @@ -1823,12 +1603,10 @@ declare_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1843,10 +1621,8 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.SkippedTokens) } | '{' ';' case_list '}' { @@ -1858,11 +1634,9 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(caseList, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.SkippedTokens) } | ':' case_list T_ENDSWITCH ';' { @@ -1874,12 +1648,10 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } | ':' ';' case_list T_ENDSWITCH ';' { @@ -1892,13 +1664,11 @@ switch_case_list: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.Tokens) - yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(caseList, token.CaseListStart, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(caseList, token.CaseListEnd, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $5.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $5.SkippedTokens) } ; @@ -1906,8 +1676,6 @@ case_list: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | case_list T_CASE expr case_separator inner_statement_list { @@ -1918,11 +1686,9 @@ case_list: _case.GetNode().Position = position.NewTokenNodeListPosition($2, $5) // save comments - yylex.(*Parser).setFreeFloating(_case, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_case, token.Expr, append($4.Tokens)) - yylex.(*Parser).setToken(_case, token.CaseSeparator, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_case, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(_case, token.Expr, append($4.SkippedTokens)) + yylex.(*Parser).setToken(_case, token.CaseSeparator, $4.SkippedTokens) } | case_list T_DEFAULT case_separator inner_statement_list { @@ -1933,11 +1699,9 @@ case_list: _default.GetNode().Position = position.NewTokenNodeListPosition($2, $4) // save comments - yylex.(*Parser).setFreeFloating(_default, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloating(_default, token.Default, $3.Tokens) - yylex.(*Parser).setToken(_default, token.CaseSeparator, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_default, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(_default, token.Default, $3.SkippedTokens) + yylex.(*Parser).setToken(_default, token.CaseSeparator, $3.SkippedTokens) } ; @@ -1959,8 +1723,6 @@ while_statement: // save position $$.GetNode().Position = position.NewNodePosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' inner_statement_list T_ENDWHILE ';' { @@ -1972,12 +1734,10 @@ while_statement: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Cond, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AltEnd, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } ; @@ -1992,11 +1752,9 @@ if_stmt_without_else: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | if_stmt_without_else T_ELSEIF '(' expr ')' statement { @@ -2012,11 +1770,9 @@ if_stmt_without_else: $$.GetNode().Position = position.NewNodesPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.SkippedTokens) } ; @@ -2024,8 +1780,6 @@ if_stmt: if_stmt_without_else %prec T_NOELSE { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | if_stmt_without_else T_ELSE statement { @@ -2039,9 +1793,7 @@ if_stmt: $$.GetNode().Position = position.NewNodesPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.SkippedTokens) } ; @@ -2060,12 +1812,10 @@ alt_if_stmt_without_else: $$.GetNode().Position = position.NewTokenNodeListPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $5.SkippedTokens) } | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list { @@ -2084,12 +1834,10 @@ alt_if_stmt_without_else: _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $7) // save comments - yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_elseIf, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $5.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $6.SkippedTokens) } ; @@ -2104,13 +1852,11 @@ alt_if_stmt: // save comments altif := $$.(*ast.StmtAltIf) if len(altif.ElseIf) > 0 { - yylex.(*Parser).setFreeFloating(altif.ElseIf[len(altif.ElseIf)-1], token.End, append($2.Tokens, $3.Tokens...)) + yylex.(*Parser).setFreeFloating(altif.ElseIf[len(altif.ElseIf)-1], token.End, append($2.SkippedTokens, $3.SkippedTokens...)) } else { - yylex.(*Parser).setFreeFloating(altif.Stmt, token.End, append($2.Tokens, $3.Tokens...)) + yylex.(*Parser).setFreeFloating(altif.Stmt, token.End, append($2.SkippedTokens, $3.SkippedTokens...)) } - yylex.(*Parser).setToken($$, token.SemiColon, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) } | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { @@ -2128,12 +1874,10 @@ alt_if_stmt: $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating(_else, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($5.Tokens, $6.Tokens...)) - yylex.(*Parser).setToken($$, token.SemiColon, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(_else, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(stmtsBrackets, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(stmtsBrackets, token.End, append($5.SkippedTokens, $6.SkippedTokens...)) + yylex.(*Parser).setToken($$, token.SemiColon, $6.SkippedTokens) } ; @@ -2141,14 +1885,10 @@ parameter_list: non_empty_parameter_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2156,17 +1896,13 @@ non_empty_parameter_list: parameter { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_parameter_list ',' parameter { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2179,18 +1915,18 @@ parameter: var variable ast.Vertex variable = &ast.ExprVariable{ast.Node{}, identifier} variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) if $3 != nil { variable = &ast.Variadic{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($3, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } if $2 != nil { variable = &ast.Reference{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($2, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } $$ = &ast.Parameter{ast.Node{}, $1, variable, nil} @@ -2204,8 +1940,6 @@ parameter: } else { $$.GetNode().Position = position.NewTokenPosition($4) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | optional_type is_reference is_variadic T_VARIABLE '=' expr { @@ -2215,19 +1949,19 @@ parameter: var variable ast.Vertex variable = &ast.ExprVariable{ast.Node{}, identifier} variable.GetNode().Position = position.NewTokenPosition($4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $4.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.End, $5.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.End, $5.SkippedTokens) if $3 != nil { variable = &ast.Variadic{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($3, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $3.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $3.SkippedTokens) } if $2 != nil { variable = &ast.Reference{ast.Node{}, variable} variable.GetNode().Position = position.NewTokensPosition($2, $4) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } $$ = &ast.Parameter{ast.Node{}, $1, variable, $6} @@ -2241,8 +1975,6 @@ parameter: } else { $$.GetNode().Position = position.NewTokenNodePosition($4, $6) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2250,14 +1982,10 @@ optional_type: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | type_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2265,8 +1993,6 @@ type_expr: type { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '?' type { @@ -2276,9 +2002,7 @@ type_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2291,9 +2015,7 @@ type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CALLABLE { @@ -2303,15 +2025,11 @@ type: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | name { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2319,17 +2037,13 @@ return_type: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | ':' type_expr { $$ = $2; // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) } ; @@ -2342,10 +2056,8 @@ argument_list: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $2.SkippedTokens) } | '(' non_empty_argument_list possible_comma ')' { @@ -2355,14 +2067,12 @@ argument_list: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) if $3 != nil { - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($3.Tokens, $4.Tokens...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($3.SkippedTokens, $4.SkippedTokens...)) } else { - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.Tokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2370,17 +2080,13 @@ non_empty_argument_list: argument { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_argument_list ',' argument { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2394,8 +2100,6 @@ argument: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ELLIPSIS expr { @@ -2405,9 +2109,7 @@ argument: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2417,15 +2119,11 @@ global_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | global_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2433,8 +2131,6 @@ global_var: simple_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2444,15 +2140,11 @@ static_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | static_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2469,9 +2161,7 @@ static_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' expr { @@ -2485,10 +2175,8 @@ static_var: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } ; @@ -2496,14 +2184,10 @@ class_statement_list: class_statement_list class_statement { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2517,10 +2201,8 @@ class_statement: // save comments yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.PropertyList, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } | method_modifiers T_CONST class_const_list ';' { @@ -2532,14 +2214,12 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } | T_USE name_list trait_adaptations { @@ -2549,9 +2229,7 @@ class_statement: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | method_modifiers T_FUNCTION returns_ref identifier backup_doc_comment '(' parameter_list ')' return_type method_body { @@ -2569,20 +2247,18 @@ class_statement: // save comments if len($1) > 0 { yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) } if $3 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $8.SkippedTokens) } ; @@ -2590,17 +2266,13 @@ name_list: name { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | name_list ',' name { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2612,11 +2284,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | '{' '}' { @@ -2625,10 +2294,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $2.SkippedTokens) } | '{' trait_adaptation_list '}' { @@ -2637,10 +2304,8 @@ trait_adaptations: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.AdaptationList, $3.SkippedTokens) } ; @@ -2648,14 +2313,10 @@ trait_adaptation_list: trait_adaptation { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | trait_adaptation_list trait_adaptation { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2665,20 +2326,16 @@ trait_adaptation: $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.NameList, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.NameList, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | trait_alias ';' { $$ = $1; // save comments - yylex.(*Parser).setFreeFloating($$, token.Alias, $2.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Alias, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } ; @@ -2692,9 +2349,7 @@ trait_precedence: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } ; @@ -2710,10 +2365,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } | trait_method_reference T_AS reserved_non_modifiers { @@ -2726,10 +2379,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) } | trait_method_reference T_AS member_modifier identifier { @@ -2742,10 +2393,8 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(alias, token.Start, $4.SkippedTokens) } | trait_method_reference T_AS member_modifier { @@ -2756,9 +2405,7 @@ trait_alias: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Ref, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Ref, $2.SkippedTokens) } ; @@ -2773,15 +2420,11 @@ trait_method_reference: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | absolute_trait_method_reference { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2797,10 +2440,8 @@ absolute_trait_method_reference: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $2.SkippedTokens) } ; @@ -2813,10 +2454,8 @@ method_body: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.SemiColon, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.SemiColon, $1.SkippedTokens) } | '{' inner_statement_list '}' { @@ -2826,10 +2465,8 @@ method_body: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) } ; @@ -2837,8 +2474,6 @@ variable_modifiers: non_empty_member_modifiers { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_VAR { @@ -2849,9 +2484,7 @@ variable_modifiers: modifier.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(modifier, token.Start, $1.SkippedTokens) } ; @@ -2859,14 +2492,10 @@ method_modifiers: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2874,14 +2503,10 @@ non_empty_member_modifiers: member_modifier { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_member_modifiers member_modifier { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2894,9 +2519,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PROTECTED { @@ -2906,9 +2529,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PRIVATE { @@ -2918,9 +2539,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_STATIC { @@ -2930,9 +2549,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ABSTRACT { @@ -2942,9 +2559,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FINAL { @@ -2954,9 +2569,7 @@ member_modifier: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -2966,15 +2579,11 @@ property_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | property { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -2991,9 +2600,7 @@ property: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '=' expr backup_doc_comment { @@ -3007,10 +2614,8 @@ property: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } ; @@ -3020,15 +2625,11 @@ class_const_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | class_const_decl { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3043,10 +2644,8 @@ class_const_decl: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -3061,10 +2660,8 @@ const_decl: $$.GetNode().Position = position.NewTokenNodePosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -3074,15 +2671,11 @@ echo_expr_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | echo_expr { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3090,8 +2683,6 @@ echo_expr: expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3099,14 +2690,10 @@ for_exprs: /* empty */ { $$ = nil; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | non_empty_for_exprs { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3116,15 +2703,11 @@ non_empty_for_exprs: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | expr { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -3141,11 +2724,9 @@ anonymous_class: $$.GetNode().Position = position.NewTokensPosition($1, $8) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Name, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $8.SkippedTokens) } ; @@ -3161,9 +2742,7 @@ new_expr: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NEW anonymous_class { @@ -3173,9 +2752,7 @@ new_expr: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -3190,12 +2767,10 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $6) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $5.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $5.SkippedTokens) } | '[' array_pair_list ']' '=' expr { @@ -3207,11 +2782,9 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Var, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(shortList, token.ArrayPairList, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Var, $4.SkippedTokens) } | variable '=' expr { @@ -3222,9 +2795,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable '=' '&' expr { @@ -3235,10 +2806,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Equal, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Equal, $3.SkippedTokens) } | T_CLONE expr { @@ -3248,9 +2817,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | variable T_PLUS_EQUAL expr { @@ -3261,9 +2828,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MINUS_EQUAL expr { @@ -3274,9 +2839,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MUL_EQUAL expr { @@ -3287,9 +2850,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_POW_EQUAL expr { @@ -3300,9 +2861,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_DIV_EQUAL expr { @@ -3313,9 +2872,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_CONCAT_EQUAL expr { @@ -3326,9 +2883,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_MOD_EQUAL expr { @@ -3339,9 +2894,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_AND_EQUAL expr { @@ -3352,9 +2905,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_OR_EQUAL expr { @@ -3365,9 +2916,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_XOR_EQUAL expr { @@ -3378,9 +2927,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_SL_EQUAL expr { @@ -3391,9 +2938,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_SR_EQUAL expr { @@ -3404,9 +2949,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_COALESCE_EQUAL expr { @@ -3417,9 +2960,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | variable T_INC { @@ -3430,9 +2971,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | T_INC variable { @@ -3442,9 +2981,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | variable T_DEC { @@ -3455,9 +2992,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | T_DEC variable { @@ -3467,9 +3002,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr T_BOOLEAN_OR expr { @@ -3480,9 +3013,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_BOOLEAN_AND expr { @@ -3493,9 +3024,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_OR expr { @@ -3506,9 +3035,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_AND expr { @@ -3519,9 +3046,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_LOGICAL_XOR expr { @@ -3532,9 +3057,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '|' expr { @@ -3545,9 +3068,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '&' expr { @@ -3558,9 +3079,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '^' expr { @@ -3571,9 +3090,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '.' expr { @@ -3584,9 +3101,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '+' expr { @@ -3597,9 +3112,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '-' expr { @@ -3610,9 +3123,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '*' expr { @@ -3623,9 +3134,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_POW expr { @@ -3636,9 +3145,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '/' expr { @@ -3649,9 +3156,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '%' expr { @@ -3662,9 +3167,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_SL expr { @@ -3675,9 +3178,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_SR expr { @@ -3688,9 +3189,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | '+' expr %prec T_INC { @@ -3700,9 +3199,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '-' expr %prec T_INC { @@ -3712,9 +3209,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '!' expr { @@ -3724,9 +3219,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '~' expr { @@ -3736,9 +3229,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr T_IS_IDENTICAL expr { @@ -3749,9 +3240,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_NOT_IDENTICAL expr { @@ -3762,9 +3251,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_EQUAL expr { @@ -3775,9 +3262,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_NOT_EQUAL expr { @@ -3788,10 +3273,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setToken($$, token.Equal, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setToken($$, token.Equal, $2.SkippedTokens) } | expr '<' expr { @@ -3802,9 +3285,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_SMALLER_OR_EQUAL expr { @@ -3815,9 +3296,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr '>' expr { @@ -3828,9 +3307,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_IS_GREATER_OR_EQUAL expr { @@ -3841,9 +3318,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_SPACESHIP expr { @@ -3854,9 +3329,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr T_INSTANCEOF class_name_reference { @@ -3867,9 +3340,7 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | '(' expr ')' { @@ -3879,16 +3350,12 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | new_expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr '?' expr ':' expr { @@ -3899,10 +3366,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $4.SkippedTokens) } | expr '?' ':' expr { @@ -3913,10 +3378,8 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Cond, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.True, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Cond, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.True, $3.SkippedTokens) } | expr T_COALESCE expr { @@ -3927,15 +3390,11 @@ expr_without_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | internal_functions_in_yacc { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_INT_CAST expr { @@ -3945,10 +3404,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_DOUBLE_CAST expr { @@ -3958,10 +3415,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_STRING_CAST expr { @@ -3971,10 +3426,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_ARRAY_CAST expr { @@ -3984,10 +3437,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_OBJECT_CAST expr { @@ -3997,10 +3448,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_BOOL_CAST expr { @@ -4010,10 +3459,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_UNSET_CAST expr { @@ -4023,10 +3470,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setToken($$, token.Cast, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setToken($$, token.Cast, $1.SkippedTokens) } | T_EXIT exit_expr { @@ -4044,9 +3489,7 @@ expr_without_variable: } // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '@' expr { @@ -4056,15 +3499,11 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '`' backticks_expr '`' { @@ -4074,9 +3513,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_PRINT expr { @@ -4086,9 +3523,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD { @@ -4098,9 +3533,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD expr { @@ -4110,9 +3543,7 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_YIELD expr T_DOUBLE_ARROW expr { @@ -4122,10 +3553,8 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Expr, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Expr, $3.SkippedTokens) } | T_YIELD_FROM expr { @@ -4135,15 +3564,11 @@ expr_without_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | inline_function { $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_STATIC inline_function { @@ -4161,9 +3586,7 @@ expr_without_variable: // save comments yylex.(*Parser).setFreeFloatingTokens($$, token.Static, $$.GetNode().Tokens[token.Start]); delete($$.GetNode().Tokens, token.Start) - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens); - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens); } ; @@ -4176,16 +3599,16 @@ inline_function: $$.GetNode().Position = position.NewTokensPosition($1, $11) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $4.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $4.SkippedTokens) } - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $6.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $9.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Stmts, $11.SkippedTokens) // normalize if $8 == nil { @@ -4194,8 +3617,6 @@ inline_function: if $7 == nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.LexicalVarList]); delete($$.GetNode().Tokens, token.LexicalVarList) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_FN returns_ref '(' parameter_list ')' return_type backup_doc_comment T_DOUBLE_ARROW expr { @@ -4205,22 +3626,20 @@ inline_function: $$.GetNode().Position = position.NewTokenNodePosition($1, $9) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) if $2 == nil { - yylex.(*Parser).setFreeFloating($$, token.Function, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $3.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.Function, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Function, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Ampersand, $3.SkippedTokens) }; - yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.Tokens) + yylex.(*Parser).setFreeFloating($$, token.ParameterList, $5.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ReturnType, $8.SkippedTokens) // normalize if $6 == nil { yylex.(*Parser).setFreeFloatingTokens($$, token.Params, $$.GetNode().Tokens[token.ReturnType]); delete($$.GetNode().Tokens, token.ReturnType) }; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4243,8 +3662,6 @@ lexical_vars: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_USE '(' lexical_var_list ')' { @@ -4254,11 +3671,9 @@ lexical_vars: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Use, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Use, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.LexicalVarList, $4.SkippedTokens) } ; @@ -4268,15 +3683,11 @@ lexical_var_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | lexical_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4291,9 +3702,7 @@ lexical_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '&' T_VARIABLE { @@ -4307,10 +3716,8 @@ lexical_var: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(variable, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(variable, token.Start, $2.SkippedTokens) } ; @@ -4324,8 +3731,6 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { @@ -4336,9 +3741,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM member_name argument_list { @@ -4349,9 +3752,7 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | callable_expr argument_list { @@ -4362,8 +3763,6 @@ function_call: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4376,15 +3775,11 @@ class_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | name { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4392,14 +3787,10 @@ class_name_reference: class_name { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4407,8 +3798,6 @@ exit_expr: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' optional_expr ')' { @@ -4418,10 +3807,8 @@ exit_expr: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -4429,8 +3816,6 @@ backticks_expr: /* empty */ { $$ = []ast.Vertex{} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE { @@ -4439,14 +3824,10 @@ backticks_expr: // save position part.GetNode().Position = position.NewTokenPosition($1) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4454,14 +3835,10 @@ ctor_arguments: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | argument_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4474,11 +3851,9 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Array, $2.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Array, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $4.SkippedTokens) } | '[' array_pair_list ']' { @@ -4488,10 +3863,8 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.ArrayPairList, $3.SkippedTokens) } | T_CONSTANT_ENCAPSED_STRING { @@ -4501,9 +3874,7 @@ dereferencable_scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -4516,9 +3887,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DNUMBER { @@ -4528,9 +3897,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_LINE { @@ -4540,9 +3907,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FILE { @@ -4552,9 +3917,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_DIR { @@ -4564,9 +3927,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_TRAIT_C { @@ -4576,9 +3937,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_METHOD_C { @@ -4588,9 +3947,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_FUNC_C { @@ -4600,9 +3957,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NS_C { @@ -4612,9 +3967,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_CLASS_C { @@ -4624,9 +3977,7 @@ scalar: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC T_ENCAPSED_AND_WHITESPACE T_END_HEREDOC { @@ -4638,9 +3989,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC T_END_HEREDOC { @@ -4650,9 +3999,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '"' encaps_list '"' { @@ -4662,9 +4009,7 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_START_HEREDOC encaps_list T_END_HEREDOC { @@ -4674,21 +4019,15 @@ scalar: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | dereferencable_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | constant { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4702,8 +4041,6 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | class_name T_PAAMAYIM_NEKUDOTAYIM identifier { @@ -4716,10 +4053,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM identifier { @@ -4732,10 +4067,8 @@ constant: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - yylex.(*Parser).setFreeFloating(target, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(target, token.Start, $3.SkippedTokens) } ; @@ -4743,14 +4076,10 @@ expr: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr_without_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4758,14 +4087,10 @@ optional_expr: /* empty */ { $$ = nil - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4773,8 +4098,6 @@ variable_class_name: dereferencable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4782,8 +4105,6 @@ dereferencable: variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' expr ')' { @@ -4793,16 +4114,12 @@ dereferencable: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | dereferencable_scalar { $$ = $1; - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4810,8 +4127,6 @@ callable_expr: callable_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | '(' expr ')' { @@ -4821,16 +4136,12 @@ callable_expr: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | dereferencable_scalar { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4838,8 +4149,6 @@ callable_variable: simple_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dereferencable '[' optional_expr ']' { @@ -4849,10 +4158,8 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | constant '[' optional_expr ']' { @@ -4862,10 +4169,8 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | dereferencable '{' expr '}' { @@ -4875,10 +4180,8 @@ callable_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | dereferencable T_OBJECT_OPERATOR property_name argument_list { @@ -4889,15 +4192,11 @@ callable_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | function_call { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -4905,14 +4204,10 @@ variable: callable_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | static_member { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | dereferencable T_OBJECT_OPERATOR property_name { @@ -4923,9 +4218,7 @@ variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } ; @@ -4940,9 +4233,7 @@ simple_variable: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '$' '{' expr '}' { @@ -4952,11 +4243,9 @@ simple_variable: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.Tokens, $3.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($3, token.Start, append($2.SkippedTokens, $3.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($3, token.End, append($3.GetNode().Tokens[token.End], $4.SkippedTokens...)) } | '$' simple_variable { @@ -4966,9 +4255,7 @@ simple_variable: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -4982,9 +4269,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } | variable_class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -4995,9 +4280,7 @@ static_member: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) } ; @@ -5005,8 +4288,6 @@ new_variable: simple_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | new_variable '[' optional_expr ']' { @@ -5016,10 +4297,8 @@ new_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | new_variable '{' expr '}' { @@ -5029,10 +4308,8 @@ new_variable: $$.GetNode().Position = position.NewNodeTokenPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | new_variable T_OBJECT_OPERATOR property_name { @@ -5043,9 +4320,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | class_name T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -5056,9 +4331,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } | new_variable T_PAAMAYIM_NEKUDOTAYIM simple_variable { @@ -5069,9 +4342,7 @@ new_variable: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) } ; @@ -5084,25 +4355,19 @@ member_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '{' expr '}' { $$ = $2; // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) } | simple_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5115,25 +4380,19 @@ property_name: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '{' expr '}' { $$ = $2; // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.Tokens, $$.GetNode().Tokens[token.Start]...)) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.Tokens...)) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Start, append($1.SkippedTokens, $$.GetNode().Tokens[token.Start]...)) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($$.GetNode().Tokens[token.End], $3.SkippedTokens...)) } | simple_variable { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5141,8 +4400,6 @@ array_pair_list: non_empty_array_pair_list { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5150,14 +4407,10 @@ possible_array_pair: /* empty */ { $$ = &ast.ExprArrayItem{ast.Node{}, false, nil, nil} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | array_pair { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5171,9 +4424,7 @@ non_empty_array_pair_list: $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } | possible_array_pair { @@ -5182,8 +4433,6 @@ non_empty_array_pair_list: } else { $$ = []ast.Vertex{$1} } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; @@ -5197,9 +4446,7 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) } | expr { @@ -5210,8 +4457,6 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | expr T_DOUBLE_ARROW '&' variable { @@ -5224,10 +4469,8 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(reference, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(reference, token.Start, $3.SkippedTokens) } | '&' variable { @@ -5239,9 +4482,7 @@ array_pair: reference.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_ELLIPSIS expr { @@ -5251,9 +4492,7 @@ array_pair: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | expr T_DOUBLE_ARROW T_LIST '(' array_pair_list ')' { @@ -5267,12 +4506,10 @@ array_pair: // save comments yylex.(*Parser).MoveFreeFloating($1, $$) - yylex.(*Parser).setFreeFloating($$, token.Expr, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $4.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Expr, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.Start, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $6.SkippedTokens) } | T_LIST '(' array_pair_list ')' { @@ -5285,11 +4522,9 @@ array_pair: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.List, $2.Tokens) - yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.List, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(listNode, token.ArrayPairList, $4.SkippedTokens) } ; @@ -5297,8 +4532,6 @@ encaps_list: encaps_list encaps_var { $$ = append($1, $2) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | encaps_list T_ENCAPSED_AND_WHITESPACE { @@ -5309,15 +4542,11 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($2) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $2.SkippedTokens) } | encaps_var { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_ENCAPSED_AND_WHITESPACE encaps_var { @@ -5328,9 +4557,7 @@ encaps_list: encapsed.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(encapsed, token.Start, $1.SkippedTokens) } ; @@ -5345,9 +4572,7 @@ encaps_var: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE '[' encaps_var_offset ']' { @@ -5361,10 +4586,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $4.SkippedTokens) } | T_VARIABLE T_OBJECT_OPERATOR T_STRING { @@ -5380,10 +4603,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setFreeFloating($$, token.Var, $2.Tokens) - yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Var, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(fetch, token.Start, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES expr '}' { @@ -5395,10 +4616,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '}' { @@ -5412,10 +4631,8 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $3) // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } | T_DOLLAR_OPEN_CURLY_BRACES T_STRING_VARNAME '[' expr ']' '}' { @@ -5429,22 +4646,18 @@ encaps_var: $$.GetNode().Position = position.NewTokensPosition($1, $6) // save comments - yylex.(*Parser).setToken(variable, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken(variable, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Var, $3.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.Expr, $5.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $6.SkippedTokens) } | T_CURLY_OPEN variable '}' { $$ = $2; // save comments - yylex.(*Parser).setToken($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setToken($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) } ; @@ -5457,9 +4670,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_NUM_STRING { @@ -5474,9 +4685,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | '-' T_NUM_STRING { @@ -5500,9 +4709,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokensPosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_VARIABLE { @@ -5514,9 +4721,7 @@ encaps_var_offset: $$.GetNode().Position = position.NewTokenPosition($1) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -5529,15 +4734,13 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $5) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloating($$, token.Isset, $2.Tokens) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloating($$, token.Isset, $2.SkippedTokens) if $4 == nil { - yylex.(*Parser).setFreeFloating($$, token.VarList, $5.Tokens) + yylex.(*Parser).setFreeFloating($$, token.VarList, $5.SkippedTokens) } else { - yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.Tokens, $5.Tokens...)) + yylex.(*Parser).setFreeFloating($$, token.VarList, append($4.SkippedTokens, $5.SkippedTokens...)) } - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | T_EMPTY '(' expr ')' { @@ -5549,11 +4752,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_INCLUDE expr { @@ -5563,9 +4764,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_INCLUDE_ONCE expr { @@ -5575,9 +4774,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_EVAL '(' expr ')' { @@ -5589,11 +4786,9 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.Tokens) - yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.Start, $2.SkippedTokens) + yylex.(*Parser).setFreeFloatingTokens(exprBrackets, token.End, $4.SkippedTokens) } | T_REQUIRE expr { @@ -5603,9 +4798,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } | T_REQUIRE_ONCE expr { @@ -5615,9 +4808,7 @@ internal_functions_in_yacc: $$.GetNode().Position = position.NewTokenNodePosition($1, $2) // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) } ; @@ -5625,17 +4816,13 @@ isset_variables: isset_variable { $$ = []ast.Vertex{$1} - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } | isset_variables ',' isset_variable { $$ = append($1, $3) // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.Tokens) - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) + yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -5643,8 +4830,6 @@ isset_variable: expr { $$ = $1 - - yylex.(*Parser).returnTokenToPool(yyDollar, &yyVAL) } ; diff --git a/internal/php7/php7_bench_test.go b/internal/php7/php7_bench_test.go index 558c54b..d5f2636 100644 --- a/internal/php7/php7_bench_test.go +++ b/internal/php7/php7_bench_test.go @@ -382,7 +382,7 @@ CAD; ` for n := 0; n < b.N; n++ { - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() } diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 68364f5..8d52038 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -19595,11 +19595,12 @@ func TestPhp7(t *testing.T) { }, } - lexer := scanner.NewLexer(src, "7.4", false, nil) + lexer := scanner.NewLexer(src, "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19734,11 +19735,12 @@ func TestPhp5Strings(t *testing.T) { }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19962,11 +19964,12 @@ CAD; }, } - lexer := scanner.NewLexer([]byte(src), "7.4", false, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() actual := php7parser.GetRootNode() traverser.NewDFS(new(visitor.FilterParserNodes)).Traverse(actual) + traverser.NewDFS(new(visitor.FilterTokens)).Traverse(actual) assert.DeepEqual(t, expected, actual) } @@ -19989,7 +19992,7 @@ func TestPhp7ControlCharsErrors(t *testing.T) { parserErrors = append(parserErrors, e) } - lexer := scanner.NewLexer([]byte(src), "7.4", false, errorHandlerFunc) + lexer := scanner.NewLexer([]byte(src), "7.4", errorHandlerFunc) php7parser := php7.NewParser(lexer, errorHandlerFunc) php7parser.Parse() assert.DeepEqual(t, expected, parserErrors) diff --git a/internal/position/position.go b/internal/position/position.go index cbcc309..2603826 100644 --- a/internal/position/position.go +++ b/internal/position/position.go @@ -1,9 +1,9 @@ package position import ( - "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" ) type startPos struct { @@ -95,7 +95,7 @@ func NewNodePosition(n ast.Vertex) *position.Position { } // NewTokenPosition returns new Position -func NewTokenPosition(t *scanner.Token) *position.Position { +func NewTokenPosition(t *token.Token) *position.Position { return &position.Position{ StartLine: t.Position.StartLine, EndLine: t.Position.EndLine, @@ -105,7 +105,7 @@ func NewTokenPosition(t *scanner.Token) *position.Position { } // NewTokensPosition returns new Position -func NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *position.Position { +func NewTokensPosition(startToken *token.Token, endToken *token.Token) *position.Position { return &position.Position{ StartLine: startToken.Position.StartLine, EndLine: endToken.Position.EndLine, @@ -115,7 +115,7 @@ func NewTokensPosition(startToken *scanner.Token, endToken *scanner.Token) *posi } // NewTokenNodePosition returns new Position -func NewTokenNodePosition(t *scanner.Token, n ast.Vertex) *position.Position { +func NewTokenNodePosition(t *token.Token, n ast.Vertex) *position.Position { return &position.Position{ StartLine: t.Position.StartLine, EndLine: getNodeEndPos(n).endLine, @@ -125,7 +125,7 @@ func NewTokenNodePosition(t *scanner.Token, n ast.Vertex) *position.Position { } // NewNodeTokenPosition returns new Position -func NewNodeTokenPosition(n ast.Vertex, t *scanner.Token) *position.Position { +func NewNodeTokenPosition(n ast.Vertex, t *token.Token) *position.Position { return &position.Position{ StartLine: getNodeStartPos(n).startLine, EndLine: t.Position.EndLine, @@ -145,7 +145,7 @@ func NewNodesPosition(startNode ast.Vertex, endNode ast.Vertex) *position.Positi } // NewNodeListTokenPosition returns new Position -func NewNodeListTokenPosition(list []ast.Vertex, t *scanner.Token) *position.Position { +func NewNodeListTokenPosition(list []ast.Vertex, t *token.Token) *position.Position { return &position.Position{ StartLine: getListStartPos(list).startLine, EndLine: t.Position.EndLine, @@ -155,7 +155,7 @@ func NewNodeListTokenPosition(list []ast.Vertex, t *scanner.Token) *position.Pos } // NewTokenNodeListPosition returns new Position -func NewTokenNodeListPosition(t *scanner.Token, list []ast.Vertex) *position.Position { +func NewTokenNodeListPosition(t *token.Token, list []ast.Vertex) *position.Position { return &position.Position{ StartLine: t.Position.StartLine, EndLine: getListEndPos(list).endLine, @@ -185,7 +185,7 @@ func NewNodeListNodePosition(list []ast.Vertex, n ast.Vertex) *position.Position } // NewOptionalListTokensPosition returns new Position -func NewOptionalListTokensPosition(list []ast.Vertex, t *scanner.Token, endToken *scanner.Token) *position.Position { +func NewOptionalListTokensPosition(list []ast.Vertex, t *token.Token, endToken *token.Token) *position.Position { if list == nil { return &position.Position{ StartLine: t.Position.StartLine, diff --git a/internal/position/position_test.go b/internal/position/position_test.go index f932f2d..1fd6c83 100644 --- a/internal/position/position_test.go +++ b/internal/position/position_test.go @@ -5,15 +5,15 @@ import ( "testing" builder "github.com/z7zmey/php-parser/internal/position" - "github.com/z7zmey/php-parser/internal/scanner" "github.com/z7zmey/php-parser/pkg/ast" "github.com/z7zmey/php-parser/pkg/position" + "github.com/z7zmey/php-parser/pkg/token" ) func TestNewTokenPosition(t *testing.T) { - tkn := &scanner.Token{ + tkn := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, @@ -29,18 +29,18 @@ func TestNewTokenPosition(t *testing.T) { } func TestNewTokensPosition(t *testing.T) { - token1 := &scanner.Token{ + token1 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, EndPos: 3, }, } - token2 := &scanner.Token{ + token2 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 4, @@ -71,9 +71,9 @@ func TestNewNodePosition(t *testing.T) { } func TestNewTokenNodePosition(t *testing.T) { - tkn := &scanner.Token{ + tkn := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, @@ -108,9 +108,9 @@ func TestNewNodeTokenPosition(t *testing.T) { }, } - tkn := &scanner.Token{ + tkn := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 10, @@ -202,9 +202,9 @@ func TestNewNodeListTokenPosition(t *testing.T) { }, } - tkn := &scanner.Token{ + tkn := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 3, EndLine: 3, StartPos: 20, @@ -218,9 +218,9 @@ func TestNewNodeListTokenPosition(t *testing.T) { } func TestNewTokenNodeListPosition(t *testing.T) { - tkn := &scanner.Token{ + tkn := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, @@ -332,18 +332,18 @@ func TestNewNodeListNodePosition(t *testing.T) { } func TestNewOptionalListTokensPosition(t *testing.T) { - token1 := &scanner.Token{ + token1 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, EndPos: 3, }, } - token2 := &scanner.Token{ + token2 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 2, EndLine: 2, StartPos: 4, @@ -378,18 +378,18 @@ func TestNewOptionalListTokensPosition2(t *testing.T) { }, } - token1 := &scanner.Token{ + token1 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 4, EndLine: 4, StartPos: 27, EndPos: 29, }, } - token2 := &scanner.Token{ + token2 := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 5, EndLine: 5, StartPos: 30, @@ -426,9 +426,9 @@ func TestNilNodeListPos(t *testing.T) { } func TestNilNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ + token := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, @@ -459,9 +459,9 @@ func TestEmptyNodeListPos(t *testing.T) { } func TestEmptyNodeListTokenPos(t *testing.T) { - token := &scanner.Token{ + token := &token.Token{ Value: []byte(`foo`), - Position: position.Position{ + Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 0, diff --git a/internal/scanner/lexer.go b/internal/scanner/lexer.go index 7456961..b21ff7c 100644 --- a/internal/scanner/lexer.go +++ b/internal/scanner/lexer.go @@ -13,31 +13,32 @@ import ( type Lexer struct { data []byte phpVersion string - withTokens bool errHandlerFunc func(*errors.Error) + sts, ste int p, pe, cs int ts, te, act int stack []int top int heredocLabel []byte - tokenPool *TokenPool + tokenPool *token.Pool + positionPool *position.Pool newLines NewLines } -func NewLexer(data []byte, phpVersion string, withTokens bool, errHandlerFunc func(*errors.Error)) *Lexer { +func NewLexer(data []byte, phpVersion string, errHandlerFunc func(*errors.Error)) *Lexer { lex := &Lexer{ data: data, phpVersion: phpVersion, - withTokens: withTokens, errHandlerFunc: errHandlerFunc, pe: len(data), stack: make([]int, 0), - tokenPool: &TokenPool{}, - newLines: NewLines{make([]int, 0, 128)}, + tokenPool: token.NewPool(position.DefaultBlockSize), + positionPool: position.NewPool(position.DefaultBlockSize), + newLines: NewLines{make([]int, 0, 128)}, } initLexer(lex) @@ -45,26 +46,37 @@ func NewLexer(data []byte, phpVersion string, withTokens bool, errHandlerFunc fu return lex } -func (lex *Lexer) ReturnTokenToPool(t *Token) { - lex.tokenPool.Put(t) +func (lex *Lexer) setTokenPosition(token *token.Token) { + pos := lex.positionPool.Get() + + pos.StartLine = lex.newLines.GetLine(lex.ts) + pos.EndLine = lex.newLines.GetLine(lex.te - 1) + pos.StartPos = lex.ts + pos.EndPos = lex.te + + token.Position = pos } -func (lex *Lexer) setTokenPosition(token *Token) { - token.Position.StartLine = lex.newLines.GetLine(lex.ts) - token.Position.EndLine = lex.newLines.GetLine(lex.te - 1) - token.Position.StartPos = lex.ts - token.Position.EndPos = lex.te -} - -func (lex *Lexer) addHiddenToken(t *Token, id TokenID, ps, pe int) { - if !lex.withTokens { - return +func (lex *Lexer) addSkippedToken(t *token.Token, id token.ID, ps, pe int) { + if lex.sts == 0 { + lex.sts = lex.ts } - t.Tokens = append(t.Tokens, token.Token{ - ID: token.ID(id), - Value: lex.data[ps:pe], - }) + lex.ste = lex.te + + // TODO remove after parser refactoring + + skippedTkn := lex.tokenPool.Get() + skippedTkn.ID = id + skippedTkn.Value = lex.data[ps:pe] + + lex.setTokenPosition(skippedTkn) + + if t.SkippedTokens == nil { + t.SkippedTokens = make([]*token.Token, 0, 2) + } + + t.SkippedTokens = append(t.SkippedTokens, skippedTkn) } func (lex *Lexer) isNotStringVar() bool { diff --git a/internal/scanner/lexer_tokens.go b/internal/scanner/lexer_tokens.go deleted file mode 100644 index bd54024..0000000 --- a/internal/scanner/lexer_tokens.go +++ /dev/null @@ -1,145 +0,0 @@ -package scanner - -type TokenID int - -//go:generate stringer -type=TokenID -output ./tokenid_string.go -const ( - T_INCLUDE TokenID = iota + 57346 - T_INCLUDE_ONCE - T_EXIT - T_IF - T_LNUMBER - T_DNUMBER - T_STRING - T_STRING_VARNAME - T_VARIABLE - T_NUM_STRING - T_INLINE_HTML - T_CHARACTER - T_BAD_CHARACTER - T_ENCAPSED_AND_WHITESPACE - T_CONSTANT_ENCAPSED_STRING - T_ECHO - T_DO - T_WHILE - T_ENDWHILE - T_FOR - T_ENDFOR - T_FOREACH - T_ENDFOREACH - T_DECLARE - T_ENDDECLARE - T_AS - T_SWITCH - T_ENDSWITCH - T_CASE - T_DEFAULT - T_BREAK - T_CONTINUE - T_GOTO - T_FUNCTION - T_FN - T_CONST - T_RETURN - T_TRY - T_CATCH - T_FINALLY - T_THROW - T_USE - T_INSTEADOF - T_GLOBAL - T_VAR - T_UNSET - T_ISSET - T_EMPTY - T_HALT_COMPILER - T_CLASS - T_TRAIT - T_INTERFACE - T_EXTENDS - T_IMPLEMENTS - T_OBJECT_OPERATOR - T_DOUBLE_ARROW - T_LIST - T_ARRAY - T_CALLABLE - T_CLASS_C - T_TRAIT_C - T_METHOD_C - T_FUNC_C - T_LINE - T_FILE - T_COMMENT - T_DOC_COMMENT - T_OPEN_TAG - T_OPEN_TAG_WITH_ECHO - T_CLOSE_TAG - T_WHITESPACE - T_START_HEREDOC - T_END_HEREDOC - T_DOLLAR_OPEN_CURLY_BRACES - T_CURLY_OPEN - T_PAAMAYIM_NEKUDOTAYIM - T_NAMESPACE - T_NS_C - T_DIR - T_NS_SEPARATOR - T_ELLIPSIS - T_EVAL - T_REQUIRE - T_REQUIRE_ONCE - T_LOGICAL_OR - T_LOGICAL_XOR - T_LOGICAL_AND - T_INSTANCEOF - T_NEW - T_CLONE - T_ELSEIF - T_ELSE - T_ENDIF - T_PRINT - T_YIELD - T_STATIC - T_ABSTRACT - T_FINAL - T_PRIVATE - T_PROTECTED - T_PUBLIC - T_INC - T_DEC - T_YIELD_FROM - T_INT_CAST - T_DOUBLE_CAST - T_STRING_CAST - T_ARRAY_CAST - T_OBJECT_CAST - T_BOOL_CAST - T_UNSET_CAST - T_COALESCE - T_SPACESHIP - T_NOELSE - T_PLUS_EQUAL - T_MINUS_EQUAL - T_MUL_EQUAL - T_POW_EQUAL - T_DIV_EQUAL - T_CONCAT_EQUAL - T_MOD_EQUAL - T_AND_EQUAL - T_OR_EQUAL - T_XOR_EQUAL - T_SL_EQUAL - T_SR_EQUAL - T_COALESCE_EQUAL - T_BOOLEAN_OR - T_BOOLEAN_AND - T_POW - T_SL - T_SR - T_IS_IDENTICAL - T_IS_NOT_IDENTICAL - T_IS_EQUAL - T_IS_NOT_EQUAL - T_IS_SMALLER_OR_EQUAL - T_IS_GREATER_OR_EQUAL -) diff --git a/internal/scanner/scanner.go b/internal/scanner/scanner.go index c6ebf1c01cc16db50a01950d23e82b5e6d4ae3c5..f90db2331179561005b52c12de75d42bed8a805e 100644 GIT binary patch delta 13091 zcmb7LcU)D+68`PIXAuwtW5t4~!5~Gd6crQ!BZekLL!OBe#qul|yGTbsV?kJPf@l=P z8Vg3@7^6mwqDDor1{;FWXku*dB^rIkH+#;#6g`KSe{}Ee?9A-Ux3jaehtoM0TUJ;s z`?!~}QMYjuW{jWtX|K_7lO5wd;wQ(>b(}hWs>9TnY13n;IZmB8&T&TE#Mmj_jC&dz zL*YfOHR-)G^SOq2uvG0J;>wO|qsjT4QH$IhHG+RA29>>MlGpx8OF(|TIre>Od> zY$XQ0Sd3t0DmMfDjg5_FOk~-DMF(ReoY8CgjOkY1R!;gKvHSKb=Ed zp>PuI!A2&z9FM6_*Ne&%j#*B%W zIAQA4*fEiO9X2y2PO-PrX|(T7Pxfo_QR2pSro13t_-`k6A~jg!=FE03E@h|F<`8EX zx|O=I`1DA*w~S@ZPa*ECS;hyXH^gL6oA#>gmuAdEriBZ;ub|Y3xo381iqwL2USz{I zXFB4P)MPuh?2a+BTF|-G#3?Y#r*hfQ7O%bu<&|A(Ta zX>$s_E%h2U#8~7=-+>X4;l6&6EN6!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|TZlir@1mcq zV<=8GvS%&f<%27n1>MgW7WvA4wK-`dJqcqY8UHTR0e;>?8cLbH**dMp&uF*uAuS;) zK9UcqaDtW5Yyf-|!^E>z8g!1q&@bzQ-u@dp6N7(l z#??U!n_}2VV;+9mU!}u_^Suw(Vo?xkX?hKc>TWzkVetf>_f_I_S|Kl~C*T$ss{;&d_K8`%W|@yd*l1g;99}9Kx`9Fob2{ zu{&)D6SsB=KZWxZM>&??ouqa{nFqznD6cu|AWa$01`|HmW;0~tNS33~ zUo}Jr2lfxgg6EWy;lZAc!=0>n>K275sLWOfL157p@;{hG}76Va%+FrGz7e~n{jwB}dY+CJJ8?}VPv zBb9Z7`V;j_$`dZ6vaWD#VqK{cH<9HSdh)7YTMD^D47r4F<@)ZuI_1+zEJ;jW!>s+2 z(JZ+I;w5dL!g>;v^em0d#mLBaFod;&bLs4yA*j0{Hj@oPBEv;YeBKCiv)EL@FqOR! zWO7e$|1?&kLXtt}vN0Vz^|!CdIZR*s3;vYp$nR}J*n-Cl=2at#b-bhMplk*UhHqx- zJ?a6U%|r*Mj?wCVh4?0 zjGoI{N*~W=PQtyj=dd{%cf++6G5V{O@WbPI3fDU4u`G>`Oza7_@|b+JLT}c%XW*~B zFnR$?H@fh^B0ShSEMy+0nAt2s2g?i31rQr*-XrVERvjb(3&xhayl~usEoR*o0b{)U zmWN`~5GA4bn86O#EM}v{=7PJwdK${^MbQ?JyTnui5WhF%8CZY;7WZXw?Rl#4GdS|W za%Ly}wUl)fF7CJ-GuY5YK!n-DxhoYOKDr8hBhz}qq}3(|7sKZ^S94%*)J-mwt0)@j!N4|J$a<^TWy diff --git a/internal/scanner/scanner.rl b/internal/scanner/scanner.rl index cd29221..18874ae 100644 --- a/internal/scanner/scanner.rl +++ b/internal/scanner/scanner.rl @@ -4,6 +4,8 @@ import ( "fmt" "strconv" "strings" + + "github.com/z7zmey/php-parser/pkg/token" ) %%{ @@ -18,13 +20,14 @@ func initLexer(lex *Lexer) { %% write init; } -func (lex *Lexer) Lex() *Token { +func (lex *Lexer) Lex() *token.Token { eof := lex.pe - var tok TokenID + var tok token.ID - token := lex.tokenPool.Get() - token.Tokens = token.Tokens[:0] - token.Value = lex.data[0:0] + tkn := lex.tokenPool.Get() + + lex.sts = 0 + lex.ste = 0 lblStart := 0 lblEnd := 0 @@ -124,7 +127,7 @@ func (lex *Lexer) Lex() *Token { main := |* "#!" any* :>> newline => { - lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) + lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) }; any => { fnext html; @@ -135,42 +138,42 @@ func (lex *Lexer) Lex() *Token { html := |* any_line+ -- ' { lex.ungetStr("<") - lex.setTokenPosition(token) - tok = T_INLINE_HTML; + lex.setTokenPosition(tkn) + tok = token.T_INLINE_HTML; fbreak; }; ' { - lex.addHiddenToken(token, T_OPEN_TAG, lex.ts, lex.te) + lex.addSkippedToken(tkn, token.T_OPEN_TAG, lex.ts, lex.te) fnext php; }; ' { lex.ungetCnt(lex.te - lex.ts - 5) - lex.addHiddenToken(token, T_OPEN_TAG, lex.ts, lex.ts+5) + lex.addSkippedToken(tkn, token.T_OPEN_TAG, lex.ts, lex.ts+5) fnext php; }; ' { - lex.setTokenPosition(token); - tok = T_ECHO; + lex.setTokenPosition(tkn); + tok = token.T_ECHO; fnext php; fbreak; }; *|; php := |* - whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; - '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; - ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext html; fbreak;}; + whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + '?>' newline? => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext html; fbreak;}; + ';' whitespace_line* '?>' newline? => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext html; fbreak;}; - (dnum | exponent_dnum) => {lex.setTokenPosition(token); tok = T_DNUMBER; fbreak;}; + (dnum | exponent_dnum) => {lex.setTokenPosition(tkn); tok = token.T_DNUMBER; fbreak;}; bnum => { s := strings.Replace(string(lex.data[lex.ts+2:lex.te]), "_", "", -1) _, err := strconv.ParseInt(s, 2, 0) if err == nil { - lex.setTokenPosition(token); tok = T_LNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_LNUMBER; fbreak; } - lex.setTokenPosition(token); tok = T_DNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_DNUMBER; fbreak; }; lnum => { base := 10 @@ -182,142 +185,142 @@ func (lex *Lexer) Lex() *Token { _, err := strconv.ParseInt(s, base, 0) if err == nil { - lex.setTokenPosition(token); tok = T_LNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_LNUMBER; fbreak; } - lex.setTokenPosition(token); tok = T_DNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_DNUMBER; fbreak; }; hnum => { s := strings.Replace(string(lex.data[lex.ts+2:lex.te]), "_", "", -1) _, err := strconv.ParseInt(s, 16, 0) if err == nil { - lex.setTokenPosition(token); tok = T_LNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_LNUMBER; fbreak; } - lex.setTokenPosition(token); tok = T_DNUMBER; fbreak; + lex.setTokenPosition(tkn); tok = token.T_DNUMBER; fbreak; }; - 'abstract'i => {lex.setTokenPosition(token); tok = T_ABSTRACT; fbreak;}; - 'array'i => {lex.setTokenPosition(token); tok = T_ARRAY; fbreak;}; - 'as'i => {lex.setTokenPosition(token); tok = T_AS; fbreak;}; - 'break'i => {lex.setTokenPosition(token); tok = T_BREAK; fbreak;}; - 'callable'i => {lex.setTokenPosition(token); tok = T_CALLABLE; fbreak;}; - 'case'i => {lex.setTokenPosition(token); tok = T_CASE; fbreak;}; - 'catch'i => {lex.setTokenPosition(token); tok = T_CATCH; fbreak;}; - 'class'i => {lex.setTokenPosition(token); tok = T_CLASS; fbreak;}; - 'clone'i => {lex.setTokenPosition(token); tok = T_CLONE; fbreak;}; - 'const'i => {lex.setTokenPosition(token); tok = T_CONST; fbreak;}; - 'continue'i => {lex.setTokenPosition(token); tok = T_CONTINUE; fbreak;}; - 'declare'i => {lex.setTokenPosition(token); tok = T_DECLARE; fbreak;}; - 'default'i => {lex.setTokenPosition(token); tok = T_DEFAULT; fbreak;}; - 'do'i => {lex.setTokenPosition(token); tok = T_DO; fbreak;}; - 'echo'i => {lex.setTokenPosition(token); tok = T_ECHO; fbreak;}; - 'else'i => {lex.setTokenPosition(token); tok = T_ELSE; fbreak;}; - 'elseif'i => {lex.setTokenPosition(token); tok = T_ELSEIF; fbreak;}; - 'empty'i => {lex.setTokenPosition(token); tok = T_EMPTY; fbreak;}; - 'enddeclare'i => {lex.setTokenPosition(token); tok = T_ENDDECLARE; fbreak;}; - 'endfor'i => {lex.setTokenPosition(token); tok = T_ENDFOR; fbreak;}; - 'endforeach'i => {lex.setTokenPosition(token); tok = T_ENDFOREACH; fbreak;}; - 'endif'i => {lex.setTokenPosition(token); tok = T_ENDIF; fbreak;}; - 'endswitch'i => {lex.setTokenPosition(token); tok = T_ENDSWITCH; fbreak;}; - 'endwhile'i => {lex.setTokenPosition(token); tok = T_ENDWHILE; fbreak;}; - 'eval'i => {lex.setTokenPosition(token); tok = T_EVAL; fbreak;}; - 'exit'i | 'die'i => {lex.setTokenPosition(token); tok = T_EXIT; fbreak;}; - 'extends'i => {lex.setTokenPosition(token); tok = T_EXTENDS; fbreak;}; - 'final'i => {lex.setTokenPosition(token); tok = T_FINAL; fbreak;}; - 'finally'i => {lex.setTokenPosition(token); tok = T_FINALLY; fbreak;}; - 'for'i => {lex.setTokenPosition(token); tok = T_FOR; fbreak;}; - 'foreach'i => {lex.setTokenPosition(token); tok = T_FOREACH; fbreak;}; - 'function'i | 'cfunction'i => {lex.setTokenPosition(token); tok = T_FUNCTION; fbreak;}; - 'fn'i => {lex.setTokenPosition(token); tok = T_FN; fbreak;}; - 'global'i => {lex.setTokenPosition(token); tok = T_GLOBAL; fbreak;}; - 'goto'i => {lex.setTokenPosition(token); tok = T_GOTO; fbreak;}; - 'if'i => {lex.setTokenPosition(token); tok = T_IF; fbreak;}; - 'isset'i => {lex.setTokenPosition(token); tok = T_ISSET; fbreak;}; - 'implements'i => {lex.setTokenPosition(token); tok = T_IMPLEMENTS; fbreak;}; - 'instanceof'i => {lex.setTokenPosition(token); tok = T_INSTANCEOF; fbreak;}; - 'insteadof'i => {lex.setTokenPosition(token); tok = T_INSTEADOF; fbreak;}; - 'interface'i => {lex.setTokenPosition(token); tok = T_INTERFACE; fbreak;}; - 'list'i => {lex.setTokenPosition(token); tok = T_LIST; fbreak;}; - 'namespace'i => {lex.setTokenPosition(token); tok = T_NAMESPACE; fbreak;}; - 'private'i => {lex.setTokenPosition(token); tok = T_PRIVATE; fbreak;}; - 'public'i => {lex.setTokenPosition(token); tok = T_PUBLIC; fbreak;}; - 'print'i => {lex.setTokenPosition(token); tok = T_PRINT; fbreak;}; - 'protected'i => {lex.setTokenPosition(token); tok = T_PROTECTED; fbreak;}; - 'return'i => {lex.setTokenPosition(token); tok = T_RETURN; fbreak;}; - 'static'i => {lex.setTokenPosition(token); tok = T_STATIC; fbreak;}; - 'switch'i => {lex.setTokenPosition(token); tok = T_SWITCH; fbreak;}; - 'throw'i => {lex.setTokenPosition(token); tok = T_THROW; fbreak;}; - 'trait'i => {lex.setTokenPosition(token); tok = T_TRAIT; fbreak;}; - 'try'i => {lex.setTokenPosition(token); tok = T_TRY; fbreak;}; - 'unset'i => {lex.setTokenPosition(token); tok = T_UNSET; fbreak;}; - 'use'i => {lex.setTokenPosition(token); tok = T_USE; fbreak;}; - 'var'i => {lex.setTokenPosition(token); tok = T_VAR; fbreak;}; - 'while'i => {lex.setTokenPosition(token); tok = T_WHILE; fbreak;}; - 'yield'i whitespace_line* 'from'i => {lex.setTokenPosition(token); tok = T_YIELD_FROM; fbreak;}; - 'yield'i => {lex.setTokenPosition(token); tok = T_YIELD; fbreak;}; - 'include'i => {lex.setTokenPosition(token); tok = T_INCLUDE; fbreak;}; - 'include_once'i => {lex.setTokenPosition(token); tok = T_INCLUDE_ONCE; fbreak;}; - 'require'i => {lex.setTokenPosition(token); tok = T_REQUIRE; fbreak;}; - 'require_once'i => {lex.setTokenPosition(token); tok = T_REQUIRE_ONCE; fbreak;}; - '__CLASS__'i => {lex.setTokenPosition(token); tok = T_CLASS_C; fbreak;}; - '__DIR__'i => {lex.setTokenPosition(token); tok = T_DIR; fbreak;}; - '__FILE__'i => {lex.setTokenPosition(token); tok = T_FILE; fbreak;}; - '__FUNCTION__'i => {lex.setTokenPosition(token); tok = T_FUNC_C; fbreak;}; - '__LINE__'i => {lex.setTokenPosition(token); tok = T_LINE; fbreak;}; - '__NAMESPACE__'i => {lex.setTokenPosition(token); tok = T_NS_C; fbreak;}; - '__METHOD__'i => {lex.setTokenPosition(token); tok = T_METHOD_C; fbreak;}; - '__TRAIT__'i => {lex.setTokenPosition(token); tok = T_TRAIT_C; fbreak;}; - '__halt_compiler'i => {lex.setTokenPosition(token); tok = T_HALT_COMPILER; fnext halt_compiller_open_parenthesis; fbreak;}; - 'new'i => {lex.setTokenPosition(token); tok = T_NEW; fbreak;}; - 'and'i => {lex.setTokenPosition(token); tok = T_LOGICAL_AND; fbreak;}; - 'or'i => {lex.setTokenPosition(token); tok = T_LOGICAL_OR; fbreak;}; - 'xor'i => {lex.setTokenPosition(token); tok = T_LOGICAL_XOR; fbreak;}; - '\\' => {lex.setTokenPosition(token); tok = T_NS_SEPARATOR; fbreak;}; - '...' => {lex.setTokenPosition(token); tok = T_ELLIPSIS; fbreak;}; - '::' => {lex.setTokenPosition(token); tok = T_PAAMAYIM_NEKUDOTAYIM; fbreak;}; - '&&' => {lex.setTokenPosition(token); tok = T_BOOLEAN_AND; fbreak;}; - '||' => {lex.setTokenPosition(token); tok = T_BOOLEAN_OR; fbreak;}; - '&=' => {lex.setTokenPosition(token); tok = T_AND_EQUAL; fbreak;}; - '|=' => {lex.setTokenPosition(token); tok = T_OR_EQUAL; fbreak;}; - '.=' => {lex.setTokenPosition(token); tok = T_CONCAT_EQUAL; fbreak;}; - '*=' => {lex.setTokenPosition(token); tok = T_MUL_EQUAL; fbreak;}; - '**=' => {lex.setTokenPosition(token); tok = T_POW_EQUAL; fbreak;}; - '/=' => {lex.setTokenPosition(token); tok = T_DIV_EQUAL; fbreak;}; - '+=' => {lex.setTokenPosition(token); tok = T_PLUS_EQUAL; fbreak;}; - '-=' => {lex.setTokenPosition(token); tok = T_MINUS_EQUAL; fbreak;}; - '^=' => {lex.setTokenPosition(token); tok = T_XOR_EQUAL; fbreak;}; - '%=' => {lex.setTokenPosition(token); tok = T_MOD_EQUAL; fbreak;}; - '--' => {lex.setTokenPosition(token); tok = T_DEC; fbreak;}; - '++' => {lex.setTokenPosition(token); tok = T_INC; fbreak;}; - '=>' => {lex.setTokenPosition(token); tok = T_DOUBLE_ARROW; fbreak;}; - '<=>' => {lex.setTokenPosition(token); tok = T_SPACESHIP; fbreak;}; - '!=' | '<>' => {lex.setTokenPosition(token); tok = T_IS_NOT_EQUAL; fbreak;}; - '!==' => {lex.setTokenPosition(token); tok = T_IS_NOT_IDENTICAL; fbreak;}; - '==' => {lex.setTokenPosition(token); tok = T_IS_EQUAL; fbreak;}; - '===' => {lex.setTokenPosition(token); tok = T_IS_IDENTICAL; fbreak;}; - '<<=' => {lex.setTokenPosition(token); tok = T_SL_EQUAL; fbreak;}; - '>>=' => {lex.setTokenPosition(token); tok = T_SR_EQUAL; fbreak;}; - '>=' => {lex.setTokenPosition(token); tok = T_IS_GREATER_OR_EQUAL; fbreak;}; - '<=' => {lex.setTokenPosition(token); tok = T_IS_SMALLER_OR_EQUAL; fbreak;}; - '**' => {lex.setTokenPosition(token); tok = T_POW; fbreak;}; - '<<' => {lex.setTokenPosition(token); tok = T_SL; fbreak;}; - '>>' => {lex.setTokenPosition(token); tok = T_SR; fbreak;}; - '??' => {lex.setTokenPosition(token); tok = T_COALESCE; fbreak;}; - '??=' => {lex.setTokenPosition(token); tok = T_COALESCE_EQUAL; fbreak;}; + 'abstract'i => {lex.setTokenPosition(tkn); tok = token.T_ABSTRACT; fbreak;}; + 'array'i => {lex.setTokenPosition(tkn); tok = token.T_ARRAY; fbreak;}; + 'as'i => {lex.setTokenPosition(tkn); tok = token.T_AS; fbreak;}; + 'break'i => {lex.setTokenPosition(tkn); tok = token.T_BREAK; fbreak;}; + 'callable'i => {lex.setTokenPosition(tkn); tok = token.T_CALLABLE; fbreak;}; + 'case'i => {lex.setTokenPosition(tkn); tok = token.T_CASE; fbreak;}; + 'catch'i => {lex.setTokenPosition(tkn); tok = token.T_CATCH; fbreak;}; + 'class'i => {lex.setTokenPosition(tkn); tok = token.T_CLASS; fbreak;}; + 'clone'i => {lex.setTokenPosition(tkn); tok = token.T_CLONE; fbreak;}; + 'const'i => {lex.setTokenPosition(tkn); tok = token.T_CONST; fbreak;}; + 'continue'i => {lex.setTokenPosition(tkn); tok = token.T_CONTINUE; fbreak;}; + 'declare'i => {lex.setTokenPosition(tkn); tok = token.T_DECLARE; fbreak;}; + 'default'i => {lex.setTokenPosition(tkn); tok = token.T_DEFAULT; fbreak;}; + 'do'i => {lex.setTokenPosition(tkn); tok = token.T_DO; fbreak;}; + 'echo'i => {lex.setTokenPosition(tkn); tok = token.T_ECHO; fbreak;}; + 'else'i => {lex.setTokenPosition(tkn); tok = token.T_ELSE; fbreak;}; + 'elseif'i => {lex.setTokenPosition(tkn); tok = token.T_ELSEIF; fbreak;}; + 'empty'i => {lex.setTokenPosition(tkn); tok = token.T_EMPTY; fbreak;}; + 'enddeclare'i => {lex.setTokenPosition(tkn); tok = token.T_ENDDECLARE; fbreak;}; + 'endfor'i => {lex.setTokenPosition(tkn); tok = token.T_ENDFOR; fbreak;}; + 'endforeach'i => {lex.setTokenPosition(tkn); tok = token.T_ENDFOREACH; fbreak;}; + 'endif'i => {lex.setTokenPosition(tkn); tok = token.T_ENDIF; fbreak;}; + 'endswitch'i => {lex.setTokenPosition(tkn); tok = token.T_ENDSWITCH; fbreak;}; + 'endwhile'i => {lex.setTokenPosition(tkn); tok = token.T_ENDWHILE; fbreak;}; + 'eval'i => {lex.setTokenPosition(tkn); tok = token.T_EVAL; fbreak;}; + 'exit'i | 'die'i => {lex.setTokenPosition(tkn); tok = token.T_EXIT; fbreak;}; + 'extends'i => {lex.setTokenPosition(tkn); tok = token.T_EXTENDS; fbreak;}; + 'final'i => {lex.setTokenPosition(tkn); tok = token.T_FINAL; fbreak;}; + 'finally'i => {lex.setTokenPosition(tkn); tok = token.T_FINALLY; fbreak;}; + 'for'i => {lex.setTokenPosition(tkn); tok = token.T_FOR; fbreak;}; + 'foreach'i => {lex.setTokenPosition(tkn); tok = token.T_FOREACH; fbreak;}; + 'function'i | 'cfunction'i => {lex.setTokenPosition(tkn); tok = token.T_FUNCTION; fbreak;}; + 'fn'i => {lex.setTokenPosition(tkn); tok = token.T_FN; fbreak;}; + 'global'i => {lex.setTokenPosition(tkn); tok = token.T_GLOBAL; fbreak;}; + 'goto'i => {lex.setTokenPosition(tkn); tok = token.T_GOTO; fbreak;}; + 'if'i => {lex.setTokenPosition(tkn); tok = token.T_IF; fbreak;}; + 'isset'i => {lex.setTokenPosition(tkn); tok = token.T_ISSET; fbreak;}; + 'implements'i => {lex.setTokenPosition(tkn); tok = token.T_IMPLEMENTS; fbreak;}; + 'instanceof'i => {lex.setTokenPosition(tkn); tok = token.T_INSTANCEOF; fbreak;}; + 'insteadof'i => {lex.setTokenPosition(tkn); tok = token.T_INSTEADOF; fbreak;}; + 'interface'i => {lex.setTokenPosition(tkn); tok = token.T_INTERFACE; fbreak;}; + 'list'i => {lex.setTokenPosition(tkn); tok = token.T_LIST; fbreak;}; + 'namespace'i => {lex.setTokenPosition(tkn); tok = token.T_NAMESPACE; fbreak;}; + 'private'i => {lex.setTokenPosition(tkn); tok = token.T_PRIVATE; fbreak;}; + 'public'i => {lex.setTokenPosition(tkn); tok = token.T_PUBLIC; fbreak;}; + 'print'i => {lex.setTokenPosition(tkn); tok = token.T_PRINT; fbreak;}; + 'protected'i => {lex.setTokenPosition(tkn); tok = token.T_PROTECTED; fbreak;}; + 'return'i => {lex.setTokenPosition(tkn); tok = token.T_RETURN; fbreak;}; + 'static'i => {lex.setTokenPosition(tkn); tok = token.T_STATIC; fbreak;}; + 'switch'i => {lex.setTokenPosition(tkn); tok = token.T_SWITCH; fbreak;}; + 'throw'i => {lex.setTokenPosition(tkn); tok = token.T_THROW; fbreak;}; + 'trait'i => {lex.setTokenPosition(tkn); tok = token.T_TRAIT; fbreak;}; + 'try'i => {lex.setTokenPosition(tkn); tok = token.T_TRY; fbreak;}; + 'unset'i => {lex.setTokenPosition(tkn); tok = token.T_UNSET; fbreak;}; + 'use'i => {lex.setTokenPosition(tkn); tok = token.T_USE; fbreak;}; + 'var'i => {lex.setTokenPosition(tkn); tok = token.T_VAR; fbreak;}; + 'while'i => {lex.setTokenPosition(tkn); tok = token.T_WHILE; fbreak;}; + 'yield'i whitespace_line* 'from'i => {lex.setTokenPosition(tkn); tok = token.T_YIELD_FROM; fbreak;}; + 'yield'i => {lex.setTokenPosition(tkn); tok = token.T_YIELD; fbreak;}; + 'include'i => {lex.setTokenPosition(tkn); tok = token.T_INCLUDE; fbreak;}; + 'include_once'i => {lex.setTokenPosition(tkn); tok = token.T_INCLUDE_ONCE; fbreak;}; + 'require'i => {lex.setTokenPosition(tkn); tok = token.T_REQUIRE; fbreak;}; + 'require_once'i => {lex.setTokenPosition(tkn); tok = token.T_REQUIRE_ONCE; fbreak;}; + '__CLASS__'i => {lex.setTokenPosition(tkn); tok = token.T_CLASS_C; fbreak;}; + '__DIR__'i => {lex.setTokenPosition(tkn); tok = token.T_DIR; fbreak;}; + '__FILE__'i => {lex.setTokenPosition(tkn); tok = token.T_FILE; fbreak;}; + '__FUNCTION__'i => {lex.setTokenPosition(tkn); tok = token.T_FUNC_C; fbreak;}; + '__LINE__'i => {lex.setTokenPosition(tkn); tok = token.T_LINE; fbreak;}; + '__NAMESPACE__'i => {lex.setTokenPosition(tkn); tok = token.T_NS_C; fbreak;}; + '__METHOD__'i => {lex.setTokenPosition(tkn); tok = token.T_METHOD_C; fbreak;}; + '__TRAIT__'i => {lex.setTokenPosition(tkn); tok = token.T_TRAIT_C; fbreak;}; + '__halt_compiler'i => {lex.setTokenPosition(tkn); tok = token.T_HALT_COMPILER; fnext halt_compiller_open_parenthesis; fbreak;}; + 'new'i => {lex.setTokenPosition(tkn); tok = token.T_NEW; fbreak;}; + 'and'i => {lex.setTokenPosition(tkn); tok = token.T_LOGICAL_AND; fbreak;}; + 'or'i => {lex.setTokenPosition(tkn); tok = token.T_LOGICAL_OR; fbreak;}; + 'xor'i => {lex.setTokenPosition(tkn); tok = token.T_LOGICAL_XOR; fbreak;}; + '\\' => {lex.setTokenPosition(tkn); tok = token.T_NS_SEPARATOR; fbreak;}; + '...' => {lex.setTokenPosition(tkn); tok = token.T_ELLIPSIS; fbreak;}; + '::' => {lex.setTokenPosition(tkn); tok = token.T_PAAMAYIM_NEKUDOTAYIM; fbreak;}; + '&&' => {lex.setTokenPosition(tkn); tok = token.T_BOOLEAN_AND; fbreak;}; + '||' => {lex.setTokenPosition(tkn); tok = token.T_BOOLEAN_OR; fbreak;}; + '&=' => {lex.setTokenPosition(tkn); tok = token.T_AND_EQUAL; fbreak;}; + '|=' => {lex.setTokenPosition(tkn); tok = token.T_OR_EQUAL; fbreak;}; + '.=' => {lex.setTokenPosition(tkn); tok = token.T_CONCAT_EQUAL; fbreak;}; + '*=' => {lex.setTokenPosition(tkn); tok = token.T_MUL_EQUAL; fbreak;}; + '**=' => {lex.setTokenPosition(tkn); tok = token.T_POW_EQUAL; fbreak;}; + '/=' => {lex.setTokenPosition(tkn); tok = token.T_DIV_EQUAL; fbreak;}; + '+=' => {lex.setTokenPosition(tkn); tok = token.T_PLUS_EQUAL; fbreak;}; + '-=' => {lex.setTokenPosition(tkn); tok = token.T_MINUS_EQUAL; fbreak;}; + '^=' => {lex.setTokenPosition(tkn); tok = token.T_XOR_EQUAL; fbreak;}; + '%=' => {lex.setTokenPosition(tkn); tok = token.T_MOD_EQUAL; fbreak;}; + '--' => {lex.setTokenPosition(tkn); tok = token.T_DEC; fbreak;}; + '++' => {lex.setTokenPosition(tkn); tok = token.T_INC; fbreak;}; + '=>' => {lex.setTokenPosition(tkn); tok = token.T_DOUBLE_ARROW; fbreak;}; + '<=>' => {lex.setTokenPosition(tkn); tok = token.T_SPACESHIP; fbreak;}; + '!=' | '<>' => {lex.setTokenPosition(tkn); tok = token.T_IS_NOT_EQUAL; fbreak;}; + '!==' => {lex.setTokenPosition(tkn); tok = token.T_IS_NOT_IDENTICAL; fbreak;}; + '==' => {lex.setTokenPosition(tkn); tok = token.T_IS_EQUAL; fbreak;}; + '===' => {lex.setTokenPosition(tkn); tok = token.T_IS_IDENTICAL; fbreak;}; + '<<=' => {lex.setTokenPosition(tkn); tok = token.T_SL_EQUAL; fbreak;}; + '>>=' => {lex.setTokenPosition(tkn); tok = token.T_SR_EQUAL; fbreak;}; + '>=' => {lex.setTokenPosition(tkn); tok = token.T_IS_GREATER_OR_EQUAL; fbreak;}; + '<=' => {lex.setTokenPosition(tkn); tok = token.T_IS_SMALLER_OR_EQUAL; fbreak;}; + '**' => {lex.setTokenPosition(tkn); tok = token.T_POW; fbreak;}; + '<<' => {lex.setTokenPosition(tkn); tok = token.T_SL; fbreak;}; + '>>' => {lex.setTokenPosition(tkn); tok = token.T_SR; fbreak;}; + '??' => {lex.setTokenPosition(tkn); tok = token.T_COALESCE; fbreak;}; + '??=' => {lex.setTokenPosition(tkn); tok = token.T_COALESCE_EQUAL; fbreak;}; - '(' whitespace* 'array'i whitespace* ')' => {lex.setTokenPosition(token); tok = T_ARRAY_CAST; fbreak;}; - '(' whitespace* ('bool'i|'boolean'i) whitespace* ')' => {lex.setTokenPosition(token); tok = T_BOOL_CAST; fbreak;}; - '(' whitespace* ('real'i|'double'i|'float'i) whitespace* ')' => {lex.setTokenPosition(token); tok = T_DOUBLE_CAST; fbreak;}; - '(' whitespace* ('int'i|'integer'i) whitespace* ')' => {lex.setTokenPosition(token); tok = T_INT_CAST; fbreak;}; - '(' whitespace* 'object'i whitespace* ')' => {lex.setTokenPosition(token); tok = T_OBJECT_CAST; fbreak;}; - '(' whitespace* ('string'i|'binary'i) whitespace* ')' => {lex.setTokenPosition(token); tok = T_STRING_CAST; fbreak;}; - '(' whitespace* 'unset'i whitespace* ')' => {lex.setTokenPosition(token); tok = T_UNSET_CAST; fbreak;}; + '(' whitespace* 'array'i whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_ARRAY_CAST; fbreak;}; + '(' whitespace* ('bool'i|'boolean'i) whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_BOOL_CAST; fbreak;}; + '(' whitespace* ('real'i|'double'i|'float'i) whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_DOUBLE_CAST; fbreak;}; + '(' whitespace* ('int'i|'integer'i) whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_INT_CAST; fbreak;}; + '(' whitespace* 'object'i whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_OBJECT_CAST; fbreak;}; + '(' whitespace* ('string'i|'binary'i) whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_STRING_CAST; fbreak;}; + '(' whitespace* 'unset'i whitespace* ')' => {lex.setTokenPosition(tkn); tok = token.T_UNSET_CAST; fbreak;}; ('#' | '//') any_line* when is_not_comment_end => { lex.ungetStr("?>") - lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) + lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) }; '/*' any_line* :>> '*/' { isDocComment := false; @@ -326,37 +329,35 @@ func (lex *Lexer) Lex() *Token { } if isDocComment { - lex.addHiddenToken(token, T_DOC_COMMENT, lex.ts, lex.te) + lex.addSkippedToken(tkn, token.T_DOC_COMMENT, lex.ts, lex.te) } else { - lex.addHiddenToken(token, T_COMMENT, lex.ts, lex.te) + lex.addSkippedToken(tkn, token.T_COMMENT, lex.ts, lex.te) } }; operators => { - // rune, _ := utf8.DecodeRune(lex.data[lex.ts:lex.te]); - // tok = TokenID(Rune2Class(rune)); - lex.setTokenPosition(token); - tok = TokenID(int(lex.data[lex.ts])); + lex.setTokenPosition(tkn); + tok = token.ID(int(lex.data[lex.ts])); fbreak; }; - "{" => { lex.setTokenPosition(token); tok = TokenID(int('{')); lex.call(ftargs, fentry(php)); goto _out; }; - "}" => { lex.setTokenPosition(token); tok = TokenID(int('}')); lex.ret(1); goto _out;}; - "$" varname => { lex.setTokenPosition(token); tok = T_VARIABLE; fbreak; }; - varname => { lex.setTokenPosition(token); tok = T_STRING; fbreak; }; + "{" => { lex.setTokenPosition(tkn); tok = token.ID(int('{')); lex.call(ftargs, fentry(php)); goto _out; }; + "}" => { lex.setTokenPosition(tkn); tok = token.ID(int('}')); lex.ret(1); goto _out;}; + "$" varname => { lex.setTokenPosition(tkn); tok = token.T_VARIABLE; fbreak; }; + varname => { lex.setTokenPosition(tkn); tok = token.T_STRING; fbreak; }; - "->" => { lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fnext property; fbreak; }; + "->" => { lex.setTokenPosition(tkn); tok = token.T_OBJECT_OPERATOR; fnext property; fbreak; }; constant_string => { - lex.setTokenPosition(token); - tok = T_CONSTANT_ENCAPSED_STRING; + lex.setTokenPosition(tkn); + tok = token.T_CONSTANT_ENCAPSED_STRING; fbreak; }; "b"i? "<<<" [ \t]* ( heredoc_label | ("'" heredoc_label "'") | ('"' heredoc_label '"') ) newline => { lex.heredocLabel = lex.data[lblStart:lblEnd] - lex.setTokenPosition(token); - tok = T_START_HEREDOC; + lex.setTokenPosition(tkn); + tok = token.T_START_HEREDOC; if lex.isHeredocEnd(lex.p+1) { fnext heredoc_end; @@ -367,8 +368,8 @@ func (lex *Lexer) Lex() *Token { } fbreak; }; - "`" => {lex.setTokenPosition(token); tok = TokenID(int('`')); fnext backqote; fbreak;}; - '"' => {lex.setTokenPosition(token); tok = TokenID(int('"')); fnext template_string; fbreak;}; + "`" => {lex.setTokenPosition(tkn); tok = token.ID(int('`')); fnext backqote; fbreak;}; + '"' => {lex.setTokenPosition(tkn); tok = token.ID(int('"')); fnext template_string; fbreak;}; any_line => { c := lex.data[lex.p] @@ -377,28 +378,28 @@ func (lex *Lexer) Lex() *Token { *|; property := |* - whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; - "->" => {lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; - varname => {lex.setTokenPosition(token); tok = T_STRING; fnext php; fbreak;}; + whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + "->" => {lex.setTokenPosition(tkn); tok = token.T_OBJECT_OPERATOR; fbreak;}; + varname => {lex.setTokenPosition(tkn); tok = token.T_STRING; fnext php; fbreak;}; any => {lex.ungetCnt(1); fgoto php;}; *|; nowdoc := |* any_line* when is_not_heredoc_end => { - lex.setTokenPosition(token); - tok = T_ENCAPSED_AND_WHITESPACE; + lex.setTokenPosition(tkn); + tok = token.T_ENCAPSED_AND_WHITESPACE; fnext heredoc_end; fbreak; }; *|; heredoc := |* - "{$" => {lex.ungetCnt(1); lex.setTokenPosition(token); tok = T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; - "${" => {lex.setTokenPosition(token); tok = T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; + "{$" => {lex.ungetCnt(1); lex.setTokenPosition(tkn); tok = token.T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; + "${" => {lex.setTokenPosition(tkn); tok = token.T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; "$" => {lex.ungetCnt(1); fcall string_var;}; any_line* when is_not_heredoc_end_or_var => { - lex.setTokenPosition(token); - tok = T_ENCAPSED_AND_WHITESPACE; + lex.setTokenPosition(tkn); + tok = token.T_ENCAPSED_AND_WHITESPACE; if len(lex.data) > lex.p+1 && lex.data[lex.p+1] != '$' && lex.data[lex.p+1] != '{' { fnext heredoc_end; @@ -408,59 +409,59 @@ func (lex *Lexer) Lex() *Token { *|; backqote := |* - "{$" => {lex.ungetCnt(1); lex.setTokenPosition(token); tok = T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; - "${" => {lex.setTokenPosition(token); tok = T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; + "{$" => {lex.ungetCnt(1); lex.setTokenPosition(tkn); tok = token.T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; + "${" => {lex.setTokenPosition(tkn); tok = token.T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; "$" varname_first => {lex.ungetCnt(2); fcall string_var;}; - '`' => {lex.setTokenPosition(token); tok = TokenID(int('`')); fnext php; fbreak;}; + '`' => {lex.setTokenPosition(tkn); tok = token.ID(int('`')); fnext php; fbreak;}; any_line* when is_not_backqoute_end_or_var => { - lex.setTokenPosition(token); - tok = T_ENCAPSED_AND_WHITESPACE; + lex.setTokenPosition(tkn); + tok = token.T_ENCAPSED_AND_WHITESPACE; fbreak; }; *|; template_string := |* - "{$" => {lex.ungetCnt(1); lex.setTokenPosition(token); tok = T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; - "${" => {lex.setTokenPosition(token); tok = T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; + "{$" => {lex.ungetCnt(1); lex.setTokenPosition(tkn); tok = token.T_CURLY_OPEN; lex.call(ftargs, fentry(php)); goto _out;}; + "${" => {lex.setTokenPosition(tkn); tok = token.T_DOLLAR_OPEN_CURLY_BRACES; lex.call(ftargs, fentry(string_var_name)); goto _out;}; "$" varname_first => {lex.ungetCnt(2); fcall string_var;}; - '"' => {lex.setTokenPosition(token); tok = TokenID(int('"')); fnext php; fbreak;}; + '"' => {lex.setTokenPosition(tkn); tok = token.ID(int('"')); fnext php; fbreak;}; any_line* when is_not_string_end_or_var => { - lex.setTokenPosition(token); - tok = T_ENCAPSED_AND_WHITESPACE; + lex.setTokenPosition(tkn); + tok = token.T_ENCAPSED_AND_WHITESPACE; fbreak; }; *|; heredoc_end := |* varname -- ";" => { - lex.setTokenPosition(token); - tok = T_END_HEREDOC; + lex.setTokenPosition(tkn); + tok = token.T_END_HEREDOC; fnext php; fbreak; }; varname => { - lex.setTokenPosition(token); - tok = T_END_HEREDOC; + lex.setTokenPosition(tkn); + tok = token.T_END_HEREDOC; fnext php; fbreak; }; *|; string_var := |* - '$' varname => {lex.setTokenPosition(token); tok = T_VARIABLE; fbreak;}; - '->' varname_first => {lex.ungetCnt(1); lex.setTokenPosition(token); tok = T_OBJECT_OPERATOR; fbreak;}; - varname => {lex.setTokenPosition(token); tok = T_STRING; fbreak;}; - '[' => {lex.setTokenPosition(token); tok = TokenID(int('[')); lex.call(ftargs, fentry(string_var_index)); goto _out;}; + '$' varname => {lex.setTokenPosition(tkn); tok = token.T_VARIABLE; fbreak;}; + '->' varname_first => {lex.ungetCnt(1); lex.setTokenPosition(tkn); tok = token.T_OBJECT_OPERATOR; fbreak;}; + varname => {lex.setTokenPosition(tkn); tok = token.T_STRING; fbreak;}; + '[' => {lex.setTokenPosition(tkn); tok = token.ID(int('[')); lex.call(ftargs, fentry(string_var_index)); goto _out;}; any => {lex.ungetCnt(1); fret;}; *|; string_var_index := |* - lnum | hnum | bnum => {lex.setTokenPosition(token); tok = T_NUM_STRING; fbreak;}; - '$' varname => {lex.setTokenPosition(token); tok = T_VARIABLE; fbreak;}; - varname => {lex.setTokenPosition(token); tok = T_STRING; fbreak;}; - whitespace_line | [\\'#] => {lex.setTokenPosition(token); tok = T_ENCAPSED_AND_WHITESPACE; lex.ret(2); goto _out;}; - operators > (svi, 1) => {lex.setTokenPosition(token); tok = TokenID(int(lex.data[lex.ts])); fbreak;}; - ']' > (svi, 2) => {lex.setTokenPosition(token); tok = TokenID(int(']')); lex.ret(2); goto _out;}; + lnum | hnum | bnum => {lex.setTokenPosition(tkn); tok = token.T_NUM_STRING; fbreak;}; + '$' varname => {lex.setTokenPosition(tkn); tok = token.T_VARIABLE; fbreak;}; + varname => {lex.setTokenPosition(tkn); tok = token.T_STRING; fbreak;}; + whitespace_line | [\\'#] => {lex.setTokenPosition(tkn); tok = token.T_ENCAPSED_AND_WHITESPACE; lex.ret(2); goto _out;}; + operators > (svi, 1) => {lex.setTokenPosition(tkn); tok = token.ID(int(lex.data[lex.ts])); fbreak;}; + ']' > (svi, 2) => {lex.setTokenPosition(tkn); tok = token.ID(int(']')); lex.ret(2); goto _out;}; any_line => { c := lex.data[lex.p] lex.error(fmt.Sprintf("WARNING: Unexpected character in input: '%c' (ASCII=%d)", c, c)); @@ -468,38 +469,39 @@ func (lex *Lexer) Lex() *Token { *|; string_var_name := |* - varname ("[" | "}") => {lex.ungetCnt(1); lex.setTokenPosition(token); tok = T_STRING_VARNAME; fnext php; fbreak;}; + varname ("[" | "}") => {lex.ungetCnt(1); lex.setTokenPosition(tkn); tok = token.T_STRING_VARNAME; fnext php; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_open_parenthesis := |* - whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; - "(" => {lex.setTokenPosition(token); tok = TokenID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; + whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + "(" => {lex.setTokenPosition(tkn); tok = token.ID(int('(')); fnext halt_compiller_close_parenthesis; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_parenthesis := |* - whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; - ")" => {lex.setTokenPosition(token); tok = TokenID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; + whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + ")" => {lex.setTokenPosition(tkn); tok = token.ID(int(')')); fnext halt_compiller_close_semicolon; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_close_semicolon := |* - whitespace_line* => {lex.addHiddenToken(token, T_WHITESPACE, lex.ts, lex.te)}; - ";" => {lex.setTokenPosition(token); tok = TokenID(int(';')); fnext halt_compiller_end; fbreak;}; + whitespace_line* => {lex.addSkippedToken(tkn, token.T_WHITESPACE, lex.ts, lex.te)}; + ";" => {lex.setTokenPosition(tkn); tok = token.ID(int(';')); fnext halt_compiller_end; fbreak;}; any => {lex.ungetCnt(1); fnext php;}; *|; halt_compiller_end := |* - any_line* => { lex.addHiddenToken(token, T_HALT_COMPILER, lex.ts, lex.te); }; + any_line* => { lex.addSkippedToken(tkn, token.T_HALT_COMPILER, lex.ts, lex.te); }; *|; write exec; }%% - token.Value = lex.data[lex.ts:lex.te] - token.ID = tok - lex.addHiddenToken(token, tok, lex.ts, lex.te); + tkn.Value = lex.data[lex.ts:lex.te] + tkn.ID = token.ID(tok) + tkn.SkippedString = lex.data[lex.sts:lex.ste] + lex.addSkippedToken(tkn, tok, lex.ts, lex.te); - return token + return tkn } \ No newline at end of file diff --git a/internal/scanner/scanner_test.go b/internal/scanner/scanner_test.go index 530f972..465c40a 100644 --- a/internal/scanner/scanner_test.go +++ b/internal/scanner/scanner_test.go @@ -1,12 +1,12 @@ package scanner import ( - "github.com/z7zmey/php-parser/pkg/errors" - "github.com/z7zmey/php-parser/pkg/position" + "gotest.tools/assert" "testing" + "github.com/z7zmey/php-parser/pkg/errors" + "github.com/z7zmey/php-parser/pkg/position" "github.com/z7zmey/php-parser/pkg/token" - "gotest.tools/assert" ) func TestTokens(t *testing.T) { @@ -186,175 +186,174 @@ func TestTokens(t *testing.T) { ` expected := []string{ - T_INLINE_HTML.String(), - TokenID(int(';')).String(), - T_INLINE_HTML.String(), - T_ECHO.String(), - TokenID(int(';')).String(), - T_INLINE_HTML.String(), + token.T_INLINE_HTML.String(), + token.ID(int(';')).String(), + token.T_INLINE_HTML.String(), + token.T_ECHO.String(), + token.ID(int(';')).String(), + token.T_INLINE_HTML.String(), - T_ABSTRACT.String(), - T_ARRAY.String(), - T_AS.String(), - T_BREAK.String(), - T_CALLABLE.String(), - T_CASE.String(), - T_CATCH.String(), - T_CLASS.String(), - T_CLONE.String(), - T_CONST.String(), - T_CONTINUE.String(), - T_DECLARE.String(), - T_DEFAULT.String(), - T_DO.String(), - T_ECHO.String(), - T_ELSE.String(), - T_ELSEIF.String(), - T_EMPTY.String(), - T_ENDDECLARE.String(), - T_ENDFOR.String(), - T_ENDFOREACH.String(), - T_ENDIF.String(), - T_ENDSWITCH.String(), - T_ENDWHILE.String(), - T_EVAL.String(), - T_EXIT.String(), - T_EXTENDS.String(), - T_FINAL.String(), - T_FINALLY.String(), - T_FOR.String(), - T_FOREACH.String(), - T_FUNCTION.String(), - T_FUNCTION.String(), - T_GLOBAL.String(), - T_GOTO.String(), - T_IF.String(), - T_ISSET.String(), - T_IMPLEMENTS.String(), - T_INSTANCEOF.String(), - T_INSTEADOF.String(), - T_INTERFACE.String(), - T_LIST.String(), - T_NAMESPACE.String(), - T_PRIVATE.String(), - T_PUBLIC.String(), - T_PRINT.String(), - T_PROTECTED.String(), - T_RETURN.String(), - T_STATIC.String(), - T_SWITCH.String(), - T_THROW.String(), - T_TRAIT.String(), - T_TRY.String(), - T_UNSET.String(), - T_USE.String(), - T_VAR.String(), - T_WHILE.String(), - T_YIELD_FROM.String(), - T_YIELD.String(), - T_INCLUDE.String(), - T_INCLUDE_ONCE.String(), - T_REQUIRE.String(), - T_REQUIRE_ONCE.String(), + token.T_ABSTRACT.String(), + token.T_ARRAY.String(), + token.T_AS.String(), + token.T_BREAK.String(), + token.T_CALLABLE.String(), + token.T_CASE.String(), + token.T_CATCH.String(), + token.T_CLASS.String(), + token.T_CLONE.String(), + token.T_CONST.String(), + token.T_CONTINUE.String(), + token.T_DECLARE.String(), + token.T_DEFAULT.String(), + token.T_DO.String(), + token.T_ECHO.String(), + token.T_ELSE.String(), + token.T_ELSEIF.String(), + token.T_EMPTY.String(), + token.T_ENDDECLARE.String(), + token.T_ENDFOR.String(), + token.T_ENDFOREACH.String(), + token.T_ENDIF.String(), + token.T_ENDSWITCH.String(), + token.T_ENDWHILE.String(), + token.T_EVAL.String(), + token.T_EXIT.String(), + token.T_EXTENDS.String(), + token.T_FINAL.String(), + token.T_FINALLY.String(), + token.T_FOR.String(), + token.T_FOREACH.String(), + token.T_FUNCTION.String(), + token.T_FUNCTION.String(), + token.T_GLOBAL.String(), + token.T_GOTO.String(), + token.T_IF.String(), + token.T_ISSET.String(), + token.T_IMPLEMENTS.String(), + token.T_INSTANCEOF.String(), + token.T_INSTEADOF.String(), + token.T_INTERFACE.String(), + token.T_LIST.String(), + token.T_NAMESPACE.String(), + token.T_PRIVATE.String(), + token.T_PUBLIC.String(), + token.T_PRINT.String(), + token.T_PROTECTED.String(), + token.T_RETURN.String(), + token.T_STATIC.String(), + token.T_SWITCH.String(), + token.T_THROW.String(), + token.T_TRAIT.String(), + token.T_TRY.String(), + token.T_UNSET.String(), + token.T_USE.String(), + token.T_VAR.String(), + token.T_WHILE.String(), + token.T_YIELD_FROM.String(), + token.T_YIELD.String(), + token.T_INCLUDE.String(), + token.T_INCLUDE_ONCE.String(), + token.T_REQUIRE.String(), + token.T_REQUIRE_ONCE.String(), - T_CLASS_C.String(), - T_DIR.String(), - T_FILE.String(), - T_FUNC_C.String(), - T_LINE.String(), - T_NS_C.String(), - T_METHOD_C.String(), - T_TRAIT_C.String(), - T_HALT_COMPILER.String(), + token.T_CLASS_C.String(), + token.T_DIR.String(), + token.T_FILE.String(), + token.T_FUNC_C.String(), + token.T_LINE.String(), + token.T_NS_C.String(), + token.T_METHOD_C.String(), + token.T_TRAIT_C.String(), + token.T_HALT_COMPILER.String(), - T_NEW.String(), - T_LOGICAL_AND.String(), - T_LOGICAL_OR.String(), - T_LOGICAL_XOR.String(), + token.T_NEW.String(), + token.T_LOGICAL_AND.String(), + token.T_LOGICAL_OR.String(), + token.T_LOGICAL_XOR.String(), - T_NS_SEPARATOR.String(), - T_ELLIPSIS.String(), - T_PAAMAYIM_NEKUDOTAYIM.String(), - T_BOOLEAN_AND.String(), - T_BOOLEAN_OR.String(), - T_AND_EQUAL.String(), - T_OR_EQUAL.String(), - T_CONCAT_EQUAL.String(), - T_MUL_EQUAL.String(), - T_POW_EQUAL.String(), - T_DIV_EQUAL.String(), - T_PLUS_EQUAL.String(), - T_MINUS_EQUAL.String(), - T_XOR_EQUAL.String(), - T_MOD_EQUAL.String(), - T_DEC.String(), - T_INC.String(), - T_DOUBLE_ARROW.String(), - T_SPACESHIP.String(), - T_IS_NOT_EQUAL.String(), - T_IS_NOT_EQUAL.String(), - T_IS_NOT_IDENTICAL.String(), - T_IS_EQUAL.String(), - T_IS_IDENTICAL.String(), - T_SL_EQUAL.String(), - T_SR_EQUAL.String(), - T_IS_GREATER_OR_EQUAL.String(), - T_IS_SMALLER_OR_EQUAL.String(), - T_POW.String(), - T_SL.String(), - T_SR.String(), - T_COALESCE.String(), + token.T_NS_SEPARATOR.String(), + token.T_ELLIPSIS.String(), + token.T_PAAMAYIM_NEKUDOTAYIM.String(), + token.T_BOOLEAN_AND.String(), + token.T_BOOLEAN_OR.String(), + token.T_AND_EQUAL.String(), + token.T_OR_EQUAL.String(), + token.T_CONCAT_EQUAL.String(), + token.T_MUL_EQUAL.String(), + token.T_POW_EQUAL.String(), + token.T_DIV_EQUAL.String(), + token.T_PLUS_EQUAL.String(), + token.T_MINUS_EQUAL.String(), + token.T_XOR_EQUAL.String(), + token.T_MOD_EQUAL.String(), + token.T_DEC.String(), + token.T_INC.String(), + token.T_DOUBLE_ARROW.String(), + token.T_SPACESHIP.String(), + token.T_IS_NOT_EQUAL.String(), + token.T_IS_NOT_EQUAL.String(), + token.T_IS_NOT_IDENTICAL.String(), + token.T_IS_EQUAL.String(), + token.T_IS_IDENTICAL.String(), + token.T_SL_EQUAL.String(), + token.T_SR_EQUAL.String(), + token.T_IS_GREATER_OR_EQUAL.String(), + token.T_IS_SMALLER_OR_EQUAL.String(), + token.T_POW.String(), + token.T_SL.String(), + token.T_SR.String(), + token.T_COALESCE.String(), - TokenID(int(';')).String(), - TokenID(int(':')).String(), - TokenID(int(',')).String(), - TokenID(int('.')).String(), - TokenID(int('[')).String(), - TokenID(int(']')).String(), - TokenID(int('(')).String(), - TokenID(int(')')).String(), - TokenID(int('|')).String(), - TokenID(int('/')).String(), - TokenID(int('^')).String(), - TokenID(int('&')).String(), - TokenID(int('+')).String(), - TokenID(int('-')).String(), - TokenID(int('*')).String(), - TokenID(int('=')).String(), - TokenID(int('%')).String(), - TokenID(int('!')).String(), - TokenID(int('~')).String(), - TokenID(int('$')).String(), - TokenID(int('<')).String(), - TokenID(int('>')).String(), - TokenID(int('?')).String(), - TokenID(int('@')).String(), - TokenID(int('{')).String(), - TokenID(int('}')).String(), + token.ID(int(';')).String(), + token.ID(int(':')).String(), + token.ID(int(',')).String(), + token.ID(int('.')).String(), + token.ID(int('[')).String(), + token.ID(int(']')).String(), + token.ID(int('(')).String(), + token.ID(int(')')).String(), + token.ID(int('|')).String(), + token.ID(int('/')).String(), + token.ID(int('^')).String(), + token.ID(int('&')).String(), + token.ID(int('+')).String(), + token.ID(int('-')).String(), + token.ID(int('*')).String(), + token.ID(int('=')).String(), + token.ID(int('%')).String(), + token.ID(int('!')).String(), + token.ID(int('~')).String(), + token.ID(int('$')).String(), + token.ID(int('<')).String(), + token.ID(int('>')).String(), + token.ID(int('?')).String(), + token.ID(int('@')).String(), + token.ID(int('{')).String(), + token.ID(int('}')).String(), - T_VARIABLE.String(), - T_STRING.String(), + token.T_VARIABLE.String(), + token.T_STRING.String(), - T_OBJECT_OPERATOR.String(), - T_OBJECT_OPERATOR.String(), - T_STRING.String(), + token.T_OBJECT_OPERATOR.String(), + token.T_OBJECT_OPERATOR.String(), + token.T_STRING.String(), - T_ARRAY_CAST.String(), - T_BOOL_CAST.String(), - T_BOOL_CAST.String(), - T_DOUBLE_CAST.String(), - T_DOUBLE_CAST.String(), - T_DOUBLE_CAST.String(), - T_INT_CAST.String(), - T_INT_CAST.String(), - T_OBJECT_CAST.String(), - T_STRING_CAST.String(), - T_STRING_CAST.String(), - T_UNSET_CAST.String(), + token.T_ARRAY_CAST.String(), + token.T_BOOL_CAST.String(), + token.T_BOOL_CAST.String(), + token.T_DOUBLE_CAST.String(), + token.T_DOUBLE_CAST.String(), + token.T_DOUBLE_CAST.String(), + token.T_INT_CAST.String(), + token.T_INT_CAST.String(), + token.T_OBJECT_CAST.String(), + token.T_STRING_CAST.String(), + token.T_STRING_CAST.String(), + token.T_UNSET_CAST.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -381,15 +380,14 @@ func TestShebang(t *testing.T) { "\n", } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} tkn := lexer.Lex() - assert.Equal(t, tkn.ID, T_DNUMBER) + assert.Equal(t, tkn.ID, token.T_DNUMBER) - l := len(tkn.Tokens) - for _, tt := range tkn.Tokens[:l-1] { + l := len(tkn.SkippedTokens) + for _, tt := range tkn.SkippedTokens[:l-1] { actual = append(actual, string(tt.Value)) } @@ -402,15 +400,14 @@ func TestShebangHtml(t *testing.T) { 0.1 ` - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) tkn := lexer.Lex() - assert.Equal(t, tkn.ID, T_INLINE_HTML) - assert.Equal(t, string(tkn.Tokens[0].Value), "#!/usr/bin/env php\n") + assert.Equal(t, tkn.ID, token.T_INLINE_HTML) + assert.Equal(t, string(tkn.SkippedTokens[0].Value), "#!/usr/bin/env php\n") tkn = lexer.Lex() - assert.Equal(t, tkn.ID, T_DNUMBER) + assert.Equal(t, tkn.ID, token.T_DNUMBER) } func TestNumberTokens(t *testing.T) { @@ -434,26 +431,25 @@ func TestNumberTokens(t *testing.T) { ` expected := []string{ - T_DNUMBER.String(), - T_DNUMBER.String(), - T_DNUMBER.String(), - T_DNUMBER.String(), + token.T_DNUMBER.String(), + token.T_DNUMBER.String(), + token.T_DNUMBER.String(), + token.T_DNUMBER.String(), - T_LNUMBER.String(), - T_DNUMBER.String(), + token.T_LNUMBER.String(), + token.T_DNUMBER.String(), - T_LNUMBER.String(), - T_DNUMBER.String(), + token.T_LNUMBER.String(), + token.T_DNUMBER.String(), - T_LNUMBER.String(), - T_LNUMBER.String(), + token.T_LNUMBER.String(), + token.T_LNUMBER.String(), - T_DNUMBER.String(), - T_DNUMBER.String(), + token.T_DNUMBER.String(), + token.T_DNUMBER.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -490,27 +486,26 @@ func TestConstantStrings(t *testing.T) { ` expected := []string{ - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -547,16 +542,16 @@ func TestSingleQuoteStringTokens(t *testing.T) { ` expected := []string{ - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), - T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -591,67 +586,66 @@ func TestTeplateStringTokens(t *testing.T) { ` expected := []string{ - TokenID(int('"')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_DOLLAR_OPEN_CURLY_BRACES.String(), - T_STRING_VARNAME.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_DOLLAR_OPEN_CURLY_BRACES.String(), + token.T_STRING_VARNAME.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('"')).String(), - TokenID(int('"')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('"')).String(), + token.ID(int('"')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('"')).String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -682,67 +676,66 @@ func TestBackquoteStringTokens(t *testing.T) { ` expected := []string{ - TokenID(int('`')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_DOLLAR_OPEN_CURLY_BRACES.String(), - T_STRING_VARNAME.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_DOLLAR_OPEN_CURLY_BRACES.String(), + token.T_STRING_VARNAME.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('`')).String(), - TokenID(int('`')).String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - TokenID(int('`')).String(), + token.ID(int('`')).String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.ID(int('`')).String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -782,61 +775,60 @@ CAT; ` expected := []string{ - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_OBJECT_OPERATOR.String(), - T_STRING.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_NUM_STRING.String(), - TokenID(int(']')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_NUM_STRING.String(), - TokenID(int(']')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_NUM_STRING.String(), - TokenID(int(']')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_STRING.String(), - TokenID(int(']')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_VARIABLE.String(), - TokenID(int(']')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_DOLLAR_OPEN_CURLY_BRACES.String(), - T_STRING_VARNAME.String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_OBJECT_OPERATOR.String(), + token.T_STRING.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_NUM_STRING.String(), + token.ID(int(']')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_NUM_STRING.String(), + token.ID(int(']')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_NUM_STRING.String(), + token.ID(int(']')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_STRING.String(), + token.ID(int(']')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_VARIABLE.String(), + token.ID(int(']')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_DOLLAR_OPEN_CURLY_BRACES.String(), + token.T_STRING_VARNAME.String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -875,41 +867,40 @@ CAT ` expected := []string{ - T_START_HEREDOC.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), - T_START_HEREDOC.String(), - T_VARIABLE.String(), - T_VARIABLE.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), + token.T_START_HEREDOC.String(), + token.T_VARIABLE.String(), + token.T_VARIABLE.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -934,21 +925,20 @@ CAT; expected := []string{ - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_CURLY_OPEN.String(), - T_VARIABLE.String(), - TokenID(int('[')).String(), - T_CONSTANT_ENCAPSED_STRING.String(), - TokenID(int(']')).String(), - TokenID(int('}')).String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_CURLY_OPEN.String(), + token.T_VARIABLE.String(), + token.ID(int('[')).String(), + token.T_CONSTANT_ENCAPSED_STRING.String(), + token.ID(int(']')).String(), + token.ID(int('}')).String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -971,15 +961,14 @@ func TestHereDocTokens73(t *testing.T) { expected := []string{ - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(',')).String(), - T_VARIABLE.String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(',')).String(), + token.T_VARIABLE.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -1002,15 +991,14 @@ CAT;` expected := []string{ - T_START_HEREDOC.String(), - T_ENCAPSED_AND_WHITESPACE.String(), - T_END_HEREDOC.String(), - TokenID(int(';')).String(), + token.T_START_HEREDOC.String(), + token.T_ENCAPSED_AND_WHITESPACE.String(), + token.T_END_HEREDOC.String(), + token.ID(int(';')).String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) + lexer := NewLexer([]byte(src), "7.4", nil) lexer.phpVersion = "7.2" - lexer.withTokens = true actual := []string{} for { @@ -1032,17 +1020,16 @@ func TestInlineHtmlNopTokens(t *testing.T) { ` expected := []string{ - T_VARIABLE.String(), - TokenID(int(';')).String(), - T_INLINE_HTML.String(), + token.T_VARIABLE.String(), + token.ID(int(';')).String(), + token.T_INLINE_HTML.String(), - T_VARIABLE.String(), - TokenID(int(';')).String(), - T_INLINE_HTML.String(), + token.T_VARIABLE.String(), + token.ID(int(';')).String(), + token.T_INLINE_HTML.String(), } - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) actual := []string{} for { @@ -1061,11 +1048,11 @@ func TestStringTokensAfterVariable(t *testing.T) { src := ` test` - expected := []token.Token{ + expected := []*token.Token{ { ID: token.T_OPEN_TAG, Value: []byte(" bar ( '' ) ;` - lexer := NewLexer([]byte(src), "7.4", false, nil) - lexer.withTokens = true + lexer := NewLexer([]byte(src), "7.4", nil) - expected := []token.Token{ + expected := []*token.Token{ { ID: token.T_OPEN_TAG, Value: []byte("= TokenID(len(_TokenID_index)-1) { - return "TokenID(" + strconv.FormatInt(int64(i+57346), 10) + ")" - } - return _TokenID_name[_TokenID_index[i]:_TokenID_index[i+1]] -} diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 81f6ef4..85b494a 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -16,6 +16,10 @@ func (n *Node) GetNode() *Node { return n } +func (n *Node) GetPosition() *position.Position { + return n.Position +} + // Root node type Root struct { Node diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 312b888..67bbaac 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -121,7 +121,7 @@ func (v *Dump) printNode(n *ast.Node) { key := token.Position(k) v.printIndent(v.indent + 2) - v.print("token." + key.String() + ": []token.Token{\n") + v.print("token." + key.String() + ": []*token.Token{\n") for _, tkn := range n.Tokens[key] { v.printIndent(v.indent + 3) diff --git a/pkg/ast/visitor/dump_test.go b/pkg/ast/visitor/dump_test.go index cc9a387..0ccdc27 100644 --- a/pkg/ast/visitor/dump_test.go +++ b/pkg/ast/visitor/dump_test.go @@ -13,7 +13,7 @@ func ExampleDump() { stxTree := &ast.Root{ Node: ast.Node{ Tokens: token.Collection{ - token.Start: []token.Token{ + token.Start: []*token.Token{ { ID: token.T_WHITESPACE, Value: []byte(" "), @@ -44,7 +44,7 @@ func ExampleDump() { //&ast.Root{ // Node: ast.Node{ // Tokens: token.Collection{ - // token.Start: []token.Token{ + // token.Start: []*token.Token{ // { // ID: token.T_WHITESPACE, // Value: []byte(" "), diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go new file mode 100644 index 0000000..c69a3f6 --- /dev/null +++ b/pkg/ast/visitor/filter_tokens.go @@ -0,0 +1,14 @@ +package visitor + +import ( + "github.com/z7zmey/php-parser/pkg/ast" +) + +type FilterTokens struct { + Null +} + +func (v *FilterTokens) EnterNode(n ast.Vertex) bool { + n.GetNode().Tokens = nil + return true +} diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 67974fd..a50d09e 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -29,7 +29,7 @@ func Parse(src []byte, ver string, cfg Config) (ast.Vertex, error) { return nil, err } - lexer := scanner.NewLexer(src, ver, cfg.WithTokens, cfg.ErrorHandlerFunc) + lexer := scanner.NewLexer(src, ver, cfg.ErrorHandlerFunc) if r == -1 { parser = php5.NewParser(lexer, cfg.ErrorHandlerFunc) diff --git a/pkg/position/pool.go b/pkg/position/pool.go new file mode 100644 index 0000000..ad26891 --- /dev/null +++ b/pkg/position/pool.go @@ -0,0 +1,29 @@ +package position + +const DefaultBlockSize = 1024 + +type Pool struct { + block []Position + off int +} + +func NewPool(blockSize int) *Pool { + return &Pool{ + block: make([]Position, blockSize), + } +} + +func (p *Pool) Get() *Position { + if len(p.block) == 0 { + return nil + } + + if len(p.block) == p.off { + p.block = make([]Position, len(p.block)) + p.off = 0 + } + + p.off++ + + return &p.block[p.off-1] +} diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 24b5acd..2745542 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -12,7 +12,7 @@ import ( ) func parsePhp5(src string) ast.Vertex { - lexer := scanner.NewLexer([]byte(src), "5.6", true, nil) + lexer := scanner.NewLexer([]byte(src), "5.6", nil) php5parser := php5.NewParser(lexer, nil) php5parser.Parse() diff --git a/pkg/printer/printer_parsed_php7_test.go b/pkg/printer/printer_parsed_php7_test.go index 317ea02..5978f5d 100644 --- a/pkg/printer/printer_parsed_php7_test.go +++ b/pkg/printer/printer_parsed_php7_test.go @@ -29,7 +29,7 @@ abstract class Bar extends Baz // parse - lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() @@ -61,7 +61,7 @@ abstract class Bar extends Baz } func parse(src string) ast.Vertex { - lexer := scanner.NewLexer([]byte(src), "7.4", true, nil) + lexer := scanner.NewLexer([]byte(src), "7.4", nil) php7parser := php7.NewParser(lexer, nil) php7parser.Parse() diff --git a/pkg/printer/printer_test.go b/pkg/printer/printer_test.go index 8e85ac0..8e6d4e0 100644 --- a/pkg/printer/printer_test.go +++ b/pkg/printer/printer_test.go @@ -75,7 +75,7 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { Expr: &ast.ExprVariable{ Node: ast.Node{ Tokens: token.Collection{ - token.Start: []token.Token{ + token.Start: []*token.Token{ { ID: token.ID('$'), Value: []byte("$"), @@ -93,7 +93,7 @@ func TestPrinterPrintFileInlineHtml(t *testing.T) { Expr: &ast.ExprVariable{ Node: ast.Node{ Tokens: token.Collection{ - token.Start: []token.Token{ + token.Start: []*token.Token{ { ID: token.ID('$'), Value: []byte("$"), diff --git a/pkg/token/pool.go b/pkg/token/pool.go new file mode 100644 index 0000000..02c88ee --- /dev/null +++ b/pkg/token/pool.go @@ -0,0 +1,29 @@ +package token + +const DefaultBlockSize = 1024 + +type Pool struct { + block []Token + off int +} + +func NewPool(blockSize int) *Pool { + return &Pool{ + block: make([]Token, blockSize), + } +} + +func (p *Pool) Get() *Token { + if len(p.block) == 0 { + return nil + } + + if len(p.block) == p.off { + p.block = make([]Token, len(p.block)) + p.off = 0 + } + + p.off++ + + return &p.block[p.off-1] +} diff --git a/pkg/token/pool_bench_test.go b/pkg/token/pool_bench_test.go new file mode 100644 index 0000000..f6b3faf --- /dev/null +++ b/pkg/token/pool_bench_test.go @@ -0,0 +1,173 @@ +package token + +import ( + "testing" +) + +const amount = 100000 + +func BenchmarkPlain(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + + for i := 0; i < amount; i++ { + buf = append(buf, &Token{}) + } + } +} + +func BenchmarkSlice128(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 128) + + for i := 0; i < amount; i++ { + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkSlice512(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 512) + + for i := 0; i < amount; i++ { + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkSlice1024(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 1024) + + for i := 0; i < amount; i++ { + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkSlice2048(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 2048) + + for i := 0; i < amount; i++ { + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkBlockAppend128(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 128) + + for i := 0; i < amount; i++ { + if len(slc) == 128 { + slc = make([]Token, 0, 128) + } + + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkBlockAppend512(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 512) + + for i := 0; i < amount; i++ { + if len(slc) == 512 { + slc = make([]Token, 0, 512) + } + + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkBlockAppend1024(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 1024) + + for i := 0; i < amount; i++ { + if len(slc) == 1024 { + slc = make([]Token, 0, 1024) + } + + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkBlockAppend2048(b *testing.B) { + for n := 0; n < b.N; n++ { + buf := make([]*Token, 0, amount) + slc := make([]Token, 0, 2048) + + for i := 0; i < amount; i++ { + if len(slc) == 2048 { + slc = make([]Token, 0, 2048) + } + + slc = append(slc, Token{}) + buf = append(buf, &slc[len(slc)-1]) + } + } +} + +func BenchmarkPool128(b *testing.B) { + for n := 0; n < b.N; n++ { + pool := NewPool(128) + buf := make([]*Token, 0, amount) + + for i := 0; i < amount; i++ { + buf = append(buf, pool.Get()) + } + } +} + +func BenchmarkPool512(b *testing.B) { + for n := 0; n < b.N; n++ { + pool := NewPool(512) + buf := make([]*Token, 0, amount) + + for i := 0; i < amount; i++ { + buf = append(buf, pool.Get()) + } + } +} + +func BenchmarkPool1024(b *testing.B) { + for n := 0; n < b.N; n++ { + pool := NewPool(1024) + buf := make([]*Token, 0, amount) + + for i := 0; i < amount; i++ { + buf = append(buf, pool.Get()) + } + } +} + +func BenchmarkPool2048(b *testing.B) { + for n := 0; n < b.N; n++ { + pool := NewPool(2048) + buf := make([]*Token, 0, amount) + + for i := 0; i < amount; i++ { + buf = append(buf, pool.Get()) + } + } +} diff --git a/pkg/token/position.go b/pkg/token/position.go index 2ea40d4..cd76285 100644 --- a/pkg/token/position.go +++ b/pkg/token/position.go @@ -62,7 +62,7 @@ const ( CloseParenthesisToken ) -type Collection map[Position][]Token +type Collection map[Position][]*Token func (c Collection) IsEmpty() bool { for _, v := range c { diff --git a/pkg/token/token.go b/pkg/token/token.go index c1fa07e..b36c85f 100644 --- a/pkg/token/token.go +++ b/pkg/token/token.go @@ -1,5 +1,7 @@ package token +import "github.com/z7zmey/php-parser/pkg/position" + //go:generate stringer -type=ID -output ./token_string.go type ID int @@ -145,6 +147,13 @@ const ( ) type Token struct { - ID ID - Value []byte + ID ID + Value []byte + Position *position.Position + SkippedTokens []*Token + Skipped []byte +} + +func (t *Token) GetPosition() *position.Position { + return t.Position } From 767187ff853ee2e8dd59e9c7adea6ad52a9c30f8 Mon Sep 17 00:00:00 2001 From: Vadym Slizov Date: Sat, 22 Aug 2020 16:59:26 +0300 Subject: [PATCH 046/140] [refactoring] update ast structure for "Use" and "GroupUse" nodes --- internal/php5/parser_test.go | 873 +++++------ internal/php5/php5.go | Bin 301917 -> 298404 bytes internal/php5/php5.y | 415 ++--- internal/php5/php5_test.go | 872 +++++------ internal/php7/parser_test.go | 1589 ++++++++----------- internal/php7/php7.go | Bin 256975 -> 253133 bytes internal/php7/php7.y | 290 ++-- internal/php7/php7_test.go | 1590 ++++++++------------ pkg/ast/ast.go | 4 +- pkg/ast/node.go | 53 +- pkg/ast/traverser/dfs.go | 56 +- pkg/ast/visitor/dump.go | 50 +- pkg/ast/visitor/filter_parser_nodes.go | 28 - pkg/ast/visitor/filter_tokens.go | 21 + pkg/ast/visitor/namespace_resolver.go | 60 +- pkg/ast/visitor/namespace_resolver_test.go | 141 +- pkg/ast/visitor/null.go | 10 +- pkg/printer/pretty_printer.go | 48 +- pkg/printer/pretty_printer_test.go | 83 +- pkg/printer/printer.go | 119 +- pkg/printer/printer_parsed_php5_test.go | 3 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 89 +- 23 files changed, 2761 insertions(+), 3639 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index bc6d43c..6ab5b7a 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -11677,17 +11677,17 @@ func TestStmtUse(t *testing.T) { EndPos: 11, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11696,27 +11696,17 @@ func TestStmtUse(t *testing.T) { EndPos: 10, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, @@ -11757,46 +11747,36 @@ func TestStmtUse_FullyQualified(t *testing.T) { EndPos: 12, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 11, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 11, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 7, + StartPos: 8, EndPos: 11, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, @@ -11837,59 +11817,49 @@ func TestStmtUse_FullyQualifiedAlias(t *testing.T) { EndPos: 19, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 18, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 18, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, - StartPos: 7, + StartPos: 8, + EndPos: 11, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 8, + EndPos: 11, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 15, EndPos: 18, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 8, - EndPos: 11, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 15, - EndPos: 18, - }, - }, - Value: []byte("Bar"), - }, + Value: []byte("Bar"), }, }, }, @@ -11928,17 +11898,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 16, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 15, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11947,31 +11917,31 @@ func TestStmtUse_List(t *testing.T) { EndPos: 10, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, - &ast.StmtUseDeclaration{ + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -11980,27 +11950,17 @@ func TestStmtUse_List(t *testing.T) { EndPos: 15, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, }, @@ -12041,17 +12001,17 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 23, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 22, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12060,73 +12020,63 @@ func TestStmtUse_ListAlias(t *testing.T) { EndPos: 10, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 10, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 7, + EndPos: 10, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, - &ast.StmtUseDeclaration{ + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 22, + }, + }, + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 12, + EndPos: 15, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 12, + EndPos: 15, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, EndPos: 22, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 12, - EndPos: 15, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Value: []byte("Baz"), - }, + Value: []byte("Baz"), }, }, }, @@ -12165,46 +12115,38 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 26, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 25, + EndPos: 15, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 15, - }, - }, - Value: []byte("function"), - }, - Use: &ast.StmtUseList{ + Value: []byte("function"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 25, + EndPos: 19, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12213,31 +12155,31 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 19, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, - }, - }, - Value: []byte("Foo"), - }, - }, + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 21, - EndPos: 25, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 21, + EndPos: 25, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 22, + EndPos: 25, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12246,19 +12188,7 @@ func TestStmtUse_ListFunctionType(t *testing.T) { EndPos: 25, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 22, - EndPos: 25, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, }, @@ -12299,46 +12229,38 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 40, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 39, + EndPos: 15, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 15, - }, - }, - Value: []byte("function"), - }, - Use: &ast.StmtUseList{ + Value: []byte("function"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 16, - EndPos: 39, + EndPos: 26, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 26, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 16, + EndPos: 19, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12347,42 +12269,42 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 19, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 16, - EndPos: 19, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 23, - EndPos: 26, - }, - }, - Value: []byte("foo"), + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 28, - EndPos: 39, - }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 23, + EndPos: 26, }, - Use: &ast.NameName{ + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 28, + EndPos: 39, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 29, + EndPos: 32, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12391,33 +12313,21 @@ func TestStmtUse_ListFunctionTypeAliases(t *testing.T) { EndPos: 32, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 29, - EndPos: 32, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 36, - EndPos: 39, - }, - }, - Value: []byte("bar"), + Value: []byte("Bar"), }, }, }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 36, + EndPos: 39, + }, + }, + Value: []byte("bar"), + }, }, }, }, @@ -12455,47 +12365,38 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 23, }, }, - - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 22, + EndPos: 12, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 12, - }, - }, - Value: []byte("const"), - }, - Use: &ast.StmtUseList{ + Value: []byte("const"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 22, + EndPos: 16, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12504,31 +12405,31 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 16, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, - }, - }, - Value: []byte("Foo"), - }, - }, + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 18, - EndPos: 22, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 18, + EndPos: 22, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 19, + EndPos: 22, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12537,19 +12438,7 @@ func TestStmtUse_ListConstType(t *testing.T) { EndPos: 22, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 19, - EndPos: 22, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, }, @@ -12590,46 +12479,38 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 37, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 7, - EndPos: 36, + EndPos: 12, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 7, - EndPos: 12, - }, - }, - Value: []byte("const"), - }, - Use: &ast.StmtUseList{ + Value: []byte("const"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, EndLine: 1, StartPos: 13, - EndPos: 36, + EndPos: 23, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 23, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 13, + EndPos: 16, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12638,42 +12519,42 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 16, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 13, - EndPos: 16, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 20, - EndPos: 23, - }, - }, - Value: []byte("foo"), + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 25, - EndPos: 36, - }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 20, + EndPos: 23, }, - Use: &ast.NameName{ + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 25, + EndPos: 36, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 26, + EndPos: 29, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -12682,33 +12563,21 @@ func TestStmtUse_ListConstTypeAliases(t *testing.T) { EndPos: 29, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 26, - EndPos: 29, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 1, - EndLine: 1, - StartPos: 33, - EndPos: 36, - }, - }, - Value: []byte("bar"), + Value: []byte("Bar"), }, }, }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 1, + EndLine: 1, + StartPos: 33, + EndPos: 36, + }, + }, + Value: []byte("bar"), + }, }, }, }, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f05d4520c2db1614610b9a406fafb5cd28d64c81..a1be3c01d1e823818b9cead42d2f229ebccfa0a9 100644 GIT binary patch delta 17588 zcmeHO2Xxj&wm&oTPat%Zo{;aOgkk`{UO+miNZBA*QAk#!W~C$~h$t-Rswf>1E{amD ziwXus#-^efre({buH023A+r_x8QF=g2u6_}_cy&Ye4VZkzeu z-g3@Rs_w-~%K8|P8^zI^&Po;5IuTz6O{24Xn{PN!6 zvg(>%>VKDOSYFAL>WZ3*DU*BCx&eIP>>e6A%lva%b@|wfC-)Bfe`d@WGG*e#vZ>>u z=k}_Za&h@&pKeI`d4QKGPSw4`K3(kGUK1;-YYf?#@<|ngr%aqO*<v!$6V&(&Ps>17kAmG`C&zZPxIIZ}=v(G`?%G`dQ7x-zP2 zpYl}|qOG;RD9Yd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waz~TyK>u){v~~)bvC}78B+8hIc9d?$ zyf+!nfQ4>aITc45a(18*Qw*LCgc{agq3FJZc3F*eL{UR^+jNVs+UEKcc9~&#=h8c~8d1REQrys@K z6z+vvtGID@B_viqgR^NxTd-;Ycv>KGi#6-54pdd@It7e>0ncU+%oF%Y*(UyX8g`pQ z%cmX?LlT#0L_1B$33Q&C}kNcvWus$zS~SU z_(Bf7dAHp#kNV}X3Z#0|jBV)=VIBw5ZIXXe-U0<7Z0=Sec zQ6y({zf?Mlqlzsek0c4m1=pwc>rlKsa{^B^{T{K{BH)e6<&TJ2Mm-4uzjt46u8oBYvBdm-gC9&ZRE>O*bs(CLW7mv4oJRE{kl161 zh3)GG;dMi)sF}R%sF>3a?h4s;ztrhMR#z$1?NIY_Hhj=&LmO?AS%oVEatTz*_N`|-+>NspcuzW)I* C@{_Xw diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 23503c6..f6589cd 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -485,55 +485,47 @@ top_statement: } | T_USE mixed_group_use_declaration ';' { - $$ = &ast.StmtUse{ast.Node{}, $2} + use := $2.(*ast.StmtGroupUse) - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) + use.Node.Position = position.NewTokensPosition($1, $3) + use.UseTkn = $1 + use.SemiColonTkn = $3 - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = $2 } | T_USE use_type group_use_declaration ';' { - useType := &ast.StmtUseType{ast.Node{}, $2, $3} - $$ = &ast.StmtUse{ast.Node{}, useType} + use := $3.(*ast.StmtGroupUse) - // save position - useType.GetNode().Position = position.NewNodesPosition($2, $3) - $$.GetNode().Position = position.NewTokensPosition($1, $4) + use.Node.Position = position.NewTokensPosition($1, $4) + use.UseTkn = $1 + use.Type = $2 + use.SemiColonTkn = $4 - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) + $$ = $3 } | T_USE use_declarations ';' { - useList := &ast.StmtUseList{ast.Node{}, $2} - $$ = &ast.StmtUse{ast.Node{}, useList} - - // save position - useList.GetNode().Position = position.NewNodeListPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $3.SkippedTokens) + $$ = &ast.StmtUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + UseTkn: $1, + UseDeclarations: $2, + SemiColonTkn: $3, + } } | T_USE use_type use_declarations ';' { - useList := &ast.StmtUseList{ast.Node{}, $3} - useType := &ast.StmtUseType{ast.Node{}, $2, useList} - $$ = &ast.StmtUse{ast.Node{}, useType} - - // save position - useList.GetNode().Position = position.NewNodeListPosition($3) - useType.GetNode().Position = position.NewNodesPosition($2, useList) - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, $4.SkippedTokens) + $$ = &ast.StmtUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + UseTkn: $1, + Type: $2, + UseDeclarations: $3, + SemiColonTkn: $4, + } } | T_CONST const_list ';' { @@ -575,104 +567,90 @@ use_type: group_use_declaration: namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - name := &ast.NameName{ast.Node{}, $1} - useList := &ast.StmtUseList{ast.Node{}, $4} - useListBrackets := &ast.ParserBrackets{ast.Node{}, useList} - useListNsSeparator := &ast.ParserNsSeparator{ast.Node{}, useListBrackets} - $$ = &ast.StmtGroupUseList{ast.Node{}, name, useListNsSeparator} - - // save position - name.GetNode().Position = position.NewNodeListPosition($1) - useList.GetNode().Position = position.NewNodeListPosition($4) - useListBrackets.GetNode().Position = position.NewTokensPosition($3, $6) - useListNsSeparator.GetNode().Position = position.NewTokensPosition($2, $6) - $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) - - // save comments - if $5 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.SkippedTokens) + if len($4) > 0 { + $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 + } + + $$ = &ast.StmtGroupUse{ + Node: ast.Node{ + Position: position.NewNodeListTokenPosition($1, $6), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, + NsSeparatorTkn: $2, + OpenCurlyBracketTkn: $3, + UseDeclarations: $4, + CloseCurlyBracketTkn: $6, } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' unprefixed_use_declarations possible_comma '}' { - name := &ast.NameName{ast.Node{}, $2} - prefixNsSeparator := &ast.ParserNsSeparator{ast.Node{}, name} - useList := &ast.StmtUseList{ast.Node{}, $5} - useListBrackets := &ast.ParserBrackets{ast.Node{}, useList} - useListNsSeparator := &ast.ParserNsSeparator{ast.Node{}, useListBrackets} - $$ = &ast.StmtGroupUseList{ast.Node{}, prefixNsSeparator, useListNsSeparator} + $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 - // save position - name.GetNode().Position = position.NewNodeListPosition($2) - prefixNsSeparator.GetNode().Position = position.NewTokenNodePosition($1, name) - useList.GetNode().Position = position.NewNodeListPosition($5) - useListBrackets.GetNode().Position = position.NewTokensPosition($4, $7) - useListNsSeparator.GetNode().Position = position.NewTokensPosition($3, $7) - $$.GetNode().Position = position.NewTokensPosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.SkippedTokens) + $$ = &ast.StmtGroupUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $7), + }, + LeadingNsSeparatorTkn: $1, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Parts: $2, + }, + NsSeparatorTkn: $3, + OpenCurlyBracketTkn: $4, + UseDeclarations: $5, + CloseCurlyBracketTkn: $7, } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.SkippedTokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.SkippedTokens) } ; mixed_group_use_declaration: namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - name := &ast.NameName{ast.Node{}, $1} - useList := &ast.StmtUseList{ast.Node{}, $4} - useListBrackets := &ast.ParserBrackets{ast.Node{}, useList} - useListNsSeparator := &ast.ParserNsSeparator{ast.Node{}, useListBrackets} - $$ = &ast.StmtGroupUseList{ast.Node{}, name, useListNsSeparator} + $4[len($4)-1].(*ast.StmtUseDeclaration).CommaTkn = $5 - // save position - name.GetNode().Position = position.NewNodeListPosition($1) - useList.GetNode().Position = position.NewNodeListPosition($4) - useListBrackets.GetNode().Position = position.NewTokensPosition($3, $6) - useListNsSeparator.GetNode().Position = position.NewTokensPosition($2, $6) - $$.GetNode().Position = position.NewNodeListTokenPosition($1, $6) - - // save comments - if $5 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $5.SkippedTokens) + $$ = &ast.StmtGroupUse{ + Node: ast.Node{ + Position: position.NewNodeListTokenPosition($1, $6), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, + NsSeparatorTkn: $2, + OpenCurlyBracketTkn: $3, + UseDeclarations: $4, + CloseCurlyBracketTkn: $6, } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $6.SkippedTokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $2.SkippedTokens) } | T_NS_SEPARATOR namespace_name T_NS_SEPARATOR '{' inline_use_declarations possible_comma '}' { - name := &ast.NameName{ast.Node{}, $2} - prefixNsSeparator := &ast.ParserNsSeparator{ast.Node{}, name} - useList := &ast.StmtUseList{ast.Node{}, $5} - useListBrackets := &ast.ParserBrackets{ast.Node{}, useList} - useListNsSeparator := &ast.ParserNsSeparator{ast.Node{}, useListBrackets} - $$ = &ast.StmtGroupUseList{ast.Node{}, prefixNsSeparator, useListNsSeparator} + $5[len($5)-1].(*ast.StmtUseDeclaration).CommaTkn = $6 - // save position - name.GetNode().Position = position.NewNodeListPosition($2) - prefixNsSeparator.GetNode().Position = position.NewTokenNodePosition($1, name) - useList.GetNode().Position = position.NewNodeListPosition($5) - useListBrackets.GetNode().Position = position.NewTokensPosition($4, $7) - useListNsSeparator.GetNode().Position = position.NewTokensPosition($3, $7) - $$.GetNode().Position = position.NewTokensPosition($1, $7) - - // save comments - yylex.(*Parser).setFreeFloating(prefixNsSeparator, token.Start, $1.SkippedTokens) - if $6 != nil { - yylex.(*Parser).setFreeFloatingTokens(useList, token.End, $6.SkippedTokens) + $$ = &ast.StmtGroupUse{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $7), + }, + LeadingNsSeparatorTkn: $1, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Parts: $2, + }, + NsSeparatorTkn: $3, + OpenCurlyBracketTkn: $4, + UseDeclarations: $5, + CloseCurlyBracketTkn: $7, } - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.Start, $4.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens(useListBrackets, token.End, $7.SkippedTokens) - yylex.(*Parser).setFreeFloating(useListNsSeparator, token.Start, $3.SkippedTokens) } ; @@ -690,10 +668,9 @@ possible_comma: inline_use_declarations: inline_use_declarations ',' inline_use_declaration { - $$ = append($1, $3) + $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = append($1, $3) } | inline_use_declaration { @@ -704,10 +681,9 @@ inline_use_declarations: unprefixed_use_declarations: unprefixed_use_declarations ',' unprefixed_use_declaration { - $$ = append($1, $3) + $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = append($1, $3) } | unprefixed_use_declaration { @@ -718,10 +694,9 @@ unprefixed_use_declarations: use_declarations: use_declarations ',' use_declaration { - $$ = append($1, $3) + $1[len($1)-1].(*ast.StmtUseDeclaration).CommaTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = append($1, $3) } | use_declaration { @@ -736,39 +711,49 @@ inline_use_declaration: } | use_type unprefixed_use_declaration { - $$ = &ast.StmtUseType{ast.Node{}, $1, $2} + decl := $2.(*ast.StmtUseDeclaration) + decl.Type = $1 + decl.Node.Position = position.NewNodesPosition($1, $2) - // save position - $$.GetNode().Position = position.NewNodesPosition($1, $2) + $$ = $2 } ; unprefixed_use_declaration: namespace_name { - name := &ast.NameName{ast.Node{}, $1} - $$ = &ast.StmtUseDeclaration{ast.Node{}, name, nil} - - // save position - name.GetNode().Position = position.NewNodeListPosition($1) - $$.GetNode().Position = position.NewNodePosition(name) + $$ = &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, + } } | namespace_name T_AS T_STRING { - name := &ast.NameName{ast.Node{}, $1} - alias := &ast.Identifier{ast.Node{}, $3.Value} - asAlias := &ast.ParserAs{ast.Node{}, alias} - $$ = &ast.StmtUseDeclaration{ast.Node{}, name, asAlias} - - // save position - name.GetNode().Position = position.NewNodeListPosition($1) - alias.GetNode().Position = position.NewTokenPosition($3) - asAlias.GetNode().Position = position.NewTokensPosition($2, $3) - $$.GetNode().Position = position.NewNodeListTokenPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(asAlias, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(alias, token.Start, $3.SkippedTokens) + $$ = &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: position.NewNodeListTokenPosition($1, $3), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + }, + AsTkn: $2, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Value: $3.Value, + }, + } } ; @@ -779,14 +764,11 @@ use_declaration: } | T_NS_SEPARATOR unprefixed_use_declaration { - $$ = &ast.ParserNsSeparator{ast.Node{}, $2} + decl := $2.(*ast.StmtUseDeclaration) + decl.NsSeparatorTkn = $1 + decl.Node.Position = position.NewTokenNodePosition($1, $2) - // save position - $2.GetNode().Position = position.NewTokenNodePosition($1, $2) - $$.GetNode().Position = position.NewTokenNodePosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = $2 } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 8d52038..00d02cc 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -9024,17 +9024,17 @@ func TestPhp7(t *testing.T) { EndPos: 3370, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3366, + EndPos: 3369, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 161, @@ -9043,27 +9043,17 @@ func TestPhp7(t *testing.T) { EndPos: 3369, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 161, - EndLine: 161, - StartPos: 3366, - EndPos: 3369, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 161, + EndLine: 161, + StartPos: 3366, + EndPos: 3369, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, @@ -9079,46 +9069,36 @@ func TestPhp7(t *testing.T) { EndPos: 3380, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3375, - EndPos: 3379, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3375, + EndPos: 3379, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 162, EndLine: 162, - StartPos: 3375, + StartPos: 3376, EndPos: 3379, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 162, - EndLine: 162, - StartPos: 3376, - EndPos: 3379, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 162, + EndLine: 162, + StartPos: 3376, + EndPos: 3379, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, @@ -9134,59 +9114,49 @@ func TestPhp7(t *testing.T) { EndPos: 3397, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3385, - EndPos: 3396, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3385, + EndPos: 3396, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 163, EndLine: 163, - StartPos: 3385, + StartPos: 3386, + EndPos: 3389, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3386, + EndPos: 3389, + }, + }, + Value: []byte("Foo"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 163, + EndLine: 163, + StartPos: 3393, EndPos: 3396, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3389, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3386, - EndPos: 3389, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 163, - EndLine: 163, - StartPos: 3393, - EndPos: 3396, - }, - }, - Value: []byte("Bar"), - }, + Value: []byte("Bar"), }, }, }, @@ -9200,17 +9170,17 @@ func TestPhp7(t *testing.T) { EndPos: 3411, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3410, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3402, + EndPos: 3405, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 164, @@ -9219,31 +9189,31 @@ func TestPhp7(t *testing.T) { EndPos: 3405, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3402, - EndPos: 3405, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3402, + EndPos: 3405, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, - &ast.StmtUseDeclaration{ + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3407, + EndPos: 3410, + }, + }, + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 164, @@ -9252,27 +9222,17 @@ func TestPhp7(t *testing.T) { EndPos: 3410, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 164, - EndLine: 164, - StartPos: 3407, - EndPos: 3410, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 164, + EndLine: 164, + StartPos: 3407, + EndPos: 3410, }, - Value: []byte("Bar"), }, + Value: []byte("Bar"), }, }, }, @@ -9288,17 +9248,17 @@ func TestPhp7(t *testing.T) { EndPos: 3432, }, }, - UseList: &ast.StmtUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3431, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3416, + EndPos: 3419, + }, }, - }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 165, @@ -9307,73 +9267,63 @@ func TestPhp7(t *testing.T) { EndPos: 3419, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3416, - EndPos: 3419, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3416, + EndPos: 3419, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, }, - &ast.StmtUseDeclaration{ + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3421, + EndPos: 3431, + }, + }, + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 165, EndLine: 165, StartPos: 3421, + EndPos: 3424, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3421, + EndPos: 3424, + }, + }, + Value: []byte("Bar"), + }, + }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 165, + EndLine: 165, + StartPos: 3428, EndPos: 3431, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3424, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3421, - EndPos: 3424, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 165, - EndLine: 165, - StartPos: 3428, - EndPos: 3431, - }, - }, - Value: []byte("Baz"), - }, + Value: []byte("Baz"), }, }, }, @@ -9387,46 +9337,38 @@ func TestPhp7(t *testing.T) { EndPos: 3456, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3437, - EndPos: 3455, + EndPos: 3445, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3437, - EndPos: 3445, - }, - }, - Value: []byte("function"), - }, - Use: &ast.StmtUseList{ + Value: []byte("function"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, EndLine: 166, StartPos: 3446, - EndPos: 3455, + EndPos: 3449, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3446, + EndPos: 3449, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, @@ -9435,31 +9377,31 @@ func TestPhp7(t *testing.T) { EndPos: 3449, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3446, - EndPos: 3449, - }, - }, - Value: []byte("Foo"), - }, - }, + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3451, - EndPos: 3455, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3451, + EndPos: 3455, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 166, + EndLine: 166, + StartPos: 3452, + EndPos: 3455, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 166, @@ -9468,19 +9410,7 @@ func TestPhp7(t *testing.T) { EndPos: 3455, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 166, - EndLine: 166, - StartPos: 3452, - EndPos: 3455, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, }, @@ -9496,46 +9426,38 @@ func TestPhp7(t *testing.T) { EndPos: 3494, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3461, - EndPos: 3493, + EndPos: 3469, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3461, - EndPos: 3469, - }, - }, - Value: []byte("function"), - }, - Use: &ast.StmtUseList{ + Value: []byte("function"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, EndLine: 167, StartPos: 3470, - EndPos: 3493, + EndPos: 3480, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3480, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3470, + EndPos: 3473, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, @@ -9544,42 +9466,42 @@ func TestPhp7(t *testing.T) { EndPos: 3473, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3470, - EndPos: 3473, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3477, - EndPos: 3480, - }, - }, - Value: []byte("foo"), + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3482, - EndPos: 3493, - }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3477, + EndPos: 3480, }, - Use: &ast.NameName{ + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3482, + EndPos: 3493, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3483, + EndPos: 3486, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 167, @@ -9588,33 +9510,21 @@ func TestPhp7(t *testing.T) { EndPos: 3486, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3483, - EndPos: 3486, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 167, - EndLine: 167, - StartPos: 3490, - EndPos: 3493, - }, - }, - Value: []byte("bar"), + Value: []byte("Bar"), }, }, }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 167, + EndLine: 167, + StartPos: 3490, + EndPos: 3493, + }, + }, + Value: []byte("bar"), + }, }, }, }, @@ -9627,46 +9537,38 @@ func TestPhp7(t *testing.T) { EndPos: 3515, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3499, - EndPos: 3514, + EndPos: 3504, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3499, - EndPos: 3504, - }, - }, - Value: []byte("const"), - }, - Use: &ast.StmtUseList{ + Value: []byte("const"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, EndLine: 168, StartPos: 3505, - EndPos: 3514, + EndPos: 3508, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3505, + EndPos: 3508, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, @@ -9675,31 +9577,31 @@ func TestPhp7(t *testing.T) { EndPos: 3508, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3505, - EndPos: 3508, - }, - }, - Value: []byte("Foo"), - }, - }, + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3510, - EndPos: 3514, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3510, + EndPos: 3514, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 168, + EndLine: 168, + StartPos: 3511, + EndPos: 3514, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 168, @@ -9708,19 +9610,7 @@ func TestPhp7(t *testing.T) { EndPos: 3514, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 168, - EndLine: 168, - StartPos: 3511, - EndPos: 3514, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, }, @@ -9736,46 +9626,38 @@ func TestPhp7(t *testing.T) { EndPos: 3550, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3520, - EndPos: 3549, + EndPos: 3525, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3520, - EndPos: 3525, - }, - }, - Value: []byte("const"), - }, - Use: &ast.StmtUseList{ + Value: []byte("const"), + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, EndLine: 169, StartPos: 3526, - EndPos: 3549, + EndPos: 3536, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3536, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3526, + EndPos: 3529, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, @@ -9784,42 +9666,42 @@ func TestPhp7(t *testing.T) { EndPos: 3529, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3526, - EndPos: 3529, - }, - }, - Value: []byte("Foo"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3533, - EndPos: 3536, - }, - }, - Value: []byte("foo"), + Value: []byte("Foo"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3538, - EndPos: 3549, - }, + }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3533, + EndPos: 3536, }, - Use: &ast.NameName{ + }, + Value: []byte("foo"), + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3538, + EndPos: 3549, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3539, + EndPos: 3542, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 169, @@ -9828,37 +9710,25 @@ func TestPhp7(t *testing.T) { EndPos: 3542, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3539, - EndPos: 3542, - }, - }, - Value: []byte("Bar"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 169, - EndLine: 169, - StartPos: 3546, - EndPos: 3549, - }, - }, - Value: []byte("bar"), + Value: []byte("Bar"), }, }, }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 169, + EndLine: 169, + StartPos: 3546, + EndPos: 3549, + }, + }, + Value: []byte("bar"), + }, }, }, }, - &ast.StmtUse{ + &ast.StmtGroupUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9867,58 +9737,50 @@ func TestPhp7(t *testing.T) { EndPos: 3572, }, }, - UseList: &ast.StmtGroupUseList{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, - StartPos: 3556, - EndPos: 3571, + StartPos: 3557, + EndPos: 3560, }, }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3557, - EndPos: 3560, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3557, - EndPos: 3560, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3557, + EndPos: 3560, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, - UseList: &ast.StmtUseList{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, EndLine: 171, StartPos: 3562, - EndPos: 3570, + EndPos: 3565, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3562, + EndPos: 3565, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9927,31 +9789,31 @@ func TestPhp7(t *testing.T) { EndPos: 3565, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3562, - EndPos: 3565, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3567, + EndPos: 3570, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 171, + EndLine: 171, + StartPos: 3567, + EndPos: 3570, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 171, @@ -9960,26 +9822,14 @@ func TestPhp7(t *testing.T) { EndPos: 3570, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 171, - EndLine: 171, - StartPos: 3567, - EndPos: 3570, - }, - }, - Value: []byte("Baz"), - }, - }, + Value: []byte("Baz"), }, }, }, }, }, }, - &ast.StmtUse{ + &ast.StmtGroupUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -9988,58 +9838,50 @@ func TestPhp7(t *testing.T) { EndPos: 3600, }, }, - UseList: &ast.StmtGroupUseList{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3577, - EndPos: 3599, + EndPos: 3580, }, }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3577, - EndPos: 3580, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3577, + EndPos: 3580, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, - UseList: &ast.StmtUseList{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, EndLine: 172, StartPos: 3582, - EndPos: 3598, + EndPos: 3585, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, - }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3582, + EndPos: 3585, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -10048,31 +9890,31 @@ func TestPhp7(t *testing.T) { EndPos: 3585, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3582, - EndPos: 3585, - }, - }, - Value: []byte("Bar"), - }, - }, + Value: []byte("Bar"), }, }, - &ast.StmtUseDeclaration{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3598, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3587, + EndPos: 3598, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3587, + EndPos: 3590, }, - Use: &ast.NameName{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 172, @@ -10081,37 +9923,25 @@ func TestPhp7(t *testing.T) { EndPos: 3590, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3587, - EndPos: 3590, - }, - }, - Value: []byte("Baz"), - }, - }, - }, - Alias: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 172, - EndLine: 172, - StartPos: 3594, - EndPos: 3598, - }, - }, - Value: []byte("quux"), + Value: []byte("Baz"), }, }, }, + Alias: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 172, + EndLine: 172, + StartPos: 3594, + EndPos: 3598, + }, + }, + Value: []byte("quux"), + }, }, }, }, - &ast.StmtUse{ + &ast.StmtGroupUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10120,36 +9950,28 @@ func TestPhp7(t *testing.T) { EndPos: 3629, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, EndLine: 173, StartPos: 3605, - EndPos: 3628, + EndPos: 3613, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3605, - EndPos: 3613, - }, + Value: []byte("function"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3614, + EndPos: 3617, }, - Value: []byte("function"), }, - Use: &ast.StmtGroupUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3614, - EndPos: 3628, - }, - }, - Prefix: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10158,31 +9980,31 @@ func TestPhp7(t *testing.T) { EndPos: 3617, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3614, - EndPos: 3617, - }, - }, - Value: []byte("Foo"), - }, + Value: []byte("Foo"), + }, + }, + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3619, + EndPos: 3622, }, }, - UseList: &ast.StmtUseList{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, EndLine: 173, StartPos: 3619, - EndPos: 3627, + EndPos: 3622, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10191,31 +10013,31 @@ func TestPhp7(t *testing.T) { EndPos: 3622, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3619, - EndPos: 3622, - }, - }, - Value: []byte("Bar"), - }, - }, - }, + Value: []byte("Bar"), }, - &ast.StmtUseDeclaration{ + }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3624, + EndPos: 3627, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 173, + EndLine: 173, + StartPos: 3624, + EndPos: 3627, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 173, @@ -10224,36 +10046,14 @@ func TestPhp7(t *testing.T) { EndPos: 3627, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 173, - EndLine: 173, - StartPos: 3624, - EndPos: 3627, - }, - }, - Value: []byte("Baz"), - }, - }, - }, + Value: []byte("Baz"), }, }, }, }, }, }, - &ast.StmtUse{ + &ast.StmtGroupUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10262,36 +10062,28 @@ func TestPhp7(t *testing.T) { EndPos: 3656, }, }, - UseList: &ast.StmtUseType{ + Type: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3634, - EndPos: 3655, + EndPos: 3639, }, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3634, - EndPos: 3639, - }, + Value: []byte("const"), + }, + Prefix: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3641, + EndPos: 3644, }, - Value: []byte("const"), }, - Use: &ast.StmtGroupUseList{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3640, - EndPos: 3655, - }, - }, - Prefix: &ast.NameName{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10300,31 +10092,31 @@ func TestPhp7(t *testing.T) { EndPos: 3644, }, }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3641, - EndPos: 3644, - }, - }, - Value: []byte("Foo"), - }, + Value: []byte("Foo"), + }, + }, + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3646, + EndPos: 3649, }, }, - UseList: &ast.StmtUseList{ + Use: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, EndLine: 174, StartPos: 3646, - EndPos: 3654, + EndPos: 3649, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10333,31 +10125,31 @@ func TestPhp7(t *testing.T) { EndPos: 3649, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3646, - EndPos: 3649, - }, - }, - Value: []byte("Bar"), - }, - }, - }, + Value: []byte("Bar"), }, - &ast.StmtUseDeclaration{ + }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3651, + EndPos: 3654, + }, + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 174, + EndLine: 174, + StartPos: 3651, + EndPos: 3654, + }, + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 174, @@ -10366,36 +10158,14 @@ func TestPhp7(t *testing.T) { EndPos: 3654, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 174, - EndLine: 174, - StartPos: 3651, - EndPos: 3654, - }, - }, - Value: []byte("Baz"), - }, - }, - }, + Value: []byte("Baz"), }, }, }, }, }, }, - &ast.StmtUse{ + &ast.StmtGroupUse{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10404,69 +10174,61 @@ func TestPhp7(t *testing.T) { EndPos: 3691, }, }, - UseList: &ast.StmtGroupUseList{ + Prefix: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3661, - EndPos: 3690, + EndPos: 3664, }, }, - Prefix: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3661, - EndPos: 3664, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3661, - EndPos: 3664, - }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3661, + EndPos: 3664, }, - Value: []byte("Foo"), }, + Value: []byte("Foo"), }, }, - UseList: &ast.StmtUseList{ + }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, EndLine: 175, StartPos: 3666, - EndPos: 3689, + EndPos: 3675, }, }, - UseDeclarations: []ast.Vertex{ - &ast.StmtUseType{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3666, - EndPos: 3675, - }, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3666, + EndPos: 3671, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3666, - EndPos: 3671, - }, - }, - Value: []byte("const"), + }, + Value: []byte("const"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3672, + EndPos: 3675, }, - Use: &ast.StmtUseDeclaration{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10475,52 +10237,42 @@ func TestPhp7(t *testing.T) { EndPos: 3675, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3672, - EndPos: 3675, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3672, - EndPos: 3675, - }, - }, - Value: []byte("Bar"), - }, - }, - }, + Value: []byte("Bar"), }, }, - &ast.StmtUseType{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3677, - EndPos: 3689, - }, + }, + }, + &ast.StmtUseDeclaration{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3677, + EndPos: 3689, + }, + }, + Type: &ast.Identifier{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3677, + EndPos: 3685, }, - Type: &ast.Identifier{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3677, - EndPos: 3685, - }, - }, - Value: []byte("function"), + }, + Value: []byte("function"), + }, + Use: &ast.NameName{ + Node: ast.Node{ + Position: &position.Position{ + StartLine: 175, + EndLine: 175, + StartPos: 3686, + EndPos: 3689, }, - Use: &ast.StmtUseDeclaration{ + }, + Parts: []ast.Vertex{ + &ast.NameNamePart{ Node: ast.Node{ Position: &position.Position{ StartLine: 175, @@ -10529,29 +10281,7 @@ func TestPhp7(t *testing.T) { EndPos: 3689, }, }, - Use: &ast.NameName{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, - }, - }, - Parts: []ast.Vertex{ - &ast.NameNamePart{ - Node: ast.Node{ - Position: &position.Position{ - StartLine: 175, - EndLine: 175, - StartPos: 3686, - EndPos: 3689, - }, - }, - Value: []byte("Baz"), - }, - }, - }, + Value: []byte("Baz"), }, }, }, diff --git a/pkg/ast/ast.go b/pkg/ast/ast.go index 4259f92..2da9b8e 100644 --- a/pkg/ast/ast.go +++ b/pkg/ast/ast.go @@ -84,10 +84,8 @@ type NodeVisitor interface { StmtTry(n *StmtTry) StmtUnset(n *StmtUnset) StmtUse(n *StmtUse) - StmtGroupUseList(n *StmtGroupUseList) - StmtUseList(n *StmtUseList) + StmtGroupUse(n *StmtGroupUse) StmtUseDeclaration(n *StmtUseDeclaration) - StmtUseType(n *StmtUseType) StmtWhile(n *StmtWhile) ExprArray(n *ExprArray) diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 85b494a..d7dd01d 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -796,56 +796,49 @@ func (n *StmtUnset) Accept(v NodeVisitor) { // StmtUse node type StmtUse struct { Node - UseList Vertex + UseTkn *token.Token + Type Vertex + UseDeclarations []Vertex + SemiColonTkn *token.Token } func (n *StmtUse) Accept(v NodeVisitor) { v.StmtUse(n) } -// StmtGroupUseList node -type StmtGroupUseList struct { +// StmtGroupUse node +type StmtGroupUse struct { Node - Prefix Vertex - UseList Vertex + UseTkn *token.Token + Type Vertex + LeadingNsSeparatorTkn *token.Token + Prefix Vertex + NsSeparatorTkn *token.Token + OpenCurlyBracketTkn *token.Token + UseDeclarations []Vertex + CloseCurlyBracketTkn *token.Token + SemiColonTkn *token.Token } -func (n *StmtGroupUseList) Accept(v NodeVisitor) { - v.StmtGroupUseList(n) -} - -// StmtUseList node -type StmtUseList struct { - Node - UseDeclarations []Vertex -} - -func (n *StmtUseList) Accept(v NodeVisitor) { - v.StmtUseList(n) +func (n *StmtGroupUse) Accept(v NodeVisitor) { + v.StmtGroupUse(n) } // StmtUseDeclaration node type StmtUseDeclaration struct { Node - Use Vertex - Alias Vertex + Type Vertex + NsSeparatorTkn *token.Token + Use Vertex + AsTkn *token.Token + Alias Vertex + CommaTkn *token.Token } func (n *StmtUseDeclaration) Accept(v NodeVisitor) { v.StmtUseDeclaration(n) } -// StmtUseType node -type StmtUseType struct { - Node - Type Vertex - Use Vertex -} - -func (n *StmtUseType) Accept(v NodeVisitor) { - v.StmtUseType(n) -} - // StmtWhile node type StmtWhile struct { Node diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 03ebbad..20eecf3 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -1150,35 +1150,35 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - if nn.UseList != nil { - t.visitor.Enter("UseList", true) - t.Traverse(nn.UseList) - t.visitor.Leave("UseList", true) + if nn.Type != nil { + t.visitor.Enter("Type", true) + t.Traverse(nn.Type) + t.visitor.Leave("Type", true) } - case *ast.StmtGroupUseList: + if nn.UseDeclarations != nil { + t.visitor.Enter("UseDeclarations", false) + for _, c := range nn.UseDeclarations { + t.Traverse(c) + } + t.visitor.Leave("UseDeclarations", false) + } + case *ast.StmtGroupUse: if nn == nil { return } if !t.visitor.EnterNode(nn) { return } + if nn.Type != nil { + t.visitor.Enter("Type", true) + t.Traverse(nn.Type) + t.visitor.Leave("Type", true) + } if nn.Prefix != nil { t.visitor.Enter("Prefix", true) t.Traverse(nn.Prefix) t.visitor.Leave("Prefix", true) } - if nn.UseList != nil { - t.visitor.Enter("UseList", true) - t.Traverse(nn.UseList) - t.visitor.Leave("UseList", true) - } - case *ast.StmtUseList: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } if nn.UseDeclarations != nil { t.visitor.Enter("UseDeclarations", false) for _, c := range nn.UseDeclarations { @@ -1187,23 +1187,6 @@ func (t *DFS) Traverse(n ast.Vertex) { t.visitor.Leave("UseDeclarations", false) } case *ast.StmtUseDeclaration: - if nn == nil { - return - } - if !t.visitor.EnterNode(nn) { - return - } - if nn.Use != nil { - t.visitor.Enter("Use", true) - t.Traverse(nn.Use) - t.visitor.Leave("Use", true) - } - if nn.Alias != nil { - t.visitor.Enter("Alias", true) - t.Traverse(nn.Alias) - t.visitor.Leave("Alias", true) - } - case *ast.StmtUseType: if nn == nil { return } @@ -1220,6 +1203,11 @@ func (t *DFS) Traverse(n ast.Vertex) { t.Traverse(nn.Use) t.visitor.Leave("Use", true) } + if nn.Alias != nil { + t.visitor.Enter("Alias", true) + t.Traverse(nn.Alias) + t.visitor.Leave("Alias", true) + } case *ast.StmtWhile: if nn == nil { return diff --git a/pkg/ast/visitor/dump.go b/pkg/ast/visitor/dump.go index 67bbaac..61deec6 100644 --- a/pkg/ast/visitor/dump.go +++ b/pkg/ast/visitor/dump.go @@ -169,6 +169,28 @@ func (v *Dump) printNode(n *ast.Node) { 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) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.Root{\n") @@ -588,30 +610,30 @@ func (v *Dump) StmtUse(n *ast.StmtUse) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUse{\n") v.printNode(n.GetNode()) + v.printToken("UseTkn", n.UseTkn) + v.printToken("SemiColonTkn", n.SemiColonTkn) + } -func (v *Dump) StmtGroupUseList(n *ast.StmtGroupUseList) { +func (v *Dump) StmtGroupUse(n *ast.StmtGroupUse) { v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtGroupUseList{\n") - v.printNode(n.GetNode()) -} - -func (v *Dump) StmtUseList(n *ast.StmtUseList) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtUseList{\n") + 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) } func (v *Dump) StmtUseDeclaration(n *ast.StmtUseDeclaration) { v.printIndentIfNotSingle(v.indent - 1) v.print("&ast.StmtUseDeclaration{\n") v.printNode(n.GetNode()) -} - -func (v *Dump) StmtUseType(n *ast.StmtUseType) { - v.printIndentIfNotSingle(v.indent - 1) - v.print("&ast.StmtUseType{\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) { diff --git a/pkg/ast/visitor/filter_parser_nodes.go b/pkg/ast/visitor/filter_parser_nodes.go index f1a5655..4df410a 100644 --- a/pkg/ast/visitor/filter_parser_nodes.go +++ b/pkg/ast/visitor/filter_parser_nodes.go @@ -13,34 +13,6 @@ func (v *FilterParserNodes) EnterNode(n ast.Vertex) bool { return true } -func (v *FilterParserNodes) StmtGroupUseList(n *ast.StmtGroupUseList) { - if nn, ok := n.Prefix.(*ast.ParserNsSeparator); ok { - n.Prefix = nn.Child - } - - if nn, ok := n.UseList.(*ast.ParserNsSeparator); ok { - n.UseList = nn.Child - } - - if nn, ok := n.UseList.(*ast.ParserBrackets); ok { - n.UseList = nn.Child - } -} - -func (v *FilterParserNodes) StmtUseList(n *ast.StmtUseList) { - for k, v := range n.UseDeclarations { - if nn, ok := v.(*ast.ParserNsSeparator); ok { - n.UseDeclarations[k] = nn.Child - } - } -} - -func (v *FilterParserNodes) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - if nn, ok := n.Alias.(*ast.ParserAs); ok { - n.Alias = nn.Child - } -} - func (v *FilterParserNodes) StmtAltIf(n *ast.StmtAltIf) { for { if nn, ok := n.Cond.(*ast.ParserBrackets); ok { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index c69a3f6..7101b86 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -10,5 +10,26 @@ type FilterTokens struct { func (v *FilterTokens) EnterNode(n ast.Vertex) bool { n.GetNode().Tokens = nil + n.Accept(v) return true } + +func (v *FilterTokens) StmtUse(n *ast.StmtUse) { + n.UseTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtGroupUse(n *ast.StmtGroupUse) { + n.UseTkn = nil + n.LeadingNsSeparatorTkn = nil + n.NsSeparatorTkn = nil + n.OpenCurlyBracketTkn = nil + n.CloseCurlyBracketTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtUseDeclaration(n *ast.StmtUseDeclaration) { + n.NsSeparatorTkn = nil + n.AsTkn = nil + n.CommaTkn = nil +} diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 65f0f54..34c92c7 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -13,9 +13,7 @@ type NamespaceResolver struct { Namespace *Namespace ResolvedNames map[ast.Vertex]string - goDeep bool - useType string - usePrefix []ast.Vertex + goDeep bool } // NewNamespaceResolver NamespaceResolver type constructor @@ -47,28 +45,28 @@ func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) { } } -func (nsr *NamespaceResolver) StmtUseType(n *ast.StmtUseType) { +func (nsr *NamespaceResolver) StmtUse(n *ast.StmtUse) { + useType := "" if n.Type != nil { - nsr.useType = string(n.Type.(*ast.Identifier).Value) + useType = string(n.Type.(*ast.Identifier).Value) } + + for _, nn := range n.UseDeclarations { + nsr.AddAlias(useType, nn, nil) + } + + nsr.goDeep = false } -func (nsr *NamespaceResolver) StmtGroupUseList(n *ast.StmtGroupUseList) { - if n.Prefix != nil { - nsr.usePrefix = n.Prefix.(*ast.NameName).Parts - } -} - -func (nsr *NamespaceResolver) StmtUseDeclaration(n *ast.StmtUseDeclaration) { - useNameParts := n.Use.(*ast.NameName).Parts - var alias string - if n.Alias == nil { - alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) - } else { - alias = string(n.Alias.(*ast.Identifier).Value) +func (nsr *NamespaceResolver) StmtGroupUse(n *ast.StmtGroupUse) { + useType := "" + if n.Type != nil { + useType = string(n.Type.(*ast.Identifier).Value) } - nsr.Namespace.AddAlias(nsr.useType, concatNameParts(nsr.usePrefix, useNameParts), alias) + for _, nn := range n.UseDeclarations { + nsr.AddAlias(useType, nn, n.Prefix.(*ast.NameName).Parts) + } nsr.goDeep = false } @@ -215,10 +213,26 @@ func (nsr *NamespaceResolver) LeaveNode(n ast.Vertex) { if nn.Stmts != nil { nsr.Namespace = NewNamespace("") } - case *ast.StmtUseType: - nsr.useType = "" - case *ast.StmtGroupUseList: - nsr.usePrefix = nil + } +} + +// AddAlias adds a new alias +func (nsr *NamespaceResolver) AddAlias(useType string, nn ast.Vertex, prefix []ast.Vertex) { + switch use := nn.(type) { + case *ast.StmtUseDeclaration: + if use.Type != nil { + useType = string(use.Type.(*ast.Identifier).Value) + } + + useNameParts := use.Use.(*ast.NameName).Parts + var alias string + if use.Alias == nil { + alias = string(useNameParts[len(useNameParts)-1].(*ast.NameNamePart).Value) + } else { + alias = string(use.Alias.(*ast.Identifier).Value) + } + + nsr.Namespace.AddAlias(useType, concatNameParts(prefix, useNameParts), alias) } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 22eb8bc..34a31f7 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -17,11 +17,9 @@ func TestResolveStaticCall(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -51,11 +49,9 @@ func TestResolveStaticPropertyFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -84,11 +80,9 @@ func TestResolveClassConstFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -117,11 +111,9 @@ func TestResolveNew(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -150,11 +142,9 @@ func TestResolveInstanceOf(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -186,14 +176,13 @@ func TestResolveInstanceCatch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, &ast.StmtUseDeclaration{ - Use: nameDE, - Alias: &ast.Identifier{Value: []byte("F")}, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, + }, + &ast.StmtUseDeclaration{ + Use: nameDE, + Alias: &ast.Identifier{Value: []byte("F")}, }, }, }, @@ -232,14 +221,10 @@ func TestResolveFunctionCall(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("function")}, - Use: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, - }, + Type: &ast.Identifier{Value: []byte("function")}, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -268,14 +253,10 @@ func TestResolveConstFetch(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("const")}, - Use: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, - }, + Type: &ast.Identifier{Value: []byte("const")}, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -305,39 +286,25 @@ func TestResolveGroupUse(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ - &ast.StmtUse{ - UseList: &ast.StmtGroupUseList{ - Prefix: nameAB, - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("Function")}, - Use: &ast.StmtUseDeclaration{ - Use: nameF, - }, - }, - &ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("const")}, - Use: &ast.StmtUseDeclaration{ - Use: nameC, - }, - }, - }, + &ast.StmtGroupUse{ + Prefix: nameAB, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Type: &ast.Identifier{Value: []byte("Function")}, + Use: nameF, + }, + &ast.StmtUseDeclaration{ + Type: &ast.Identifier{Value: []byte("const")}, + Use: nameC, }, }, }, - &ast.StmtUse{ - UseList: &ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("Function")}, - Use: &ast.StmtGroupUseList{ - Prefix: nameBD, - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameE, - }, - }, - }, + &ast.StmtGroupUse{ + Prefix: nameBD, + Type: &ast.Identifier{Value: []byte("Function")}, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameE, }, }, }, @@ -381,11 +348,9 @@ func TestResolveTraitUse(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAB, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAB, }, }, }, @@ -704,11 +669,9 @@ func TestResolveNamespaces(t *testing.T) { NamespaceName: namespaceCD, Stmts: []ast.Vertex{ &ast.StmtUse{ - UseList: &ast.StmtUseList{ - UseDeclarations: []ast.Vertex{ - &ast.StmtUseDeclaration{ - Use: nameAC, - }, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: nameAC, }, }, }, diff --git a/pkg/ast/visitor/null.go b/pkg/ast/visitor/null.go index 033a77f..291d8f9 100644 --- a/pkg/ast/visitor/null.go +++ b/pkg/ast/visitor/null.go @@ -282,11 +282,7 @@ func (v *Null) StmtUse(_ *ast.StmtUse) { // do nothing } -func (v *Null) StmtGroupUseList(_ *ast.StmtGroupUseList) { - // do nothing -} - -func (v *Null) StmtUseList(_ *ast.StmtUseList) { +func (v *Null) StmtGroupUse(_ *ast.StmtGroupUse) { // do nothing } @@ -294,10 +290,6 @@ func (v *Null) StmtUseDeclaration(_ *ast.StmtUseDeclaration) { // do nothing } -func (v *Null) StmtUseType(_ *ast.StmtUseType) { - // do nothing -} - func (v *Null) StmtWhile(_ *ast.StmtWhile) { // do nothing } diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 71a89a8..1aab5d1 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -399,14 +399,10 @@ func (p *PrettyPrinter) printNode(n ast.Vertex) { p.printStmtUnset(n) case *ast.StmtUse: p.printStmtUse(n) - case *ast.StmtGroupUseList: - p.printStmtGroupUseList(n) - case *ast.StmtUseList: - p.printStmtUseList(n) + case *ast.StmtGroupUse: + p.printStmtGroupUse(n) case *ast.StmtUseDeclaration: p.printStmtUseDeclaration(n) - case *ast.StmtUseType: - p.printStmtUseType(n) case *ast.StmtWhile: p.printStmtWhile(n) } @@ -2139,30 +2135,41 @@ func (p *PrettyPrinter) printStmtUse(n ast.Vertex) { io.WriteString(p.w, "use ") - p.Print(nn.UseList) + if nn.Type != nil { + p.Print(nn.Type) + io.WriteString(p.w, " ") + } + + p.joinPrint(", ", nn.UseDeclarations) io.WriteString(p.w, ";") } -func (p *PrettyPrinter) printStmtGroupUseList(n ast.Vertex) { - nn := n.(*ast.StmtGroupUseList) +func (p *PrettyPrinter) printStmtGroupUse(n ast.Vertex) { + nn := n.(*ast.StmtGroupUse) + + io.WriteString(p.w, "use ") + + if nn.Type != nil { + p.Print(nn.Type) + io.WriteString(p.w, " ") + } p.Print(nn.Prefix) io.WriteString(p.w, "\\{") - p.Print(nn.UseList) - io.WriteString(p.w, "}") -} - -func (p *PrettyPrinter) printStmtUseList(n ast.Vertex) { - nn := n.(*ast.StmtUseList) - p.joinPrint(", ", nn.UseDeclarations) + io.WriteString(p.w, "}") } func (p *PrettyPrinter) printStmtUseDeclaration(n ast.Vertex) { nn := n.(*ast.StmtUseDeclaration) + if nn.Type != nil { + p.Print(nn.Type) + io.WriteString(p.w, " ") + } + p.Print(nn.Use) if nn.Alias != nil { @@ -2171,15 +2178,6 @@ func (p *PrettyPrinter) printStmtUseDeclaration(n ast.Vertex) { } } -func (p *PrettyPrinter) printStmtUseType(n ast.Vertex) { - nn := n.(*ast.StmtUseType) - - p.Print(nn.Type) - io.WriteString(p.w, " ") - - p.Print(nn.Use) -} - func (p *PrettyPrinter) printStmtWhile(n ast.Vertex) { nn := n.(*ast.StmtWhile) diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 72f4988..199bc2f 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -3954,39 +3954,7 @@ func TestPrintUse(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtUse{ - UseList: &ast.StmtUseList{}, - }) - - expected := `use ;` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtGroupUseList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtGroupUseList{ - Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - UseList: &ast.StmtUseList{}, - }) - - expected := `Foo\{}` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintStmtUseList(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtUseList{ + Type: &ast.Identifier{Value: []byte("function")}, UseDeclarations: []ast.Vertex{ &ast.StmtUseDeclaration{ Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, @@ -3998,7 +3966,33 @@ func TestPrintStmtUseList(t *testing.T) { }, }) - expected := `Foo as Bar, Baz` + expected := `use function Foo as Bar, Baz;` + actual := o.String() + + if expected != actual { + t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) + } +} + +func TestPrintStmtGroupUse(t *testing.T) { + o := bytes.NewBufferString("") + + p := printer.NewPrettyPrinter(o, " ") + p.Print(&ast.StmtGroupUse{ + Type: &ast.Identifier{Value: []byte("function")}, + Prefix: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + UseDeclarations: []ast.Vertex{ + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Alias: &ast.Identifier{Value: []byte("Bar")}, + }, + &ast.StmtUseDeclaration{ + Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Baz")}}}, + }, + }, + }) + + expected := `use function Foo\{Foo as Bar, Baz}` actual := o.String() if expected != actual { @@ -4011,30 +4005,11 @@ func TestPrintUseDeclaration(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtUseDeclaration{ + Type: &ast.Identifier{Value: []byte("function")}, Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Alias: &ast.Identifier{Value: []byte("Bar")}, }) - expected := `Foo as Bar` - actual := o.String() - - if expected != actual { - t.Errorf("\nexpected: %s\ngot: %s\n", expected, actual) - } -} - -func TestPrintUseType(t *testing.T) { - o := bytes.NewBufferString("") - - p := printer.NewPrettyPrinter(o, " ") - p.Print(&ast.StmtUseType{ - Type: &ast.Identifier{Value: []byte("function")}, - Use: &ast.StmtUseDeclaration{ - Use: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, - Alias: &ast.Identifier{Value: []byte("Bar")}, - }, - }) - expected := `function Foo as Bar` actual := o.String() diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 3951b6f..8d73f1b 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -76,6 +76,23 @@ func (p *Printer) printFreeFloatingOrDefault(n ast.Vertex, pos token.Position, d } } +func (p *Printer) printToken(t *token.Token, def string) { + if t != nil { + p.w.Write(t.Skipped) + p.w.Write(t.Value) + p.bufStart = "" + return + } + + if def != "" { + p.w.Write([]byte(p.bufStart)) + p.bufStart = "" + + p.w.Write([]byte(def)) + return + } +} + func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { if n == nil { return @@ -87,7 +104,7 @@ func (p *Printer) printFreeFloating(n ast.Vertex, pos token.Position) { } func (p *Printer) printNode(n ast.Vertex) { - switch n.(type) { + switch n := n.(type) { // node @@ -438,14 +455,10 @@ func (p *Printer) printNode(n ast.Vertex) { p.printStmtUnset(n) case *ast.StmtUse: p.printStmtUse(n) - case *ast.StmtGroupUseList: - p.printStmtGroupUseList(n) - case *ast.StmtUseList: - p.printStmtUseList(n) + case *ast.StmtGroupUse: + p.printStmtGroupUse(n) case *ast.StmtUseDeclaration: p.printStmtUseDeclaration(n) - case *ast.StmtUseType: - p.printStmtUseType(n) case *ast.StmtWhile: p.printStmtWhile(n) case *ast.ParserAs: @@ -3260,74 +3273,66 @@ func (p *Printer) printStmtUnset(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtUse(n ast.Vertex) { - nn := n.(*ast.StmtUse) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "use") +func (p *Printer) printStmtUse(n *ast.StmtUse) { + p.printToken(n.UseTkn, "use") p.bufStart = " " - p.Print(nn.UseList) + p.Print(n.Type) - p.printFreeFloatingOrDefault(nn, token.End, ";") + p.bufStart = " " + p.joinPrint(",", n.UseDeclarations) + + p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtGroupUseList(n ast.Vertex) { - nn := n.(*ast.StmtGroupUseList) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtGroupUse(n *ast.StmtGroupUse) { + p.printToken(n.UseTkn, "use") - p.Print(nn.Prefix) + p.bufStart = " " + p.Print(n.Type) - if _, ok := nn.UseList.(*ast.ParserNsSeparator); !ok { - io.WriteString(p.w, "\\{") - } + p.bufStart = " " + p.printToken(n.LeadingNsSeparatorTkn, "") - p.Print(nn.UseList) + p.Print(n.Prefix) + p.printToken(n.NsSeparatorTkn, "\\") + p.printToken(n.OpenCurlyBracketTkn, "{") - if _, ok := nn.UseList.(*ast.ParserNsSeparator); !ok { - io.WriteString(p.w, "}") - } - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtUseList(n ast.Vertex) { - nn := n.(*ast.StmtUseList) - p.printFreeFloating(nn, token.Start) - - p.joinPrint(",", nn.UseDeclarations) - - p.printFreeFloating(nn, token.End) -} - -func (p *Printer) printStmtUseDeclaration(n ast.Vertex) { - nn := n.(*ast.StmtUseDeclaration) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.Use) - - if nn.Alias != nil { - if _, ok := nn.Alias.(*ast.ParserAs); !ok { - io.WriteString(p.w, " as") + for k, v := range n.UseDeclarations { + p.Print(v) + var def string + if k != len(n.UseDeclarations)-1 { + def = "," + } + if decl, ok := v.(*ast.StmtUseDeclaration); ok { + p.printToken(decl.CommaTkn, def) } - - p.bufStart = " " - p.Print(nn.Alias) } - p.printFreeFloating(nn, token.End) + p.printToken(n.CloseCurlyBracketTkn, "}") + p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtUseType(n ast.Vertex) { - nn := n.(*ast.StmtUseType) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { + p.Print(n.Type) - p.Print(nn.Type) + if n.Type != nil { + p.bufStart = " " + } + + p.printToken(n.NsSeparatorTkn, "") + + p.Print(n.Use) + + if n.Alias == nil { + return + } p.bufStart = " " - p.Print(nn.Use) + p.printToken(n.AsTkn, "as") - p.printFreeFloating(nn, token.End) + p.bufStart = " " + p.Print(n.Alias) } func (p *Printer) printStmtWhile(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 2745542..60cdc39 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1308,7 +1308,8 @@ func TestParseAndPrintPhp5Unset(t *testing.T) { } func TestParseAndPrintPhp5UseList(t *testing.T) { - src := ` Date: Mon, 24 Aug 2020 14:20:20 +0300 Subject: [PATCH 047/140] [refactoring] update ast structure of "name" nodes --- internal/php5/parser_test.go | 4 +- internal/php5/php5.go | Bin 298404 -> 296000 bytes internal/php5/php5.y | 308 ++++++++++++--------- internal/php5/php5_test.go | 6 +- internal/php7/parser_test.go | 4 +- internal/php7/php7.go | Bin 253133 -> 252280 bytes internal/php7/php7.y | 164 +++++------ internal/php7/php7_test.go | 6 +- pkg/ast/node.go | 24 +- pkg/ast/traverser/dfs.go | 8 +- pkg/ast/visitor/filter_tokens.go | 27 ++ pkg/ast/visitor/namespace_resolver.go | 4 +- pkg/ast/visitor/namespace_resolver_test.go | 14 +- pkg/printer/pretty_printer.go | 4 +- pkg/printer/pretty_printer_test.go | 6 +- pkg/printer/printer.go | 143 +++++----- pkg/printer/printer_parsed_php5_test.go | 35 ++- pkg/printer/printer_parsed_php7_test.go | 39 ++- pkg/printer/printer_test.go | 6 +- 19 files changed, 446 insertions(+), 356 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 6ab5b7a..ab1446d 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -8546,7 +8546,7 @@ func TestStmtNamespace(t *testing.T) { EndPos: 17, }, }, - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -8604,7 +8604,7 @@ func TestStmtNamespace_Stmts(t *testing.T) { EndPos: 19, }, }, - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index a1be3c01d1e823818b9cead42d2f229ebccfa0a9..b074c966276016b5d0ba2a3ab7733f1b5d9c3eb4 100644 GIT binary patch delta 13770 zcmd5@cXXCT);}}zBq5ZL5NZ;Vmy!t5-d-?3B1#h^h=m1#1c(9x2@s`8waX$wC09WO zZ0xeSfQ7LGt1G%Hf*qs;TpJefTSfGve7`Br`v#CbyT^aNoI_5YJ9qBfxpU{%;n9^% zw%p!i!}P5BK7Y7={i<1& zi5_+ZZS}AYG~!|2h^oi)M$PM|;-{c&dR5m;%O;nresd^Dlrg!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lp71#iAd@)PuCY5kzklH(m4^&uxrOvZH-6l14gQ< zcdG{4(oG^8tjd4WYm>tBwjy~Hl3+@-H;m4Wi42DyKT5)F)^Jr9wj zmH34ts+9UkR5C*8)d@(h@DoJ~`SKlDQ=keOdOR<+Sh&#OsDxHO78 zx7b(<9^dDww%%~TMB;fDFeUDy%BNru$dI@H1i(?+v2Xd{`=mt5FTo5$FR3Uw|07Jq I^=H-hpMk+Pi2wiq diff --git a/internal/php7/php7.y b/internal/php7/php7.y index f6589cd..33c558c 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -350,57 +350,59 @@ top_statement_list: namespace_name: T_STRING { - namePart := &ast.NameNamePart{ast.Node{}, $1.Value} - $$ = []ast.Vertex{namePart} - - // save position - namePart.GetNode().Position = position.NewTokenPosition($1) - - // save comments - yylex.(*Parser).setFreeFloating(namePart, token.Start, $1.SkippedTokens) + $$ = []ast.Vertex{ + &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + StringTkn: $1, + Value: $1.Value, + }, + } } | namespace_name T_NS_SEPARATOR T_STRING { - namePart := &ast.NameNamePart{ast.Node{}, $3.Value} - $$ = append($1, namePart) - - // save position - namePart.GetNode().Position = position.NewTokenPosition($3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(namePart, token.Start, $3.SkippedTokens) + $$ = append($1, &ast.NameNamePart{ + Node: ast.Node{ + Position: position.NewTokensPosition($2, $3), + }, + NsSeparatorTkn: $2, + StringTkn: $3, + Value: $3.Value, + }) } ; name: namespace_name { - $$ = &ast.NameName{ast.Node{}, $1} - - // save position - $$.GetNode().Position = position.NewNodeListPosition($1) + $$ = &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($1), + }, + Parts: $1, + } } - | T_NAMESPACE T_NS_SEPARATOR namespace_name + | T_NAMESPACE T_NS_SEPARATOR namespace_name { - $$ = &ast.NameRelative{ast.Node{}, $3} - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) + $$ = &ast.NameRelative{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $3), + }, + NsTkn: $1, + NsSeparatorTkn: $2, + Parts: $3, + } } - | T_NS_SEPARATOR namespace_name + | T_NS_SEPARATOR namespace_name { - $$ = &ast.NameFullyQualified{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokenNodeListPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) + $$ = &ast.NameFullyQualified{ + Node: ast.Node{ + Position: position.NewTokenNodeListPosition($1, $2), + }, + NsSeparatorTkn: $1, + Parts: $2, + } } ; @@ -443,45 +445,49 @@ top_statement: } | T_NAMESPACE namespace_name ';' { - name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtNamespace{ast.Node{}, name, nil} - - // save position - name.GetNode().Position = position.NewNodeListPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtNamespace{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + NsTkn: $1, + Name: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Parts: $2, + }, + SemiColonTkn: $3, + } } | T_NAMESPACE namespace_name '{' top_statement_list '}' { - name := &ast.NameName{ast.Node{}, $2} - $$ = &ast.StmtNamespace{ast.Node{}, name, $4} - - // save position - name.GetNode().Position = position.NewNodeListPosition($2) - $$.GetNode().Position = position.NewTokensPosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).MoveFreeFloating($2[0], name) - yylex.(*Parser).setFreeFloating(name, token.End, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $5.SkippedTokens) + $$ = &ast.StmtNamespace{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $5), + }, + NsTkn: $1, + Name: &ast.NameName{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Parts: $2, + }, + OpenCurlyBracket: $3, + Stmts: $4, + CloseCurlyBracket: $5, + } } | T_NAMESPACE '{' top_statement_list '}' { - $$ = &ast.StmtNamespace{ast.Node{}, nil, $3} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Namespace, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $4.SkippedTokens) + $$ = &ast.StmtNamespace{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + NsTkn: $1, + OpenCurlyBracket: $2, + Stmts: $3, + CloseCurlyBracket: $4, + } } | T_USE mixed_group_use_declaration ';' { @@ -1222,10 +1228,12 @@ catch_name_list: } | catch_name_list '|' name { + switch n := lastNode($1).(type) { + case *ast.NameName: n.ListSeparatorTkn = $2 + case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 + case *ast.NameRelative: n.ListSeparatorTkn = $2 + } $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; @@ -2251,10 +2259,12 @@ name_list: } | name_list ',' name { + switch n := lastNode($1).(type) { + case *ast.NameName: n.ListSeparatorTkn = $2 + case *ast.NameFullyQualified: n.ListSeparatorTkn = $2 + case *ast.NameRelative: n.ListSeparatorTkn = $2 + } $$ = append($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index 00d02cc..d717743 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -6962,7 +6962,7 @@ func TestPhp7(t *testing.T) { EndPos: 2525, }, }, - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 115, @@ -6995,7 +6995,7 @@ func TestPhp7(t *testing.T) { EndPos: 2542, }, }, - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Node: ast.Node{ Position: &position.Position{ StartLine: 116, @@ -17695,7 +17695,7 @@ func TestPhp7(t *testing.T) { Position: &position.Position{ StartLine: 318, EndLine: 318, - StartPos: 5212, + StartPos: 5211, EndPos: 5215, }, }, diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d7dd01d..d64da63 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -603,8 +603,12 @@ func (n *StmtLabel) Accept(v NodeVisitor) { // StmtNamespace node type StmtNamespace struct { Node - NamespaceName Vertex - Stmts []Vertex + NsTkn *token.Token + Name Vertex + OpenCurlyBracket *token.Token + Stmts []Vertex + CloseCurlyBracket *token.Token + SemiColonTkn *token.Token } func (n *StmtNamespace) Accept(v NodeVisitor) { @@ -1840,7 +1844,8 @@ func (n *ExprBinarySpaceship) Accept(v NodeVisitor) { type NameName struct { Node - Parts []Vertex + Parts []Vertex + ListSeparatorTkn *token.Token } func (n *NameName) Accept(v NodeVisitor) { @@ -1849,7 +1854,9 @@ func (n *NameName) Accept(v NodeVisitor) { type NameFullyQualified struct { Node - Parts []Vertex + NsSeparatorTkn *token.Token + Parts []Vertex + ListSeparatorTkn *token.Token } func (n *NameFullyQualified) Accept(v NodeVisitor) { @@ -1858,7 +1865,10 @@ func (n *NameFullyQualified) Accept(v NodeVisitor) { type NameRelative struct { Node - Parts []Vertex + NsTkn *token.Token + NsSeparatorTkn *token.Token + Parts []Vertex + ListSeparatorTkn *token.Token } func (n *NameRelative) Accept(v NodeVisitor) { @@ -1867,7 +1877,9 @@ func (n *NameRelative) Accept(v NodeVisitor) { type NameNamePart struct { Node - Value []byte + NsSeparatorTkn *token.Token + StringTkn *token.Token + Value []byte } func (n *NameNamePart) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 20eecf3..7e41a44 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -845,10 +845,10 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - if nn.NamespaceName != nil { - t.visitor.Enter("NamespaceName", true) - t.Traverse(nn.NamespaceName) - t.visitor.Leave("NamespaceName", true) + if nn.Name != nil { + t.visitor.Enter("Name", true) + t.Traverse(nn.Name) + t.visitor.Leave("Name", true) } if nn.Stmts != nil { t.visitor.Enter("Stmts", false) diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 7101b86..adba189 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -33,3 +33,30 @@ func (v *FilterTokens) StmtUseDeclaration(n *ast.StmtUseDeclaration) { n.AsTkn = nil n.CommaTkn = nil } + +func (v *FilterTokens) NameNamePart(n *ast.NameNamePart) { + n.NsSeparatorTkn = nil + n.StringTkn = nil +} + +func (v *FilterTokens) NameName(n *ast.NameName) { + n.ListSeparatorTkn = nil +} + +func (v *FilterTokens) NameFullyQualified(n *ast.NameFullyQualified) { + n.NsSeparatorTkn = nil + n.ListSeparatorTkn = nil +} + +func (v *FilterTokens) NameRelative(n *ast.NameRelative) { + n.NsTkn = nil + n.NsSeparatorTkn = nil + n.ListSeparatorTkn = nil +} + +func (v *FilterTokens) StmtNamespace(n *ast.StmtNamespace) { + n.NsTkn = nil + n.OpenCurlyBracket = nil + n.CloseCurlyBracket = nil + n.SemiColonTkn = nil +} diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index 34c92c7..fb5659d 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -37,10 +37,10 @@ func (nsr *NamespaceResolver) EnterNode(n ast.Vertex) bool { } func (nsr *NamespaceResolver) StmtNamespace(n *ast.StmtNamespace) { - if n.NamespaceName == nil { + if n.Name == nil { nsr.Namespace = NewNamespace("") } else { - NSParts := n.NamespaceName.(*ast.NameName).Parts + NSParts := n.Name.(*ast.NameName).Parts nsr.Namespace = NewNamespace(concatNameParts(NSParts)) } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 34a31f7..5b01ecc 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -605,7 +605,7 @@ func TestResolveConstantsName(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: nameAB, + Name: nameAB, }, &ast.StmtConstList{ Consts: []ast.Vertex{ @@ -649,7 +649,7 @@ func TestResolveNamespaces(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: namespaceAB, + Name: namespaceAB, }, &ast.StmtConstList{ Consts: []ast.Vertex{ @@ -666,7 +666,7 @@ func TestResolveNamespaces(t *testing.T) { Stmts: []ast.Vertex{}, }, &ast.StmtNamespace{ - NamespaceName: namespaceCD, + Name: namespaceCD, Stmts: []ast.Vertex{ &ast.StmtUse{ UseDeclarations: []ast.Vertex{ @@ -749,7 +749,7 @@ func TestDoNotResolveReservedConstants(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: namespaceName, + Name: namespaceName, }, &ast.StmtExpression{ Expr: &ast.ExprConstFetch{ @@ -877,7 +877,7 @@ func TestDoNotResolveReservedNames(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{Value: []byte("Foo")}, }, @@ -955,7 +955,7 @@ func TestDoNotResolveReservedSpecialNames(t *testing.T) { stxTree := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{Value: []byte("Foo")}, }, @@ -1007,7 +1007,7 @@ func TestResolvePropertyTypeName(t *testing.T) { stmts := &ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{Value: []byte("Foo")}, }, diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index 1aab5d1..fca19fd 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1931,9 +1931,9 @@ func (p *PrettyPrinter) printStmtNamespace(n ast.Vertex) { io.WriteString(p.w, "namespace") - if nn.NamespaceName != nil { + if nn.Name != nil { io.WriteString(p.w, " ") - p.Print(nn.NamespaceName) + p.Print(nn.Name) } if nn.Stmts != nil { diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index 199bc2f..c457cb8 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -22,7 +22,7 @@ abstract class Bar extends Baz rootNode := &ast.Root{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: &ast.NameName{ + Name: &ast.NameName{ Parts: []ast.Vertex{ &ast.NameNamePart{Value: []byte("Foo")}, }, @@ -3454,7 +3454,7 @@ func TestPrintNamespace(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtNamespace{ - NamespaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, }) expected := `namespace Foo;` @@ -3472,7 +3472,7 @@ func TestPrintNamespaceWithStmts(t *testing.T) { p.Print(&ast.StmtStmtList{ Stmts: []ast.Vertex{ &ast.StmtNamespace{ - NamespaceName: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, + Name: &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("Foo")}}}, Stmts: []ast.Vertex{ &ast.StmtExpression{Expr: &ast.ExprVariable{VarName: &ast.Identifier{Value: []byte("a")}}}, }, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 8d73f1b..0e8a0dd 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -55,6 +55,16 @@ func (p *Printer) joinPrint(glue string, nn []ast.Vertex) { } } +func (p *Printer) joinPrintRefactored(glue string, nn []ast.Vertex) { + for k, n := range nn { + if k > 0 { + p.bufStart = glue + } + + p.Print(n) + } +} + func (p *Printer) printNodes(nn []ast.Vertex) { for _, n := range nn { p.Print(n) @@ -558,50 +568,36 @@ func (p *Printer) printNodeArgument(n ast.Vertex) { // name -func (p *Printer) printNameNamePart(n ast.Vertex) { - nn := n.(*ast.NameNamePart) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" - - io.WriteString(p.w, string(nn.Value)) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printNameNamePart(n *ast.NameNamePart) { + p.printToken(n.NsSeparatorTkn, "") + p.printToken(n.StringTkn, string(n.Value)) } -func (p *Printer) printNameName(n ast.Vertex) { - nn := n.(*ast.NameName) - p.printFreeFloating(nn, token.Start) +func (p *Printer) printNameName(n *ast.NameName) { + p.printFreeFloating(n, token.Start) - p.joinPrint("\\", nn.Parts) + p.joinPrintRefactored("\\", n.Parts) - p.printFreeFloating(nn, token.End) + p.printToken(n.ListSeparatorTkn, "") } -func (p *Printer) printNameFullyQualified(n ast.Vertex) { - nn := n.(*ast.NameFullyQualified) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" +func (p *Printer) printNameFullyQualified(n *ast.NameFullyQualified) { + p.printFreeFloating(n, token.Start) + p.printToken(n.NsSeparatorTkn, "\\") - io.WriteString(p.w, "\\") - p.joinPrint("\\", nn.Parts) + p.joinPrintRefactored("\\", n.Parts) - p.printFreeFloating(nn, token.End) + p.printToken(n.ListSeparatorTkn, "") } -func (p *Printer) printNameRelative(n ast.Vertex) { - nn := n.(*ast.NameRelative) - p.printFreeFloatingOrDefault(nn, token.Start, p.bufStart) - p.bufStart = "" +func (p *Printer) printNameRelative(n *ast.NameRelative) { + p.printFreeFloating(n, token.Start) + p.printToken(n.NsTkn, "namespace") + p.printToken(n.NsSeparatorTkn, "\\") - io.WriteString(p.w, "namespace") - p.printFreeFloating(nn, token.Namespace) + p.joinPrintRefactored("\\", n.Parts) - for _, part := range nn.Parts { - io.WriteString(p.w, "\\") - p.Print(part) - } - - p.printFreeFloating(nn, token.End) + p.printToken(n.ListSeparatorTkn, "") } // scalar @@ -2299,7 +2295,9 @@ func (p *Printer) printStmtCatch(n ast.Vertex) { io.WriteString(p.w, "catch") p.printFreeFloating(nn, token.Catch) io.WriteString(p.w, "(") - p.joinPrint("|", nn.Types) + + p.joinPrintRefactored("|", nn.Types) + p.Print(nn.Var) p.printFreeFloating(nn, token.Var) io.WriteString(p.w, ")") @@ -2409,10 +2407,9 @@ func (p *Printer) printStmtClass(n ast.Vertex) { io.WriteString(p.w, " ") } io.WriteString(p.w, "implements") - if nn.Implements.InterfaceNames[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Implements.InterfaceNames) + p.bufStart = " " + p.joinPrintRefactored(",", nn.Implements.InterfaceNames) + } p.printFreeFloating(nn, token.Name) @@ -2896,10 +2893,8 @@ func (p *Printer) printStmtInterface(n ast.Vertex) { io.WriteString(p.w, " ") } io.WriteString(p.w, "extends") - if nn.Extends.InterfaceNames[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Extends.InterfaceNames) + p.bufStart = " " + p.joinPrintRefactored(",", nn.Extends.InterfaceNames) } p.printFreeFloating(nn, token.Name) @@ -2923,32 +2918,28 @@ func (p *Printer) printStmtLabel(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtNamespace(n ast.Vertex) { - nn := n.(*ast.StmtNamespace) - p.printFreeFloating(nn, token.Start) - io.WriteString(p.w, "namespace") +func (p *Printer) printStmtNamespace(n *ast.StmtNamespace) { + p.printToken(n.NsTkn, "namespace") - if nn.NamespaceName != nil { - if nn.NamespaceName.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(nn.NamespaceName) + if n.Name != nil { + p.bufStart = " " + p.Print(n.Name) } - if nn.Stmts != nil { - p.printFreeFloating(nn, token.Namespace) - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") - } else { - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } + if n.Stmts != nil { + p.printToken(n.OpenCurlyBracket, "{") + p.printNodes(n.Stmts) + p.printToken(n.CloseCurlyBracket, "}") + return } - p.printFreeFloating(nn, token.End) + if n.OpenCurlyBracket != nil { + p.printToken(n.OpenCurlyBracket, "{") + p.printToken(n.CloseCurlyBracket, "}") + return + } + + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtNop(n ast.Vertex) { @@ -3202,10 +3193,8 @@ func (p *Printer) printStmtTraitUse(n ast.Vertex) { p.printFreeFloating(nn, token.Start) io.WriteString(p.w, "use") - if nn.Traits[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Traits) + p.bufStart = " " + p.joinPrintRefactored(",", nn.Traits) p.Print(nn.TraitAdaptationList) @@ -3276,11 +3265,13 @@ func (p *Printer) printStmtUnset(n ast.Vertex) { func (p *Printer) printStmtUse(n *ast.StmtUse) { p.printToken(n.UseTkn, "use") - p.bufStart = " " - p.Print(n.Type) + if n.Type != nil { + p.bufStart = " " + p.Print(n.Type) + } p.bufStart = " " - p.joinPrint(",", n.UseDeclarations) + p.joinPrintRefactored(",", n.UseDeclarations) p.printToken(n.SemiColonTkn, ";") } @@ -3298,16 +3289,7 @@ func (p *Printer) printStmtGroupUse(n *ast.StmtGroupUse) { p.printToken(n.NsSeparatorTkn, "\\") p.printToken(n.OpenCurlyBracketTkn, "{") - for k, v := range n.UseDeclarations { - p.Print(v) - var def string - if k != len(n.UseDeclarations)-1 { - def = "," - } - if decl, ok := v.(*ast.StmtUseDeclaration); ok { - p.printToken(decl.CommaTkn, def) - } - } + p.joinPrintRefactored(",", n.UseDeclarations) p.printToken(n.CloseCurlyBracketTkn, "}") p.printToken(n.SemiColonTkn, ";") @@ -3325,6 +3307,7 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.Print(n.Use) if n.Alias == nil { + p.printToken(n.CommaTkn, "") return } @@ -3333,6 +3316,8 @@ func (p *Printer) printStmtUseDeclaration(n *ast.StmtUseDeclaration) { p.bufStart = " " p.Print(n.Alias) + + p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtWhile(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 60cdc39..17cef65 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -45,8 +45,8 @@ func TestParseAndPrintPhp5Root(t *testing.T) { } func TestParseAndPrintPhp5Identifier(t *testing.T) { - - src := ` Date: Mon, 24 Aug 2020 21:41:06 +0300 Subject: [PATCH 048/140] [refactoring] update ast structure of "HaltCompiler" node --- internal/php5/php5.go | Bin 296000 -> 295716 bytes internal/php5/php5.y | 34 +++++++++++++----------- internal/php7/php7.go | Bin 252280 -> 251010 bytes internal/php7/php7.y | 34 +++++++++++++----------- pkg/ast/node.go | 4 +++ pkg/ast/visitor/filter_tokens.go | 7 +++++ pkg/printer/printer.go | 12 ++++----- pkg/printer/printer_parsed_php5_test.go | 3 ++- pkg/printer/printer_parsed_php7_test.go | 3 ++- 9 files changed, 56 insertions(+), 41 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index b074c966276016b5d0ba2a3ab7733f1b5d9c3eb4..926e1bebabfb0937d9f5ece935e29a3d8e94ac78 100644 GIT binary patch delta 8742 zcmcIpd0f?1+W$P~{6KJFRY+MbnxdHEz3e0+iVKw~7`f(%D5bff*r;h3wrDPemOf*P zVm9VmIzmZDb0f!kQ*+JC#!?&|t<;hBw~~6l=lt%yTxRC|^Zo1Ivp>uCS$}m)!(Mwj ztoo4-{uwP>&Y55Od|%Q2i5EJk7dlX5OFpnlrgF8DvO@AEOq-KCb9(8NX(h7@r_Q*O z<9bkBQ2vD3B{SwsE-9N*hDjdMgE|D~PMcX)(zL)uSro&kT@=cfyHg1Nr3Xdwkgha< zGSsTB^xwo6%VY#sKSP1My(^V)uNNqQcXq!blbcQ;#}PQ3V_ zh~T&nD1n`ow46&PP-h<26VE&_mlpEDWEx1xJgX0F=Upi@kX^eeg7YIq0{2P9Qkp8r zBNy?GG(1vsPDC39)S?`^LF|`_$%0VfP{;ezeZ;%(ghbM~rau)c=TJICd`BPL;nLTC zPwBjB2X*55M5`^ISPS0&oQ>nFSGonKX68{iaa0aYWT*)_G)!>EiT2&>D`31eKwp2D z`1wJ2Fw>@f$zV`lxr1)^z7W8z@-XKWyMAF5fhAntQt+vJuz0f0EmqCKaN?!+`kr9V zTS0>3o)t>{kWW1&SnT+$NadW>Vw9>bq+bN?JRYkh@Y^U5l+Ki5_2Sv1@jsQ-Xe!f^ zi{y|{E1JiR0n=|Kf@w4S7(>cn*IsgR-dLZvL;s&}8^LAc@XWUfKt)506~ouYQ7$E^ zUVor50+ayGvAp0CbydfU2yzE}Y|yHwim6V3p=a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IR^`iizJ4#r3B;SvprzNIc%hD}F9 zUc!sru)9?+y8lk=D7GPK%iW(~9MkphOQ)8q zFX+TQ!2neDca&AbmY6mDOSPr*_dR&8F8yCVeE!!~zu~}s^tTvg?6db0hNHa58V8o` zW`oE**`(;I=dD!erT=w>GagFGPEGpa%joe3)#LQg0|65{7f9LOT-&S+Y~f(jwfjUz zLDj1qIzEp239WxH`*hlBxDLfklyEkdnZP=mSxJoq|^ua>>&{WWM-zgVOA zlLsdA7Oz}m2Q!~B;l8EuRnILP1WbrVHF_JiP0j?|AFF4no<3+}$TgpJd}@OG!M>(yD$ASA4~p1VQq;ta-WlW78Bh{jXn+y3aL8!!jq1o^gl z^CN1Ik4PLhuhpu#dj4a|KCPLrr&J=G(jb4!dMyRb$e@>7{eCSt#?^3@hinq|G@dSwGf4=Ur86jb&WmTer{Haa(<`!>L8ZMbg(W%99BO$OO zx^SE7>zgYfkLRKl`h$9PB11*p5!HX)u8wEMF>#9~`(>t>JD;%ObM@Gr>Q4cTZ&nuL zg`jEGr!k!UngK>|5g*d1fwKa!%=KWeO6l6)d!-+k(UMQ=*Y~Ik0*lfy-C@6)XS-cy zPUwsUuM+s;!OKP{NoQmR0F&)a=vV%r_GEOSQ5H-4PmUe6IH+d%7{BG1OJ~Jlyw|K- zq&gwc-msz0uEaNB=2EJG+i&6w)qD`;X#D<&y2;VVPaPp$chtM87zxzLoJ4vxdTPu! kdS1CVln%dbqrnj2`a1Jv)rog}nn?*b&n}>`$5r%y0G(#mCIA2c diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 33c558c..3013dfd 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -434,14 +434,15 @@ top_statement: } | T_HALT_COMPILER '(' ')' ';' { - $$ = &ast.StmtHaltCompiler{ast.Node{}} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) + $$ = &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + HaltCompilerTkn: $1, + OpenParenthesisTkn: $2, + CloseParenthesisTkn: $3, + SemiColonTkn: $4, + } } | T_NAMESPACE namespace_name ';' { @@ -838,14 +839,15 @@ inner_statement: } | T_HALT_COMPILER '(' ')' ';' { - $$ = &ast.StmtHaltCompiler{ast.Node{}} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloatingTokens($$, token.End, append($2.SkippedTokens, append($3.SkippedTokens, $4.SkippedTokens...)...)) + $$ = &ast.StmtHaltCompiler{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $4), + }, + HaltCompilerTkn: $1, + OpenParenthesisTkn: $2, + CloseParenthesisTkn: $3, + SemiColonTkn: $4, + } } statement: diff --git a/pkg/ast/node.go b/pkg/ast/node.go index d64da63..4b633fe 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -539,6 +539,10 @@ func (n *StmtGoto) Accept(v NodeVisitor) { // StmtHaltCompiler node type StmtHaltCompiler struct { Node + HaltCompilerTkn *token.Token + OpenParenthesisTkn *token.Token + CloseParenthesisTkn *token.Token + SemiColonTkn *token.Token } func (n *StmtHaltCompiler) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index adba189..ff7f336 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -60,3 +60,10 @@ func (v *FilterTokens) StmtNamespace(n *ast.StmtNamespace) { n.CloseCurlyBracket = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtHaltCompiler(n *ast.StmtHaltCompiler) { + n.HaltCompilerTkn = nil + n.OpenParenthesisTkn = nil + n.CloseParenthesisTkn = nil + n.SemiColonTkn = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 0e8a0dd..450f928 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2823,13 +2823,11 @@ func (p *Printer) printStmtGoto(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtHaltCompiler(n ast.Vertex) { - nn := n.(*ast.StmtHaltCompiler) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "__halt_compiler") - - p.printFreeFloatingOrDefault(nn, token.End, "();") +func (p *Printer) printStmtHaltCompiler(n *ast.StmtHaltCompiler) { + p.printToken(n.HaltCompilerTkn, "__halt_compiler") + p.printToken(n.OpenParenthesisTkn, "(") + p.printToken(n.CloseParenthesisTkn, ")") + p.printToken(n.SemiColonTkn, ";") } func (p *Printer) printStmtIf(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 17cef65..a65bd6b 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1049,7 +1049,8 @@ func TestParseAndPrintPhp5Goto(t *testing.T) { } func TestParseAndPrintPhp5HaltCompiler(t *testing.T) { - src := ` Date: Mon, 24 Aug 2020 23:28:44 +0300 Subject: [PATCH 049/140] [refactoring] update ast structure of "Constant" nodes --- internal/php5/parser_test.go | 16 +- internal/php5/php5.go | Bin 295716 -> 295135 bytes internal/php5/php5.y | 199 ++++++++++++--------- internal/php5/php5_test.go | 16 +- internal/php7/parser_test.go | 20 +-- internal/php7/php7.go | Bin 251010 -> 251161 bytes internal/php7/php7.y | 94 +++++----- internal/php7/php7_test.go | 18 +- pkg/ast/node.go | 16 +- pkg/ast/traverser/dfs.go | 12 +- pkg/ast/visitor/filter_tokens.go | 15 ++ pkg/ast/visitor/namespace_resolver.go | 2 +- pkg/ast/visitor/namespace_resolver_test.go | 16 +- pkg/printer/pretty_printer.go | 2 +- pkg/printer/pretty_printer_test.go | 32 ++-- pkg/printer/printer.go | 78 ++------ pkg/printer/printer_parsed_php5_test.go | 5 +- pkg/printer/printer_parsed_php7_test.go | 5 +- pkg/printer/printer_test.go | 40 ++--- 19 files changed, 298 insertions(+), 288 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index ab1446d..52dc6df 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -4154,7 +4154,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndPos: 27, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -4186,7 +4186,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndPos: 36, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5124,7 +5124,7 @@ func TestStmtConstList(t *testing.T) { EndPos: 16, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5156,7 +5156,7 @@ func TestStmtConstList(t *testing.T) { EndPos: 25, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5451,7 +5451,7 @@ func TestStmtDeclare(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5530,7 +5530,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5562,7 +5562,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndPos: 34, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5642,7 +5642,7 @@ func TestStmtDeclare_Alt(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, diff --git a/internal/php5/php5.go b/internal/php5/php5.go index 926e1bebabfb0937d9f5ece935e29a3d8e94ac78..f836b8b6f3ba8c2b0999e5a704be6ac12529220a 100644 GIT binary patch delta 10677 zcmeHNXLyxWwtm*$UlMZ&X%G<74pB-}lGAenga9e1K@$|I0*O+jB>@767zpSLUKxso zEOA7NI$$LzxNWr2JMt)MP!W{@f?Nkt2C$5GR2=TR_jk@oM4jihANR-g2j*M5t-b2I z);^E^Hu>n{fy>ic|IdDT%mefQm%W&l|>w3|`fT3YBXBJwrS%NJZr0 znSJPH-n~NhX6MJUADbA$RVN<$kU@ zAyT=aJ6UFHc3w&E^YTKlAzp7gpwIk@nC4NYo>=_T6HkJV$VU3i_JXZaoaM96{Z9W4 zR(;f;>jz_X^JC;R2Pz!cg$%FuH_myQxVQ`)EDp$4)-E{lG5&rC#1hEo{g2t##F5j= zsU*tdh>cyqE0&AiJh_6}$KM>*M2=C!z};dX*RB+?GB!4r7gtc%4mrIptD0SxbA8>6 zx*|Qfs=AJQ7vQ2TBZbB5E9i30I!(!(<;NWw22m_GeM!9&ufRdEvGw-vN^Y&4)yJv-i%js3 z&8ddHnDP2-?v`w2aElvTmXylN`wkyC#0+1^v2BZn`PtbQ4&pl5IoEQ<9%y^O1Jc3C zv2viy^Mx#G{4jE~y;^74ohys2i;{nGKeIPixhO5yKBkXz%vde8;S*=oO}ur1kwt8e z3*`tpug`&FbSk9I5!og4JCkAK1KNqGj`k@LImX6@B-w=@$)Srmr4au>=24tjDU-Q; zFU7`(m)NprS2?9{VlH(|Y_p4zJ#V;{(mb)TzaVEQA|mI=GFzAR4jx!4bN{EpPUXU> zB8v|Who|TH)H@k;J#p7fml|XEHzHVMs^5*L9Ry=Ao-?J2b_tQ^g{g@kKOjV$s-8fbqC|dxlRl=7+*}Ro z+dGT0)bOdan{afu`7%v;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$2(sUjnsmH7J6r110`*L0#wal@D-_E`IGen61UHO zMCvX3{1$T&YT^*=j{J`TzOlm7ds|~R)o>greIOcOZq;Ih)l2B$ikh*X$+QYjVR)tq zJb*18WhDqM%7?3Pp*2j^9b?%KV2>7Bcj{5Lz_T`Vh4uteutPmN!73n`rk^}@Z=vNx zYn+z2!u(Uh4)&%UW^t3LR+!p|I}@uZCdAa>4tyJ@dAOk=`_42(j9HWM@P2Ir8Y?== zGhSy_@!?{8xH2X9?9y*KhUi-bdKJ4d)Q>L))U)FUgo^nyU=dDVdTm;#*_wu~Xsvk{ M=3*)21X8*94?0P0BLDyZ diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 5d11a5d..181e9a4 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -447,14 +447,9 @@ top_statement: } | constant_declaration ';' { + $1.(*ast.StmtConstList).SemiColonTkn = $2 + $1.(*ast.StmtConstList).Node.Position = position.NewNodeTokenPosition($1, $2) $$ = $1 - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Stmts, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } ; @@ -725,39 +720,52 @@ use_const_declaration: constant_declaration: constant_declaration ',' T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $3.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $5} constList := $1.(*ast.StmtConstList) - lastConst := lastNode(constList.Consts) - constList.Consts = append(constList.Consts, constant) + constList.Node.Position = position.NewNodesPosition($1, $5) + lastNode(constList.Consts).(*ast.StmtConstant).CommaTkn = $2 + constList.Consts = append(constList.Consts, &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $5), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Value: $3.Value, + }, + EqualTkn: $4, + Expr: $5, + }) + $$ = $1 - // save position - name.GetNode().Position = position.NewTokenPosition($3) - constant.GetNode().Position = position.NewTokenNodePosition($3, $5) - $$.GetNode().Position = position.NewNodeNodeListPosition($1, constList.Consts) - - // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtConstList).Consts).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $2.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $4} - constList := []ast.Vertex{constant} - $$ = &ast.StmtConstList{ast.Node{}, constList} + $$ = &ast.StmtConstList{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $4), + }, + ConstTkn: $1, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($2, $4), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + Value: $2.Value, + }, + EqualTkn: $3, + Expr: $4, + }, + }, + } - // save position - name.GetNode().Position = position.NewTokenPosition($2) - constant.GetNode().Position = position.NewTokenNodePosition($2, $4) - $$.GetNode().Position = position.NewTokenNodeListPosition($1, constList) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtConstList).Consts).(*ast.StmtConstant).Name, token.Start, $2.SkippedTokens) } ; @@ -1735,32 +1743,42 @@ declare_statement: declare_list: T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $1.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $3} - $$ = []ast.Vertex{constant} + $$ = []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Value: $1.Value, + }, + EqualTkn: $2, + Expr: $3, + }, + } - // save position - name.GetNode().Position = position.NewTokenPosition($1) - constant.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating(constant, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$).(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } | declare_list ',' T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $3.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $5} - $$ = append($1, constant) + lastNode($1).(*ast.StmtConstant).CommaTkn = $2 + $$ = append($1, &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $5), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Value: $3.Value, + }, + EqualTkn: $4, + Expr: $5, + }) - // save position - name.GetNode().Position = position.NewTokenPosition($3) - constant.GetNode().Position = position.NewTokenNodePosition($3, $5) - - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } ; @@ -2359,14 +2377,9 @@ class_statement: } | class_constant_declaration ';' { + $1.(*ast.StmtClassConstList).SemiColonTkn = $2 + $1.(*ast.StmtClassConstList).Node.Position = position.NewNodeTokenPosition($1, $2) $$ = $1 - - // save position - $$.GetNode().Position = position.NewNodeTokenPosition($1, $2) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.ConstList, $2.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $2.SkippedTokens) } | trait_use_statement { @@ -2797,38 +2810,52 @@ class_variable_declaration: class_constant_declaration: class_constant_declaration ',' T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $3.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $5} constList := $1.(*ast.StmtClassConstList) - lastConst := lastNode(constList.Consts) - constList.Consts = append(constList.Consts, constant) + constList.Node.Position = position.NewNodesPosition($1, $5) + lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).CommaTkn = $2 + constList.Consts = append(constList.Consts, &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($3, $5), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($3), + }, + Value: $3.Value, + }, + EqualTkn: $4, + Expr: $5, + }) + $$ = $1 - // save position - name.GetNode().Position = position.NewTokenPosition($3) - constant.GetNode().Position = position.NewTokenNodePosition($3, $5) - $1.GetNode().Position = position.NewNodesPosition($1, $5) - - // save comments - yylex.(*Parser).setFreeFloating(lastConst, token.End, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $3.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $4.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).Name, token.Start, $3.SkippedTokens) } | T_CONST T_STRING '=' static_scalar { - name := &ast.Identifier{ast.Node{}, $2.Value} - constant := &ast.StmtConstant{ast.Node{}, name, $4} - $$ = &ast.StmtClassConstList{ast.Node{}, nil, []ast.Vertex{constant}} + $$ = &ast.StmtClassConstList{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $4), + }, + ConstTkn: $1, + Consts: []ast.Vertex{ + &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($2, $4), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($2), + }, + Value: $2.Value, + }, + EqualTkn: $3, + Expr: $4, + }, + }, + } - // save position - name.GetNode().Position = position.NewTokenPosition($2) - constant.GetNode().Position = position.NewTokenNodePosition($2, $4) - $$.GetNode().Position = position.NewTokenNodePosition($1, $4) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Start, $2.SkippedTokens) - yylex.(*Parser).setFreeFloating(constant, token.Name, $3.SkippedTokens) + yylex.(*Parser).setFreeFloating(lastNode($$.(*ast.StmtClassConstList).Consts).(*ast.StmtConstant).Name, token.Start, $2.SkippedTokens) } ; diff --git a/internal/php5/php5_test.go b/internal/php5/php5_test.go index a8b3fcb..ad42cb2 100644 --- a/internal/php5/php5_test.go +++ b/internal/php5/php5_test.go @@ -3134,7 +3134,7 @@ func TestPhp5(t *testing.T) { EndPos: 1071, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 58, @@ -3166,7 +3166,7 @@ func TestPhp5(t *testing.T) { EndPos: 1080, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 58, @@ -3793,7 +3793,7 @@ func TestPhp5(t *testing.T) { EndPos: 1409, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 67, @@ -3825,7 +3825,7 @@ func TestPhp5(t *testing.T) { EndPos: 1418, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 67, @@ -4020,7 +4020,7 @@ func TestPhp5(t *testing.T) { EndPos: 1512, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 71, @@ -4074,7 +4074,7 @@ func TestPhp5(t *testing.T) { EndPos: 1530, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 72, @@ -4106,7 +4106,7 @@ func TestPhp5(t *testing.T) { EndPos: 1546, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 72, @@ -4162,7 +4162,7 @@ func TestPhp5(t *testing.T) { EndPos: 1566, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 73, diff --git a/internal/php7/parser_test.go b/internal/php7/parser_test.go index 4cb66c8..b0e66dd 100644 --- a/internal/php7/parser_test.go +++ b/internal/php7/parser_test.go @@ -4318,7 +4318,7 @@ func TestStmtClassConstList(t *testing.T) { EndPos: 34, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -4350,7 +4350,7 @@ func TestStmtClassConstList(t *testing.T) { EndPos: 43, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -4442,7 +4442,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndPos: 27, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -4474,7 +4474,7 @@ func TestStmtClassConstList_WithoutModifiers(t *testing.T) { EndPos: 36, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5721,7 +5721,7 @@ func TestStmtConstList(t *testing.T) { EndPos: 16, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -5753,7 +5753,7 @@ func TestStmtConstList(t *testing.T) { EndPos: 25, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6048,7 +6048,7 @@ func TestStmtDeclare(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6127,7 +6127,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6159,7 +6159,7 @@ func TestStmtDeclare_Stmts(t *testing.T) { EndPos: 34, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, @@ -6239,7 +6239,7 @@ func TestStmtDeclare_Alt(t *testing.T) { EndPos: 18, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 1, diff --git a/internal/php7/php7.go b/internal/php7/php7.go index f9ec7d41e2833796643a118937546f7677979e72..39c787688584d5c9527277dfd352e7f8c8151870 100644 GIT binary patch delta 12046 zcmd5?dvw>uu|K<;Hwk%=gg`=mzd(fWNc_DY5C{>eD2gD85d;$iDi8w!tULq(L9781 zXvqkQ5=EZoih`~dkf2sk)DY!XTQ4nIxku}xP(50y%AKA4{=VN$>OJ@0>p2|rozLv- z?Ck99%jIag7;tS$S2(Ym z0pHrKE1Z;Sz}Kc4Fn$E!pC(+MX23(bBm8NaF&Zh3Y6O4K-GB?yyTT{Z4LCKUEBr!+ z0smma_z{3TnFjntrZM`zvJieK%Yc#Ms7CMuJq-A*9$n$Z*#>+hyDNN0jsZWFW5DVqy$u*Y0+5t%z}Mz? zh5u>7vULpTBM5uk z2K>3ZEBsKA0e@K36@H+v0iW#K6<*xWfDiXGV1KdkvA@el5UMUS20naQXWk%;>2JUd z{ky`E0S3HmfB}DPe8{;aY$=7MRo#RO;s&vsVy2OI4`MEYj`tHT`P^W3TP%JRg0Gal zs~9`V5$adQuCyV!_HtHCU*72`@q~v>QjGL5+{yD7;<93KHpa;ZT_3VFmDf1xtrt zhge_ecLf`umZqj+LFkY?|M_B`$zaP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=NXV4)Fzknn9jOMX`=ZZLl@-~q%o^&#;7ES^Ymg~+6pE5y5ow|%!bytCw?$He_+ zo_Vs&e?oM&e8LfVxJtaj)l5}@MW;6nIfNACtCixQA%Zi%OxSeuxunr5<<_-;c>(IW zPE3{WtrmEQpM62?B2NN3kI;f1{LrO>>V40No`xpqCwSKqTHRA5%7W)bCj^fd;ELy~ zD(^pDfUZ;*o&i+Xy4M3Ww5}|bei;hyTCrYa=}8_QL8bK%)sO#ni>7Qci>S||Dm_^# zp|zWg(D+8Gpha@{R`H4X|3+fOXFf-;&7ue4%4Et_+r$!MO~|u!?X@3O&*4`{T-rKk zAQ+HHY&HmEM(PU{zR=6HuZc#60$Ws{Y<0MF!|Z4D+w0bdL<9whe!E0hBL?!Tu&jDR z;LFh2V_MgLl3L;JszIn;y>R8V2gK{xmm)`su0QNddrLfEAd`9GMUo)Hhjg;5X6o4Q zk*^*W{R}T|zUucU%xoza9TBLb>osD=WB6)y?tBbKs5}UvpD1@7SE;PNKPIv1Lu1~B c))k`Cgy3a~WZHY;5oZYhYv@j=-V=fU1K}m6-~a#s diff --git a/internal/php7/php7.y b/internal/php7/php7.y index 3013dfd..ab3d550 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -536,15 +536,14 @@ top_statement: } | T_CONST const_list ';' { - $$ = &ast.StmtConstList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $3.SkippedTokens) + $$ = &ast.StmtConstList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + ConstTkn: $1, + Consts: $2, + SemiColonTkn: $3, + } } ; @@ -782,10 +781,9 @@ use_declaration: const_list: const_list ',' const_decl { - $$ = append($1, $3) + lastNode($1).(*ast.StmtConstant).CommaTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = append($1, $3) } | const_decl { @@ -2198,20 +2196,15 @@ class_statement: } | method_modifiers T_CONST class_const_list ';' { - $$ = &ast.StmtClassConstList{ast.Node{}, $1, $3} - - // save position - $$.GetNode().Position = position.NewOptionalListTokensPosition($1, $2, $4) - - // save comments - if len($1) > 0 { - yylex.(*Parser).MoveFreeFloating($1[0], $$) - yylex.(*Parser).setFreeFloating($$, token.ModifierList, $2.SkippedTokens) - } else { - yylex.(*Parser).setFreeFloating($$, token.Start, $2.SkippedTokens) + $$ = &ast.StmtClassConstList{ + Node: ast.Node{ + Position: position.NewOptionalListTokensPosition($1, $2, $4), + }, + Modifiers: $1, + ConstTkn: $2, + Consts: $3, + SemiColonTkn: $4, } - yylex.(*Parser).setFreeFloating($$, token.ConstList, $4.SkippedTokens) - yylex.(*Parser).setToken($$, token.SemiColon, $4.SkippedTokens) } | T_USE name_list trait_adaptations { @@ -2616,10 +2609,9 @@ property: class_const_list: class_const_list ',' class_const_decl { - $$ = append($1, $3) + lastNode($1).(*ast.StmtConstant).CommaTkn = $2 - // save comments - yylex.(*Parser).setFreeFloating(lastNode($1), token.End, $2.SkippedTokens) + $$ = append($1, $3) } | class_const_decl { @@ -2630,32 +2622,42 @@ class_const_list: class_const_decl: identifier '=' expr backup_doc_comment { - name := &ast.Identifier{ast.Node{}, $1.Value} - $$ = &ast.StmtConstant{ast.Node{}, name, $3} + $$ = &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Value: $1.Value, + }, + EqualTkn: $2, + Expr: $3, + } - // save position - name.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$.(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } ; const_decl: T_STRING '=' expr backup_doc_comment { - name := &ast.Identifier{ast.Node{}, $1.Value} - $$ = &ast.StmtConstant{ast.Node{}, name, $3} + $$ = &ast.StmtConstant{ + Node: ast.Node{ + Position: position.NewTokenNodePosition($1, $3), + }, + Name: &ast.Identifier{ + Node: ast.Node{ + Position: position.NewTokenPosition($1), + }, + Value: $1.Value, + }, + EqualTkn: $2, + Expr: $3, + } - // save position - name.GetNode().Position = position.NewTokenPosition($1) - $$.GetNode().Position = position.NewTokenNodePosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Name, $2.SkippedTokens) + yylex.(*Parser).setFreeFloating($$.(*ast.StmtConstant).Name, token.Start, $1.SkippedTokens) } ; diff --git a/internal/php7/php7_test.go b/internal/php7/php7_test.go index d717743..8f474fa 100644 --- a/internal/php7/php7_test.go +++ b/internal/php7/php7_test.go @@ -3919,7 +3919,7 @@ func TestPhp7(t *testing.T) { EndPos: 1322, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 70, @@ -3951,7 +3951,7 @@ func TestPhp7(t *testing.T) { EndPos: 1331, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 70, @@ -4018,7 +4018,7 @@ func TestPhp7(t *testing.T) { EndPos: 1359, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 71, @@ -4050,7 +4050,7 @@ func TestPhp7(t *testing.T) { EndPos: 1368, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 71, @@ -4732,7 +4732,7 @@ func TestPhp7(t *testing.T) { EndPos: 1693, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 81, @@ -4764,7 +4764,7 @@ func TestPhp7(t *testing.T) { EndPos: 1702, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 81, @@ -4959,7 +4959,7 @@ func TestPhp7(t *testing.T) { EndPos: 1796, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 85, @@ -5013,7 +5013,7 @@ func TestPhp7(t *testing.T) { EndPos: 1814, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 86, @@ -5069,7 +5069,7 @@ func TestPhp7(t *testing.T) { EndPos: 1834, }, }, - ConstantName: &ast.Identifier{ + Name: &ast.Identifier{ Node: ast.Node{ Position: &position.Position{ StartLine: 87, diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 4b633fe..038dc46 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -318,8 +318,10 @@ func (n *StmtClass) Accept(v NodeVisitor) { // StmtClassConstList node type StmtClassConstList struct { Node - Modifiers []Vertex - Consts []Vertex + Modifiers []Vertex + ConstTkn *token.Token + Consts []Vertex + SemiColonTkn *token.Token } func (n *StmtClassConstList) Accept(v NodeVisitor) { @@ -364,7 +366,9 @@ func (n *StmtClassMethod) Accept(v NodeVisitor) { // StmtConstList node type StmtConstList struct { Node - Consts []Vertex + ConstTkn *token.Token + Consts []Vertex + SemiColonTkn *token.Token } func (n *StmtConstList) Accept(v NodeVisitor) { @@ -374,8 +378,10 @@ func (n *StmtConstList) Accept(v NodeVisitor) { // StmtConstant node type StmtConstant struct { Node - ConstantName Vertex - Expr Vertex + Name Vertex + EqualTkn *token.Token + Expr Vertex + CommaTkn *token.Token } func (n *StmtConstant) Accept(v NodeVisitor) { diff --git a/pkg/ast/traverser/dfs.go b/pkg/ast/traverser/dfs.go index 7e41a44..3d9d5a5 100644 --- a/pkg/ast/traverser/dfs.go +++ b/pkg/ast/traverser/dfs.go @@ -487,10 +487,10 @@ func (t *DFS) Traverse(n ast.Vertex) { if !t.visitor.EnterNode(nn) { return } - if nn.ConstantName != nil { - t.visitor.Enter("ConstantName", true) - t.Traverse(nn.ConstantName) - t.visitor.Leave("ConstantName", true) + if nn.Name != nil { + t.visitor.Enter("Name", true) + t.Traverse(nn.Name) + t.visitor.Leave("Name", true) } if nn.Expr != nil { t.visitor.Enter("Expr", true) @@ -1334,9 +1334,9 @@ func (t *DFS) Traverse(n ast.Vertex) { t.visitor.Leave("Class", true) } if nn.ConstantName != nil { - t.visitor.Enter("ConstantName", true) + t.visitor.Enter("Name", true) t.Traverse(nn.ConstantName) - t.visitor.Leave("ConstantName", true) + t.visitor.Leave("Name", true) } case *ast.ExprClone: if nn == nil { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index ff7f336..5cd2215 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -67,3 +67,18 @@ func (v *FilterTokens) StmtHaltCompiler(n *ast.StmtHaltCompiler) { n.CloseParenthesisTkn = nil n.SemiColonTkn = nil } + +func (v *FilterTokens) StmtConstList(n *ast.StmtConstList) { + n.ConstTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtClassConstList(n *ast.StmtClassConstList) { + n.ConstTkn = nil + n.SemiColonTkn = nil +} + +func (v *FilterTokens) StmtConstant(n *ast.StmtConstant) { + n.EqualTkn = nil + n.CommaTkn = nil +} diff --git a/pkg/ast/visitor/namespace_resolver.go b/pkg/ast/visitor/namespace_resolver.go index fb5659d..3eac4a1 100644 --- a/pkg/ast/visitor/namespace_resolver.go +++ b/pkg/ast/visitor/namespace_resolver.go @@ -141,7 +141,7 @@ func (nsr *NamespaceResolver) StmtPropertyList(n *ast.StmtPropertyList) { func (nsr *NamespaceResolver) StmtConstList(n *ast.StmtConstList) { for _, constant := range n.Consts { - nsr.AddNamespacedName(constant, string(constant.(*ast.StmtConstant).ConstantName.(*ast.Identifier).Value)) + nsr.AddNamespacedName(constant, string(constant.(*ast.StmtConstant).Name.(*ast.Identifier).Value)) } } diff --git a/pkg/ast/visitor/namespace_resolver_test.go b/pkg/ast/visitor/namespace_resolver_test.go index 5b01ecc..8e84e88 100644 --- a/pkg/ast/visitor/namespace_resolver_test.go +++ b/pkg/ast/visitor/namespace_resolver_test.go @@ -594,12 +594,12 @@ func TestResolveConstantsName(t *testing.T) { nameAB := &ast.NameName{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("A")}, &ast.NameNamePart{Value: []byte("B")}}} constantB := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("B")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + Name: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } constantC := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("C")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + Name: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } stxTree := &ast.StmtStmtList{ @@ -638,12 +638,12 @@ func TestResolveNamespaces(t *testing.T) { relativeNameCE := &ast.NameRelative{Parts: []ast.Vertex{&ast.NameNamePart{Value: []byte("C")}, &ast.NameNamePart{Value: []byte("E")}}} constantB := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("B")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + Name: &ast.Identifier{Value: []byte("B")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } constantC := &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("C")}, - Expr: &ast.ScalarLnumber{Value: []byte("1")}, + Name: &ast.Identifier{Value: []byte("C")}, + Expr: &ast.ScalarLnumber{Value: []byte("1")}, } stxTree := &ast.StmtStmtList{ diff --git a/pkg/printer/pretty_printer.go b/pkg/printer/pretty_printer.go index fca19fd..cd5d20f 100644 --- a/pkg/printer/pretty_printer.go +++ b/pkg/printer/pretty_printer.go @@ -1603,7 +1603,7 @@ func (p *PrettyPrinter) printStmtClassConstList(n ast.Vertex) { func (p *PrettyPrinter) printStmtConstant(n ast.Vertex) { nn := n.(*ast.StmtConstant) - p.Print(nn.ConstantName) + p.Print(nn.Name) io.WriteString(p.w, " = ") p.Print(nn.Expr) } diff --git a/pkg/printer/pretty_printer_test.go b/pkg/printer/pretty_printer_test.go index c457cb8..343703b 100644 --- a/pkg/printer/pretty_printer_test.go +++ b/pkg/printer/pretty_printer_test.go @@ -2530,8 +2530,8 @@ func TestPrintStmtClass(t *testing.T) { Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -2585,8 +2585,8 @@ func TestPrintStmtAnonymousClass(t *testing.T) { Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, }, @@ -2616,12 +2616,12 @@ func TestPrintStmtClassConstList(t *testing.T) { Modifiers: []ast.Vertex{&ast.Identifier{Value: []byte("public")}}, Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'a'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'a'")}, }, &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("BAR")}, - Expr: &ast.ScalarString{Value: []byte("'b'")}, + Name: &ast.Identifier{Value: []byte("BAR")}, + Expr: &ast.ScalarString{Value: []byte("'b'")}, }, }, }) @@ -2639,8 +2639,8 @@ func TestPrintStmtConstant(t *testing.T) { p := printer.NewPrettyPrinter(o, " ") p.Print(&ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'BAR'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'BAR'")}, }) expected := "FOO = 'BAR'" @@ -2676,8 +2676,8 @@ func TestPrintStmtDeclareStmts(t *testing.T) { &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, Stmt: &ast.StmtStmtList{ @@ -2710,8 +2710,8 @@ func TestPrintStmtDeclareExpr(t *testing.T) { &ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, Stmt: &ast.StmtExpression{Expr: &ast.ScalarString{Value: []byte("'bar'")}}, @@ -2737,8 +2737,8 @@ func TestPrintStmtDeclareNop(t *testing.T) { p.Print(&ast.StmtDeclare{ Consts: []ast.Vertex{ &ast.StmtConstant{ - ConstantName: &ast.Identifier{Value: []byte("FOO")}, - Expr: &ast.ScalarString{Value: []byte("'bar'")}, + Name: &ast.Identifier{Value: []byte("FOO")}, + Expr: &ast.ScalarString{Value: []byte("'bar'")}, }, }, Stmt: &ast.StmtNop{}, diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index 450f928..f87cd9b 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2421,69 +2421,27 @@ func (p *Printer) printStmtClass(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtClassConstList(n ast.Vertex) { - nn := n.(*ast.StmtClassConstList) - p.printFreeFloating(nn, token.Start) - - if nn.Modifiers != nil { - for k, m := range nn.Modifiers { - if k > 0 && m.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.Print(m) - } - - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - } - p.printFreeFloating(nn, token.ModifierList) - io.WriteString(p.w, "const") - - if nn.Consts[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Consts) - p.printFreeFloating(nn, token.ConstList) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtClassConstList(n *ast.StmtClassConstList) { + p.joinPrintRefactored(" ", n.Modifiers) + p.bufStart = " " + p.printToken(n.ConstTkn, "const") + p.bufStart = " " + p.joinPrintRefactored(",", n.Consts) + p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtConstList(n ast.Vertex) { - nn := n.(*ast.StmtConstList) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "const") - - if nn.Consts[0].GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, " ") - } - p.joinPrint(",", nn.Consts) - p.printFreeFloating(nn, token.Stmts) - - p.printFreeFloating(nn, token.SemiColon) - if nn.GetNode().Tokens.IsEmpty() { - io.WriteString(p.w, ";") - } - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtConstList(n *ast.StmtConstList) { + p.printToken(n.ConstTkn, "const") + p.bufStart = " " + p.joinPrintRefactored(",", n.Consts) + p.printToken(n.SemiColonTkn, ";") } -func (p *Printer) printStmtConstant(n ast.Vertex) { - nn := n.(*ast.StmtConstant) - p.printFreeFloating(nn, token.Start) - - p.Print(nn.ConstantName) - p.printFreeFloating(nn, token.Name) - io.WriteString(p.w, "=") - p.Print(nn.Expr) - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtConstant(n *ast.StmtConstant) { + p.Print(n.Name) + p.printToken(n.EqualTkn, "=") + p.Print(n.Expr) + p.printToken(n.CommaTkn, "") } func (p *Printer) printStmtContinue(n ast.Vertex) { @@ -2515,7 +2473,7 @@ func (p *Printer) printStmtDeclare(n ast.Vertex) { io.WriteString(p.w, "declare") p.printFreeFloating(nn, token.Declare) io.WriteString(p.w, "(") - p.joinPrint(",", nn.Consts) + p.joinPrintRefactored(",", nn.Consts) p.printFreeFloating(nn, token.ConstList) io.WriteString(p.w, ")") diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index a65bd6b..5c14c0f 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -896,7 +896,8 @@ func TestParseAndPrintPhp5ClassConstList(t *testing.T) { } func TestParseAndPrintPhp5ConstList(t *testing.T) { - src := ` Date: Wed, 2 Sep 2020 22:58:19 +0300 Subject: [PATCH 050/140] [refactoring] update ast structure of "StmtList" nodes --- internal/php5/php5.go | Bin 295135 -> 296051 bytes internal/php5/php5.y | 88 ++++++++++++++++-------- internal/php7/php7.go | Bin 251161 -> 251037 bytes internal/php7/php7.y | 88 ++++++++++++++++-------- pkg/ast/node.go | 4 +- pkg/ast/visitor/filter_tokens.go | 5 ++ pkg/printer/printer.go | 15 ++-- pkg/printer/printer_parsed_php5_test.go | 3 +- pkg/printer/printer_parsed_php7_test.go | 3 +- 9 files changed, 133 insertions(+), 73 deletions(-) diff --git a/internal/php5/php5.go b/internal/php5/php5.go index f836b8b6f3ba8c2b0999e5a704be6ac12529220a..caf5d7472aa1f5cecd3bc73938674a68af440074 100644 GIT binary patch delta 13592 zcma)Dd3@AGvj24Vk3hmtz8gZ6U5OgporS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*9=bk=OOw*oxcA8X*#Dz7GPT`5(~+vW;s)E1N?v!_-{-) B?F0Y- diff --git a/internal/php5/php5.y b/internal/php5/php5.y index 181e9a4..05a8884 100644 --- a/internal/php5/php5.y +++ b/internal/php5/php5.y @@ -844,14 +844,14 @@ statement: unticked_statement: '{' inner_statement_list '}' { - $$ = &ast.StmtStmtList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + $$ = &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenCurlyBracket: $1, + Stmts: $2, + CloseCurlyBracket: $3, + } } | T_IF parenthesis_expr statement elseif_list else_single { @@ -871,12 +871,16 @@ unticked_statement: } | T_IF parenthesis_expr ':' inner_statement_list new_elseif_list new_else_single T_ENDIF ';' { - stmts := &ast.StmtStmtList{ast.Node{}, $4} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($4), + }, + Stmts: $4, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} $$ = &ast.StmtAltIf{ast.Node{}, $2, stmtsBrackets, $5, $6} // save position - stmts.GetNode().Position = position.NewNodeListPosition($4) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($3, $4) $$.GetNode().Position = position.NewTokensPosition($1, $8) @@ -1673,11 +1677,15 @@ for_statement: } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1698,11 +1706,15 @@ foreach_statement: } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1724,11 +1736,15 @@ declare_statement: } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1902,11 +1918,15 @@ while_statement: } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1945,13 +1965,17 @@ new_elseif_list: } | new_elseif_list T_ELSEIF parenthesis_expr ':' inner_statement_list { - stmts := &ast.StmtStmtList{ast.Node{}, $5} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($5), + }, + Stmts: $5, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} _elseIf := &ast.StmtAltElseIf{ast.Node{}, $3, stmtsBrackets} $$ = append($1, _elseIf) // save position - stmts.GetNode().Position = position.NewNodeListPosition($5) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($4, $5) _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $5) @@ -1987,12 +2011,16 @@ new_else_single: } | T_ELSE ':' inner_statement_list { - stmts := &ast.StmtStmtList{ast.Node{}, $3} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($3), + }, + Stmts: $3, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} $$ = &ast.StmtAltElse{ast.Node{}, stmtsBrackets} // save position - stmts.GetNode().Position = position.NewNodeListPosition($3) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($2, $3) $$.GetNode().Position = position.NewTokenNodeListPosition($1, $3) @@ -2626,14 +2654,14 @@ method_body: } | '{' inner_statement_list '}' { - $$ = &ast.StmtStmtList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + $$ = &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenCurlyBracket: $1, + Stmts: $2, + CloseCurlyBracket: $3, + } } ; diff --git a/internal/php7/php7.go b/internal/php7/php7.go index 39c787688584d5c9527277dfd352e7f8c8151870..bfc89708bbc79701ef76007c3ca647035367b6f4 100644 GIT binary patch delta 6073 zcmbtYdsvoLwtx28+!X-@LO=l(uPNXC<1>Emi7F;h{MRI2F_vuH=n^BiszHSFVvmUA=O>G3j`E3~ zd})LTW7|X#!iPqSWImCDuj}(f4Ci>oAT{G>qJEL3q1_{f@(G&=4f^r&^5xuqr$}J? zMbV#!{-?;{+Ks}_?H`NRIeM2EpxVxefr3v?mB}2vM+9-7_r<5e!zaHIgMUEVoDal= zTeLB>o#T(siad@PNJ;fmpm6dz(Lp}<4{J=)OJn&?JB9G>KZ_y%Qg?j2$R)d1&1n~_ ziJUgZ!ySC$UASvQHN}}f9&8sioLxhAa%!6><;xeuPq{XTLb>fD@fEpTde3a0d{L}X zd%hMz=oQi2{t?_e^)u0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J@W9((f(oPU1Hq(C--F$efqNV@l-&v`iqd<`@}n#q{}79E+!lc{7=P zL(Aj@^QytM4sIv|wrmcqgM;Jez&E**;PaXD zJpc>wy}(rNg2nPkx0gUW~_GZM6*JaSy?FUaNL~vIhTq z%_Xgd;SO|B1`7475ffBEcr&@JMsw?qY6K>ABQS$*&A9Gq!OuKmqN9uP&4yO3(S`;{ z36~w#h8j{jy+$sFf{)>TOK<(w1_kY0509FX7@+CHo8(=B%Qon2Ib>ljkw3;zIuRf= z|Cxd(ZvwG8eb)P%@%~mkYB}t!xrA>t7KV|WeZz)ct?3FD#mzrji zr>EqNKM-a!u|z4#3FeOtqRFY)OUgl`&i)cpH}m2CLiPvvyVIoOvE5&fHt<&`4Hp_JZY_f!7JeWd{{~UyNzDKN diff --git a/internal/php7/php7.y b/internal/php7/php7.y index ab3d550..a1ca1c7 100644 --- a/internal/php7/php7.y +++ b/internal/php7/php7.y @@ -851,14 +851,14 @@ inner_statement: statement: '{' inner_statement_list '}' { - $$ = &ast.StmtStmtList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + $$ = &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenCurlyBracket: $1, + Stmts: $2, + CloseCurlyBracket: $3, + } } | if_stmt { @@ -1535,11 +1535,15 @@ for_statement: } | ':' inner_statement_list T_ENDFOR ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltFor{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1560,11 +1564,15 @@ foreach_statement: } | ':' inner_statement_list T_ENDFOREACH ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltForeach{ast.Node{}, nil, nil, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1585,11 +1593,15 @@ declare_statement: } | ':' inner_statement_list T_ENDDECLARE ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtDeclare{ast.Node{}, true, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1716,11 +1728,15 @@ while_statement: } | ':' inner_statement_list T_ENDWHILE ';' { - stmtList := &ast.StmtStmtList{ast.Node{}, $2} + stmtList := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($2), + }, + Stmts: $2, + } $$ = &ast.StmtAltWhile{ast.Node{}, nil, stmtList} // save position - stmtList.GetNode().Position = position.NewNodeListPosition($2) $$.GetNode().Position = position.NewTokensPosition($1, $4) // save comments @@ -1791,13 +1807,17 @@ alt_if_stmt_without_else: T_IF '(' expr ')' ':' inner_statement_list { exprBrackets := &ast.ParserBrackets{ast.Node{}, $3} - stmts := &ast.StmtStmtList{ast.Node{}, $6} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($6), + }, + Stmts: $6, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} $$ = &ast.StmtAltIf{ast.Node{}, exprBrackets, stmtsBrackets, nil, nil} // save position exprBrackets.GetNode().Position = position.NewTokensPosition($2, $4) - stmts.GetNode().Position = position.NewNodeListPosition($6) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($5, $6) $$.GetNode().Position = position.NewTokenNodeListPosition($1, $6) @@ -1810,7 +1830,12 @@ alt_if_stmt_without_else: | alt_if_stmt_without_else T_ELSEIF '(' expr ')' ':' inner_statement_list { exprBrackets := &ast.ParserBrackets{ast.Node{}, $4} - stmts := &ast.StmtStmtList{ast.Node{}, $7} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($7), + }, + Stmts: $7, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} _elseIf := &ast.StmtAltElseIf{ast.Node{}, exprBrackets, stmtsBrackets} $1.(*ast.StmtAltIf).ElseIf = append($1.(*ast.StmtAltIf).ElseIf, _elseIf) @@ -1819,7 +1844,6 @@ alt_if_stmt_without_else: // save position exprBrackets.GetNode().Position = position.NewTokensPosition($3, $5) - stmts.GetNode().Position = position.NewNodeListPosition($7) stmtsBrackets.GetNode().Position = position.NewTokenNodeListPosition($6, $7) _elseIf.GetNode().Position = position.NewTokenNodeListPosition($2, $7) @@ -1850,7 +1874,12 @@ alt_if_stmt: } | alt_if_stmt_without_else T_ELSE ':' inner_statement_list T_ENDIF ';' { - stmts := &ast.StmtStmtList{ast.Node{}, $4} + stmts := &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewNodeListPosition($4), + }, + Stmts: $4, + } stmtsBrackets := &ast.ParserBrackets{ast.Node{}, stmts} _else := &ast.StmtAltElse{ast.Node{}, stmtsBrackets} $1.(*ast.StmtAltIf).Else = _else @@ -1858,7 +1887,6 @@ alt_if_stmt: $$ = $1 // save position - stmts.GetNode().Position = position.NewNodeListPosition($4) stmtsBrackets.GetNode().Position = position.NewTokensPosition($3, $5) _else.GetNode().Position = position.NewTokenNodeListPosition($2, $4) $$.GetNode().Position = position.NewNodeTokenPosition($1, $6) @@ -2446,14 +2474,14 @@ method_body: } | '{' inner_statement_list '}' { - $$ = &ast.StmtStmtList{ast.Node{}, $2} - - // save position - $$.GetNode().Position = position.NewTokensPosition($1, $3) - - // save comments - yylex.(*Parser).setFreeFloating($$, token.Start, $1.SkippedTokens) - yylex.(*Parser).setFreeFloating($$, token.Stmts, $3.SkippedTokens) + $$ = &ast.StmtStmtList{ + Node: ast.Node{ + Position: position.NewTokensPosition($1, $3), + }, + OpenCurlyBracket: $1, + Stmts: $2, + CloseCurlyBracket: $3, + } } ; diff --git a/pkg/ast/node.go b/pkg/ast/node.go index 038dc46..2013eee 100644 --- a/pkg/ast/node.go +++ b/pkg/ast/node.go @@ -691,7 +691,9 @@ func (n *StmtStaticVar) Accept(v NodeVisitor) { // StmtStmtList node type StmtStmtList struct { Node - Stmts []Vertex + OpenCurlyBracket *token.Token + Stmts []Vertex + CloseCurlyBracket *token.Token } func (n *StmtStmtList) Accept(v NodeVisitor) { diff --git a/pkg/ast/visitor/filter_tokens.go b/pkg/ast/visitor/filter_tokens.go index 5cd2215..b368d8a 100644 --- a/pkg/ast/visitor/filter_tokens.go +++ b/pkg/ast/visitor/filter_tokens.go @@ -82,3 +82,8 @@ func (v *FilterTokens) StmtConstant(n *ast.StmtConstant) { n.EqualTkn = nil n.CommaTkn = nil } + +func (v *FilterTokens) StmtStmtList(n *ast.StmtStmtList) { + n.OpenCurlyBracket = nil + n.CloseCurlyBracket = nil +} diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index f87cd9b..4d1c2aa 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -2530,6 +2530,7 @@ func (p *Printer) printStmtDo(n ast.Vertex) { } p.Print(nn.Stmt) + p.printFreeFloating(nn, token.Stmts) io.WriteString(p.w, "while") @@ -3001,16 +3002,10 @@ func (p *Printer) printStmtStatic(n ast.Vertex) { p.printFreeFloating(nn, token.End) } -func (p *Printer) printStmtStmtList(n ast.Vertex) { - nn := n.(*ast.StmtStmtList) - p.printFreeFloating(nn, token.Start) - - io.WriteString(p.w, "{") - p.printNodes(nn.Stmts) - p.printFreeFloating(nn, token.Stmts) - io.WriteString(p.w, "}") - - p.printFreeFloating(nn, token.End) +func (p *Printer) printStmtStmtList(n *ast.StmtStmtList) { + p.printToken(n.OpenCurlyBracket, "{") + p.printNodes(n.Stmts) + p.printToken(n.CloseCurlyBracket, "}") } func (p *Printer) printStmtSwitch(n ast.Vertex) { diff --git a/pkg/printer/printer_parsed_php5_test.go b/pkg/printer/printer_parsed_php5_test.go index 5c14c0f..cd835d9 100644 --- a/pkg/printer/printer_parsed_php5_test.go +++ b/pkg/printer/printer_parsed_php5_test.go @@ -1211,7 +1211,8 @@ func TestParseAndPrintPhp5StaticVar(t *testing.T) { } func TestParseAndPrintPhp5StmtList(t *testing.T) { - src := ` Date: Thu, 3 Sep 2020 22:18:06 +0300 Subject: [PATCH 051/140] [refactoring] update ast structure of "If", "ElseIf", "Else" nodes --- internal/php5/parser_test.go | 27 ++- internal/php5/php5.go | Bin 296051 -> 295688 bytes internal/php5/php5.y | 214 +++++++++++-------- internal/php5/php5_test.go | 27 ++- internal/php7/parser_test.go | 27 ++- internal/php7/php7.go | Bin 251037 -> 248339 bytes internal/php7/php7.y | 273 +++++++++++++----------- internal/php7/php7_test.go | 27 ++- pkg/ast/ast.go | 3 - pkg/ast/node.go | 67 +++--- pkg/ast/traverser/dfs.go | 58 ----- pkg/ast/visitor/dump.go | 33 ++- pkg/ast/visitor/filter_parser_nodes.go | 54 ----- pkg/ast/visitor/filter_tokens.go | 26 +++ pkg/ast/visitor/null.go | 12 -- pkg/printer/pretty_printer.go | 27 ++- pkg/printer/pretty_printer_test.go | 24 ++- pkg/printer/printer.go | 236 ++++++-------------- pkg/printer/printer_parsed_php5_test.go | 6 +- pkg/printer/printer_parsed_php7_test.go | 6 +- pkg/printer/printer_test.go | 26 ++- 21 files changed, 537 insertions(+), 636 deletions(-) diff --git a/internal/php5/parser_test.go b/internal/php5/parser_test.go index 52dc6df..0a8d776 100644 --- a/internal/php5/parser_test.go +++ b/internal/php5/parser_test.go @@ -3660,7 +3660,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3669,6 +3669,7 @@ func TestStmtAltIf_AltIf(t *testing.T) { EndPos: 23, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3731,7 +3732,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3740,6 +3741,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: 38, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3773,7 +3775,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -3782,6 +3784,7 @@ func TestStmtAltIf_AltElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3846,7 +3849,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3855,6 +3858,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: 31, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3887,7 +3891,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { }, Stmts: []ast.Vertex{}, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -3896,6 +3900,7 @@ func TestStmtAltIf_AltElse(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ @@ -3940,7 +3945,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, }, Stmts: []ast.Vertex{ - &ast.StmtAltIf{ + &ast.StmtIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 2, @@ -3949,6 +3954,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: 61, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -3982,7 +3988,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, ElseIf: []ast.Vertex{ - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 3, @@ -3991,6 +3997,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4024,7 +4031,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { Stmts: []ast.Vertex{}, }, }, - &ast.StmtAltElseIf{ + &ast.StmtElseIf{ Node: ast.Node{ Position: &position.Position{ StartLine: 4, @@ -4033,6 +4040,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Cond: &ast.ExprVariable{ Node: ast.Node{ Position: &position.Position{ @@ -4067,7 +4075,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { }, }, }, - Else: &ast.StmtAltElse{ + Else: &ast.StmtElse{ Node: ast.Node{ Position: &position.Position{ StartLine: 5, @@ -4076,6 +4084,7 @@ func TestStmtAltIf_AltElseElseIf(t *testing.T) { EndPos: -1, }, }, + Alt: true, Stmt: &ast.StmtStmtList{ Node: ast.Node{ Position: &position.Position{ diff --git a/internal/php5/php5.go b/internal/php5/php5.go index caf5d7472aa1f5cecd3bc73938674a68af440074..953db897e00983ea3c13adb39882cde84a6f7924 100644 GIT binary patch delta 10238 zcmdT~d3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